Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to apply the following shading effect

enter image description here

proposed in " Fake sheet effect " as a background for a mdframed environment. How can this be achieved?

share|improve this question
    
Is the gray filled rectangle the text area or where should be the text? –  Marco Daniel Sep 8 '12 at 10:54

1 Answer 1

up vote 15 down vote accepted
+100

Here is a suggestion whereby I only modified the first frame:

enter image description here

\documentclass{article}

\usepackage{kantlipsum}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{calc}

\mdfdefinestyle{fakesheet}{%
backgroundcolor=gray!15,
middlelinecolor=gray!15,
roundcorner=15pt,
 singleextra={%
  \fill[gray!60,rounded corners,] 
  ($(P)+(0,-2.05)$) .. controls  ($(P)+(0.14,-0.55)$) ..  ($(P)+(0.16,-0.45)$) --  ($(P)+(-0.2,-0.4)$) -- cycle;
   \draw[gray!15,line width=0.20cm]  ($(P)+(-.1,-2.15)$)  --  ($(P)+(-.1,-.4)$) ;
\path let \p1=(P), \p2=(O) in ({(\x1-\x2)/2},\y2) coordinate (M);
\shade[left color=gray!50,right color=gray!50,middle color=black!55,rounded corners] 
  ($(M)+(-5.4,-0.135)$) .. controls ($(M)+(0,-0.015)$) .. ($(M)+(5.4,-0.135)$) -- ($(M)+(5.4,0.135)$) .. controls ($(M)+(0,0.135)$) .. ($(M)+(-5.4,0.135)$)-- cycle;
   \draw[gray!15,line width=0.20cm]  ($(M)+(-5.4,0.10)$)  --  ($(M)+(5.4,0.1)$) ;
  }
}


\newmdenv[style=fakesheet]{shadeenv}

\begin{document}
\kant[1]

\begin{shadeenv}
\kant[2]
\end{shadeenv}

\end{document}

Extra material can be added by the options singleextra firstextra etc. See forexample here:

mdframed-Put something on the start of one vertical left rule

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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