![adjustbox 在 \ref 处有错误引用](https://linux22.com/image/472680/adjustbox%20%E5%9C%A8%20%5Cref%20%E5%A4%84%E6%9C%89%E9%94%99%E8%AF%AF%E5%BC%95%E7%94%A8.png)
要旋转表格,我使用了\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}