作者Swanj (瓦泥)
看板LaTeX
标题Re: 请问 caption 强制不换行
时间Wed Jun 11 14:08:17 2008
※ 引述《[email protected] (蒙古大夫 2.0)》之铭言:
: ※ 引述《[email protected] (瓦泥)》之铭言:
: > 正如您所说,我发现问题了
: > code 如下
: > -------------------------------------------------------------
: > \begin{center}
: [...]
: > \end{center}
: > -----------------------------------------------------------
: > 会换行的原因在於
: > 因为要使用 tablenotes 所以采用 threeparttable
: > threeparttable 的预设情况是 caption 会依据表格的宽度自动拆行
: > 但是 table 预设情况就是单行 \textwidth 的宽度了
: > 只不过这样这样排版注解就会比较麻烦了
: > 不知道您有没有什麽好方法呢?
: > 谢谢您!
: 这就是要有例子的原因,因为 packages 实在是太多了。
: threepattable 的 caption format 不是由他自行控制的,他只负责
: 装进他预设的 box,所以会折行,可以配合 caption package 来用。
: \usepackage[width=\textwidth]{caption}
: 或
: \usepackage{caption}
: [...]
: \captionsetup{width=\textwidth}
谢谢您的解答,不过我在测试的时候发现吊诡的情况
\begin{center}
\begin{threeparttable}
\large
\captionsetup{width=\textwidth}
\caption{Coding Rationale for Target Status}
\small\centering
\begin{tabular}{ccc}
\toprule
Target Status & Coding &
a\\
\midrule
Public & 0 & \\
Subsidiary & 1 & \\
Private & 2 & \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
这样会显示
Table 3.6: Coding Rationale for Target Status
---------------------------------
Target Status Coding a
但如果把上面加黄色的 a 改为 aa
\begin{center}
\begin{threeparttable}
\large
\captionsetup{width=\textwidth}
\caption{Coding Rationale for Target Status}
\small\centering
\begin{tabular}{ccc}
\toprule
Target Status & Coding &
aa\\
\midrule
Public & 0 & \\
Subsidiary & 1 & \\
Private & 2 & \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
则显示为:
Table 3.6: Coding Rationale for Target Status
----------------------------------
Target Status Coding aa
就正常了!!!!!!!! (感谢 Edward 指点)
结论:
小 table 还是用 \begin{table} \end{table}
大的 table 也比较有机会有 table note, 再考虑使用有点 bug
(临界宽度以上正常) 的 threeparttable
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.192.179.64
※ 编辑: Swanj 来自: 123.192.179.64 (06/11 14:11)