29

如果标题比它下面的表格宽,我的论文看起来很糟糕。我怎样才能让它们都对齐?

现在我的代码看起来像:

\begin{table}[th!]
\caption{Reference temperature blah blah}
\centering
\begin{tabular}{llll}
...
\end{tabular}
\end{table}
4

5 回答 5

36

实际上,使用 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 可能会发生变化)

于 2012-05-09T17:31:15.610 回答
14

通过将我的标题放在 parbox 中,我取得了成功:

\parbox{5cm}{\caption{Lorem ipsum dolor sit amet...}}
于 2011-08-04T23:24:54.543 回答
13

如果您知道或找出桌子的宽度,比如说 5cm -

  • 如果您使用的是 KOMA-Script 类:

    \setcapwidth[c]{5cm}

  • 如果您使用的是标题包:

    \captionsetup{宽度=5cm}

两者都可以在表环境中应用。

自动计算的解决方案更复杂,但可以使用\settowidth命令完成。

于 2010-07-23T23:02:09.003 回答
5

在标题包指南中:

这里只支持固定宽度;如果您正在寻找将标题宽度限制为图形或表格宽度的方法,请查看floatrow [8] 或threeparttable [22] 包。

于 2012-12-17T07:40:43.827 回答
2

将您的表格和标题放在一个小型页面内。标题将换行。这也是为表格添加适当脚注的好方法。

于 2010-07-23T21:51:12.200 回答