I noticed that the tabular environment produces surplus vertical space on top of \baselineskip
(as does LaTeX by default but that part can be avoided by using \offinterlineskip
):
\documentclass{article}
\begin{document}
\offinterlineskip
\fontsize{40pt}{40pt}\selectfont
No vertical spacing (bars touch):\\\textbar\\\textbar
\begin{tabular}{l}
Tabular produces vertical space:\\\textbar\\\textbar
\end{tabular}
\end{document}
How can I make tabular
omit that vertical space? Seems I have not found the proper length to set yet...
To add to the accepted answer:
Turns out most of the confusion was due to the issue described in a follow-up question, see https://tex.stackexchange.com/a/410251/152311
The font size of 40 pt I used in the example to highlight the issue unfortunately shows the problem of not fully scalable fonts at its worst and introduces a large vertical spacing even for normal text which I tried to suppress with \offinterlineskip
subsequently. This command does not affect the tabular
environment in the same way, though.
It turns out the "fix" is as simple as adding the fix-cm
package or using a scalable font like lmodern:
\documentclass{scrartcl}
\usepackage{lmodern}
\begin{document}
% \offinterlineskip
\fontsize{40pt}{40pt}\selectfont
No vertical spacing (bars touch):\\\textbar\\\textbar
\begin{tabular}{l}
Tabular produces vertical space:\\\textbar\\\textbar
\end{tabular}
\end{document}
Note the sudden increase in font size (not properly visible in the screenshots due to different scaling unfortunately).
The bars are almost touching also in the tabular
example now (help on how to remove the remaining difference would be appreciated but is mostly academic now).
Using \fontsize{40pt}{80pt}\selectfont
causes the behavior I desired initially (e.g. a proper double line spacing in the text and the tabular
).