
我不是乳膠專家,我使用的是baposter模板。我的問題是我找不到一種方法來減少選項卡寬度(因為它對於我的專欄來說太寬了)..我一直在互聯網上查找,並且在其中一個網站上建議使用調整框pakage,這就是我所做的...但是我遇到了很多錯誤..
有人可以幫我嗎?
以下幾行似乎有問題。
非常感謝。
\begin{adjustbox}{keepaspectratio,width=0.9\linewidth}
\begin{center}
\begin{tabular}{l l l}
\toprule
\textbf{Area Ratio} & \textbf{Energy Spectrum} & \textbf{Diameter Spectrum}\\
\midrule
O(d,p$_1$)/C(d,p$_0$) & 3.54 & 3.56 \\
O(d,p$_1$)/O(d,p$_0$) & 7.96 & 7.19 \\
%3 & 0.0009271 & 0.296 \\
\bottomrule
\end{tabular}
\captionof{table}{Table caption}
\end{center}
\end{adjustbox}
答案1
在這種情況下使用adjustbox
有一些缺點,例如字體大小與周圍的內容不符。在調整框內使用也\begin{center}...\end{center}
沒有太大意義(這也是導致片段錯誤的原因)。
目前,列的寬度由長標題決定。例如,如果將它們分成兩行,您的表格將變得更加緊湊。
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{l l l}
\toprule
\textbf{Area} & \textbf{Energy} & \textbf{Diameter}\\
\textbf{Ratio} & \textbf{Spectrum} & \textbf{Spectrum}\\
\midrule
O(d,p$_1$)/C(d,p$_0$) & 3.54 & 3.56 \\
O(d,p$_1$)/O(d,p$_0$) & 7.96 & 7.19 \\
%3 & 0.0009271 & 0.296 \\
\bottomrule
\end{tabular}
\end{document}
不確定表格的上下文實際上是什麼,但“比率”聽起來像是它可能顯示為“真實”分數,這將節省更多空間:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{l l l}
\toprule
\textbf{Area} & \textbf{Energy} & \textbf{Diameter}\\
\textbf{Ratio} & \textbf{Spectrum} & \textbf{Spectrum}\\
\midrule\addlinespace
$\displaystyle\frac{O(d,p_1)}{C(d,p_0)}$ & 3.54 & 3.56 \\\addlinespace
$\displaystyle\frac{O(d,p_1)}{O(d,p_0)}$ & 7.96 & 7.19 \\\addlinespace
\bottomrule
\end{tabular}
\end{document}