summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex174
1 files changed, 86 insertions, 88 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
index 60a4801c7da..9c971d5c91e 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
@@ -131,7 +131,7 @@ The following deformations use only straight lines in order to morph the paths.
This decoration is actually always defined when the decoration module is
loaded, but it is documented here for consistency.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations}}]
\begin{tikzpicture}[decoration=lineto]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -155,7 +155,7 @@ The following deformations use only straight lines in order to morph the paths.
|zigzag| decorations.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration={straight zigzag,meta-segment length=1.1cm}]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -177,7 +177,7 @@ The following deformations use only straight lines in order to morph the paths.
$[-d,d]$, where $d$ is the value of |amplitude|.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[pre={\pgfmathsetseed{1}},preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}
[decoration={random steps,segment length=2mm}]
\draw [help lines] grid (3,2);
@@ -198,7 +198,7 @@ The following deformations use only straight lines in order to morph the paths.
\item |segment length| determines the length each spike.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=saw]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -219,7 +219,7 @@ The following deformations use only straight lines in order to morph the paths.
cycle.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=zigzag]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -246,14 +246,14 @@ The following deformations use only straight lines in order to morph the paths.
Note that this decoration makes only little sense for curves. You should
apply it only to straight lines.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=bent]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) -- (1.5,2) -- (0,1);
\end{tikzpicture}
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration={bent,aspect=.3}]
\draw [decorate,fill=yellow!80!black] (0,0) rectangle (3.5,2);
\node[circle,draw] (A) at (.5,.5) {A};
@@ -274,7 +274,7 @@ The following deformations use only straight lines in order to morph the paths.
\item |segment length| determines the width of the half ellipse.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=bumps]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -303,7 +303,7 @@ The following deformations use only straight lines in order to morph the paths.
default, means ``look more from the front''.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=coil]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -311,7 +311,7 @@ The following deformations use only straight lines in order to morph the paths.
\end{tikzpicture}
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}
[decoration={coil,aspect=0.3,segment length=3mm,amplitude=3mm}]
\draw [help lines] grid (3,2);
@@ -332,7 +332,7 @@ The following deformations use only straight lines in order to morph the paths.
This decoration is mostly useful in conjunction with meta-decorations. It
is also actually defined in the decoration module and is always available.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=curveto]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -352,7 +352,7 @@ The following deformations use only straight lines in order to morph the paths.
\item |segment length| determines the sine wave's wavelength.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathmorphing}}]
\begin{tikzpicture}[decoration=snake]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black]
@@ -388,7 +388,7 @@ The following deformations use only straight lines in order to morph the paths.
the path.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing}}]
\begin{tikzpicture}[decoration=border]
\draw [help lines] grid (3,2);
\draw [postaction={decorate,draw,red}]
@@ -410,7 +410,7 @@ The following deformations use only straight lines in order to morph the paths.
``middle part'' of the brace will be.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing}}]
\begin{tikzpicture}[decoration=brace]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1);
@@ -430,7 +430,7 @@ The following deformations use only straight lines in order to morph the paths.
Thus, the total opening angle is twice this angle.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing}}]
\begin{tikzpicture}[decoration={expanding waves,angle=5}]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
@@ -458,7 +458,7 @@ The following deformations use only straight lines in order to morph the paths.
\item |amplitude| determines half the length of the ticks.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing}}]
\begin{tikzpicture}[decoration=ticks]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
@@ -479,7 +479,7 @@ The following deformations use only straight lines in order to morph the paths.
\item |radius| determines the radius of each arc.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing}}]
\begin{tikzpicture}[decoration={waves,radius=4mm}]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
@@ -494,7 +494,7 @@ The following deformations use only straight lines in order to morph the paths.
Typically, each segment will be replaced with another path, but this need
not necessarily be the case.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing}}]
\begin{tikzpicture}[>=stealth, every node/.style={midway, sloped, font=\tiny},
decoration={show path construction,
moveto code={
@@ -565,8 +565,8 @@ The following deformations use only straight lines in order to morph the paths.
The second support on the curveto input segment path.
\end{command}
%
-{\tikzexternaldisable
-\begin{codeexample}[]
+{\ifpgfmanualexternalize\tikzexternaldisable\fi
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.pathreplacing,shapes.misc}}]
\tikzset{
show curve controls/.style={
decoration={
@@ -642,7 +642,7 @@ with the most general and most useful of these libraries.
Let us start with the above example in real code:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={
markings,% switch on markings
mark=% actually add a mark
@@ -661,7 +661,7 @@ with the most general and most useful of these libraries.
We can also add the cross repeatedly:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={
markings,% switch on markings
mark=% actually add a mark
@@ -681,7 +681,7 @@ with the most general and most useful of these libraries.
The |mark| decoration option is used to specify a marking. It comes in two
versions:
%
- \begin{key}{/pgf/decoration/mark=\texttt{at position} \meta{pos}| with |\meta{code}}
+ \begin{key}{/pgf/decoration/mark=\texttt{at position }\meta{pos}\texttt{ with }\meta{code}}
The options specifies that when a |marking| decoration is applied,
there should be a marking at position \meta{pos} on the path whose code
is given by \meta{code}.
@@ -721,7 +721,7 @@ with the most general and most useful of these libraries.
not allowed (and will result in chaos) to have a marking that lies
earlier on the path to follow a marking that is later on the path.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={
markings,% switch on markings
mark=at position 1cm with \node[red]{1cm};,
@@ -736,7 +736,7 @@ with the most general and most useful of these libraries.
Here is an example that shows how markings can be used to place text on
plots:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[domain=0:4,label/.style={postaction={
decorate,
decoration={
@@ -774,10 +774,7 @@ with the most general and most useful of these libraries.
A second way to use the |mark| key is the following:
%
- \begin{key}{/pgf/decoration/mark=|between positions|
- \meta{start pos} |and| \meta{end pos} |step|
- \meta{stepping} |with| \meta{code}%
- }
+ \begin{key}{/pgf/decoration/mark=\texttt{between positions }\meta{start pos}\texttt{ and }\meta{end pos}\texttt{ step }\meta{stepping}\texttt{ with }\meta{code}}
This works similarly to the |at position| version of this option, only
multiple marks are placed, starting at \meta{start pos} and then spaced
apart by \meta{stepping}. The \meta{start pos}, the \meta{end pos}, and
@@ -789,7 +786,7 @@ with the most general and most useful of these libraries.
a path starting with the beginning of the path ($\meta{start pos} = 0$)
and ending at the end ($\meta{end pos} = 1$).
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={markings,
mark=between positions 0 and 1 step 0.1
with { \draw (-2pt,-2pt) -- (2pt,2pt);
@@ -803,7 +800,7 @@ with the most general and most useful of these libraries.
crosses. Note the use of the |transform shape| option to ensure that
the nodes are actually rotated.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings,shapes.arrows}}]
\begin{tikzpicture}[decoration={markings,
mark=between positions 0 and 1 step 1cm
with { \node [single arrow,fill=red,
@@ -817,7 +814,7 @@ with the most general and most useful of these libraries.
even refer to them later on.
%
% FIXME: the automatic key highlighting fails here!
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={markings,
mark=between positions 0 and 1 step 1cm with {
\node [draw,
@@ -833,7 +830,7 @@ with the most general and most useful of these libraries.
In the following example we use the distance info to place ``length
information'' on a path:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={markings,
% Main marks
mark=between positions 0 and 1 step 40pt with
@@ -880,7 +877,7 @@ with the most general and most useful of these libraries.
Here are two examples that show how this works:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={markings,
mark connection node=my node,
mark=at position .5 with
@@ -890,7 +887,7 @@ with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={markings,
mark connection node=my node,
mark=at position .25 with
@@ -917,7 +914,7 @@ executed. (They are only defined in this code):
The \meta{options} can only be given when \tikzname\ is used. In this case,
they are executed in a scope that contains the arrow tip.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={
markings,% switch on markings
mark=at position 1cm with {\node[red]{1cm};},
@@ -930,7 +927,8 @@ executed. (They are only defined in this code):
\end{codeexample}
Here is a more useful example:
-\begin{codeexample}[]
+ %
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.markings}}]
\begin{tikzpicture}[decoration={
markings,% switch on markings
mark=between positions 0 and .75 step 4mm with {\arrow{stealth}},
@@ -960,7 +958,7 @@ executed. (They are only defined in this code):
The footprint decoration adds little footprints around the path. They start
with the left foot.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.footprints}}]
\begin{tikzpicture}[decoration={footprints,foot length=5pt,stride length=10pt}]
\draw [help lines] grid (3,3);
\fill [decorate] (0,0) -- (3,2) arc (0:180:1.5 and 1);
@@ -974,7 +972,7 @@ executed. (They are only defined in this code):
The length or size of the footprint itself. A larger value makes the
footprint larger, but does not change the stride length.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.footprints}}]
\begin{tikzpicture}[decoration={footprints,foot length=20pt}]
\fill [decorate] (0,0) -- (3,0);
\end{tikzpicture}
@@ -985,7 +983,7 @@ executed. (They are only defined in this code):
The length of strides. This is the distance between the beginnings of
left footprints along the path.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.footprints}}]
\begin{tikzpicture}[decoration={footprints,stride length=50pt}]
\fill [decorate] (0,0) -- (3,0);
\end{tikzpicture}
@@ -996,7 +994,7 @@ executed. (They are only defined in this code):
The separation in the middle between the footprints. The footprints are
moved away from the path by half this amount.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.footprints}}]
\begin{tikzpicture}[decoration={footprints,foot sep=10pt}]
\fill [decorate] (0,0) -- (3,0);
\end{tikzpicture}
@@ -1006,7 +1004,7 @@ executed. (They are only defined in this code):
\begin{key}{/pgf/decoration/foot angle (initially 10)}
Footprints are rotated by this much.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.footprints}}]
\begin{tikzpicture}[decoration={footprints,foot angle=60}]
\fill [decorate] (0,0) -- (3,0);
\end{tikzpicture}
@@ -1072,7 +1070,7 @@ shapes. This library is included mostly for historical reasons, using the
\item |shape width| determines the width of each cross.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes}}]
\begin{tikzpicture}[decoration=crosses]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
@@ -1093,7 +1091,7 @@ shapes. This library is included mostly for historical reasons, using the
\item |shape width| determines the width of the triangle.
\end{itemize}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes}}]
\begin{tikzpicture}[decoration=triangles]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black] (0,0) -- (3,1) arc (0:180:1.5 and 1);
@@ -1115,14 +1113,14 @@ shapes. This library is included mostly for historical reasons, using the
size of the text box (like the arrow shapes).} If any of these restrictions
pose a problem, use the |markings| library instead.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes,shapes.geometric}}]
\begin{tikzpicture}[decoration={shape backgrounds,shape=star,shape size=5pt}]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes,shapes.geometric}}]
\tikzset{paint/.style={ draw=#1!50!black, fill=#1!50 },
decorate with/.style=
{decorate,decoration={shape backgrounds,shape=#1,shape size=2mm}}}
@@ -1144,7 +1142,7 @@ shapes. This library is included mostly for historical reasons, using the
A shape background path is added at the start point of the path and, if the
distance between the shapes is appropriate, at the end point of the path.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes,shapes.geometric}}]
\begin{tikzpicture}[decoration={
shape backgrounds,shape=regular polygon,shape size=4mm}]
\draw [help lines] grid (3,2);
@@ -1165,7 +1163,7 @@ shapes. This library is included mostly for historical reasons, using the
|inner sep| and |minimum size| will be ignored, but transformations can be
applied to each segment as described below.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes,shapes.geometric}}]
\tikzset{
paint/.style={draw=#1!50!black, fill=#1!50},
my star/.style={decorate,decoration={shape backgrounds,shape=star},
@@ -1192,7 +1190,7 @@ shapes. This library is included mostly for historical reasons, using the
shapes or between the edges of the \emph{boundaries} of the shape
borders.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes,shapes.symbols}}]
\begin{tikzpicture}[
decoration={shape backgrounds,shape size=.5cm,shape=signal},
signal from=west, signal to=east,
@@ -1218,7 +1216,7 @@ shapes. This library is included mostly for historical reasons, using the
distance between shapes is determined. These keywords will only have a
noticeable effect if the shapes sizes differ over time.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes}}]
\tikzset{
paint/.style={draw=#1!50!black, fill=#1!50},
spreading/.style={
@@ -1243,7 +1241,7 @@ shapes. This library is included mostly for historical reasons, using the
Internally this sets the \TeX-if |\ifpgfshapedecorationsloped|
accordingly.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes,shapes.geometric}}]
\tikzset{
paint/.style={draw=#1!50!black, fill=#1!50}
}
@@ -1265,7 +1263,7 @@ shapes. This library is included mostly for historical reasons, using the
shapes are scaled:
\begin{key}{/pgf/decoration/shape scaled=\meta{boolean} (initially false)}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes}}]
\tikzset{
bigger/.style={decoration={shape start size=.125cm, shape end size=.5cm}},
smaller/.style={decoration={shape start size=.5cm, shape end size=.125cm}},
@@ -1301,7 +1299,7 @@ shapes. This library is included mostly for historical reasons, using the
that a shape will take only if it is drawn exactly at the end of the
path.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.shapes}}]
\tikzset{
bigger/.style={decoration={shape start size=.25cm, shape end size=1cm}},
smaller/.style={decoration={shape start size=1cm, shape end size=.25cm}},
@@ -1346,7 +1344,7 @@ shapes. This library is included mostly for historical reasons, using the
the decoration is done. This is why no line is shown in the following
example.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\catcode`\|12
\begin{tikzpicture}[decoration={text along path,
text={Some long text along a ridiculously long curve that}}]
@@ -1397,7 +1395,7 @@ shapes. This library is included mostly for historical reasons, using the
codes of delimiters -- see below).
%
{\catcode`\|12
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\catcode`\|12
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -1412,7 +1410,7 @@ shapes. This library is included mostly for historical reasons, using the
added to any existing formatting.
%
{\catcode`\|12
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\path [decorate,decoration={text along path,
@@ -1438,7 +1436,7 @@ shapes. This library is included mostly for historical reasons, using the
the specified format commands are added to any existing ones, you
should avoid using |+| as a delimiter.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\path [decorate, decoration={text along path,text format delimiters={[}{]},
@@ -1457,7 +1455,7 @@ shapes. This library is included mostly for historical reasons, using the
This key reverses the path. This is especially useful for typesetting
text along different sides of curves.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\draw [gray, ->]
@@ -1480,7 +1478,7 @@ shapes. This library is included mostly for historical reasons, using the
Aligns the text according to \meta{alignment}, which should be one of
|left|, |right|, or |center|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\draw [red, dashed]
@@ -1521,7 +1519,7 @@ shapes. This library is included mostly for historical reasons, using the
(i.e., the automaton would have to shift \emph{backwards} between
characters) this key will have no effect.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\draw [red, dashed]
@@ -1538,7 +1536,7 @@ shapes. This library is included mostly for historical reasons, using the
forward only for space characters (including |\space|, but
\emph{excluding} |\ |).
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\draw [red, dashed]
@@ -1556,7 +1554,7 @@ shapes. This library is included mostly for historical reasons, using the
options (such as |text|, |scale| and |opacity|) can be used to create `text
effects'.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text,math}}]
\bfseries\large
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!}, text align=center,
@@ -1572,8 +1570,8 @@ shapes. This library is included mostly for historical reasons, using the
\end{tikzpicture}
\end{codeexample}
- There are some important differences between this decoration and the |text
- along path| decoration:
+ There are some important differences between this decoration and the
+ |text along path| decoration:
%
\begin{itemize}
\item formatting (e.g., font and color) cannot be specified in the
@@ -1606,7 +1604,7 @@ shapes. This library is included mostly for historical reasons, using the
separated by a \emph{word separator}. This, however, does not mean that you
are limited to using only natural language as the decoration text.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={000-001-010-011-100-101-110-111},
text effects/.cd,
@@ -1620,7 +1618,7 @@ shapes. This library is included mostly for historical reasons, using the
In addition, it is possible to replace characters with \tikzname\ code:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={000-001-010-011-100-101-110-111}, text align=center,
text effects/.cd,
@@ -1664,7 +1662,7 @@ shapes. This library is included mostly for historical reasons, using the
horizontally fit each node to the character it contains, reducing the
spacing between characters).
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!}}]
@@ -1741,7 +1739,7 @@ shapes. This library is included mostly for historical reasons, using the
\begin{key}{/pgf/decoration/text effects/character widths=\marg{effects}}
Shorthand for the |every character width| style.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!}, text align=center,
text effects/.cd,
@@ -1765,7 +1763,7 @@ shapes. This library is included mostly for historical reasons, using the
\begin{key}{/pgf/decoration/text effects/character count=\meta{macro}}
Store the number of the character being typeset in \meta{macro}.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1783,7 +1781,7 @@ shapes. This library is included mostly for historical reasons, using the
\meta{macro}. This key can be used with the |character count| key to
produce some quite pleasing effects:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text,math}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1802,7 +1800,7 @@ shapes. This library is included mostly for historical reasons, using the
character in the word) in \meta{macro}. Numbering starts at |1| and the
character acting as a word separator is numbered |0|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1825,7 +1823,7 @@ shapes. This library is included mostly for historical reasons, using the
\meta{macro} takes the number of the previous word. If the decoration
text starts with a word separator \meta{macro} will be |0|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1850,7 +1848,7 @@ shapes. This library is included mostly for historical reasons, using the
This key enables \meta{effects} to be applied to every character in the
decoration text that is specified in \meta{characters}.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={Falsches {\"U}ben von Xylophonmusik qu{\"a}lt jeden gr{\"o}{\ss}eren Zwerg},
text effects/.cd,
@@ -1870,7 +1868,7 @@ shapes. This library is included mostly for historical reasons, using the
path was actually a straight line starting from the given point. This
`virtual' straight line is then decorated with the text.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1888,7 +1886,7 @@ shapes. This library is included mostly for historical reasons, using the
line that is used as the decorated path is rotated by \meta{angle}
around the starting point.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1905,7 +1903,7 @@ shapes. This library is included mostly for historical reasons, using the
This key will make the decoration increase the space between characters
so that the entire path is used by the decoration.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/every character/.style={text along path}}]
@@ -1924,7 +1922,7 @@ shapes. This library is included mostly for historical reasons, using the
This key will make the decoration scale the text so that the entire
path is used by the decoration.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/every character/.style={text along path}}]
@@ -1944,7 +1942,7 @@ shapes. This library is included mostly for historical reasons, using the
useful if using `right-to-left` languages. Unfortunately, any leading
`soft' spaces in the original text will be lost.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1964,7 +1962,7 @@ shapes. This library is included mostly for historical reasons, using the
Alternatively, to get the numbering to follow the reversed text, it is
possible to reverse the path and then invert the scale:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -1984,7 +1982,7 @@ shapes. This library is included mostly for historical reasons, using the
Group sequences of letters together so they are treated as a single
`character'.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -2004,7 +2002,7 @@ shapes. This library is included mostly for historical reasons, using the
The order in which the |reverse text| and |group letters| keys are applied
is important:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -2031,7 +2029,7 @@ shapes. This library is included mostly for historical reasons, using the
decoration starts. If any of these options are given the behaviour of
the |repeat text| key is undefined, but typically it will be ignored.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!\ },
text effects/.cd,
@@ -2051,7 +2049,7 @@ shapes. This library is included mostly for historical reasons, using the
which takes one argument. The argument will be a macro which when
expanded will contain the current character.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\def\mycommand#1{#1$_\n$}
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
@@ -2075,7 +2073,7 @@ shapes. This library is included mostly for historical reasons, using the
with the |every character| or |every letter| styles) will also be
applied to \meta{code}.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.text}}]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/.cd,
@@ -2105,7 +2103,7 @@ shapes. This library is included mostly for historical reasons, using the
repeatedly applying this replacement, different levels of the Koch curve
fractal can be created. Its Hausdorff dimension is $\log 5/\log 3$.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.fractals}}]
\begin{tikzpicture}[decoration=Koch curve type 1]
\draw decorate{ (0,0) -- (3,0) };
\draw decorate{ decorate{ (0,-1.5) -- (3,-1.5) }};
@@ -2119,7 +2117,7 @@ shapes. This library is included mostly for historical reasons, using the
This decoration replaces a straight line by a ``rectangular sine''. Its
Hausdorff dimension is $3/2$.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.fractals}}]
\begin{tikzpicture}[decoration=Koch curve type 2]
\draw decorate{ (0,0) -- (3,0) };
\draw decorate{ decorate{ (0,-2) -- (3,-2) }};
@@ -2133,7 +2131,7 @@ shapes. This library is included mostly for historical reasons, using the
This decoration replaces a straight line by a ``line with a spike''. The
Hausdorff dimension of Koch's snowflake's is $\log 4/\log 3$.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.fractals}}]
\begin{tikzpicture}[decoration=Koch snowflake]
\draw decorate{ (0,0) -- (3,0) };
\draw decorate{ decorate{ (0,-1) -- (3,-1) }};
@@ -2148,7 +2146,7 @@ shapes. This library is included mostly for historical reasons, using the
This decoration replaces a straight line by a ``line with a gap in the
middle''. The Hausdorff dimension of the Cantor set is $\log 2/\log 3$.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{decorations.fractals}}]
\begin{tikzpicture}[decoration=Cantor set,very thick]
\draw decorate{ (0,0) -- (3,0) };
\draw decorate{ decorate{ (0,-.5) -- (3,-.5) }};