I have an operator $\boxplus$
that works on an indexed collection of arguments, similar to $\sum$
or $\prod$
or $\bigoplus$
.
The following makes the index ranges typeset nicely:
\usepackage{amsopn}
\DeclareMathOperator*{\op}{\boxplus}
But the size is still fixed, which looks wrong, especially in displaymath:
$ \sum_{i=1}^3 x_i \quad \bigoplus_{i=1}^3 x_i \quad \op_{i=1}^3 x_i $
$$ \sum_{i=1}^3 x_i \quad \bigoplus_{i=1}^3 x_i \quad \op_{i=1}^3 x_i $$
How can I make appropriate sizes be used for inline math and displaymath,
like what happens automatically with $\sum$
and $\prod$
and $\bigoplus$
?
Best Answer
One option using
\mathchoice
:Mostly equivalent macros with
\mathpalette
, that avoids code duplication. There are other small fixes.