我正在使用这些命令来创建一个带有图例的表格,但问题是,当我引用它时,它显示为“表格 IIIB”而不是“表格 III”。
你能帮我吗 ?
\begingroup
\squeezetable
\begin{table}[t]
\begin{ruledtabular}
%\centering
\caption{Difference between the potential energy of different types of atoms and the average potential energy of the system : $\Delta$E = E - E\textsubscript{ave} (E\textsubscript{ave} = -3.016 eV/at.)}
\begin{tabular}{c c c c c c}
Type of atom & $\Delta$E (eV/at.) & 1\textsuperscript{st} neighbors' $\Delta$E (eV/at.) \\
\hline
a & -0.01863 & - \\
%\hline
b & 0.7002 & -0.03113* \\
%\hline
c & -0.06651 & 0.1377* \\
%\hline
d & 0.1609 & 0.02185*\\
%\hline
e & -0.1137 & 0.1440* \\
%\hline
\end{tabular}
\end{ruledtabular}
\label{Epot}
\\
\begin{flushleft}
a : tetracoordinated atom with no defective neighbors\\
b : tricoordinated atom\\
c : five-coordinated atom\\
d : five-coordinated atom belonging to a triangular geometry**\\
e : five-coordinated atom not belonging to a triangular geometry**\\
* Only tetracoordinated atoms\\
** Triangular geometry refers to a three-membered ring formed of 5-coordinated atoms only
\end{flushleft}
\end{table}
\endgroup
答案1
您需要将标签放在ruledtablular
环境中;否则,会导致错误引用。由于未提供完整代码,此解决方案设法找到运行所需的包。
代码
\documentclass{revtex4-1}
\usepackage{array}
\usepackage{subscript}
\usepackage{lipsum}
\begin{document}
\begingroup
\squeezetable
\begin{table}[!hbt]
\begin{ruledtabular}
%\centering
\caption{Difference between the potential energy of different types of atoms and the average potential energy of the system : $\Delta$E = E - E\textsubscript{ave} (E\textsubscript{ave} = -3.016 eV/at.)}
\begin{tabular}{c c c c c c}
Type of atom & $\Delta$E (eV/at.) & 1\textsuperscript{st} neighbors' $\Delta$E (eV/at.) \\
\hline
a & -0.01863 & - \\
%\hline
b & 0.7002 & -0.03113* \\
%\hline
c & -0.06651 & 0.1377* \\
%\hline
d & 0.1609 & 0.02185*\\
%\hline
e & -0.1137 & 0.1440* \\
%\hline
\end{tabular}
\label{Epot}
\end{ruledtabular}
\begin{flushleft}
a : tetracoordinated atom with no defective neighbors\\
b : tricoordinated atom\\
c : five-coordinated atom\\
d : five-coordinated atom belonging to a triangular geometry**\\
e : five-coordinated atom not belonging to a triangular geometry**\\
* Only tetracoordinated atoms\\
** Triangular geometry refers to a three-membered ring formed of 5-coordinated atoms only
\end{flushleft}
\end{table}
\endgroup
Table \ref{Epot} shows the first table.
\section{Test}
\begingroup
\squeezetable
\begin{table}[!hbt]
\begin{ruledtabular}
%\centering
\caption{Difference between the potential energy of different types of atoms and the average potential energy of the system : $\Delta$E = E - E\textsubscript{ave} (E\textsubscript{ave} = -3.016 eV/at.)}
\begin{tabular}{c c c c c c}
Type of atom & $\Delta$E (eV/at.) & 1\textsuperscript{st} neighbors' $\Delta$E (eV/at.) \\
\hline
a & -0.01863 & - \\
%\hline
b & 0.7002 & -0.03113* \\
%\hline
c & -0.06651 & 0.1377* \\
%\hline
d & 0.1609 & 0.02185*\\
%\hline
e & -0.1137 & 0.1440* \\
%\hline
\end{tabular}
\label{EpotA}
\end{ruledtabular}
\begin{flushleft}
a : tetracoordinated atom with no defective neighbors\\
b : tricoordinated atom\\
c : five-coordinated atom\\
d : five-coordinated atom belonging to a triangular geometry**\\
e : five-coordinated atom not belonging to a triangular geometry**\\
* Only tetracoordinated atoms\\
** Triangular geometry refers to a three-membered ring formed of 5-coordinated atoms only
\end{flushleft}
\end{table}
\endgroup
Table \ref{EpotA} shows the second table, demonstrating the correct reference when label is put inside the ruledtabular environment.
\subsection{A subsection}
\begingroup
\squeezetable
\begin{table}[!hbt]
\begin{ruledtabular}
%\centering
\caption{Difference between the potential energy of different types of atoms and the average potential energy of the system : $\Delta$E = E - E\textsubscript{ave} (E\textsubscript{ave} = -3.016 eV/at.)}
\begin{tabular}{c c c c c c}
Type of atom & $\Delta$E (eV/at.) & 1\textsuperscript{st} neighbors' $\Delta$E (eV/at.) \\
\hline
a & -0.01863 & - \\
%\hline
b & 0.7002 & -0.03113* \\
%\hline
c & -0.06651 & 0.1377* \\
%\hline
d & 0.1609 & 0.02185*\\
%\hline
e & -0.1137 & 0.1440* \\
%\hline
\end{tabular}
\end{ruledtabular}
\label{EpotB}
\begin{flushleft}
a : tetracoordinated atom with no defective neighbors\\
b : tricoordinated atom\\
c : five-coordinated atom\\
d : five-coordinated atom belonging to a triangular geometry**\\
e : five-coordinated atom not belonging to a triangular geometry**\\
* Only tetracoordinated atoms\\
** Triangular geometry refers to a three-membered ring formed of 5-coordinated atoms only
\end{flushleft}
\end{table}
\endgroup
Table \ref{EpotB} shows the third table, depicting the incorrect reference because the label was NOT inside the ruledtabular environment.
\end{document}