0

I have a problem with linespacing after I put a figure in my document. The figure code is put just after some equation code. Although the figure is drawn in the top of the page it seems that it adds some extra linespace after the equation. How can I fix it?

The problem is not present when I remove the equation.

The problem can be reproduced with the code below:

\documentclass{mwrep}
\begin{document} 
  % extra linespacing 
  some text some text some text some text
  \begin{equation}some equation\end{equation}
  \begin{figure}some figure\end{figure} % adds extra linespace though drawn in another place

  some text some text some text some text

  % regular linespacing
  some text some text some text some text
  \begin{equation}some equation\end{equation}

  some text some text some text some text
\end{document}
3
  • 1
    Without a MWE, I hesitate to say more than: try reversing the order of your figure and equation....
    – jon
    Sep 21, 2015 at 1:17
  • 1
    No, it cannot be reproduced with that code. For one thing, that code will not compile. For another, the problem is bound to depend on your class and relevant packages. Remember, though, that TeX uses stretchy spaces which is one of the tricks it uses to optimise page and line breaks.
    – cfr
    Sep 21, 2015 at 1:20
  • I've edited the code to be a working example. Reversing the order seems to fix the problem. Sep 21, 2015 at 1:29

1 Answer 1

2

The problem can be fixed by inserting a blank line between two environments, ie between \end{equation} and \begin{figure}.

So the code will look as:

some text some text some text some text
\begin{equation}some equation\end{equation}

\begin{figure}some figure\end{figure}
2
  • Any reason why it happens? Sep 21, 2015 at 12:14
  • No, I just looked for a fix to the problem. Sep 22, 2015 at 8:35

You must log in to answer this question.

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