2

My document has a number of equations that are surrounded by text. After long sentences, the equations look fine. However, after short sentences, they do not: the problem is that the equations are 'shifting up' into the empty space.

Is there a solution to this? One option is to add lots of white text above equations (to lengthen short sentences) but I imagine that better solutions are available.

Here is an example (I wasn't sure what might be relevant so have erred on the side of inclusion):

\documentclass[12pt,a4paper]{article}

\begin{document}

**Example 1 (no problem)**. This is a 'long sentence' followed by
\begin{equation} 2x = 10 \end{equation}

**Example 2 (problem)**
\begin{equation} 2x = 10 \end{equation}

\end{document}

enter image description here

1 Answers1

3

If the last line of the paragraph is short more than 2em to the left of the equation then Tex uses a different spacing, if you do not like this you can set the space for this case to be same as the overlapping case:

\setlength\abovedisplayshortskip{\abovedisplayskip}
\setlength\belowdisplayshortskip{\belowdisplayskip}
David Carlisle
  • 757,742
  • Thanks so much! Can I ask where I put these commands? I tried putting them in the document I received an error message (specifically, 'missing number, treated as zero') – afreelunch Dec 19 '19 at 18:32
  • @afreelunch anywhere before the equation but I had a typo with ( instead of { so you need the fixed version as above (now:-) – David Carlisle Dec 19 '19 at 18:37
  • Uhm, actually the best way should be to patch \normalsize, wouldn't it? – campa Dec 20 '19 at 09:25
  • @campa possibly although most documents shouldn't have global size changes mid document so a single setting should be fine (and patching normalsize is a bit tricky as you also have to take account of \@normalsize and for newer formats \normalsize<space> which would mean that 90% of the answer was about how to patch normalsize and not about display math spacing. – David Carlisle Dec 20 '19 at 09:34