[Tex/LaTex] Increase line spacing in wrapped inline maths

inline()line-breakingline-spacingmath-mode

I am using \allowbreak to wrap long expressions over multiple lines. For some reason, successive lines of maths broken in this way always appear without any line spacing. I haven't found any \setstretch,\linespread etc. that will increasing the spacing. Any suggestions?

Edit: example added below. This produces text paragraphs with a lot of spacing, yet the two lines of the maths expression are glued together. I guess this is consistent, in the sense that the distance between two base lines of the maths expression is at least the distance between two base lines of text.

So a better way to ask my question: in the example below, how do I ensure that the maths lines do not stick together, but have a bit of vertical space between them, without changing the line spacing of the text lines?

\documentclass{article}
\usepackage{lipsum}
\everymath{\displaystyle\allowbreak}
\linespread{2.0}

\begin{document}

\lipsum[1]
$\frac{1}{c_s^{2}} \partial_{t}{\psi_{1}}
\partial_{t}{\rho_{0}}+\frac{1}{c_s^{2}} \partial_{t}{\rho_{0}}
\partial_{i}{\psi_{1}} v^{(0)}_{i}+\frac{1}{c_s^{2}}
\partial_{t}{\partial_{t}{\psi_{1}}} \rho_{0}+\frac{1}{c_s^{2}}
\partial_{t}{v^{(0)}_{i}} \partial_{i}{\psi_{1}}
\rho_{0}+\frac{1}{c_s^{2}} \partial_{t}{\partial_{i}{\psi_{1}}}
\rho_{0} v^{(0)}_{i}+\frac{1}{c_s^{2}} \partial_{t}{\psi_{1}}
\partial_{i}{\rho_{0}} v^{(0)}_{i}+\frac{1}{c_s^{2}}
\partial_{i}{\partial_{t}{\psi_{1}}} \rho_{0}
v^{(0)}_{i}$
\lipsum[1]
\end{document}

Best Answer

TeX will ensure that baselines are equally spaced, unless the distance between the deepest object in a line and the highest object in the next one is less than \lineskiplimit (default value 0pt). Well this is not the complete truth, but it's sufficient for this case.

In your document the distance between baselines is set to 24pt, due to \linespread{2}.

The deepest object is \frac{1}{c_s^2}, which is also the highest object. Its depth is 9.33168pt, while its height is 13.20952pt.

Summing up these we get 22.54120pt, which is less than the usual distance between baselines, so no additional space will be added and the baselines will have 24pt distance between them.

Just to make experiments, try doing \linespread{1.8}\lineskip=30pt and you'll see

enter image description here

I added \noindent in front of the formula so as to avoid an overfull box that's irrelevant for the problem at hand.

Now the sum of depth and height is larger than the baseline skip, so \lineskip glue is inserted to distance them (default value 1pt).

Differently from other software, TeX does not implement line spacing by inserting a fixed amount of glue between lines: this would lead to differently spaced lines, according to the presence of ascenders or descenders. Rather, it works on a constant distance between baselines, until possible.

What you could do is to increase the values of \lineskiplimit \lineskip: with

\lineskip=6pt
\lineskiplimit=18pt

you get

enter image description here

which is as wrong as it could be. But the document is yours; adjust the values to suit. If you want also the distance between “rutrum” and the formula to be larger, give an even larger value to \lineskiplimit.

The problem is in the declaration

\everymath{\displaystyle}

(note that \allowbreak does nothing at all, because it just inserts a zero penalty at the start of each math formula, which is useless or even bad). Such a declaration is one of the best ways to spoil the appearance of a document.

Just for comparison, here is the output without the dreaded declaration, and it looks quite good (considering the bad situation you're in with double spacing).

enter image description here

Related Question