图形覆盖行距

图形覆盖行距

我正在使用 framed 包在一些文本周围绘制一个框。当我编译它而不将其包装在 figure 命令中时,我没有遇到任何问题。但是,当我像这样使用它时:

\documentclass[a4paper,12pt]{report}
\usepackage{setspace} % for switching between double/single space in document‎
\usepackage{framed}‎‎
\usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry}‎

\doublespacing‎‎

\begin{document}‎
this is a line

this is a line

\begin{figure}‎
\begin{framed}
this is a line

this is another line
\end{‎framed}‎‎
\caption[figure1]‎{description for figure1}‎‎‎
\label{Fig_1}‎‎ %for Lockstep point!see the comments!  
\end{figure}

\end{document}‎

行距恢复为默认设置(见附图)。我是不是漏掉了什么?
顺便说一句,我见过帖子1帖子2,仍然没有线索。如果我使用框架的原因很重要,我必须提到,当使用双倍行距时,文本跨越 1 页以上,框架做得很好。

替代文本

答案1

setspace 包修补了浮动环境、脚注等,使其变为单倍行距。遗憾的是,没有包选项可以抑制这种情况,因此如果您不喜欢将浮动设置为默认的单倍行距,请在加载 setspace 包后立即插入以下代码:

\usepackage[...]{setspace}
\makeatletter
\let\@xfloat=\latex@xfloat % revert setspace patch of floating environments
\makeatother

但请注意,这也会增加图形主体和图形标题之间的垂直距离。(并使标题也双倍行距。)如果您不喜欢这样,请忘记上面的代码并\doublespacing在您的环境中更好地使用framed

相关内容