[Tex/LaTex] How to put figures and tables together (in the same page) at the end? And leave some in the text

floatstables

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.

Best Answer

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).

enter image description here

\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.