In the following example, the space after the red equation is much larger than the space after the black one.

\[ a = b \]

The quick brown fox jumps over the lazy dog.
\[ a = b \]

The quick brown fox jumps over the lazy dog.

It appears to me that the presence of \color{black} fools TeX into thinking there is something on the line after the equation, so the paragraph break causes a spurious blank line before the text. Section 3.7 of grfguide mentions spacing problems, but doesn't really explain the situation. What is on the line after the red equation?

Note that there is already a question asking how to deal with this problem; I want to understand what is going on.


1 Answer 1


TeX puts a \special (or pdftex colour primitive which is equivalent) which inserts the commands to switch the colour, however unlike a font change this is an actual item on the vertical list, so it "hides" boxes and spaces that occur immediately before it so that decisions made by the vertical display code do not see the same detail of the preceding paragraph. It's normally better to try to get the color switch in to horizontal mode, for example

The quick brown fox jumps over the lazy dog.\color{red}
\[ a = b \]


One way to see what is happening is to put \showoutput into the document and then compare the log file a) without colour b) with color commands in vertical mode c) with colour commands just in horizontal mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.