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.

David Carlisle
  • 757,742
tmwitten
  • 661
  • 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 '14 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 '14 at 17:31
  • \begin{table} looks like latex? are you sure you are using amstex (which is a separate non-latex format) not ams latex class such as amsart ?? – David Carlisle Aug 27 '14 at 17:35
  • TOTALLY DUH! I'm sorry, I meant LaTeX. It's been a long week with school starting again and my brain isn't working right. Yes LaTeX. But it still doesn't work – tmwitten Aug 27 '14 at 17:36
  • I tried \vfill\pagebreak[4] and that didn't work either – tmwitten Aug 27 '14 at 17:39
  • \clearpage will flush each float on to a new page – David Carlisle Aug 27 '14 at 17:39
  • BRAVO David!!! Thank you so much. That worked. I will have to sit and figure out why it worked. But it worked. You get the gold star. – tmwitten Aug 27 '14 at 17:43
  • \vfill doesn't actually put anything on a page, and \pagebreak requires a non-empty page to actually break. \clearpage puts an invisible, empty box on the page so there's something there for the float to interact with. – barbara beeton Aug 27 '14 at 17:51
  • 1
    @barbarabeeton more to the point \clearpage unlike \newpage or \pagebreak explicitly invokes the output routine to flush all pending floats. – David Carlisle Aug 27 '14 at 17:52
  • @DavidCarlisle -- good point. of course. (if you wanted to clear out one float at a time, you could do it the hard way, with \vspace*{\fill}\newpage after each one. \clearpage is lots easier.) – barbara beeton Aug 27 '14 at 17:56
  • @barbarabeeton No vspace and \newpage have essentially no effect on the pending floats, they may just stay in the pending lists until a more suitable page comes along. – David Carlisle Aug 27 '14 at 17:59
  • 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 '14 at 18:05
  • @tmwitten -- don't be discouraged. i seem to have a lot to learn too, and i've been at it a lot longer. – barbara beeton Aug 27 '14 at 18:29
  • 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 '15 at 18:06

4 Answers4

39

\clearpage will flush each float on to a new page

David Carlisle
  • 757,742
  • What does "flush each float" mean exactly? – ryanwebjackson Sep 14 '22 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. – David Carlisle Sep 15 '22 at 07: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}
egreg
  • 1,121,712
3

This is what the package endfloat is for.

Sverre
  • 20,729
  • 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:-) – David Carlisle Aug 28 '14 at 08: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 '14 at 11:26
  • Sure, but once they are there, they're there:-) – David Carlisle Aug 28 '14 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 ;)

Phil
  • 1