[Tex/LaTex] Bad table references with \input{…}


I have been searching a bit, but couldn't find the proper answer to my problem.

I have multiple tables defined for a report. Let's say some tables are presented in the main content of the report and for further clarity, are also defined in the appendix.

Since they are subject to last minute modification, I didn't want to create twice the same tables, so I inserted them with the \input command.

The problem is that when I call \ref, it is the reference of the table in the appendix that is given (ie: A.3 not 1.5).

How could I manage this?

Table definition:

    \begin{tabular}{ccc} \hline
    \multicolumn{3}{c}{value test}\\ \hline
    Model & \multicolumn{2}{c}{3D} \\
    $S$ & 102.60 & 66.90 \\
    $S^{macro}$ & $93.43$ & $63.90$\\
    Relative scatter (\%) & $-8.94$ & $-4.48$\\
    \caption{$S_{12}$ analysis}

In the document for example


Table \ref{tab:S12_analysis}

Table \ref{tab:S12_analysis}


Best Answer



on your file by \labelthistable

then use

Table \ref{mytableone}


Table \ref{mynewtable}