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
- Section heading
- mytexthere
- tables begin here
but rather it is:
- tables begin here
- section heading
- 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 theplaceins
package then\FloatBarrier
is added to all\section
commands automatically.