章節標題和表格之間的垂直間距

章節標題和表格之間的垂直間距

在我的附錄中,我只有章節,每個章節後面都有一個或多個表格。這些表格均帶有標題。但我希望表格在通常的垂直空間之後開始,如果您只是在章節後面寫一些文本,請放置該空間。

這是一個非常短的 MWE 來說明這一點。正如您所看到的,標題和章節之間的垂直空間比標題和某些文字之間的垂直空間大得多。

\documentclass[a4paper, 12pt, headsepline, smallheadings,]{scrreprt}
\usepackage{booktabs}
\usepackage[showframe]{geometry}
\renewcommand*{\chapterheadstartvskip}{\vspace{-1\baselineskip}}
\begin{document}
\chapter{Chapter}
\begin{table}[h]
\caption[title table 1]{description table 1}
\fbox{content}
\end{table}
\chapter{Chapter}
aaa
\end{document}

編輯:我意識到這\captionsetup{aboveskip=0pt}減少了空間。那麼這個空間似乎來自字幕包?正確的值是多少(一些測試表明它不是零,但必須有點負)?另外,如何在本地為整個附錄設置此設置,而不是為先前的內容設置?

原問題:標題和表格之間的垂直間距如何設定為與標題和文字之間的垂直間距相同?

謝謝!

答案1

您可以透過發出以下命令來消除該差距

\setlength{\abovecaptionskip}{-12.75pt}

或(載入後caption

\captionsetup[table]{aboveskip=-12.75pt}

請注意,上述兩個命令僅影響它們後面的程式碼,因此您可以簡單地將它們放在附錄之後。

微量元素

\documentclass[a4paper, 12pt, headsepline, smallheadings,]{scrreprt}
\usepackage{booktabs}
\usepackage[showframe]{geometry}
\renewcommand*{\chapterheadstartvskip}{\vspace{-1\baselineskip}}
\begin{document}
\setlength{\abovecaptionskip}{-12.75pt}
\chapter{Chapter}
\begin{table}[h]
\caption[title table 1]{description table 1}
\fbox{content}
\end{table}
\chapter{Chapter}
aaa
\end{document} 

輸出

在此輸入影像描述

答案2

我看到兩種可能的解決方案:簡單地在本地排版 \raggedbottom — 或考慮到您的表格不必浮動:它們位於章節標題之後。所以你可以嘗試使用 subcaption 套件:

\chapter{Chapter}

\noindent\begin{minipage}{\textwidth}
\captionsetup{type=table}
\begin{subtable}\caption{description table1}\label{tabA1}Table A.1\end{subtable}
\begin{subtable}\caption{description table2}\label{tabA2}Table A.2\end{subtable}
\begin{subtable}\caption{description table3}\label{tabA3}Table A.3\end{subtable}
\end{minipage}

相關內容