[Tex/LaTex] Why will the table not come after a section with \FloatBarrier

floatssectioning

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?

Best Answer

\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.