2

I'm writing a report with using the IEEE Transactions template, and the template itself includes an example figure:

\begin{figure}[htbp]
\begin{centering}
\textsf{A single column figure goes here}
\par\end{centering}
\caption{Captions go \emph{under} the figure}
\end{figure}

which is typeset very nicely as it should be.

However, when I replicate that, but also add in an image:

\begin{figure}[htbp]
\begin{centering}
\includegraphics{photo of stuff}
\par\end{centering}
\caption{things}
\label{fig:stuff}
\end{figure}

I get no image in the body of the text as it should be, but instead an ugly sprawl of all my figures on the following page:

Bad code doing bad things

Any ideas as to whats going wrong here and how to fix it would be greatly appreciate. Thank you!

Born
  • 23
  • 4

2 Answers2

6

IEEE is known for having quite ridiculous things in their templates, which in some cases definitely should not be followed. You should IMHO try this:

\begin{figure}[tp]
\centering
\includegraphics[width=\linewidth]{yourfile}
\caption{Captions go \emph{under} the figure.}
\end{figure}

Remarks:

  • I am strongly against [h] or [H] placement of figures, and I'm certainly not the only one. As well, I don't like [b]ottom figure
  • centering is not an environment, just a command.
  • [width=\linewidth] is a way how to make your graphics as wide as they can be.
  • If you wanted a full-width graphics, you should be able to use \begin{figure*}...\end{figure*}. However, it necessarily moves the figure to the following page, so you might consider moving it in the code to get it where it should be.
yo'
  • 51,322
4

I'm almost sure that your image is too big.

Try to adjust the image width using an optional argument

\includegraphics[width=xxxcm]{photo of stuff}

where xxx is the desired length and cm is the unit. You can use other units, for example mm, pt or in.

Also, you can set up the width equal to the line width using width=\linewidth (without unit, since that command already has one).

Sigur
  • 37,330
  • 1
    Please, make it into a complete example; also add that \centering should be used and not the inexistent centering environment. – egreg Jan 11 '14 at 15:55
  • @egreg, it is not necessary anymore. Other users had added similar answers. I guess that I'll delete mine. – Sigur Jan 11 '14 at 19:47