# How do I make an exact copy of a table, but keep its number for referencing?

I have a table, and I want to print it twice in my document. I want them to have the same label, caption and number, so that in the caption when it says "Table 1: foo" the same number shows up, and so that when I reference its label, it will always reference to the same number. Is this possible?

-

One option, using the collect package to collect the table, and then reuse it again with \includecollection; the counter is properly taken care of and also the \label duplication is avoided:

\documentclass{article}
\usepackage{collect}

\definecollection{mytable}
\newcounter{duptable}
\newcounter{tmp}

\makeatletter
\newcommand\resttable{%
\let\oldlabel\label
\let\label\@gobble
\setcounter{tmp}{\value{table}}
\setcounter{table}{\value{duptable}}
\includecollection{mytable}
\let\label\oldlabel
\setcounter{table}{\value{tmp}}
}
\makeatother

\begin{document}

\begin{collect*}{mytable}{\setcounter{duptable}{\value{table}}}{}{}{}
\begin{table}
\centering
\begin{tabular}{cc}
\hline
A & B \\
C & D \\
\hline
\end{tabular}
\caption{A collectable table}
\label{tab:test}
\end{table}
\end{collect*}

\resttable

\end{document}


-