2

How to define a big plus operator that behaves exactly like bigsum but uses the plus symbol instead of a capital sigma?

I know that the best option (or at least the way Don would do it) is probably to design this symbol using metafont but scaling is good enough for me.

5

enter image description here

You can use \mathchoice to use a suitably scaled font in each math style.


\font \zzz = cmr10 at 14pt
\font\zzzb  cmr10 at 20pt
\font\zzzsy =cmsy10 at 14pt
\font\zzzsyb =cmsy10 at 20pt

\def\bigplus{\mathop{\mathchoice{\hbox{\zzzb+}}{\hbox{\zzz+}}{\scriptstyle+}{\scriptscriptstyle+}}}
\def\bigtimes{\mathop{\mathchoice{\hbox{\zzzsyb\char2}}{\hbox{\zzzsy\char2}}{\scriptstyle\times}{\scriptscriptstyle\times}}}

\def\test{\sum_{i=0}^nx^i \rightarrow \bigplus_{i=0}^nx^i \rightarrow \bigtimes_{i=0}^nx^i}
$$
\test
$$
or..

\bigskip

This $\test$

\bigskip

Or this $x^{\test}$
\bye

Or with vertical center for Barbara

enter image description here

\def\bigplus{\mathop{\mathchoice{\vcenter{\hbox{\zzzb+}}}{\vcenter{\hbox{\zzz+}}}{\scriptstyle+}{\scriptscriptstyle+}}}
\def\bigtimes{\mathop{\mathchoice{\vcenter{\hbox{\zzzsyb\char2}}}{\vcenter{\hbox{\zzzsy\char2}}}{\scriptstyle\times}{\scriptscriptstyle\times}}}
9
  • Thank you for your answer but I don't understand why the same font isn't used in the two examples and what's the meaning of zzz, thank you
    – Laravel
    Oct 7 at 20:25
  • @Laravel + comes from the roman font and \times comes from the symbols font in the default plain tex layout. zzz is just a name you could call them \bigrm \biggerrm, \bigsym, \biggersym if you prefer. Oct 7 at 20:35
  • Thank you that makes sense! Were the 14pt and 20pt values chosen arbitrarily?
    – Laravel
    Oct 7 at 20:40
  • yes I just did it by eye. @Laravel Oct 7 at 20:41
  • 1
    You really want to treat those enlarged symbols like "large operators' so that they're centered vertically on the math axis. (Please!) By the way, the selection of 20pt and 14pt are appropriate.]; that's what was used when this had to be done at AMS. Oct 8 at 0:27
2

You can do it with scaling, provided you load eplain. The following code is based on https://tex.stackexchange.com/a/23436/4427. The idea is to measure \sum in the current math style and to scale the chosen symbol to match.

Experiment and choose the right factor for \genericbigop and the chosen symbol.

\input eplain
\beginpackages
\usepackage{graphicx}
\endpackages

% add scaled versions of the cmex font
\font\sevenex=cmex7
\font\fiveex=cmex7 at 5pt
\scriptfont3=\sevenex
\scriptscriptfont3=\fiveex
%

\catcode`@=11
\def\genericbigop#1#2{% #1=factor, #2=symbol
  \mathop{\vphantom{\sum}\mathpalette\genericbigop@{{#1}{#2}}}\displaylimits
}
\def\genericbigop@#1#2{\genericbigop@@#1#2}
\def\genericbigop@@#1#2#3{%
  \vcenter{%
    \setbox\z@=\hbox{$#1\sum$}%
    \dimen@=\ht\z@ \advance\dimen@\dp\z@
    \hbox{\resizebox{#2\dimen@}{!}{$\m@th#3$}}%
  }%
}
\catcode`@=12

\def\bigplus{\genericbigop{1.1}{+}}
\def\bigtimes{\genericbigop{1.1}{\times}}

$$
\sum_{i=0}^nx^i \quad \bigplus_{i=0}^nx^i \quad \bigtimes_{i=0}^nx^i
$$
\centerline{%
  $\sum_{i=0}^nx^i \quad \bigplus_{i=0}^nx^i \quad \bigtimes_{i=0}^nx^i$
}
\centerline{%
  $\scriptstyle\sum_{i=0}^nx^i \quad \bigplus_{i=0}^nx^i \quad \bigtimes_{i=0}^nx^i$
}
\centerline{%
  $\scriptscriptstyle\sum_{i=0}^nx^i \quad \bigplus_{i=0}^nx^i \quad \bigtimes_{i=0}^nx^i$
}

\bye

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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