smash subscript in sum

You get the same as in the second example with an empty subscript, because TeX reserves the space and it forces the next size, which happens to be the same as when the subscript is present. The only difference is that in the first case the radical is lowered because of the depth of j.

The “real” solution is

\[
  \vphantom{\sum_{ij}}\sqrt{\vphantom{\sum}\mathop{\smash{\sum_{ij}}} f(i,j)}
\]

enter image description here

The outer phantom is to ensure the real depth is taken care of.

However, I'd suggest one of the following two realizations.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\[
  \Bigl(\,\sum_{ij}f(i,j)\Bigr)^{1/2}
  \qquad
  \biggl(\,\sum_{ij}f(i,j)\biggr)^{\!1/2}
\]
\end{document}

enter image description here

Here's a visual proof of the top statement.

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\fbox{$\displaystyle{\mathop{{}{=}}_{}}$}
\fbox{$\displaystyle=$}

\end{document}

enter image description here

The {}{=} is to ensure the Op atom is not centered with respect to the math axis and not to add spaces around =.

With \showlists we see the first formula is

\displaystyle
\mathord
.\mathop
..\mathord
...{}
..\mathord
...\mathrel
....\fam0 =
._{}

and the empty subscript is clearly visible and adds the vertical space.


If using \sqrt I propose this as a nicer looking (in my view) way:

\documentclass{article}

% \usepackage{mathtools}

\begin{document}
\[
    \sqrt{\sum\nolimits_{ij} f(i,j)}
\]
\[
    \sqrt{\,\sum\nolimits_{ij} f(i,j)}
\]
\end{document}

enter image description here

I find the square root too close to the top angle of sum symbol, hence the second line which adds a bit of space.


FWIW, the nath package ignores the subscripts which calculating the height of the square root:

\documentclass{article}
\usepackage{nath}

\begin{document}
\[
  \sqrt{\sum_{ij} f(i,j)}
\]
\end{document}

which gives

enter image description here

Note that nath is incompatible with the display math environments of amsmath, which can severely limits its usability.

Tags:

Sqrt

Amsmath