
私は LaTeX の専門家ではないので、baposter テンプレートを使用しています。問題は、タブの幅を狭める方法が見つからないことです (列の幅が広すぎるため)。インターネットで調べたところ、あるサイトでは、adjustbox パッケージを使用するように勧められていたので、そのようにしました。しかし、エラーが大量に発生します。
誰か私を助けてくれる人はいませんか?
何かが間違っていると思われる行は次のとおりです。
どうもありがとう。
\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}
調整ボックス内で使用するのはあまり意味がありません (これもフラグメントでエラーが発生する原因です)。
現時点では、列の幅は長いヘッダーによって決まります。たとえば、列を 2 行に分割すると、テーブルはよりコンパクトになります。
\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}