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.

2 Answers2

4

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}}}
David Carlisle
  • 757,742
1

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

egreg
  • 1,121,712