<p></p><p>% 以下几个长度寄存器会影响浮动体的距离:</p><p>%</p><p>% \floatsep: space left between floats (12.0pt plus 2.0pt minus 2.0pt).</p><p>% \textfloatsep: space between last top float or first bottom float and the text (20.0pt plus 2.0pt minus 4.0pt).</p><p>% \intextsep : space left on top and bottom of an in-text float (12.0pt plus 2.0pt minus 2.0pt).</p><p>% \dbltextfloatsep is \textfloatsep for 2 column output (20.0pt plus 2.0pt minus 4.0pt).</p><p>% \dblfloatsep is \floatsep for 2 column output (12.0pt plus 2.0pt minus 2.0pt).</p><p>% \abovecaptionskip: space above caption (10.0pt).</p><p>% \belowcaptionskip: space below caption (0.0pt).</p><p>% 因此,可以根据需要对这些值用\setlength、\addtolength等命令进行修改,如:</p><p>\setlength{\abovecaptionskip}{2pt plus 0.2pt minus 0.3pt}</p><p><br/></p><p>% 浮动体前后的距离也可以用\vskip,\vspace进行调整,为了便于统一调整可以使用etoolbox宏包为环境打补丁,如:</p><p><br/></p><p>\usepackage{etoolbox} % 载入宏包</p><p><br/></p><p>\BeforeBeginEnvironment{figure}{\vskip-1ex}</p><p>\AfterEndEnvironment{figure}{\vskip-2ex}</p><p>\BeforeBeginEnvironment{table}{\vskip-1ex}</p><p>\AfterEndEnvironment{table}{\vskip-2ex}</p><p><br/></p><p>你可以根据你的需求,调整这些值,直到老师和队友满意为止。只是如果你用的是模板,这些就不要随意调整了,模板是什么就是什么,你老师和队友应该接受模板的设定才对。</p><p></p>
作者追问:2019-08-26 15:27
尝试了一下您说的方法,我发现会有些地方会出错,MWE如下:
\documentclass{ctexart}
\usepackage{zhlipsum}
\usepackage{etoolbox}
\BeforeBeginEnvironment{figure}{\vskip-5ex}
\begin{document}
\zhlipsum[1-2]
\begin{figure}[htbp]
\centering
\zhlipsum[1]
\caption{图}
\end{figure}
\zhlipsum[1]
\end{document}
效果如下:
即在浮动体在下一页时,\vskip命令使得文本部分重叠