當我想將表格大小調整為文字寬度時,網頁連結和引用不再起作用(超連結框被移動到另一個位置),而當我不將表格大小調整為文字寬度時,我不會遇到此問題。
但是,我需要這樣做,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}