5

In the below MWE, why is \smallskip adding so much extra space after display math? (And how do I fix it?)

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage{amsmath}

\begin{document}
This line.

Next line.
\smallskip

Next line after small skip.

\[displaymath\]

Next line.

\[displaymath\]
\smallskip

Next line after small skip.
\end{document}

enter image description here

2
  • The big question is where all the space around display math comes from. If you put display math in the same paragraph as the lines above and below (the way you are supposed to) the spacing is controlled by \abovedisplayskip and \belowdisplayskip. But when it is in a paragraph by itself, that won't help. So far everything I have tried (like \partopskip) hasn't worked. Feb 18, 2016 at 6:07
  • 2
    and don't leave a blank line between text and the following display. Feb 18, 2016 at 6:08

2 Answers 2

5

Good LaTeX syntax is never to leave one or more blank lines -- which implicitly generate a paragraph break -- immediately before a display-math group. If needed, one can start a new paragraph after a display-math group.

If you want to avoid generating an excessive amount of vertical whitespace between the end of one displaymath group and the next paragraph, while still using \smallskip, be sure not to insert a blank line between the \smallskip instruction and the next paragraph.

enter image description here

\documentclass[12pt]{article}
\usepackage{amsmath}
\setlength\parindent{0pt} % just for this example
\setlength\textwidth{3in} % just for this example
\begin{document}
This line.

Another line.

\smallskip              % no blank line after \smallskip
Line after a smallskip. % no blank line *before* \[...\]
\[\text{displaymath}\]

Line with no smallskip. % no blank line *before* \[...\]
\[\text{displaymath}\]

\smallskip              % no blank line after \smallskip
Line after a smallskip.
\end{document}
2
  • So in general, one should avoid inserting a blank line between a skip instruction and the following paragraph?
    – justin
    Feb 18, 2016 at 16:35
  • 1
    @justin -- A full answer would require knowing a lot more about your document setup. In general, though, I'd say you won't go wrong by not having (explicit or implicit) paragraph breaks between a vertical skip and the subsequent text material.
    – Mico
    Feb 18, 2016 at 16:44
0

Do not use blank lines before/after display math. Use it this way:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage{amsmath}

\begin{document}
    This line.

    Next line.
    \smallskip

    Next line after small skip.
%   
    \[displaymath\]
%   
    Next line.
%   
    \[displaymath\]
    \smallskip

    Next line after small skip.
%
    \[displaymath\]
%   
    Next line after small skip.
\end{document}
1
  • I'd say that if a displaymath group represents the end of a train of thought, it's OK to generate a paragraph-type break between that displaymath group and the start of the following material (which will likely be text).
    – Mico
    Feb 18, 2016 at 7:32

You must log in to answer this question.

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