[Tex/LaTex] How are big operators defined

amsmathmath-modemath-operators

I would like to create a new "big operator", by which I mean something like the Σ character used for summations.

enter image description here

I know about the \DeclareMathOperator* command, which creates an operator whose superscripts and subscripts are written directly above and below the operator. Here is an example of that.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\DeclareMathOperator*{\foo}{\maltese}

\begin{document}
\[
\foo_{i=3}^{6}(f^2(i))
\]
\end{document}

enter image description here

However, I would like to make my operator "big". I tried this:

\DeclareMathOperator*{\foo}{\text{\Large $\maltese$}}

enter image description here

but that feels like a bit of a hack. Besides, the operator is too high, and needs moving down a tad to align it properly with its operand. So, what's the proper way to do this? How, for instance, is the \sum operator defined?

Best Answer

The scalerel package allows you to scale a symbol to the size (and vertical positioning) of another symbol. So in this case, I define \foo to scale \maltese to the size of \sum. Thus, it piggybacks its sizing off the well defined behavior of \sum.

It wasn't clear to me if the questioner wanted to keep the maltese cross the same size in all operations. However, if that is the case, I can redefine the \foo operator as \barr in order to keep the size equal to that of a textstyle summation sign. The example below shows instances of \foo as well as \barr in both displaystyle and inline.

Edit: Use scalerel version 1.5 or later to ensure that scalerel captures the current math style.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\DeclareMathOperator*{\foo}{\scalerel*{\maltese}{\sum}}
\DeclareMathOperator*{\barr}{\scalerel*{\maltese}{\textstyle\sum}}
\usepackage{scalerel}

\begin{document}
\[
\foo_{i=3}^{6}(f^2(i))
\]

This is inline: \(\foo_{i=3}^{6}(f^2(i)) \)

\[
\barr_{i=3}^{6}(f^2(i))
\]

This is inline: \(\barr_{i=3}^{6}(f^2(i)) \)
\end{document} 

enter image description here

Related Question