[Tex/LaTex] \vspace command inserting more space than specified

spacing

I'm new to LaTeX altogether and discovered something strange while fiddling around with a few commands. Take this simple case of the vspace command:

\documentclass[]{article}

\begin{document}

\noindent
p

\vspace{10 mm}

\noindent
b

\end{document}

This should just insert a 10mm gap between the lower tip of p and the upper tip of b. Unfortunately, when I typeset it and measured the gap with a rule, it turned out to be around 18-19mm. I use TeXstudio as my LaTeX editor and was wondering whether the editor has something to do with this?

Best Answer

TeX doesn't work as you're conjecturing.

The normal distance between the two lines would be, measured from the baseline where the p is sitting to the next baseline (the b), 12pt.

The lower tip of the p is 1.94444pt below the baseline, the upper tip of the b is 6.94444pt above the baseline. So the normal distance between the two points is 3.11112pt = 1.09343mm

If you add to this 10mm you get a distance of 11.09343mm, which corresponds to the image below, generated by the minimal document

\documentclass{article}
\begin{document}

\noindent p

\vspace{10mm}

\noindent b%
\settoheight{\dimen0}{b}\smash{\raisebox{\dimen0}{\vrule height 11.09343mm}}

\end{document}

The line under \noindent b just adds the measuring rule that doesn't contribute to the normal spacing because of the \smash. If you get 18mm then you have other settings that you're not specifying.

enter image description here

Related Question