diff options
Diffstat (limited to 'graphics/pgf/base/doc/text-en/pgfmanual-en-base-patterns.tex')
-rw-r--r-- | graphics/pgf/base/doc/text-en/pgfmanual-en-base-patterns.tex | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-base-patterns.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-base-patterns.tex index a8f85fb4cf..de7700e548 100644 --- a/graphics/pgf/base/doc/text-en/pgfmanual-en-base-patterns.tex +++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-base-patterns.tex @@ -93,7 +93,7 @@ used for this: The \meta{code} should be \pgfname\ code than can be protocolled. It should not contain any color code. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{patterns}}] \pgfdeclarepatternformonly{stars} {\pgfpointorigin}{\pgfpoint{1cm}{1cm}} {\pgfpoint{1cm}{1cm}} @@ -141,7 +141,7 @@ used for this: values of the macro |\size|, the key |/tikz/radius|, and the \TeX{} dimension |\thickness|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{patterns}}] \pgfdeclarepatternformonly[/tikz/radius,\thickness,\size]{rings} {\pgfpoint{-0.5*\size}{-0.5*\size}} {\pgfpoint{0.5*\size}{0.5*\size}} @@ -181,7 +181,7 @@ used for this: color commands, not the |\color| command, since this fill is not protocolled. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{patterns}}] \pgfdeclarepatterninherentlycolored{green stars} {\pgfpointorigin}{\pgfpoint{1cm}{1cm}} {\pgfpoint{1cm}{1cm}} @@ -214,7 +214,35 @@ Once a pattern has been declared, it can be used. the \meta{color} parameter is ignored. For form-only patterns, the \meta{color} parameter specifies the color to be used for the pattern. % -\begin{codeexample}[] +\begin{codeexample}[ + preamble={\usetikzlibrary{patterns} +\pgfdeclarepatternformonly{stars} +{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +{\pgfpoint{1cm}{1cm}} +{ + \pgftransformshift{\pgfpoint{.5cm}{.5cm}} + \pgfpathmoveto{\pgfpointpolar{0}{4mm}} + \pgfpathlineto{\pgfpointpolar{144}{4mm}} + \pgfpathlineto{\pgfpointpolar{288}{4mm}} + \pgfpathlineto{\pgfpointpolar{72}{4mm}} + \pgfpathlineto{\pgfpointpolar{216}{4mm}} + \pgfpathclose% + \pgfusepath{fill} +} +\pgfdeclarepatterninherentlycolored{green stars} +{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +{\pgfpoint{1cm}{1cm}} +{ + \pgfsetfillcolor{green!50!black} + \pgftransformshift{\pgfpoint{.5cm}{.5cm}} + \pgfpathmoveto{\pgfpointpolar{0}{4mm}} + \pgfpathlineto{\pgfpointpolar{144}{4mm}} + \pgfpathlineto{\pgfpointpolar{288}{4mm}} + \pgfpathlineto{\pgfpointpolar{72}{4mm}} + \pgfpathlineto{\pgfpointpolar{216}{4mm}} + \pgfpathclose% + \pgfusepath{stroke,fill} +}}] \begin{tikzpicture} \pgfsetfillpattern{stars}{red} \filldraw (0,0) rectangle (1.5,2); |