带有 FONT=FOOTNOTESIZE 的 CAPTION 包在标题后留下了较大的间隙。具体来说,TABULAR 之前的标题会留下较大的间隙,而 TABULAR 之后的标题则不会。以下是一个例子。
\documentclass{article}
\usepackage[font=footnotesize]{caption} % The gap disappears without this package
\begin{document}
%--------------------------------------------------
% This table leaves a wide gap after Table 1: TEXT
%--------------------------------------------------
\begin{table}
\caption{TEXT} % The gap right after here
\footnotesize This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. \par\centering
\begin{tabular}{lr}\hline
1.0000 & 1.0000 \\\hline
\end{tabular}
\end{table}
%--------------------------------------------------
% This table doesn't leave it after Table 2: TEXT
%--------------------------------------------------
\begin{table}
{\centering\begin{tabular}{lr}\hline
1.0000 & 1.0000 \\\hline
\end{tabular}\par}
\caption{TEXT} % No gap appears here
\footnotesize This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{table}
\end{document}
在此示例中,只有第一个表格产生了难看的间隙。可以消除“表格 1:文本”和“这是一个句子。这是一个句子”之间不必要的间隙吗?
答案1
浮动内容和标题之间的垂直空间(间隙)
由包skip
提供的选项控制caption
。
这样 \captionsetup{skip=0pt}
就会消除差距。
\documentclass{article}
\usepackage[font=footnotesize]{caption} % The gap disappears without this package
\captionsetup{skip=0pt} % <-------- add this line
\begin{document}
%--------------------------------------------------
% This table leaves a wide gap after Table 1: TEXT
%--------------------------------------------------
\begin{table}
\caption{TEXT} % The gap right after here
\footnotesize This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. \par\centering
\begin{tabular}{lr}\hline
1.0000 & 1.0000 \\\hline
\end{tabular}
\end{table}
%--------------------------------------------------
% This table doesn't leave it after Table 2: TEXT
%--------------------------------------------------
\begin{table}
{\centering\begin{tabular}{lr}\hline
1.0000 & 1.0000 \\\hline
\end{tabular}\par}
\caption{TEXT} % No gap appears here
\footnotesize This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{table}
\end{document}