# Set \lineskip, \normallineskip, \lineskiplimit, \normallineskiplimit to avoid no gaps between two lines

In my paper, there are many inline equations with a large number of superscripts and subscripts. There is often no spacing between two lines.

The following is an example, which can occur in both the main text, caption, or algorithm float. The writing of math in the example may not be very good, but the focus of this issue is how to ensure a certain amount of spacing between two lines.

\documentclass{IEEEtran}
\usepackage{algorithm}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodss
$a_{\frac{f+b}{p+1}}$
tempor incididunt ut labore et dolore magna aliqasd a
$a^{\frac{1}{n+1}}$
proident, sunt in culpa qui officia
\begin{figure}
\caption{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodss
$a_{\frac{f+b}{p+1}}$
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
$a^{\frac{f+b}{p+1}}$
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\end{figure}
\begin{algorithm}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodss
$a_{\frac{f+b}{p+1}}$
tempor incididunt ut labore et dolore magna aliqua
$a^{\frac{1}{n+1}}$
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{algorithm}
\end{document}


My requirement is to ensure that the spacing between the two lines is not less than a certain length, such as 1pt. My current approach is to set \lineskip, \normallineskip, \lineskiplimit and \normallineskiplimit to 1pt.

\ExplSyntaxOn
\clist_map_inline:nn
{ \lineskip, \normallineskip, \lineskiplimit, \normallineskiplimit }
{ \setlength { #1 } { 1pt } }
\ExplSyntaxOff


I have two questions:

1. I would like to ask if there are any side effects of my actions. I have searched and learned some answers on tex.sx, but I am worried that it may have a negative effect on some areas.

2. When I read the source code of IEEEtran.cls, I found that these are set to 0pt, while \lineskip and \normallineskip are 1pt, \lineskiplimit and \normallineskiplimit are 0pt in article.cls. Why the author of IEEEtran.cls designed it this way.

% if things get too close, go ahead and let them touch
\lineskip            0pt
\normallineskip      0pt
\lineskiplimit       0pt
\normallineskiplimit 0pt

• Just set \normallineskip to 1pt. Why did the designers of IEEEtran set it to zero? Who knows? Commented Apr 17, 2023 at 8:26
• @egreg To my knowledge, when entering some environments or commands, \normallineskip will be assigned a value to \lineskip and take effect, such as minipage. If the lineskip is not set, the line spacing in the main text will not take effect. if things get too close, go ahead and let them touch mentioned by the IEEEtran author is somewhat puzzling. Expect someone to know why. Commented Apr 17, 2023 at 10:36

The default values in latex (inherited from plain) are slightly odd, \lineskiplimit is 0pt so lines can get arbitrarily close, but \lineskip is 1pt so if 0pt is reached there is a discontinuity and a 1pt lineskip is inserted.
Note even small negative values of \lineskiplimit do not (on average) cause over-printing as they just allow a tall item somewhere on one line to overlap a large depth somewhere on the line above, so you may choose to maintain baseline spacing but check for this in the log, and adjust wording if necessary.
Note typographers (and tex) would go to some lengths to maintain even baselines, so any use of \lineskip is essentially a failure. This is why inline math sets limits as subscripts, uses more cramped superscripts, smaller integral signs... So you could avoid the problem by adjusting the notation, perhaps using a/b rather than \frac{a}{b} in subscripts.
• Yes, it is generally more appropriate to place complex formulas between lines. However, it still appears that the first line is subscript and the second line is superscript, resulting in this part almost adjacent and very unattractive. Adding the distance setting mentioned earlier would make it much better. The main purpose of asking questions is that these lengths will be called at the lower level, fearing unexpected effects. Now I can confidently add 1pt. Commented Apr 17, 2023 at 11:13