29

I am using LaTeX and trying to put the tables and figures at the end of the manuscript so that they occur on separate pages. I have tried \pagebreak, \newpage, \displaybreak before each of the tables/figures and none of them are forced onto a new page. Help.

14
  • 1
    Can you post a short example? It could be an issue with the float position in which case the [H] specifier would help.
    – Tymric
    Aug 27, 2014 at 17:14
  • Okay, I have a table, then another table. I want both of them on separate pages at the end of the manuscript. I can post all the details but basically it looks like this ...\bibliography stuff \endbibliography \vfill\pagebreak (or \eject or \newpage) \begin{table}[p] ... table stuff ...\end{table} followed by the same stuff for the second ... third .. etc tables and figures ... and nothing seems to force the tables or figures to the next page. As for being blast from the past, what would you recommend when they tell you your manuscript has to be typeset in AMSTeX?
    – tmwitten
    Aug 27, 2014 at 17:31
  • 1
    @barbarabeeton more to the point \clearpage unlike \newpage or \pagebreak explicitly invokes the output routine to flush all pending floats. Aug 27, 2014 at 17:52
  • 1
    Well, whatever it does, once I put a \clearpage after each figure and table, it worked beautifully. Guess I have a whole lot more to learn about TeX.
    – tmwitten
    Aug 27, 2014 at 18:05
  • 1
    Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers.
    – Sverre
    Jun 12, 2015 at 18:06

4 Answers 4

39

\clearpage will flush each float on to a new page

2
  • What does "flush each float" mean exactly? Sep 14, 2022 at 23:45
  • 2
    @ryanwebjackson \clearpage is the same as \newpage except that after the page break any pending figures, tables etc are forced to appear at that point and not allowed to float further, it "clears" or "flushes" the list of unplaced floats. Sep 15, 2022 at 7:48
5

The package endfloat will move all floats to the end; setting totalnumber to 1 will ensure only one float per page.

\documentclass{article}
\usepackage[nomarkers,nolists]{endfloat}
\usepackage{lipsum}

\setcounter{totalnumber}{1}

\begin{document}

\lipsum[1]

\begin{figure}
\centering
\fbox{\rule{0pt}{1cm}\rule{4cm}{0pt}}
\caption{A caption}
\end{figure}

\lipsum[2]

\begin{figure}
\centering
\fbox{\rule{0pt}{2cm}\rule{4cm}{0pt}}
\caption{A caption}
\end{figure}

\lipsum[3]

\begin{figure}
\centering
\fbox{\rule{0pt}{3cm}\rule{4cm}{0pt}}
\caption{A caption}
\end{figure}

\lipsum[4]
\begin{figure}
\centering
\fbox{\rule{0pt}{1cm}\rule{4cm}{0pt}}
\caption{A caption}
\end{figure}

\lipsum[5]

\end{document}
3

This is what the package endfloat is for.

3
  • yes.. I initially made (but didn't post) a comment saying exactly this, but then as OP already has the figures at end of document in the source, just flushing them out seemed more efficient, although in general endfloat seems to work quite well for this. (+1:-) Aug 28, 2014 at 8:57
  • @DavidCarlisle My suspicion is that the OP put all figures at the end of the document in the .tex file because (s)he is unaware of endfloat.
    – Sverre
    Aug 28, 2014 at 11:26
  • Sure, but once they are there, they're there:-) Aug 28, 2014 at 12:28
0

I realize this is a very old post, but so far I couldn't find the solution anywhere and believe to have solved this, so I thought posting it here might help. I did it for setting a song book with the guitar environment, but the concept should be transferable.
Here is what I did:

%define new pagestyle for hint
\usepackage{fancyhdr}
\fancypagestyle{fancyNext}[fancy]{\fancyfoot[CO,CE]{\Large{\textbf{See next page}}}}

\usepackage{guitar}
 
\newcounter{myguitar} % counter for unique labels in each instance of new environment myguitar
% new environment "myguitar" which is basically the guitar environment, 
%   but sets the labels myguitar-start/end-\themyguitar at begin and end,
%   then checks the pagenumbers of the labels and changes the pagestyle 
%   if they are not equal
 
\newenvironment{myguitar}{%     
    \begin{guitar}\label{myguitar-start-\themyguitar} %
    \ifnum\getpagerefnumber{myguitar-start-\themyguitar}<\getpagerefnumber{myguitar-end-\themyguitar}%
    \pagestyle{fancyNext}%
    \fi%
}{%
\pagestyle{fancyNext}\end{guitar}\label{myguitar-end-\themyguitar}%
}

Hope that helps some people ;)

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .