Understanding line height / line spacing / baselineskip in LaTeX
Your first assumption and picture of \baselineskip
were correct, but
Consequently I assumed setting
\baselineskip
equal to font size should result in lines "touching" each other
Is wrong for two separate reasons.
Firstly the "font size" is an essentially arbitrary number assigned by the font designer \fontsize{10pt}{10pt}\selectfont
selects a font with nominal size 10pt and \baselineskip
equal to 10pt but the actual height of the letters (especially parentheses and accented captitals, or even unaccented capitals) may be more than 10pt. So this may or may not result in \baselineskip
glue being added depending if the height of the letters actually used on the line is more or less than 10pt.
Secondly teX does not force the baselineskip by using no space (or negative space) two over-height lines do not over-print, being set to a forced \baselineskip
spacing. If the space to be added would be less than the parameter \lineskiplimit
then a length \lineskip
is used instead.
By default in the standard classes \lineskip
is 1pt so you will see a minimum 1pt separation if the baselines would touch but (slightly strangely) \lineskiplimit
is 0pt so the distance can approach zero without \lineskip
being used, which will cause a "jump" in interline space if the height of the content is gradually increased.
If you add
\showoutput
\showboxdepth=3
to your test file, note first that it says
LaTeX Font Warning: Size substitutions with differences
(Font) up to 5.12pt have occurred.
So the fonts used were not always the size requested (but \baselineskip
was always exactly as requested) this explains why the effects are more apparent at some sizes. The log will show
\vbox(633.0+0.0)x407.0
.\glue 16.0
.\vbox(617.0+0.0)x345.0, shifted 62.0
..\vbox(12.0+0.0)x345.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 426.9944fil
...\write-{}
...\glue(\topskip) 2.5
...\hbox(7.5+2.5)x345.0, glue set 143.77742fil []
...\penalty 300
...\glue(\baselineskip) 0.0
...\hbox(7.5+2.5)x345.0, glue set 143.77742fil []
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 1.945
...\hbox(15.555+5.185)x345.0, glue set 152.1931fil []
...\penalty 300
...\glue(\lineskip) 1.0
...\hbox(15.555+5.185)x345.0, glue set 152.1931fil []
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 6.155
...\hbox(18.66+6.22)x345.0, glue set 113.70607fil []
...\penalty 300
...\glue(\baselineskip) 5.12
...\hbox(18.66+6.22)x345.0, glue set 113.70607fil []
...\glue -5.0
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 23.55556
..\hbox(6.44444+0.0)x345.0, glue set 170.0fil
...\glue 0.0 plus 1.0fil
...\OT1/cmr/m/n/10 1
...\glue 0.0 plus 1.0fil
If you allow the fonts at any size by adding \RequirePackage{fix-cm}
as the first line you get no font size warning
and a log of
\vbox(633.0+0.0)x407.0
.\glue 16.0
.\vbox(617.0+0.0)x345.0, shifted 62.0
..\vbox(12.0+0.0)x345.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 427.45435fil
...\write-{}
...\glue(\topskip) 2.5
...\hbox(7.5+2.5)x345.0, glue set 143.77742fil []
...\penalty 300
...\glue(\baselineskip) 0.0
...\hbox(7.5+2.5)x345.0, glue set 143.77742fil []
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 2.5
...\hbox(15.0+5.0)x345.0, glue set 159.07242fil []
...\penalty 300
...\glue(\baselineskip) 0.0
...\hbox(15.0+5.0)x345.0, glue set 159.07242fil []
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 2.5
...\hbox(22.5+7.5)x345.0, glue set 66.10855fil []
...\penalty 300
...\glue(\baselineskip) 0.0
...\hbox(22.5+7.5)x345.0, glue set 66.10855fil []
...\glue -5.0
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 23.55556
..\hbox(6.44444+0.0)x345.0, glue set 170.0fil
...\glue 0.0 plus 1.0fil
...\OT1/cmr/m/n/10 1
...\glue 0.0 plus 1.0fil
The second test includes 1 pt \lineskip
between lines and the third test has the lines not exactly 30 pt height because \usepackage{fix-cm}
was not used.