我想要制作一个tcolorbox
或一个tikzpicture
与下图非常相似的图像:
以下代码产生了合理的传真,但不是很好:
\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}
能否LaTeX
重现上述羊皮纸图像及其视觉效果;或者,上述图像是否可以用作上述 tikzpicture 的背景?最后,有人能建议一种比我想出的更接近羊皮纸图像的颜色吗\definecolor{parchment_yellow}{RGB}{245,233,175}
?
答案1
我尝试过匹配颜色和边距。我不知道如何处理纹理(pyhighlight
对于具有不同尺寸的节点的背景,颜色应该随机使用)。
代码
\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}