0

I would like to produce either a tcolorbox or a tikzpicture that closely resembles the following image:

enter image description here

The following code produces as reasonable facsimile, but not great:

\documentclass[12pt]{book}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{xcolor}
\definecolor{parchment_yellow}{RGB}{245,233,175}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\begin{center} 
\begin{tikzpicture}[pencildraw/.style={ %
    decorate,
    decoration={random steps,segment length=2pt,amplitude=2.25pt}
    } %
]
\node[
preaction={fill=black,opacity=.5,transform canvas={xshift=1.5mm,yshift=-1.5mm}},
pencildraw,draw,fill=parchment_yellow,text width=0.92\textwidth,inner sep=5mm,align=justify] 
{\fontsize{15}{18}\selectfont {\bf \lipsum[3]}};
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

Can LaTeX reproduce the above parchment image with its visual effects; or, can the above image be used as the background for the above tikzpicture? Finally, can anyone suggest a better color approximation to the parchment image than the one I came up with \definecolor{parchment_yellow}{RGB}{245,233,175}?

Ingmar
  • 6,690
  • 5
  • 26
  • 47
DDS
  • 8,816
  • 4
  • 9
  • 36

1 Answers1

2

enter image description here

I've tried to match the color and margin. I don't know how to handle the texture (the pyhighlight color should be used randomly for the background of a node with varying dimensions).

The code

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shadings}
\begin{document}

\definecolor{pylight}{RGB}{247, 235, 205} \definecolor{py}{RGB}{243, 224, 181} \definecolor{pydark}{RGB}{221, 182, 110} \definecolor{pyhighlight}{RGB}{254, 235, 204}

\pgfdeclareverticalshading{parchment}{100bp}{% color(0bp)=(pydark); color(25bp)=(pydark); color(30bp)=(py); color(50bp)=(pylight); color(70bp)=(py); color(75bp)=(pydark); color(100bp)=(pydark)% } \pgfdeclareradialshading{rparchment}{\pgfpoint{0cm}{0cm}}{% color(0bp)=(pylight); color(13bp)=(pylight); color(20bp)=(py); color(40bp)=(pydark); color(60bp)=(pydark!50!black); color(100bp)=(black)% } \tikzset{ pencildraw/.style={% decorate, decoration={% random steps, segment length=1.1ex, amplitude=.5ex% } }, drop shadow/.style={ blur shadow={% shadow xshift=.5pt, shadow yshift=-.5pt, shadow blur steps=9, shadow blur extra rounding=1.5pt% }, }, parchment fill/.style={ pencildraw, fill=pyhighlight, postaction={shading=parchment, opacity=1}, postaction={shading=rparchment, opacity=.7} } }

\begin{tikzpicture} \shade node[parchment fill, drop shadow, text width=10.5cm, text height=6.7cm, inner sep=.4, align=justify, label={[label distance=2ex] 151:test}] (test) {}; \path node[below=of test, label={150:original}] {\includegraphics[width=11cm]{parchment_model}}; \end{tikzpicture}

\end{document}

Daniel N
  • 5,687