# Linespacing changes at inline math with superscript

I am using a latex template where the vertical linespacing is increased whenever there is an inline math expression that contains superscripts. Subscripts are fine. I find this to be annoying. Is there some way I can turn it off on a global level? \smash{x^2} does the trick locally, but I don't want to write that everywhere. Changing the template is not an option.

• Could you please be clearer? Do you have this model and could you show what exactly you want? Thanks. – Sebastiano Dec 24 '18 at 8:17
• from your description, it seems that the \baselineskip is too small to accommodate anything taller than an ordinary uppercase letter. (does this problem occur if you have an accented uppercase letter, say \AA?) you can try setting lineskiplimit=\maxdimen \lineskip=0pt to ignore lines that are "too close together". (i'm quoting this from memory so this may be incorrect; don't have a latex system available from this computer.) this may, however, result in vertically overlapping lines. – barbara beeton Dec 25 '18 at 2:01

there are several parameters that can be reset to accomplish what is asked. the actual values depend on what is set in the document class being used. this example resets the relevant parameters based on the normal 10-point type used by article, setting the baselines "solid", i.e., equal to the type size.

unless a subscript hangs very low, the depth of a text font's descenders will probably mask it. this example uses a fraction instead, to stress the effect. setting \lineskip to 0pt nullifies this effect in the example.

to nullify the extra space resulting from superscripts requires resetting the \lineskiplimit, which is the amount of excess height allowed before extra space is added. in the example, this is reset to -\maxdimen, which will prevent space from being added no matter how high a superscript extends.

do take notice, however, that adjacent lines may overlap. individual control (using \smash) is probably preferable unless the material being set is highly uniform.

\documentclass{article}

\newcommand{\ordtext}{Ordinary text to fill several lines. }
\newcommand{\testparagraph}{\noindent
\ordtext\ordtext\ordtext
Some math with sub and superscripts:
$X^{\frac12} + Y_2 + \frac12$.
\ordtext\ordtext\ordtext
}
\textwidth=2in

\begin{document}

\baselineskip=10pt
\testparagraph
\medskip

\lineskip=0pt
\testparagraph
\medskip

\lineskiplimit=-\maxdimen
\testparagraph

\end{document}