[Tex/LaTex] Align subscripts vertically

equationssubscriptsvertical alignment

I would like to align the subscripts in an expression such as this one:

\documentclass{article}
\usepackage{amsmath}
\begin{document}    
$$\sup_{f\in\mathcal H}\lim_{\epsilon\downarrow 0}\sup_{g\in\mathcal H,0<\|g\|<\epsilon} \text{something}$$
\end{document}

This is how it looks like:

misaligned subscripts

and I'd like the \epsilon \downarrow 0 to be on the same line as the other two subscripts.

Best Answer

The mathtools package provides a trick for this:

\documentclass{article}
\usepackage{mathtools} % loads also amsmath
\begin{document}
\[
\adjustlimits\sup_{f\in\mathcal{H}}\lim_{\epsilon\downarrow 0}\sup_{g\in\mathcal{H},0<\|g\|<\epsilon} \text{something}
\]
\end{document}

The \adjustlimits command should precede a pair of operators where you want the subscripts to be aligned.

Alternatively, you can define a new operator to be used in cases like these:

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator*{\plim}{lim\vphantom{p}}

\begin{document}
\[
\sup_{f\in\mathcal{H}}\plim_{\epsilon\downarrow 0}\sup_{g\in\mathcal{H}, 0<\|g\|<\epsilon} \text{something}
\]
\end{document}

enter image description here

About avoiding $$ in LaTeX, please see Why is \[ … \] preferable to $$?

Also it's preferable to write \mathcal{H} with braces, to make clearer what symbol is involved.