当我想将表格大小调整为文本宽度时,指向网页和参考资料的链接不再起作用(超链接框被移动到另一个位置),而当我不将表格大小调整为文本宽度时,我不会遇到这个问题。
但是,我需要这样做,并且resizebox
(第一个例子)和adjustbox
(第二个例子)都会出现问题。
我该如何解决这个问题?谢谢!(我在 TeXstudio 工作并使用 LuaLaTeX 进行编译)
\documentclass{article}
\usepackage{booktabs}
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
%%% change size by resizebox
\begin{table}[]
\centering
\caption{Caption for the table.}
\label{tab:table1}
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{}llll@{}}
\toprule
\textbf{A} & \textbf{B} & \textbf{C} \\ \midrule
Problems & Help & \href{stackoverflow.com} {stackstacksstackstackstacktacstackstackstackstackstackstackstack} \\
& Search & \href{google.com}{Your friend} \\
\bottomrule
\end{tabular}
}
\end{table}
%%% change size by adjustbox
\begin{table}[]
\centering
\caption{Caption for the table.}
\label{tab:table2}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{@{}llll@{}}
\toprule
\textbf{A} & \textbf{B} & \textbf{C} \\ \midrule
Problems & Help & \href{stackoverflow.com} {stackstacksstackstackstacktacstackstackstackstackstackstackstack} \\
& Search & \href{google.com}{Your friend} \\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{table}
\end{document}