如果标题比下面的表格宽,那么在我的论文中看起来很糟糕。我该如何使它们对齐?
目前我的代码如下:
\begin{table}[th!]
\caption{Reference temperature blah blah}
\centering
\begin{tabular}{llll}
...
\end{tabular}
\end{table}
如果标题比下面的表格宽,那么在我的论文中看起来很糟糕。我该如何使它们对齐?
目前我的代码如下:
\begin{table}[th!]
\caption{Reference temperature blah blah}
\centering
\begin{tabular}{llll}
...
\end{tabular}
\end{table}
事实上,有一种更合法的方法可以通过captions包中的width
选项来实现。
对于全局效果而言:
\usepackage[width=.75\textwidth]{caption}
仅在当前环境中产生本地效果:
\usepackage{caption}
\captionsetup{width=.75\textwidth}
请参阅caption包文档中的更多信息:
https://www.ctan.org/pkg/caption?lang=en
http://mirrors.ctan.org/macros/latex/contrib/caption/caption-eng.pdf(PDF的直接链接可能会发生变化)
如果您使用KOMA-Script类:
\setcapwidth[c]{5cm}
如果您使用caption包:
\captionsetup{width=5cm}
这两种方法都可以在表格环境中应用。
自动计算解决方案更加复杂,但可以使用\settowidth命令完成。
\captionsetup{width=5cm}
,对齐方式会发生偏移。 - hola我通过将我的标题放入一个 parbox 中来取得成功:
\parbox{5cm}{\caption{Lorem ipsum dolor sit amet...}}
在标题包指南中:
这里仅支持固定宽度;如果您想限制标题的宽度与图表的宽度相同,请查看floatrow[8]或threeparttable[22]包。
将您的带标题的表格放在一个minipage中。 标题将自动换行。 这也是为表格添加适当脚注的好方法。