如果标题比它下面的表格宽,我的论文看起来很糟糕。我怎样才能让它们都对齐?
现在我的代码看起来像:
\begin{table}[th!]
\caption{Reference temperature blah blah}
\centering
\begin{tabular}{llll}
...
\end{tabular}
\end{table}
实际上,使用 captions package option 有一种更合法的方法width
。
全局效应
\usepackage[width=.75\textwidth]{caption}
仅适用于当前环境的局部效果:
\usepackage{caption}
\captionsetup{width=.75\textwidth}
标题包文档中的更多信息:
https://www.ctan.org/pkg/caption?lang=en
http://mirrors.ctan.org/macros/latex/contrib/caption/caption-eng.pdf(直接链接到 PDF 可能会发生变化)
通过将我的标题放在 parbox 中,我取得了成功:
\parbox{5cm}{\caption{Lorem ipsum dolor sit amet...}}
如果您知道或找出桌子的宽度,比如说 5cm -
如果您使用的是 KOMA-Script 类:
\setcapwidth[c]{5cm}
如果您使用的是标题包:
\captionsetup{宽度=5cm}
两者都可以在表环境中应用。
自动计算的解决方案更复杂,但可以使用\settowidth命令完成。
在标题包指南中:
这里只支持固定宽度;如果您正在寻找将标题宽度限制为图形或表格宽度的方法,请查看floatrow [8] 或threeparttable [22] 包。
将您的表格和标题放在一个小型页面内。标题将换行。这也是为表格添加适当脚注的好方法。