![“caption”包在浮动下方添加了一个空白 - 如何删除它?](https://linux22.com/image/451170/%E2%80%9Ccaption%E2%80%9D%E5%8C%85%E5%9C%A8%E6%B5%AE%E5%8A%A8%E4%B8%8B%E6%96%B9%E6%B7%BB%E5%8A%A0%E4%BA%86%E4%B8%80%E4%B8%AA%E7%A9%BA%E7%99%BD%20-%20%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4%E5%AE%83%EF%BC%9F.png)
我注意到,caption
加载包后,浮点数与文本之间的垂直间距在h
图的上方和下方并不相同。
无论有没有caption
,浮动块上方的垂直空间都是大约 0.42 厘米。
没有caption
,浮动块下方的垂直空间是 0.46 厘米(我猜想 0.04 厘米的差异是因为标题的字母较低(p、q、j、...)。
另一方面,caption
加载包后,浮动块下方的垂直空间增加到 0.51 厘米。
额外的垂直空间的原因是什么?如何删除它(保留\belowcaptionskip=0pt
)?我在文档中找不到有关此内容的任何信息。
\documentclass{article}
\usepackage{mwe, graphicx}
%\usepackage{caption}
\setlength\intextsep{10pt}
\setlength\abovecaptionskip{0pt}
\setlength\belowcaptionskip{0pt}
\begin{document}
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over \rule{2em}{\baselineskip} the lazy dog.
\begin{figure}[h]
\centering\includegraphics[width=0.4\textwidth]{example-image}
\caption{The quick brown fox \rule{2em}{\baselineskip} jumps over the lazy dog.}%
\end{figure}
The quick brown fox jumps over the \rule{2em}{\baselineskip} lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
\begin{figure}[h]
\centering\includegraphics[width=0.4\textwidth]{example-image}
\caption{The quick brown fox \rule{2em}{\baselineskip} jumps over the lazy dog.}%
\end{figure}
The quick brown fox jumps over the \rule{2em}{\baselineskip} lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
\end{document}