Graphics, Figures & TablesFigure placement

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
RensR
Posts: 10
Joined: Wed Jan 14, 2015 2:55 pm

Figure placement

Post by RensR »

I have a small problem with the placement of my figures. I have a chapter, in which I have some sections and subsections. What I want is to have the figures at the correct (sub)section and a new (sub)section can only begin if the pictures that belong to the previous (sub)section are already depicted. What do I add to my figure environment or something else? Since I have quite a lot of figures, it would otherwise become very messy with turning pages to see the correct figure.

For example:

Code: Select all

\section{SRO/NFO Stack}\label{sec:res:bil}
Text
\begin{figure}[ht!]
blabla
\end{figure}
\begin{figure}[ht!]
blabla
\end{figure}

Some more text with all scientific stuff, as can be seen in \cref{fig:res:bil:XRD} and some more text.

\begin{figure}[ht!]
\centering
\includegraphics[width=0.6\textwidth]{XRD_SRO_NFO_056.pdf}
\caption{A XRD measurement of a SRO/NFO bilayer on top of a STO substrate, compared to a blank substrate of STO.}
\label{fig:res:bil:XRD}
\end{figure}

\subsection{Magnetic behaviour}\label{subsec:res:bil:mag}

Also text, now with magnets, very cool of course.
Due to the rest of the chapter, the subsection about the magnetic stuff will begin before all (three) figures have been depicted, but not all the text in this subsection fits at the bottom of the page after the text of the section and thus the pictures brake up the text and it looks very messy.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Figure placement

Post by Johannes_B »

The default placement for figures and tables is tbp, meaning floats can be typeset at the top, the bottom and on their own page. Or in other words, if LaTeX sees fit, three floats can be placed on a page of their own.

If you don't want to change the placement specifiers, you can use package placeins to prevent the overflow. It provides the command \FloatBarrier.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply