# How to put figures and tables together (in the same page) at the end? And leave some in the text?

I would like to put most of the figures and tables together (in the same page) at the end, while leave one of them in the text where it is referred.

Now, I use

\usepackage[nolists,noheads,nomarkers]{endfloat}

\renewcommand{\efloatseparator}{\mbox{}}


The second is to block the separator after each figure.

It works well except it will put figures and tables in separate pages. The requirement is a maximum of two pages of attached figures and tables.

And I still have the problem of how to leave one of the figure in the text.

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – henrique Oct 15 '13 at 3:05

This is all easily possibly using the caption package. Insert the figure you're referencing in your document in the usual way, and add all the remaining figures/tables inside a single float (or two, if need be).

\documentclass{article}
\usepackage{caption,lipsum}% http://ctan.org/pkg/{caption,lipsum}
\begin{document}
\tableofcontents
\listoffigures
\listoftables

\section{A section}

\lipsum[1]
\begin{figure}[ht]
\caption{This is a figure referenced in the document}
\end{figure}
\lipsum[2-50]

\clearpage

\begin{figure}[ht]
\centering
\rule{100pt}{20pt}
\captionof{table}{This is a table}
\rule{100pt}{20pt}
\captionof{table}{This is a table}
\rule{100pt}{20pt}
\captionof{figure}{This is a figure}
\rule{100pt}{20pt}
\captionof{figure}{This is a figure}
\rule{100pt}{20pt}
\captionof{table}{This is a table}
\end{figure}

\end{document}


caption's \captionof{<float>}{<caption>} allows you to specify the caption of <float> even if you're in a different floating environment. In my MWE, I've mixed the captions of figure and table inside a single figure floating environment.

• Will this approach preserve the natural ordering of the floats by call-out? E.g., will a figure that comes logically before the lone in-text figure environment but ends up being placed at the end of the document still be assigned a number that's smaller than that of the in-text figure? – Mico Oct 15 '13 at 5:21
• @Mico: No, but I didn't get that much from the OP. It seemed like the only figure being referenced is the one that should stay within the document. – Werner Oct 15 '13 at 5:30
• I guess we don't know from the posting if (and how) the OP wants to cross-reference the floats. – Mico Oct 15 '13 at 5:37

You could do the following:

• Continue to load the endfloat package, but change its parameter \efloatseparator from \clearpage (the default value) to \bigskip:

\renewcommand{\efloatseparator}{\bigskip}


If that generates too much vertical whitespace for your taste, try \medskip or \smallskip. (I wouldn't suppress the inter-float whitespace entirely.)

To also suppress the \clearpage that's inserted between the end-figures and end-tables, try this (to be inserted in the preamble, after the endfloat package is loaded):

\usepackage{etoolbox}
\makeatletter
\patchcmd{\efloat@process}{{\normalsize\efloat@listof{#2}}\clearpage}%
{{\normalsize\efloat@listof{#2}}}{}{}{}
\makeatother

• For the lone figure that's not supposed to go to the back of the document, don't use an explicit figure environment. Instead, be sure to load the caption package, place the graph in the text where it's supposed to go, and issue the command

\captionof{figure}{<Caption of figure here>}


either immediately before or after the code that loads the graph.

If you need to have the lone in-text figure automatically placed at the top of a page, you could load the afterpage package and do something like

\afterpage{ <code that loads the figure> <\captionof code>}

• By default, LaTeX will not allow a lot of floats to be placed on one page. To override the default setting, it may be necessary to issue the commands

\setcounter{topnumber}{10}
\setcounter{bottomnumber}{10}
\setcounter{totalnumber}{10}


Of course, if you have more than 10 floats per page, adjust the code above to suit your needs.