# Vertical alignment of inf subscripts without vphantom

I was wondering whether it would be possible to align the index of multiple infimums (or supremums, or limits..) without recurring to the \vphantom command - I feel somehow it's kind of "cheating".

Here is a short MWE

\documentclass{article}
\usepackage{amsmath, amsthm, amssymb, amsfonts, amscd}

\begin{document}

$$\inf_{v, w \in V} \bigg(\inf_{\tilde v, \tilde w \in \widetilde V} v + w - (\tilde v + \tilde w)\bigg)$$

$$\inf_{\vphantom{\widetilde V}v, w \in V} \bigg(\inf_{\tilde v, \tilde w \in \widetilde V} v + w - (\tilde v + \tilde w) \bigg)$$

\end{document}


And this is the behaviour I would like to get without the \vphantom(equation (2) is well aligned)

• \bigg is definitely too big; try \Bigl( and \Bigr). The alignment needs the phantom, or changing the font parameter responsible for the distance, but this might have adverse effects in other places where you don't want a big gap. – egreg Nov 9 '18 at 8:43
• Thanks for your comment. I copy-pasted an actual part of a draft paper of mine (making it simpler), and I need a \Bigl( \Bigr) inside the \bigg parentheses. I agree that stand-alone like this it's a bit too big. – G. Gare Nov 9 '18 at 8:58
• It's not necessary to use larger parentheses at each nesting level. In any case, start at the lowest size possible. Note \biggl and \biggr behave correctly as regards to spacing, which \bigg doesn't. – egreg Nov 9 '18 at 9:00
• I agree - thanks - with the left/right specification of parentheses. Nonetheless, I think that nesting big-to-small parentheses, especially when it helps "covering" the inside symbols, enhances readability of rather complex formulae (the simple example I posted here is not a case of this) – G. Gare Nov 9 '18 at 9:05
• I presume you speak of the vertical placement of the subscript. Do you require the syntax to remain the same? If not, a stackengine macro could easily be defined (using an argument rather than an underscore) to set the subscript at a given baseline distance below the \inf rather than with a fixed amount of white space (as is currently done). – Steven B. Segletes Nov 9 '18 at 11:21

In this answer, I am not addressing the paren height issue that others have drawn attention to, but rather the vertical elevation of the underscript across terms of an equation.

The \vphantom is required because the subscript placement provides a fixed gap of white space between the operator and the underscript. This is generally a good thing, because it allows underscripts of various heights to be set in a reasonable way.

The drawback is that if an two operators have underscripts of slightly different heights, the baselines of the underscripts are not aligned.

Here, instead, I define a macro \finf (fixed-underset \inf) that takes an argument, \finf{...}, which it uses in lieu of the \inf_{...} syntax, and fixes the baselineskip between the operator and the underscript. An optional argument is also provided to specify the baselineskip.

Thus, the \vphantom is avoided and \finf{...} takes no more key strokes than \inf_{...}.

EDITED to provide a generic macro \fop for doing this to any math operator, and show how to set it up for not only \finf, but also \fsum. With this approach, the underscript baselines will always be aligned, regardless of their local height.

\documentclass{article}
\usepackage{amsmath, amsthm, amssymb, amsfonts, amscd}
\usepackage[usestackEOL]{stackengine}
\newcommand\fop[3][9pt]{\mathop{\ensurestackMath{\stackengine{#1}%
{\displaystyle#2}{\scriptstyle#3}{U}{c}{F}{F}{L}}}\limits}
\newcommand\finf[2][9pt]{\fop[#1]{\inf}{#2}}
\newcommand\fsum[2][13pt]{\fop[#1]{\sum}{#2}}
\begin{document}
\centering
inf (no vphantom)
$$\inf_{\mathstrut v, w \in V} \bigg(\inf_{\tilde v, \tilde w \in \widetilde V} v + w - (\tilde v + \tilde w)\bigg)$$\medskip

inf (vphantom)
$$\inf_{\vphantom{\widetilde V}v, w \in V} \bigg(\inf_{\tilde v, \tilde w \in \widetilde V} v + w - (\tilde v + \tilde w) \bigg)$$\medskip

finf
$$\finf{\mathstrut v, w \in V} \bigg(\finf{\tilde v, \tilde w \in \widetilde V} v + w - (\tilde v + \tilde w)\bigg)$$\medskip

fsum
$$\fsum{\mathstrut v, w \in V}^n \bigg(\fsum{\tilde v, \tilde w \in \widetilde V}^n v + w - (\tilde v + \tilde w)\bigg)$$
\end{document}
`

In the image below, red lines have been added just to highlight the alignment of underscript baselines that are of slightly different vertical height