乳胶中有两个并排的桌子,但是,我不能分别标记它们以供ref标签使用。有什么方法可以使用ref标签在我的文字中引用他们的名字吗?例如,我需要在表1 ...和表2 .....
中说有何评论?
\begin{table}[ht]
\parbox{.45\linewidth}{
\centering
\begin{tabular}{|l|l|l|}
\hline
person id & seq id & feature vector$_1$ \\\hline
1 & 1 & 1 \\
1 & 2 & 1 \\ \hline
1 & 1 & 1 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
\caption{HRV Dataset}
}
\hfill
\parbox{.45\linewidth}{
\centering
\begin{tabular}{|l|l|l|l|}
\hline
person id & seq id & feature vector$_1$ & feature vector$_2$ \\\hline
1 & 1 &1 \\
1 & 2 & 1 \\ \hline
1 & 1 &1\\ \hline
1 & 1 & 1 \\ \hline
% \begin{tabular}{|l|l|l|l|}
% \end{tabular}
\end{tabular}
\caption{BAC Dataset}}
\end{table}
答案 0 :(得分:1)
您可以在标题中包括标签,这将使您可以稍后在文档中分别\ref
每个表。
\documentclass{article}
\begin{document}
\begin{table}[ht]
\parbox{.40\linewidth}{
\centering
\begin{tabular}{|l|l|l|}
\hline
person id & seq id & feature vector$_1$ \\\hline
1 & 1 & 1 \\
1 & 2 & 1 \\ \hline
1 & 1 & 1 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
\caption{HRV Dataset \label{HRVtable}}
}
\hfill
\parbox{.45\linewidth}{
\centering
\begin{tabular}{|l|l|l|l|}
\hline
person id & seq id & feature vector$_1$ & feature vector$_2$ \\\hline
1 & 1 &1 &1 \\
1 & 2 & 1&1 \\ \hline
1 & 1 &1 &1\\ \hline
1 & 1 & 1 &1 \\ \hline
\end{tabular}
\caption{BAC Dataset \label{BACtable}}}
\end{table}
HRV data in Table \ref{HRVtable} and BAC data in Table \ref{BACtable}.
\end{document}
答案 1 :(得分:1)
在相同结构中的\label
内或之后添加\caption
应该没有问题(例如\parbox
或minipage
-见下文) 。我还添加了一些booktabs
比萨...
\documentclass{article}
\usepackage{booktabs,makecell}
\begin{document}
\begin{table}
\begin{minipage}{.5\linewidth}
\centering
\begin{tabular}{ *{3}{c} }
\toprule
\makecell{person \\ id} & \makecell{seq \\ id} & \makecell{feature \\ vector$_1$} \\
\midrule
1 & 1 & 1 \\
1 & 2 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\bottomrule
\end{tabular}
\caption{HRV Dataset}\label{tab:first}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\centering
\begin{tabular}{ *{4}{c} }
\toprule
\makecell{person \\ id} & \makecell{seq \\ id} & \makecell{feature \\ vector$_1$} & \makecell{feature \\ vector$_2$} \\
\midrule
1 & 1 & 1 & 4 \\
1 & 2 & 1 & 3 \\
1 & 1 & 1 & 2 \\
1 & 1 & 1 & 1 \\
\bottomrule
\end{tabular}
\caption{BAC Dataset}\label{tab:second}
\end{minipage}
\end{table}
See Table~\ref{tab:first} and Table~\ref{tab:second}\ldots
\end{document}