The text-equation space in two equations is extremely different; even though I left no blank lines

I am introducing this text and equation:

Con la energía del punto cero pasa una cosa muy similar: utilizando la ecuación \ref{E_ZPE}, y sustituyendo las tres frecuencias $\nu _{i}$ experimentales (anarmónicas) obtenemos la energía
% I have no blank line between the following and the upper text
$$\label{z} E_{ZPE}\left ( \text{anarmónica, experimental} \right )=\sum_{i=1}^{3}\left ( \tfrac{1}{2}\,h\nu _{i} \right )=4503.515 \text{ cm^{-1}}.$$
% I have no blank line between the following and the upper equation
Puesto que las frecuencias calculadas son las armónicas, la $E_{ZPE}$ calculada será también la armónica, la denotaremos como $E_{ZPE}\left ( \text{armónica, calculada} \right )$, y se recoge en la tabla \ref{tabla_resutados_monomero} para cada uno de los cálculos realizados. Como se puede observar, comparanddo la calculada con la $E_{ZPE}\left ( \text{anarmónica, experimental} \right )$, h


This is the result:

The result is that both spacings:

a) the spacing between above_text and equation

b) the spacing between below_text and equation

Both are very big, compared to other equations, such as this one:

Según la ecuación \ref{momento_dipolar_molecula}, para calcular el momento dipolar de la molécula es necesario primero calcular $\rho \left ( \vec{r}\, \right )$, pero obtenerlo a partir de la Ec. (\ref{rho_r}) es enormemente costoso, dada la elevada dimensión de la integral. Se puede demostrar que $\rho \left ( \vec{r}\, \right )$ se puede obtener así:
% I have no blank line between the following and the upper text
$$\label{rho_r_a_partir_de_matriz_P_tu} \rho \left ( \vec{r}\, \right )=\sum_{t}\sum_{u}P_{tu}\,\phi_{t}^{*}\left ( \vec{r}\, \right )\phi _{u}\left ( \vec{r}\, \right ),$$
% I have no blank line between the following and the upper equation
donde $\phi_{t}^{*}\left ( \vec{r}\, \right )$ es, respectivamente, el conjugado complejo del orbital atómico $t$ o $u$ en el punto $\left ( \vec{r}\, \right )$ (orbital atómico, o en general, función de base). $P_{tu}$ son los elementos de la matriz de densidad $P_{tu}$. De esta forma, tras terminar el cálculo $FC=SCE$, podemos reciclar la matriz


Which this is the result:

Why in the first case both spacings are bigger than in the second case ?

• ...you do know that the first equation has a superscript (upper range) for the summation, causing the math operator to stick out higher than the other... resulting in the bigger gap. – Werner Jun 24 '14 at 22:54
• @Werner: So, it is completely normal what is happening... But, would it be a possible way to make smaller this space ? (I need to "compress" information). Thank you very much. – DavidC. Jun 25 '14 at 0:06
• And this is mainly a consequence of using widened leading (aka interline space). Another factor can be the necessity for TeX to stretch spaces in order to fill up a page. – egreg Jun 25 '14 at 8:20
• @egreg: Thanks for the response. What do you mean by "widened leading (aka interline space" ? Where could I find more information about this? Thank you. – DavidC. Jun 28 '14 at 19:01
• @DavidC. I'm referring to one half or double spacing. – egreg Jun 28 '14 at 19:53

You can remove the height and depth of an object using \smash, and substitute in an alternative height and depth using a \vphantom construction:

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\lipsum[2]
$$f(x) = \sum_{i=1}^n n \qquad g(x) = \sum_x A(x)$$
\lipsum[2]
$$f(x) = \vphantom{\sum_{i=1}}\smash{\sum_{i=1}^n} n \qquad g(x) = \sum_x A(x)$$
\lipsum[2]

\end{document}


This is probably the safest way of doing it since it's localized to the equation in question. Alternatives could include an adjustment to the length \abovedisplayskip and/or \abovedisplayshortskip, but those would be global replacements that may yield undesirable results in general situations.

• @Werner.Thank you. So, in this example, \vphantom and \smash must be located before and after sub and superscript code for the summation, ok. But could this be applied for a non-superscript kind of equation, such as: E \left ( \text{experimental, monómero} \right )= \text{Energía átomos aislados}+E_{\mathit{ZPE}}+D_{0} Where should the \vphantom and \smash be localizad ? Thanks. – DavidC. Jun 28 '14 at 19:01
• @DavidC.: The \smash should be used for whatever you want actually display. The \vphantom can be anywhere on the line since it merely acts as a strut to ensure that the line has the height of the \vphantom content (since \smash removes exactly that height). – Werner Jun 28 '14 at 19:58