如何用 Beamer 画出像蜡笔一样的线条

如何用 Beamer 画出像蜡笔一样的线条

我想创建一条自定义beamer线,使我的模板看起来像下面的蜡笔一样:

. 我怎样才能创建它?

答案1

这应该可以让你开始:

\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}

\begin{tikzpicture}[crayon/.style={very thick, line cap=round, line join=round,
  decoration={random steps, segment length=0.5pt, amplitude=0.25pt}, decorate}]

\foreach \l/\c [count=\y] in {A/blue!50!gray, B/orange, C/green!50!brown, D/brown!50!black}
   \path [crayon, draw=\c] (0,-\y/2) -- (6,-\y/2) node [at start, left, font=\sffamily, text=\c] {\l};

\path [crayon, draw=red!75!black] (0,0) -- (3,-3) -- (6,0);
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

使用 PSTricks 只是为了好玩!

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-node}
\pstVerb{realtime srand}
\psset{linejoin=1}

\def\curlyline[#1](#2,#3)(#4,#5)#6{%
    \curvepnodes[plotpoints=#6]{#2}{#4}{t #5 #3 sub #4 #2 sub div t #2 sub mul #3 add .25 Rand sub 30 div add}{P}
    \psnline[#1](0,\Pnodecount){P}}
\begin{document}

\begin{pspicture}[showgrid=false](-2.2,-2.2)(2,0)
\foreach \y/\l/\c in {0/A/red,-1/B/green,-2/C/blue}{\rput(-2.2,\y){\textcolor{\c}{\l}}\curlyline[linecolor=\c](-2,\y)(2,\y){150}}
\curlyline[linecolor=orange](-2,0)(0,-2.2){150}
\curlyline[linecolor=orange](0,-2.2)(2,0){150}
\end{pspicture}
\end{document}

在此处输入图片描述

相关内容