You didn't provide a minimal example, so it's hard to say what exactly is going on. However, if you simply want "to avoid pages with only one figure", put the two \includegraphics
macros inside one figure
environment (and add some vertical space with \vspace{floatsep}
).
EDIT: Contrary to Mico's assertion, it is possible to create separate cross-references to the graphics inside figure
-- see my updated example.
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
A cross-reference to figures~\ref{first} and~\ref{second}.
\begin{figure}
\centering
\rule{1cm}{8cm}% placeholder for graphics
\caption{First}\label{first}
\vspace{\floatsep}
\rule{1cm}{8cm}% placeholder for graphics
\caption{Second}\label{second}
\end{figure}
\end{document}
The reason has to do with an oversize image. As LaTeX cannot fit it on a page it will float to the end. These type of figures are best to insert them manually
. You will need to define a different environment for this. Try modifying the \twopagepicture
by copying it a renaming it and just comment out the begin{figure}
and \end{figure}
.
\newcommand*{\twopagepicture}[4]{% copy twopagepicture an comment out
.....
% \begin{figure}[#1]
....
% \end{figure}%
% \begin{figure}[#1]
.....
% \end{figure}%
......
}
This ensures that the images will be shown exactly where placed.
To have a correctly placed two page spread firstly, one needs a method to clear to an even page, normally I would code it as follows:
\usepackage[strict]{changepage}
\makeatletter
\newcommand{\cleartoevenpage}{%
\clearpage%
\ifoddpage\c@page\hbox{}\clearpage\fi}
The second issue to take into consideration, is that the image width is always larger than the \textwidth
dimension and hence any scaling must be done on the \textheight
. This is important, otherwise you will get a new page.
The even page image is simply placed normally but issuing a \cleartoevenpage
before the placement and a \newpage after
it, producing the image shown above.
\cleartoevenpage
\includegraphics[height=0.95\textheight]{petra}
\newpage
The odd page image, will have to be shifted to the left by \textwidth
.
\hspace*{-\textwidth}\includegraphics[height=0.95\textheight]{petra}\hspace{1em}
The caption can be placed using a parbox
or a minipage
. In this case I have used a parbox
. If your captions will have more than a paragraph of text, then use a minipage. Depending on the amount of text you have it may look better if you shift it slightly up or down. This can be done either using a vspace
command or use a rule (I prefer the latter as I can have a visual clue and only zero the width at the final copy).
\parbox[b]{0.25\textwidth}{\lipsum*[1-2]\par\rule{1pt}{50pt}}
You can see the rule in the last image below.
Full MWE
\documentclass{book}
\usepackage[left=0pt,right=0pt,top=0.5in,bottom=0.5in]{geometry}
\usepackage{graphicx,lipsum,caption,crop}
\usepackage[strict]{changepage}
\makeatletter
\newcommand{\cleartoevenpage}{%
\clearpage%
\ifoddpage\c@page\hbox{}\clearpage\fi}
\begin{document}
First page
\cleartoevenpage
\includegraphics[height=0.95\textheight]{petra}
\newpage
\hspace*{-\textwidth}\includegraphics[height=0.95\textheight]{petra}\hspace{1em}
\parbox[b]{0.25\textwidth}{\lipsum*[1-2]\par\rule{1pt}{50pt}}
\end{document}
Hope this helps.
Best Answer
Replace
by
If your document just consists of a sequence of figures you don't want them to float (they have nowhere to float to) so using a float environment is massively inefficient and will cause latex all kinds of problems as it saves them hoping to find some text over which it can distribute the figures. Just put the figures in a minipage to keep them with their caption, and put a blank line between each minipage.