15

Given following situation:

\begin{figure}[ht!]
    ...
\end{figure}
\begin{equation}
    ...    
\end{equation}
Some one-line text.
\begin{eqnarray}
    ...
    ...
\end{eqnarray}

how can I make sure that the float doesn't get placed between the equation and the equation array? Also the part to protect goes over two pages, if that's of any importance.

  • You should not use eqnarray since it has incorrect spacing and may print over the equation number. Use align instead. – Martin Ueding Jun 22 '13 at 10:36
18
  • The placeins package gives the command \FloatBarrier, which will make sure any floats will be put in before this point.

  • The flafter package ensures that floats don't appear until after they appear in the code.

This means that you could use something like:

\usepackage{placeins} % put this in your pre-amble
\usepackage{flafter}  % put this in your pre-amble

...
\begin{figure}[ht!]
...
\end{figure}
\FloatBarrier % new bit
\begin{equation}
...    
\end{equation}
Some one-line text.
\begin{eqnarray}
...
...
\end{eqnarray}
% with the flafter package, this figure won't appear before this point
\begin{figure}[ht!]
...
\end{figure}

On another note, you might like to see this post: eqnarray vs align

  • Seems to work fine. Thanks for the link! While eqnarray doesn't cause any issues in my current work, I'll keep in mind that there are some drawbacks and will use align in the future. – htorque Aug 17 '11 at 12:46
  • 2
    You're welcome; I made an edit to include the flafter package, which might also be of interest. – cmhughes Aug 17 '11 at 17:22
  • 1
    FloatBarrier is all nice and well but it puts an additional constraint on figure placement that was not asked for not required to fulfil the aim of not splitting the list: Latex can no longer place the figure after an un-split list, which might be a better figure placement. – noirdesir Feb 10 '14 at 0:42

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.