KOMA 脚本:如何减少标题下方的垂直空间

KOMA 脚本:如何减少标题下方的垂直空间

图表标题下方的垂直空间很大,如何减小。

\documentclass[a5paper]{scrbook}

\usepackage[demo]{graphicx}


\begin{document}

\chapter{Sample chapter}

\section{Sample section}

%
%
Some text more text more text more text more text more text more text more text more text more text more text.

\begin{figure}[htb!]
\centering
\includegraphics[width=0.25\textwidth]{frog.jpg}
\caption{A test caption without label for a figure}
\end{figure}

%
Some text more text more text more text more text more text more text more text more text more text more text.


\end{document}

在此处输入图片描述

问:为什么我会收到 typearea 警告?这是什么意思?

答案1

更新\belowcaptionskip(默认为0pt)为负值:

在此处输入图片描述

左边是默认;右边是\setlength{\belowcaptionskip}{-\baselineskip}

答案2

您可以加载该caption包并使用此设置(-5pt根据您的需要进行调整):

\captionsetup[figure]{belowskip=-5pt}

在此处输入图片描述

完整代码:

\documentclass[a5paper]{scrbook}

\usepackage[demo]{graphicx}
\usepackage{caption}
\captionsetup[figure]{belowskip=-5pt}

\begin{document}

\chapter{Sample chapter}

\section{Sample section}

%
%
Some text more text more text more text more text more text more text more text more text more text more text.

\begin{figure}[htb!]
\centering
\includegraphics[width=0.25\textwidth]{frog.jpg}
\caption{A test caption without label for a figure}
\end{figure}

%
Some text more text more text more text more text more text more text more text more text more text more text.


\end{document} 

相关内容