[Tex/LaTex] Figure placement

floats

Please I have a question regarding figure and table placement. I am writing my thesis and the guidelines requires a figure or a table to appear after 3 lines of the last sentence.Is there any way to do that in latex. Thanks

Best Answer

Basically LaTeX handles figures, tables and similar objects as floats. LaTeX's internal algorithm "tries" various positions on a page to find the best place for the float. You can control the places that LaTeX is allowed to use while finding the best position via an optional argument at the beginning of your figure:

      \begin{figure}[tbh!]
        \centering
        \includegraphics{yourimage}
        \caption{your caption}
        \label{fig:figlabel}
      \end{figure}

Here t means top (of the page), b means bottom, h means here and as far as I know the ! means that LaTeX should ignore the other possible places (in this case none).

Nevertheless this still doesn't solve your problem. Well, there is another possible specifier for the argument, namely H. With H LaTeX ignores all other positions and places the figure at the same position as in your LaTeX source. Thus, you could use this as a dirty trick to place your figure:

    Text Text Text.\par % The paragraph ends here
    \vspace{36pt} 
    % vertical space of 3 times your font size (in this case 12pt)
    % --> equals 3 empty lines
    \begin{figure}[H]
        \centering
        \includegraphics{yourimage}
        \caption{your caption}
        \label{fig:figlabel}
     \end{figure}

Still this is not the recommended way to place a float. Please also note that placing a float that way can cause overfull vertical boxes and therefore is not a good manner.

I recommend to read this post, since it gives more information about floats and generally makes my answer obsolete.