4

The MWE is here:

\documentclass{minimal}
\usepackage{blindtext} % dummy text
\begin{document}
\blindtext

\rule{60pt}{20pt}

\blindtext
\end{document}

You can find that black rectangle, a dummy image, is separated from the paragraph blow by a vertical space, but the rectangle and paragraph above sticked together. Can someone tell me why?

1 Answer 1

6

The vertical space after that dummy image is \parskip plus linespacing (\linespread, or say \baselinestretch, times \baselineskip), and this space is normal. You can test by:

\documentclass{minimal}
\usepackage{blindtext} % dummy text
\setlength{\parskip}{10pt}
\begin{document}
\blindtext

\blindtext
\end{document}

The vertical space before the dummy image, however, is controlled by \parskip plus linespacing and the height of the dummy image. Here is one more thing you have to know: TeX separate two lines by setting their 'baseline', which is the line of base points of every boxes in the specific line, rather than by calculating the space of the bottom of the last line and the top of the next line. In your case, that height is lager than the sum of \parskip and linespacing, so they sticks together.

You can see the vertical space above that dummy image by set its height to 1ex:

\documentclass{minimal}
\usepackage{blindtext} % dummy text
\begin{document}
\blindtext

\rule{60pt}{1ex}

\blindtext
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .