6

I have a large number of (.eps) figures which I want to put into a stand-alone .pdf document. I have a script which puts together the code shown below twice (but is repeated dozens of times). The problem is that if the figure size (set below with the 0.58\paperheight) gets too large (i.e., 0.59\paperheight), LaTeX starts putting a blank page between figures. If the size gets larger (i.e., 0.7\paperheight) then it starts putting ~15 blank pages and then puts all the figures together (as I would like them to be) on subsequent pages.

Visually, it isn't an issue of the figure being too large for the page as when it finally does put the figure in, it fits nicely. I've tried using

\afterpage{

and

\lipsum

as suggested in this thread, but haven't had any luck.

Is this an issue with floats? with my document margins? Something else I'm missing? Thanks

\clearpage
\newpage
\begin{center}
  \mbox{}\vfill
  \begin{figure}[htp]
    \includegraphics[angle=0,height=0.58\paperheight]{Figure1.eps}
    \caption{}
  \end{figure}
  \vfill\mbox{}
\end{center}

\clearpage
\newpage
\begin{center}
  \mbox{}\vfill
  \begin{figure}[htp]
    \includegraphics[angle=0,height=0.58\paperheight]{Figure2.eps}
    \caption{}
  \end{figure}
  \vfill\mbox{}
\end{center}

...and so on
1
  • Why do you need both \clearpage and \newpage? Also why all those \mbox{} and \vfill? – user11232 Apr 5 '13 at 1:48
4

Replace

\clearpage
\newpage
\begin{center}
  \mbox{}\vfill
  \begin{figure}[htp]
    \includegraphics[angle=0,height=0.58\paperheight]{Figure2.eps}
    \caption{}
  \end{figure}
  \vfill\mbox{}
\end{center}

by

 \documentclass{article}
  \usepackage{capt-of}
 \begin{document}
  \raggedbottom
  \centering

 \begin{minipage}{\textwidth}
 \includegraphics[angle=0,height=0.58\paperheight]{Figure2.eps}
 \captionof{figure}{...}
 \end{minipage}


 \begin{minipage}{\textwidth}
 \includegraphics[angle=0,height=0.58\paperheight]{Figure2.eps}
 \captionof{figure}{...}
 \end{minipage}


 ...
\end{document}

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.

1
  • (nitpicker again.) "between each minipage" doesn't make sense. "between each pair of minipages" does, but it's verbose. how about "after each minipage [but the last]"? – barbara beeton Apr 5 '13 at 15:27
0

I had similar problems with floats(not inserting blank pages, but forcing page breaks).

Modifying the percentage of a page filled with text to more than 0.7 (the LaTeX default) solved my problem:

\renewcommand\floatpagefraction{0.9}

before the \begin{document} statement.

More info on that: http://www.cs.dartmouth.edu/~dfk/latex-squeeze.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.