7

I have been trying this method to get a table to go after a section heading, but for some reason I am not able to get it to visualize that way.

\section{blah}
%\hlabel{sec:blah}
mytexthere (which is after the table... :( )

\FloatBarrier

\begin{table} \centering
    \begin{tabular}{| l | l |}
        \hline
        \multicolumn{2}{|c|}{config} \\
        \hline
        blah & DOUBLE BLAH \\   
        \hline
\end{tabular}
\end{table}

%several other tables
\section{new blah}

Am I misunderstanding what \FloatBarrier does? I had assumed it will cause the final output of my document to be something like

  1. Section heading
  2. mytexthere
  3. tables begin here

but rather it is:

  1. tables begin here
  2. section heading
  3. mytexthere

I suspect \FloatBarrier is simply keeping those on the same page (which it does) but leads my question:

  • How do I cause a table to always come after the section heading it is within? Can I do this with \FloatBarrier, or is there another way?
  • Try \begin{table}[ht] ... The ht means try to place the table "here" first, and if unable, then place at the top of the page. – Steven B. Segletes Mar 12 '13 at 1:50
  • @StevenB.Segletes thanks - that fixed it. LaTeX is fun :) – enderland Mar 12 '13 at 1:53
  • 3
    \FloatBarrier has no effect at all on that table as it comes later, it is designed to stop earlier floats floating past (if you use the section option of the package it is added to all \section commands automatically). – David Carlisle Mar 12 '13 at 9:24
10

\FloatBarrier has no affect at all on that table as it comes later, it is designed to stop earlier floats floating past.

If you use the [section] option of the placeins package then \FloatBarrier is added to all \section commands automatically.

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.