`\fill[pattern=north east lines] (A,B) rectangle (C,D); `

How to make so that the stripe the pattern creates is of style `decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}`

Advertisement

`\fill[pattern=north east lines] (A,B) rectangle (C,D); `

How to make so that the stripe the pattern creates is of style `decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}`

You can declare new patterns. The `TikZ`

manual discusses it in chapter 78.

```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing, patterns}
\begin{document}
\pgfdeclarepatternformonly{mystripes}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
{\pgfpoint{1cm}{1cm}}
{
\tikz\draw[decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}, decorate] (0,0) -- ++(1,1);
}
\begin{tikzpicture}
\filldraw[pattern=mystripes] (0,0) rectangle (1.5,2);
\end{tikzpicture}
\end{document}
```

Play around with it a bit in order to get more lines, make it parameterized, etc.

A possible parameter might be the distance between two lines:

```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing, patterns}
\begin{document}
\tikzset{mystripes dist/.initial=0.25}
\pgfdeclarepatternformonly[/tikz/mystripes dist]{mystripes}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
{\pgfpoint{1cm}{1cm}}
{
\foreach \x in {0,\pgfkeysvalueof{/tikz/mystripes dist},...,1}{
\pgfmathsetmacro{\nx}{1-\x}
\tikz[overlay]\draw[decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}, decorate] (\x, 0) -- ++(\nx,\nx);
\tikz[overlay]\draw[decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}, decorate] (0, \x) -- ++(\nx,\nx);
}
}
\begin{tikzpicture}
\filldraw[pattern=mystripes] (0,0) rectangle (1.5,2);
\filldraw[pattern=mystripes, xshift=2cm, mystripes dist=0.1] (0,0) rectangle (1.5,2);
\end{tikzpicture}
\end{document}
```

The result then looks like this: