Re: 請問 caption 強制不換行
※ 引述《EdwardLee.bbs@bbs.cs.nctu.edu.tw (蒙古大夫 2.0)》之銘言:
: ※ 引述《Swanj.bbs@ptt.cc (瓦泥)》之銘言:
: > 正如您所說,我發現問題了
: > 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)
討論串 (同標題文章)
LaTeX 近期熱門文章
PTT數位生活區 即時熱門文章