0

I'm writing my thesis in LaTeX. However, as most of the users do, I face the problem of placing figures.

I tried various methods to place figures, and all of them were perfect -- except, when I add or remove a tiny bit of text.

I'm trying to obtain the structure where I can place figures, just before (or after) the comments about the figures. Something like:

[Figure 1 here]
This figure is so good I cannot explain it.

[Figure 2 here]
This figure is a bit worse. So, here's my explaination: we tried time travel and apparently failed while doing it and ended up in current time

[Figure 3 here]
This figure shows us not to try time travel without precautions.

I tried using floats. When I place 4-5 figures consecutively, with paragraphs afterwards, it works good. But after 12-13 figures (my experiments include around 20 figures), it fails and gives the famous too many unprocessed floats error. \clearpage sends the figures wherever LaTeX wishes (like end of the next section or even after the references).

I tried [hbtp] tag. But then, although the figures are in correct section, I cannot force LaTeX to put paragraphs just after or before the figures, which is my initial problem.

So, I need a generic method to achieve figure-comment structure that works whatever I add or remove.

Bernard
  • 271,350
padawan
  • 1,532

1 Answers1

1

Since this is a thesis, I would recommend checking the appropriate style manual (usually specified by the school) for how to refer to figures in running text. The Chicago Manual of Style (16th ed.) counsels, "Each illustration should appear as soon as possible after the first text reference to it" (3.8), and "An illustration should never be referred to in the text as 'the photograph opposite' or 'the graph on this page,' for such placement may not be possible in the final version" (3.9).

This is why we have floating environments with captions. You mention the illustration by label, and leave its physical placement open to change depending on the layout. You can give the environment a \label, and then use \ref to mention it in the text. In the .tex file, put the float environment somewhere after this reference (say, at the end of the paragraph).

For example:

Figure~\ref{fig:good} is so good I cannot explain it.
Figure~\ref{fig:worse} is a bit worse.

\begin{figure}
\includegraphics[width=\linewidth]{figures/good.pdf}
\caption{A good figure}
\label{fig:good}
\end{figure}

\begin{figure}
\includegraphics[width=\linewidth]{figures/worse.pdf}
\caption{A worse figure}
\label{fig:worse}
\end{figure}
musarithmia
  • 12,463