1

How to decrease the vertical space of shaded environment in preamble? Here is the code:

\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} 

Please don't define the new environment, just change some properties of shaded environment.

enter image description here

2

Off topic: Do not load color but just the more modern xcolor.

You can redefine the vertical space by redefining the 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} 

enter image description here

  • It's completely effective! Thank you very much. – Hyden Apr 29 '15 at 1:38
  • @Hyden glad to hear that. You are welcome – LaRiFaRi Apr 29 '15 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.