For a paper I'm working on they want to have an appendix with all the figures from the main text. That is, figures should be in the main text (for publication), but they should be repeated in an appendix (for easy reviewing). Is there any package that does this? If not, how would I go about renewing the figure environment to create such an appendix?
[Tex/LaTex] Repeating figures in an appendix
appendicesfloats
Related Solutions
You have to repeat the resetting at every \section
in the appendix.
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[nofiglist,notablist]{endfloat}
\usepackage{etoolbox}
\begin{document}
\section{Section one}
The main figure is Figure~\ref{Figure-1}, and the main table is Table~\ref{Table-1}. Supplemental material
includes Figure~\ref{Figure-A1} and Table~\ref{Table-A1} in the first appendix, and Figure~\ref{Figure-B1}
and Figure~\ref{Figure-B2} in the second appendix.
\begin{figure}
\includegraphics{fig1}
\caption{Figure one} \label{Figure-1}
\end{figure}
\begin{table}
\begin{tabular}{ll}
Row 1 & 1\\
Row 2 & 2\\
Row 3 & 3\\
Row 4 & 4\\
\end{tabular}
\caption{Table one}\label{Table-1}
\end{table}
\appendix
\makeatletter
\renewcommand{\thepostfigure}{\Alph{section}.\arabic{postfigure}}
\setcounter{postfigure}{0}
\renewcommand{\theposttable}{\Alph{section}.\arabic{posttable}}
\setcounter{posttable}{0}
\efloat@iwrite{fff}{%
\unexpanded{%
\setcounter{section}{0}^^J%
\renewcommand{\thefigure}{\Alph{section}.\arabic{figure}}^^J%
\setcounter{figure}{0}^^J%
}%
}
\efloat@iwrite{ttt}{%
\unexpanded{%
\setcounter{section}{0}^^J%
\renewcommand{\thetable}{\Alph{section}.\arabic{table}}^^J%
\setcounter{table}{0}^^J%
}%
}
\preto{\section}{%
\efloat@iwrite{fff}{%
\unexpanded{%
\stepcounter{section}^^J%
\renewcommand{\thefigure}{\Alph{section}.\arabic{figure}}^^J%
\setcounter{figure}{0}^^J%
}%
}%
\efloat@iwrite{ttt}{%
\unexpanded{%
\stepcounter{section}^^J%
\renewcommand{\thetable}{\Alph{section}.\arabic{table}}^^J%
\setcounter{table}{0}^^J%
}%
}%
\setcounter{posttable}{0}\setcounter{postfigure}{0}%
}
\makeatother
\section{Appendix one}
\begin{table}
\begin{tabular}{ll}
Row 1 & 1\\
Row 2 & 2\\
Row 3 & 3\\
Row 4 & 4\\
\end{tabular}
\caption{Table one in appendix A}\label{Table-A1}
\end{table}
\begin{figure}
\includegraphics{fig1}
\caption{Figure one in appendix A} \label{Figure-A1}
\end{figure}
\section{Appendix two}
\begin{figure}
\includegraphics{fig1}
\caption{Figure one in appendix B} \label{Figure-B1}
\end{figure}
\begin{figure}
\includegraphics{fig2}
\caption{Figure two in appendix B} \label{Figure-B2}
\end{figure}
\renewcommand{\thefigure}{\arabic{figure}}
\renewcommand{\thetable}{\arabic{table}}
\end{document}
As explained in this answer, you can add
\usepackage{chngcntr}
to the preamble of your document, and
\appendix
\counterwithin{figure}{section}
\counterwithin{table}{section}
before floats with new naming format.
Best Answer
It's just a matter of gathering the figures during the document in a token register, to be delivered at the end. By changing the counter we ensure that the figures are renumbered in the correct way.