如何減少陰影(\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您可以透過重新定義-internal length來重新定義垂直空間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} 

在此輸入影像描述

相關內容