Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?
share|improve this question
    
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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.