# Problem inserting picture into latex/pdflatex using figure environment

I am having trouble inserting pictures into my latex document at a specific point. Currently I have the two figure environments in the text but they are printed at the back of the document, after the bibliography. Am I missing something?

The pictures are both supposed to be full page-sized rather than a traditional smaller figure or float. I might be wrong in using the figure environment in this case, but I am not sure.

\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\begin{document}
I have some text here.  Then pics.
\newpage
\begin{figure}[ht!]
\centering
\includegraphics[scale=0.75, angle=90, width=\textwidth]{hamlet.jpg}
\caption{cool picture}
\end{figure}
\newpage
\begin{figure}[ht!]
\centering
\includegraphics[scale=0.75, angle=270, width=\textwidth]{kinglear.jpg}
\caption{cool picture 2}
\end{figure}
\newpage
some more text here
\end{document}

-

Since the images must go at a specific position, it's not convenient to use a floating environment; you can use \captionof from the capt-of or caption packages to give your figures a caption:

\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\usepackage{caption}

\begin{document}
I have some text here.  Then pics.
\clearpage
{
\centering
\includegraphics[scale=0.75, angle=90, width=\textwidth]{hamlet.jpg}
\captionof{figure}{cool picture}
\clearpage
\includegraphics[scale=0.75, angle=270, width=\textwidth]{kinglear.jpg}
\captionof{figure}{cool picture 2}
}
\clearpage
some more text here

\end{document}


The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.

Depending on how tou are controlling the size for the images, you could additionally wrap each image and its caption using a minipage to prevent an undesired page break; something like

\clearpage
\noindent\begin{minipage}{\textwidth}
\centering
\includegraphics[scale=0.75, angle=90, width=\textwidth]{hamlet.jpg}
\captionof{figure}{cool picture}
\end{minipage}
\clearpage
\noindent\begin{minipage}{\textwidth}
\centering
\includegraphics[scale=0.75, angle=270, width=\textwidth]{kinglear.jpg}
\captionof{figure}{cool picture 2}
\end{minipage}
\clearpage

-
Thank you, I did not understand why I was using a floating environment in the first place. Now it makes sense. – Mike Stumpf Jul 28 '12 at 20:09

You're not doing anything wrong by using the figure environment. Since you mention that the figures are meant to take up a full page, you could load the afterpage package and use its \afterpage command to defer typesetting the figures until the next page break occurs anyway; this will relieve you from having to figure out when to issue a \newpage or \clearpage command. Here's what I'd do:

\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx} % delete 'demo' option in real document
\usepackage{afterpage}
\begin{document}
I have some text here.  Then pics. some more text here
\afterpage{
\clearpage % flush any pending floats
\begin{figure}[p] % use [p], not [ht!]
\centering
\includegraphics[scale=0.75, angle=90, width=\textwidth]{hamlet.jpg}
\caption{cool picture}
\end{figure}
\clearpage
\begin{figure}[p] % use [p], not [ht!]
\centering
\includegraphics[scale=0.75, angle=270, width=\textwidth]{kinglear.jpg}
\caption{cool picture 2}
\end{figure}
\clearpage % force both floats to be typeset
} % end of scope of \afterpage instruction

some more text here
% this may or may not be typeset on the page prior to
% the two floats-only pages, depending on how much
% space was left on the page when \afterpage is
% encountered.
\end{document}

-
Thank you, I will look into that package – Mike Stumpf Jul 28 '12 at 20:24