回忆录类章节文件中附录文件中的交叉引用表格

回忆录类章节文件中附录文件中的交叉引用表格

我正在编写一份文档,并且已将章节拆分为回忆录类中的独立 tex 文件。我想在章节文件中引用附录中的表格,但收到以下错误消息:

您引用了尚未标记的内容。如果您已经标记了它,请确保 \ref{...} 中写的内容与 \label{...} 中写的内容相同。

我已确保标签相同。更令人困惑的是,第一个表编译良好且没有错误,但其余的则没有。可能是什么问题?

添加 MWE

这是附录 tex 文件和章节文件的片段。

附录文件中的表格

\begin{table}[htbp]  
\caption{T-tests: of difference in characteristics I}
\label{ttestsbal1}
\centering
\setlength{\tabcolsep}{2mm}
\setlength{\extrarowheight}{-2mm}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\resizebox{\linewidth}{!}{
\begin{tabular}{l*{5}{l}}
\toprule
                    &\multicolumn{2}{c}{Assigned}    &\multicolumn{2}{c}{Actual}      \\
\hline
Gender (1=Male)     &    -0.00468       &     (-0.14)&     -0.0398       &     (-0.95)\\
African (1=yes)     &    -0.00313       &     (-0.21)&      0.0135       &      (0.93)\\
Coloured (1=yes)    &     0.00501       &      (0.41)&    -0.00682       &     (-0.50)\\
Indian (1=yes)      &    -0.00348       &     (-0.48)&    -0.00664       &     (-1.32)\\
White (1=yes)       &     0.00161       &      (0.33)&           0       &         (.)\\
English             &    -0.00576       &     (-0.38)&     -0.0167       &     (-1.12)\\
Afrikaans           &  0.00000480       &      (0.00)&     -0.0145       &     (-1.13)\\
IsiZulu             &     -0.0122       &     (-0.41)&     -0.0182       &     (-0.48)\\
IsiXhosa            &      0.0345       &      (1.32)&      0.0534       &      (1.62)\\
Sesotho             &      0.0118       &      (0.60)&     0.00629       &      (0.26)\\
Tshivenda           &    -0.00230       &     (-0.24)&     0.00431       &      (0.30)\\
IsiTsonga           &     -0.0180       &     (-1.30)&     -0.0145       &     (-0.81)\\
SiSwati             &     0.00578       &      (0.52)&    -0.00126       &     (-0.08)\\
Setswana            &     -0.0263       &     (-1.30)&    -0.00925       &     (-0.35)\\
Sepedi              &     0.00326       &      (0.14)&      0.0182       &      (0.61)\\
IsiNdebele          &     0.00739       &      (0.98)&     -0.0117       &     (-1.04)\\
Other               &     0.00185       &      (0.49)&     0.00386       &      (1.08)\\
Married (1=yes)     &    -0.00184       &     (-0.21)&     0.00494       &      (0.62)\\
Living with a Partner (1=yes)&    0.000927       &      (0.13)&     0.00269       &      (0.24)\\
Widow/Widower (1=yes)&     0.00208       &      (0.95)&           0       &         (.)\\
Divorced or Seperated (1=yes)&   -0.000230       &     (-0.07)&    0.000539       &      (0.11)\\
Never Married (1=yes)&   -0.000931       &     (-0.08)&    -0.00817       &     (-0.56)\\
Completed matric (1=yes)&     -0.0167       &     (-0.53)&      0.0385       &      (0.95)\\
Completed some type of tertiary training after matric (1=yes)&     -0.0136       &     (-0.45)&     -0.0534       &     (-1.36)\\
\hline
Observations        &        1012       &            &         610       &            \\ \bottomrule
\end{tabular}}
\begin{minipage}{\textwidth} \vspace{0.05in}
\begin{enumerate}
%\tiny
\item[] \sym{*} $p<0.01$, \sym{**} $p<0.05$, \sym{***} $p<0.10$. \vspace{-0.05in}
\item[] Std. errors reported in parenthesis, robust to individual clustering. \vspace{-0.05in}
\item[] Difference is control mean minus treatment mean \vspace{-0.05 in}
\end{enumerate}
\end{minipage}
\end{table}

然后我使用以下内容在章节文件中进行交叉引用:

Table \ref{ttestsbal1} (see the end of this section) gives the statistical differences .....

在主 tex 文件中,我使用\input{chapter1}etc 而不是\include{chapter1}

相关内容