[Tex/LaTex] Placement of indices using \bigcirc in math mode

formattingmath-mode

Consider a definition of iterative function composition in a mathematical document:

\begin{align*}
    \bigcirc_{i = l}^{u}\ f_i &= \mathrm{id}_A \\
    \bigcirc_{i = l}^{u}\ f_i &= f_l \circ (\bigcirc_{i = l + 1}^{u}\ f_i)
\end{align*}

enter image description here

What i don't like is the placement of i = l and u, because it should be directly below and above the big circle in displaymath.
Now look at this example:

\begin{align*}
    \bigodot_{i = l}^{u} f_i &= \mathrm{id}_A \\
    \bigodot_{i = l}^{u} f_i &= f_l \circ (\bigodot_{i = l + 1}^{u} f_i)
\end{align*}

enter image description here

That way the placement is as I wish, but now the big cirle has a little spot within in.
I would like to achieve the placement of the second example, but with the symbol of the first example. Is there a way to do that?

By the way, here's an MWE:

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\begin{document}
    \begin{align*}
        \bigcirc_{i = l}^{u}\ f_i &= \mathrm{id}_A  &&  \text{if $l > u$}\\
        \bigcirc_{i = l}^{u}\ f_i &= f_l \circ (\bigcirc_{i = l + 1}^{u}\ f_i)  &&  \text{otherwise}
    \end{align*}
    \begin{align*}
        \bigodot_{i = l}^{u} f_i &= \mathrm{id}_A  &&  \text{if $l > u$}\\
        \bigodot_{i = l}^{u} f_i &= f_l \circ (\bigodot_{i = l + 1}^{u} f_i)  &&  \text{otherwise}
    \end{align*}
\end{document}

Best Answer

Your choices are \mathop{\bigcirc}\limits_{i = l}^{u} if you use it occasionally or if you plan to use it often, then \DeclareMathOperator*\bigcircop{\bigcirc} in the preamble and then \bigcircop_{i = l}^{u} for usage. I show both usages below.

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\DeclareMathOperator*\bigcircop{\bigcirc}
\begin{document}
    \begin{align*}
        \bigcircop_{i = l}^{u}\ f_i &= \mathrm{id}_A  &&  \text{if $l > u$}\\
        \mathop{\bigcirc}\limits_{i = l}^{u}\ f_i &= f_l \circ 
          \Bigl(\bigcircop_{i = l + 1}^{u}\ f_i\Bigr)  &&  \text{otherwise}
    \end{align*}
\end{document}

enter image description here

Note that, in \textstyle (inline) math, the super/sub-scripts on \bigcircop will revert to the normal super/sub style.

If you wanted to present the \bigcirc in a larger size, comparable to \bigodot, you could do this. Here, I scale the \bigcirc to the same vertical footprint as the \bigodot, in a way that will preserve the current math style.

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath,scalerel}
\DeclareMathOperator*\bigcircop{\scalerel*{\bigcirc}{\bigodot}}
\begin{document}
    \begin{align*}
        \bigcircop_{i = l}^{u}\ f_i &= \mathrm{id}_A  &&  \text{if $l > u$}\\
        \bigcircop_{i = l}^{u}\ f_i &= f_l \circ \Bigl(\bigcircop_{i = l + 1}^{u}\ f_i\Bigr)  &&  \text{otherwise}
    \end{align*}
\[
        \bigcircop_{i = l}^{u}
        \textstyle\quad
        \bigcircop_{i = l}^{u}
        \scriptstyle\quad
        \bigcircop_{i = l}^{u}
        \scriptscriptstyle\quad
        \bigcircop_{i = l}^{u}
\]
\end{document}

enter image description here