如何减少阴影(\usepackage{framed})环境的垂直空间?

如何减少阴影(\usepackage{framed})环境的垂直空间?

如何减少shaded前导中的环境垂直空间?代码如下:

\documentclass[a4paper,12pt]{article}
\usepackage{color,xcolor}
\usepackage{framed}
\colorlet{shadecolor}{blue!11}

\begin{document}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text 
\begin{shaded}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text
\end{shaded}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text

text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text
\end{document} 

请不要定义新的环境,只需改变shaded环境的一些属性。

在此处输入图片描述

答案1

离题:不加载color,只是更现代的xcolor

framed您可以通过重新定义内部长度来重新定义垂直空间OuterFrameSep

\documentclass[a4paper,12pt]{article}
\usepackage{xcolor}
\usepackage{framed}
\colorlet{shadecolor}{blue!11}
\setlength{\OuterFrameSep}{0pt}

\begin{document}
    text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text 
    \begin{shaded}
        text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text
    \end{shaded}
    text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text

    text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text
\end{document} 

在此处输入图片描述

相关内容