# Typesetting with long limits

The problem of typesetting with long limits has already been discussed in Improving typesetting of sums with long limits. However, the answer given there uses \mathop, which does not produce satisfying results if not only the limit, but also the 'operand' is long, as shown in the following MWE:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator{\variables}{variables}
\DeclareMathOperator{\parentstate}{parentstate}
\DeclareMathOperator{\visible}{visible}
\newcommand*{\dotcup}{\mathbin{\dot{\cup}}}

\begin{document}
original:
$\visible(s) = \variables(s) \dotcup \dot{\bigcup_{p \in \parentstate^+(s)}} \variables(p)$

with \verb+\mathop+:
$\visible(s) = \variables(s) \dotcup \mathop{\dot{\bigcup} \variables(p)}_{p \in \parentstate^+(s)}$
\end{document}


This produces the following:

I'd rather have the best of both approaches, i.e. not have the limit centered under the whole \mathop, but only under the operator itself, and leave some space at the left of the operator (as in the firstversion), but move the operand closer (as in the second version).

To have space before but not after you can use \smashoperator[r] from the mathtools package. Of course you have to make sure that what you are smashing is an operator:

\documentclass{article}
\usepackage{mathtools}

\DeclareMathOperator{\variables}{variables}
\DeclareMathOperator{\parentstate}{parentstate}
\DeclareMathOperator{\visible}{visible}
\newcommand*{\dotcup}{\mathbin{\dot{\cup}}}

\begin{document}
\begin{equation*}
\visible(s) = \variables(s) \dotcup
\smashoperator[r]{\mathop{\dot{\bigcup}}_{p \in \parentstate^+(s)}}
\variables(p)
\end{equation*}

\end{document}


The mathtools package provides the \mathclap command, which will reduce the size of the subscripts.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\DeclareMathOperator{\variables}{variables}
\DeclareMathOperator{\parentstate}{parentstate}
\DeclareMathOperator{\visible}{visible}
\newcommand*{\dotcup}{\mathbin{\dot{\cup}}}

\begin{document}
original:
$\visible(s) = \variables(s) \dotcup \dot{\bigcup_{p \in \parentstate^+(s)}} \variables(p)$

with \verb+\mathop+:
$\visible(s) = \variables(s) \dotcup \mathop{\dot{\bigcup} \variables(p)}_{p \in \parentstate^+(s)}$

with \verb+\mathclap+:
$\visible(s) = \variables(s) \dotcup \dot{\bigcup_{\mathclap{p \in \parentstate^+(s)}}} \variables(p)$
\end{document}


Alternatively, if you want more space, you can use \mathmakebox. This allows you to customise the apparent width of the subscript.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\DeclareMathOperator{\variables}{variables}
\DeclareMathOperator{\parentstate}{parentstate}
\DeclareMathOperator{\visible}{visible}
\newcommand*{\dotcup}{\mathbin{\dot{\cup}}}

\begin{document}
original:
$\visible(s) = \variables(s) \dotcup \dot{\bigcup_{p \in \parentstate^+(s)}} \variables(p)$

with \verb+\mathop+:
$\visible(s) = \variables(s) \dotcup \mathop{\dot{\bigcup} \variables(p)}_{p \in \parentstate^+(s)}$

with \verb+\mathmakebox+:
$\visible(s) = \variables(s) \dotcup \dot{\bigcup_{\mathmakebox[1cm]{p \in \parentstate^+(s)}}} \variables(p)$
\end{document}


• Thanks for your answer. However, I'd like to keep the space left of the operator as in the top-most version -- it seems easier to read that way, at least to me :). Aug 9 '13 at 9:33
• mathtools has more tools for this see \smashoperator Aug 9 '13 at 9:49