4

I have a rather large file with many chapters, before every chapter I use \cleardoublepage to get to a new doublepage but flushing all floats beforehand.

In the beginning I also had position specifiers on all floats but I then had the issue that all floats were pushed to the end. This answer suggests to remove the position specifiers, and that worked fine for me.

However, I now have the problem of sometimes seeing the following order

float
chapter title

instead of

chapter title
float

as it is in my document. I know there's a \FloatBarrier command but if I use it after the \section{chapter title} command, the float gets pushed to the next page, which is not what I want.

I wonder, how do I properly place floats and prevent them to be before my chapter titles?


A minimum working example is given here:

\documentclass[11pt,a4paper,twoside]{article}

\begin{document}

\section{Section 1}
\cleardoublepage

\section{Section 2}

\begin{table}
  \begin{tabular}{|l|}
    This is just a table \\
  \end{tabular}
\end{table}

\end{document}
  • Could you post a MWE (or two) where both cases are demonstrated. Normally, floats should be shipped out before chapters start -- I did not observe the behaviour you described up to now. – user31729 Feb 26 '14 at 18:21
  • Updated my question. – pfnuesel Feb 26 '14 at 18:38
  • You are using sections, not chapters, there is no automatic shipout of floats and new page before a new section starts. Perhaps, you have to change documentclass to book and switch to chapters accordingly. – user31729 Feb 26 '14 at 18:42
4
\documentclass[11pt,a4paper,twoside]{article}
\makeatletter
\renewcommand\fps@table{htbp}
\makeatother

\begin{document}

\section{Section 1}
\cleardoublepage

\section{Section 2}

\begin{table}
  \begin{tabular}{|l|}
    This is just a table \\
  \end{tabular}
\end{table}

\end{document}
  • Thanks. I can confirm that this is working, not just for the MWE, but also for my main document. Do you mind explaining a bit what this renewcommand does? – pfnuesel Feb 26 '14 at 18:54
  • It just changes the default position to add h same as using [htbp] on every table – David Carlisle Feb 26 '14 at 19:46
  • 1
  • floatbarrier stops floats floating forwards past the barrier it has no effect on it going backwards to the top of the current page. You could add \usepackage{flafter} which stops floats going backwards, then if it didn't fit "here" it would go to the top of the next page rather than the top of the current one – David Carlisle Feb 26 '14 at 22:05

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.