要旋转表格,我使用了\begin{adjustbox}
。但是当我引用它时 \ref{} 显示错误的 ID,并且 \centering 不起作用。如何修复它?谢谢!
以下是 tex 文件中使用的环境:
\documentclass{sokendai_thesis} % https://github.com/koikezlemma/phd_thesis_template/blob/master/sokendai_thesis.cls
\usepackage{adjustbox, booktabs}
\begin{document}
\section{AA }
Table \ref{tab:testtable}
% https://tex.stackexchange.com/questions/566793/rotate-two-tables-including-caption-on-the-same-page
\begin{adjustbox}{angle=90, caption={Summary of XXX.}, float=table}\label{tab:testtable}
\centering\small
\begin{tabular}{llll}
\toprule
& A & B & C \\
\midrule
& 1 & 2 & 3 \\
& 1 & 2 &3 \\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{document}
答案1
您必须将其\label
作为caption
键值选项的一部分包含在内:
\begin{adjustbox}{..., caption={Summary of XXX.\label{tab:testtable}}, ...}
%...
\end{adjustbox}