Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am interested in defining some customized math symbols out of existing ones. For example I would like to distinguish between different types of sums, so beside the usual symbol

enter image description here

I would like to have something of the form

enter image description here

so there are some circles in the corners. It should work just like the usual \sum command and look exactly like it (except the modification).

How could I create such a symbol in the most painless way? Is Metafont the answer? Is it possible to modify existing symbols in Metafont without too much work and expertise?

share|improve this question
    
Sometimes there's unicode for what you want : draw it (possibly rotated) at shapecatcher.com. Or construct your character by embellishing an existing one. There are wizards here good at that. –  Ethan Bolker Aug 28 '12 at 1:00
    
somewhat similar(?) (not a duplicate), regularized-product-symbol –  cmhughes Aug 28 '12 at 2:43
    

1 Answer 1

up vote 15 down vote accepted

You could create your own symbol using ooalign

screenshot

screenshot

as demonstrated in

The subtle thing in the code below is that I've used a \phantom{sum} in the displaystyle version to make sure that limits of the sum are displayed correctly. Without it, you loose the correct display of the upper limit.

If the circles aren't exactly where you want them, you can move them around by playing with the numbers in the code.

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

% a new command to draw the little circle
\newcommand{\smallcirc}[1]{\scalebox{#1}{$\circ$}}

\DeclareMathOperator*{\SumCircles}{%
\mathchoice%
  {\ooalign{\phantom{$\displaystyle\sum$}\cr\hidewidth\raisebox{1.2\height}{$\mkern22mu\smallcirc{0.7}$}\hidewidth\cr%
                                  \raisebox{-0.7\height}{$\mkern22mu\smallcirc{0.7}$}\cr
                                  \hidewidth$\displaystyle\sum$}}
  {\ooalign{$\textstyle\sum$\cr%
                                \hidewidth\raisebox{1.9\height}{$\mkern16mu\smallcirc{0.4}$}\hidewidth\cr
                                \hidewidth\raisebox{-.3\height}{$\mkern16mu\smallcirc{0.4}$}\hidewidth\cr}}
  {\ooalign{\raisebox{0\height}{\scalebox{.6}{$\scriptstyle\sum$}}\cr%
                                \hidewidth\raisebox{1.6\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr
                                \hidewidth\raisebox{-0.2\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr}}
  {\ooalign{\raisebox{.2\height}{\scalebox{.6}{$\scriptstyle\sum$}}\cr%
                                \hidewidth\raisebox{2.2\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr
                                \hidewidth\raisebox{0.4\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr}}
}


\begin{document}

$\SumCircles_{\SumCircles} \displaystyle\SumCircles$

\[
    \SumCircles_{n=1}^\infty
    \sum_{n=1}^\infty
\]

\end{document}
share|improve this answer
    
Can you maybe explain or link to what exactly it is that \ooalign does? Looking it up just leads to definitions of many other commands that use it. –  fheshwfq Aug 30 '12 at 8:53
1  
@fheshwfq see the second link I provided –  cmhughes Aug 30 '12 at 20:48
    
Thanks @cmhughes, it was just what I was looking for. –  fheshwfq Aug 31 '12 at 12:06
    
Thank you for this very nice solution! It's exactly what I was looking for. But I am still wondering whether it is too much work to take existing symbols and modify them a little with metafont. It seems that metafont is potentially more flexible in general. –  Heidar Sep 1 '12 at 16:06
    
@Heidar you're welcome :) metafont could be more flexible, but I wouldn't know where to start with that :) –  cmhughes Sep 1 '12 at 16:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.