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.
- 757,742
- 661
4 Answers
\clearpage will flush each float on to a new page
- 757,742
-
-
2@ryanwebjackson
\clearpageis the same as\newpageexcept 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
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}
- 1,121,712
-
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
.texfile because (s)he is unaware ofendfloat. – Sverre Aug 28 '14 at 11:26 -
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
-
Side note it's recommended to use the plain form when defining new environment Defining environments based on other ones: What's the right way? - TeX - LaTeX Stack Exchange – user202729 Jul 17 '22 at 15:25
[H]specifier would help. – Tymric Aug 27 '14 at 17:14\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\clearpagewill flush each float on to a new page – David Carlisle Aug 27 '14 at 17:39\vfilldoesn't actually put anything on a page, and\pagebreakrequires a non-empty page to actually break.\clearpageputs 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\clearpageunlike\newpageor\pagebreakexplicitly invokes the output routine to flush all pending floats. – David Carlisle Aug 27 '14 at 17:52\vspace*{\fill}\newpageafter each one.\clearpageis lots easier.) – barbara beeton Aug 27 '14 at 17:56\newpagehave 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