diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex index be536402d33..22e02202c4a 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex @@ -27,7 +27,7 @@ Section~\ref{section-shape-common-options} In all of the examples presented in this section, the following |shape example| style is used: % -\begin{codeexample}[code only] +\begin{codeexample}[code only,setup code] \tikzset{ shape example/.style= {color = black!30, draw, @@ -52,7 +52,7 @@ anchors. figure shows the anchors this shape defines; the anchors |10| and |130| are example of border anchors. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s,shape=circle,shape example] {Circle\vrule width 1pt height 2cm}; @@ -77,7 +77,7 @@ anchors. anchors this shape defines; the anchors |10| and |130| are example of border anchors. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s,shape=rectangle,shape example] {Rectangle\vrule width 1pt height 2cm}; @@ -117,7 +117,7 @@ anchors. The following figure shows the anchors this shape defines; the anchors |10| and |130| are example of border anchors. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s,shape=diamond,shape example] {Diamond\vrule width 1pt height 2cm}; @@ -140,7 +140,7 @@ anchors. separation is given. The following figure shows the anchors this shape defines; the anchors |10| and |130| are example of border anchors. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s,shape=ellipse,shape example] {Ellipse\vrule width 1pt height 2cm}; @@ -169,7 +169,7 @@ anchors. the natural dimensions of the node contents (which includes any |inner sep|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[every node/.style={trapezium, draw}] \node at (0,2) {A}; \node[trapezium left angle=75, trapezium right angle=45] @@ -199,7 +199,7 @@ anchors. Regardless of the rotation of the shape border, the width and height of the trapezium are as follows: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[>=stealth, every node/.style={text=black}, shape border uses incircle, shape border rotate=60] \node [trapezium, fill=gray!25, minimum width=2cm] (t) {}; @@ -216,7 +216,7 @@ anchors. minimum size specification. This is initially |false|, ensuring that the shape ``looks the same but bigger'' when enlarged. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} \begin{tikzpicture} \draw [help lines] grid (3,2); @@ -229,7 +229,7 @@ anchors. By setting \meta{boolean} to |true|, the trapezium can be stretched horizontally or vertically. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} \begin{tikzpicture} \tikzset{trapezium stretches=true} @@ -246,7 +246,7 @@ anchors. \meta{boolean} is |true|, \pgfname{} enlarges only the body of the trapezium when applying minimum width. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} \begin{tikzpicture} \draw [help lines] grid (3,2); @@ -262,7 +262,7 @@ anchors. The anchors for the trapezium are shown below. The anchor |160| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=trapezium, shape example, inner sep=1cm] @@ -291,7 +291,7 @@ anchors. |semicircle| shape are shown below. Anchor |30| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s,shape=semicircle,shape border rotate=0,shape example, inner sep=1cm] @@ -318,7 +318,7 @@ anchors. whose radius is calculated to tightly fit the node contents (including any |inner sep|). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture} \foreach \a in {3,...,7}{ \draw[red, dashed] (\a*2,0) circle(0.5cm); @@ -332,7 +332,7 @@ anchors. as the diameter of the circumcircle, that is, the circle that passes through all the corners of the polygon border. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture} \foreach \a in {3,...,7}{ \draw[blue, dashed] (\a*2,0) circle(0.5cm); @@ -351,7 +351,7 @@ anchors. The anchors for a regular polygon shape are shown below. The anchor |75| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=regular polygon, shape example, inner sep=.5cm] @@ -382,7 +382,7 @@ anchors. specified minimum size, width or height, is interpreted as the diameter of the circumcircle. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture} \draw [help lines] (0,0) grid (2,2); \draw [blue, dashed] (1,1) circle(1cm); @@ -413,10 +413,10 @@ anchors. increased to maintain the ratio. \end{key} - The inner and outer points form the principle anchors for the star, as + The inner and outer points form the principal anchors for the star, as shown below (anchor |75| is an example of a border anchor). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=star, star points=5, star point ratio=1.65, shape example, inner sep=1.5cm] @@ -443,7 +443,7 @@ anchors. regardless of the rotation of the shape border, the width and height are always considered as follows: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[>=stealth, every node/.style={text=black}, shape border uses incircle, shape border rotate=-30] \node [isosceles triangle, fill=gray!25, minimum width=1.5cm] (t) {}; @@ -467,7 +467,7 @@ anchors. will increase the width (and vice versa), in order to keep the apex angle the same. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}] \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, anchor=left corner, shape border rotate=90}} @@ -482,7 +482,7 @@ anchors. However, by setting \meta{boolean} to |true|, minimum width and height can be applied independently. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}] \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, anchor=south, shape border rotate=90, isosceles triangle stretches}} @@ -501,7 +501,7 @@ anchors. is rotated to 90 degrees. Note also that the |center| anchor does not necessarily correspond to any kind of geometric center. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=isosceles triangle, shape example, inner xsep=1cm] @@ -545,7 +545,7 @@ anchors. angles will be the same. \end{key} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[every node/.style={kite, draw}] \node[kite upper vertex angle=135, kite lower vertex angle=70] at (0,0) {A}; \node[kite vertex angles=90 and 45] at (1,0) {B}; @@ -556,7 +556,7 @@ anchors. The anchors for the |kite| are shown below. Anchor |110| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=kite, shape example, inner sep=1.5cm] @@ -588,7 +588,7 @@ anchors. the angle between the `tails' of the dart. To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture} \node[dart, draw, gray, shape border uses incircle, shape border rotate=45] (d) {dart}; @@ -611,7 +611,7 @@ anchors. rotated 90 degrees anti-clockwise). Anchor |110| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=dart, shape border rotate=90, shape example, inner sep=1.25cm] @@ -638,7 +638,7 @@ anchors. rotation determines the direction in which the `apex' of the sector points (unless other transformations have been applied). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[ every node/.style={circular sector, shape border uses incircle, draw}, ] @@ -658,7 +658,7 @@ anchors. The anchors for the circular sector shape are shown below. Anchor |30| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s,shape=circular sector, style=shape example, inner sep=1cm] @@ -681,7 +681,7 @@ anchors. the rotation of the shape border as described in Section~\ref{section-rotating-shape-borders}. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture} \node[cylinder, draw, shape aspect=.5] {ABC}; \end{tikzpicture} @@ -691,7 +691,7 @@ anchors. distance between the curved ends, and the width is always the distance between the straight sides. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[>=stealth] \node [cylinder, gray!50, rotate=30, draw, minimum height=2cm, minimum width=1cm] (c) {Cylinder}; @@ -706,7 +706,7 @@ anchors. the cylinder. By contrast, enlarging the shape to some minimum width will stretch the curved ends. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[shape aspect=.5] \tikzset{every node/.style={cylinder, shape border rotate=90, draw}} \node [minimum height=1.5cm] {A}; @@ -722,7 +722,7 @@ anchors. cylinder end. This may be ignored if the shape is enlarged to some minimum width. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[] \tikzset{every node/.style={cylinder, shape border rotate=90, draw}} \node [aspect=1.0] {A}; @@ -740,7 +740,7 @@ anchors. |\ifpgfcylinderusescustomfill| appropriately. \end{key} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \begin{tikzpicture}[aspect=0.5] \node [cylinder, cylinder uses custom fill, cylinder end fill=red!50, cylinder body fill=red!25] {Cylinder}; @@ -763,7 +763,7 @@ anchors. also the center of rotation. The |shape center| is the center of the shape which includes the 2-dimensional representation of the cylinder top. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.geometric}}] \Huge \begin{tikzpicture} \node[name=s, shape=cylinder, shape example, aspect=.5, inner xsep=3cm, @@ -798,7 +798,7 @@ anchors. diagonal line part of the foreground path; thus, the diagonal line is on top of the text. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \node [correct forbidden sign,line width=1ex,draw=red,fill=white] {Smoking}; \end{tikzpicture} @@ -812,7 +812,7 @@ anchors. lower left to the upper right. The strange naming of these shapes is for historical reasons. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \node [forbidden sign,line width=1ex,draw=red,fill=white] {Smoking}; \end{tikzpicture} @@ -834,7 +834,7 @@ anchors. The length of the handle as a multiple of the circle radius. \end{key} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \node [magnifying glass,line width=1ex,draw] {huge}; \end{tikzpicture} @@ -848,7 +848,7 @@ anchors. speaking, using an ellipse which tightly fits the node contents -- including any |inner sep|). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \node[cloud, draw, fill=gray!20, aspect=2] {ABC}; \node[cloud, draw, fill=gray!20] at (1.5,0) {D}; @@ -880,7 +880,7 @@ anchors. |\ifpgfcloudignoresaspect| is set appropriately. The initial value is |false|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture}[aspect=1, every node/.style={cloud, cloud puffs=11, draw}] \node [fill=gray!20] {rain}; \node [cloud ignores aspect, fill=white] at (1.5,0) {snow}; @@ -893,7 +893,7 @@ anchors. These requirements are considered \emph{after} any aspect specification is applied. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \draw [help lines] grid (3,2); \draw [blue, dashed] (1.5, 1) ellipse (1.5cm and 1cm); @@ -905,7 +905,7 @@ anchors. The anchors for the cloud shape are shown below for a cloud with eleven puffs. Anchor 70 is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \Huge \begin{tikzpicture} \node[name=s, shape=cloud, style=shape example, cloud puffs=11, aspect=1.5, @@ -930,7 +930,7 @@ anchors. rotation of the shape border as described in Section~\ref{section-rotating-shape-borders}. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \node[starburst, fill=yellow, draw=red, line width=2pt] {\bf BANG!}; \end{tikzpicture} @@ -950,7 +950,7 @@ anchors. are randomly generated, so there is (unfortunately) no guarantee that any such requirements will be fully met. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \draw[help lines] grid(3,2); \node[starburst, draw, minimum width=3cm, minimum height=2cm] @@ -981,7 +981,7 @@ anchors. The basic anchors for a nine point |starburst| shape are shown below. Anchor |80| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \Huge \begin{tikzpicture} \node[name=s, shape=starburst, starburst points=9, starburst point height=3.5cm, @@ -1011,7 +1011,7 @@ anchors. points from that direction. The resulting points extend the node contents (which include the |inner sep|). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} [every node/.style={signal, draw, text=white, signal to=nowhere}] \node[fill=green!65!black, signal to=east] at (0,1) {To East}; @@ -1054,7 +1054,7 @@ anchors. The anchors for the signal shape are shown below. Anchor |70| is an example of a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \Huge \begin{tikzpicture} \node[name=s, shape=signal, signal from=west, shape example, inner sep=2cm] @@ -1078,7 +1078,7 @@ anchors. This shape is a rectangle with optional, ``bendy'' top and bottom sides, which tightly fits the node contents (including the |inner sep|). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture} \node[tape, draw]{ABCD}; \node[tape, draw, tape bend top=none] at (1.5, 0) {EFGH}; @@ -1096,7 +1096,7 @@ anchors. style |in and out| will mean the side will first bend inwards and then bend outwards. The opposite holds true for |out and in|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture}[-stealth] \node[tape, draw, gray, minimum width=2cm](t){Tape}; \draw [blue]([yshift=5pt] t.north west) -- ([yshift=5pt]t.north east) @@ -1112,7 +1112,7 @@ anchors. bend styles, but the author of this shape cannot think of a single use for such a combination. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture}[every node/.style={tape, draw}] \node [tape bend top=out and in, tape bend bottom=out and in] {Parallel}; \node at (2,0) [tape bend bottom=out and in] {Why?}; @@ -1127,7 +1127,7 @@ anchors. \begin{key}{/pgf/tape bend height=\meta{length} (initially 5pt)} Sets the total height for a side with a bend. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture}[>=stealth] \draw [help lines] grid(3,2); \node [tape, fill, minimum size=2cm, red!50, tape bend top=none, @@ -1142,7 +1142,7 @@ anchors. of a border anchor. Note that border anchors will snap to the center of convex curves (i.e.\ when bending in). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \Huge \begin{tikzpicture} \node[name=s, shape=tape, tape bend height=1cm, shape example, inner xsep=3cm] @@ -1166,7 +1166,7 @@ anchors. is sometimes used in flowcharts. It is essentially a circle with a little tail: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \tikz\node [magnetic tape, draw] (A) {A}; \end{codeexample} @@ -1176,7 +1176,7 @@ anchors. This key sets how far the tail extends beyond the radius of the tape. Negative values will be ignored. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture}[every node/.style={magnetic tape, draw}] \node [magnetic tape tail extend=0cm] at (0,0) {A}; \node [magnetic tape tail extend=0.25cm] at (0,1) {B}; @@ -1189,7 +1189,7 @@ anchors. the radius of the shape. The \meta{proportion} should be between |0.0| and |1.0|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \begin{tikzpicture}[every node/.style={magnetic tape, draw}] \node [magnetic tape tail=0.5, magnetic tape tail extend=0.5cm] {A}; \node [magnetic tape tail=0.25] at (0,1) {B}; @@ -1200,7 +1200,7 @@ anchors. The following figure shows the anchors this shape defines; the anchors 10 and 130 are example of border anchors. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.symbols}}] \Huge \begin{tikzpicture} \node[name=s,shape=magnetic tape,shape example,inner sep=0.75cm, @@ -1238,7 +1238,7 @@ magnetic tape tail extend=0.5cm] rotation determines in which direction the arrow points (provided no other rotational transformations are applied). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture}[every node/.style={single arrow, draw}, rotate border/.style={shape border uses incircle, shape border rotate=#1}] \node {right}; @@ -1251,7 +1251,7 @@ magnetic tape tail extend=0.5cm] between the back ends of the arrow head, and the height is measured from the arrow tip to the end of the arrow tail. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture}[>=stealth, rotate border/.style={shape border uses incircle, shape border rotate=#1}] \node[rotate border=-30, fill=gray!25, minimum height=3cm, single arrow, @@ -1276,7 +1276,7 @@ magnetic tape tail extend=0.5cm] of the arrow head. This may change if the shape is enlarged to some minimum width. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture} \node[single arrow, draw, single arrow head extend=.5cm, gray!50, rotate=60] (a) {Arrow}; @@ -1290,7 +1290,7 @@ magnetic tape tail extend=0.5cm] This moves the point where the arrow head joins the shaft of the arrow \emph{towards} the arrow tip, by \meta{length}. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture}[every node/.style={single arrow, draw=none, rotate=60}] \node [fill=red!50] {arrow 1}; \node [fill=blue!50, single arrow head indent=1ex] at (1.5,0) {arrow 2}; @@ -1301,7 +1301,7 @@ magnetic tape tail extend=0.5cm] The anchors for this shape are shown below (anchor |20| is an example of a border anchor). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \Huge \begin{tikzpicture} \node[name=s,shape=single arrow, shape example, single arrow head extend=1.5cm] @@ -1326,7 +1326,7 @@ magnetic tape tail extend=0.5cm] (including any |inner sep|), and supports the rotation of the shape border, as described in Section~\ref{section-rotating-shape-borders}. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture}[every node/.style={double arrow, draw}] \node [double arrow, draw] {Left or Right}; \end{tikzpicture} @@ -1337,7 +1337,7 @@ magnetic tape tail extend=0.5cm] of the arrow heads, and the height is \emph{always} the tip-to-tip distance. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture}[>=stealth, rotate border/.style={shape border uses incircle, shape border rotate=#1}] \node[rotate border=210, fill=gray!25, minimum height=3cm, double arrow, @@ -1368,7 +1368,7 @@ magnetic tape tail extend=0.5cm] This moves the point where the arrow heads join the shaft of the arrow \emph{towards} the arrow tips, by \meta{length}. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture}[every node/.style={double arrow, draw=none, rotate=-60}] \node [fill=red!50] {arrow 1}; \node [fill=blue!50, double arrow head indent=1ex] at (1.5,0) {arrow 2}; @@ -1379,7 +1379,7 @@ magnetic tape tail extend=0.5cm] The anchors for this shape are shown below (anchor |20| is an example of a border anchor). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \Huge \begin{tikzpicture} \node[name=s,shape=double arrow, double arrow head extend=1.5cm, shape example, inner xsep=2cm] @@ -1403,7 +1403,7 @@ magnetic tape tail extend=0.5cm] This shape is a rectangle with optional arrows which extend from the four sides. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture} \node[arrow box, draw] {A}; \node[arrow box, draw, arrow box arrows={north:.5cm, west:0.75cm}] @@ -1417,7 +1417,7 @@ magnetic tape tail extend=0.5cm] length of each arrow independently, from either the border of the rectangle (the default) or the center of the rectangle. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \begin{tikzpicture} \tikzset{box/.style={arrow box, fill=#1}} \draw [help lines] grid(3,2); @@ -1485,7 +1485,7 @@ a side is drawn without an arrow, the anchors for that arrow should be considered unavailable. They are (unavoidably) defined, but default to the center of the appropriate side. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.arrows}}] \Huge \begin{tikzpicture} \node[shape=arrow box, shape example, inner xsep=1cm, inner ysep=1.5cm, arrow box shaft width=2cm, @@ -1526,7 +1526,7 @@ center of the appropriate side. middle. The upper part is the main part (the |text| part), the lower part is the |lower| part. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \begin{tikzpicture} \node [circle split,draw,double,fill=red!20] { @@ -1540,7 +1540,7 @@ center of the appropriate side. The shape inherits all anchors from the |circle| shape and defines the |lower| anchor in addition. See also the following figure: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \Huge \begin{tikzpicture} \node[name=s,shape=circle split,shape example] {text\nodepart{lower}lower}; @@ -1562,7 +1562,7 @@ center of the appropriate side. This shape (due to Manuel Lacruz) is similar to the split circle, but the two text parts are arranged diagonally. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \begin{tikzpicture} \node [circle solidus,draw,double,fill=red!20] { @@ -1573,7 +1573,7 @@ center of the appropriate side. \end{tikzpicture} \end{codeexample} -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \Huge \begin{tikzpicture} \node[name=s,shape=circle solidus,shape example,inner xsep=1cm] {text\nodepart{lower}lower}; @@ -1597,7 +1597,7 @@ center of the appropriate side. part is the |lower| part. The anchors for this shape are shown below. Anchor |60| is a border anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \Huge \begin{tikzpicture} \node[name=s,shape=ellipse split,shape example] {text\nodepart{lower}lower}; @@ -1618,7 +1618,7 @@ center of the appropriate side. This shape is a rectangle which can be split either horizontally or vertically into several parts. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \begin{tikzpicture}[my shape/.style={ rectangle split, rectangle split parts=#1, draw, anchor=center}] \node [my shape=5] at (0,1) @@ -1668,7 +1668,7 @@ center of the appropriate side. range |1| to |20|. If more than four parts are needed, the boxes should be allocated in advance as described above. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \begin{tikzpicture}[every text node part/.style={align=center}] \node[rectangle split, rectangle split parts=3, draw, text width=2.75cm] {Student @@ -1693,7 +1693,7 @@ center of the appropriate side. |rectangle split parts| key in that, if 3 parts (for example) are specified, but one is empty, only two will be shown. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \begin{tikzpicture}[every node/.style={draw, anchor=text, rectangle split, rectangle split parts=3}] \node {text \nodepart{second} \nodepart{third}third}; @@ -1730,7 +1730,7 @@ center of the appropriate side. part and \emph{does not} affect the alignment of the contents of the boxes. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \def\x{one \nodepart{two} 2 \nodepart{three} three \nodepart{four} 4} \begin{tikzpicture}[ every node/.style={rectangle split, rectangle split parts=4, @@ -1749,7 +1749,7 @@ center of the appropriate side. in relation to each other, whereas the other values align the boxes in relation to the part of the shape they occupy. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \def\x{\Large w\nodepart{two}x\nodepart{three}\Huge y\nodepart{four}\tiny z} \begin{tikzpicture}[ every node/.style={rectangle split, rectangle split parts=4, @@ -1786,7 +1786,7 @@ center of the appropriate side. color from the last entry in the list. This key will automatically set |/pgf/rectangle split use custom fill|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \begin{tikzpicture} \tikzset{every node/.style={rectangle split, draw, minimum width=.5cm}} \node[rectangle split part fill={red!50, green!50, blue!50, yellow!50}] {}; @@ -1803,7 +1803,7 @@ center of the appropriate side. considered unavailable. They are (unavoidably) defined, but default to other anchor positions. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.multipart}}] \Huge \begin{tikzpicture} \node[name=s,shape=rectangle split, rectangle split parts=4, shape example, @@ -1844,7 +1844,7 @@ border of the main shape to which the pointer is connected is determined automatically. However, the pointer is ignored when calculating the minimum size of the shape, and also when positioning anchors. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \begin{tikzpicture}[remember picture] \node[ellipse callout, draw] (hallo) {Hallo!}; \end{tikzpicture} @@ -1860,7 +1860,7 @@ pointer, on the other hand, is much simpler: it points to the specified coordinate absolutely (and can even point to named coordinates in different pictures). % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \begin{tikzpicture}[remember picture, note/.style={rectangle callout, fill=#1}] \draw [help lines] grid(3,2); \node [note=red!50, callout relative pointer={(0,1)}] at (3,1) {Relative}; @@ -1902,7 +1902,7 @@ following key: Moves the callout pointer towards the center of the callout's main shape by \meta{distance}. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \begin{tikzpicture} \tikzset{callout/.style={ellipse callout, callout pointer arc=30, callout absolute pointer={#1}}} @@ -1930,7 +1930,7 @@ following key: not to be used to used to position the shape as it is calculated whilst the shape is being drawn. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \Huge \begin{tikzpicture} \node[name=s,shape=rectangle callout, callout relative pointer={(1.25cm,-1cm)}, @@ -1967,7 +1967,7 @@ following key: the |pointer| anchor can only be used to position the shape when the relative anchor is specified. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \Huge \begin{tikzpicture} \node[name=s,shape=ellipse callout, callout relative pointer={(1.25cm,-1cm)}, @@ -1991,10 +1991,10 @@ following key: \begin{shape}{cloud callout} This shape is a callout whose main shape is a cloud which fits the node contents. The pointer is segmented, consisting of a series of shrinking - ellipses. This callout requires the symbol shape library (for the cloud + ellipses. This callout requires the |shapes.callouts| library (for the cloud shape). If this library is not loaded an error will result. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \begin{tikzpicture} \node[cloud callout, cloud puffs=15, aspect=2.5, cloud puff arc=120, shading=ball,text=white] {\bf Imagine...}; @@ -2038,7 +2038,7 @@ following key: anchor is specified. Note that the center of the last segment is drawn at the |pointer| anchor. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.callouts}}] \Huge \begin{tikzpicture} \node[name=s, shape=cloud callout, style=shape example, cloud puffs=11, aspect=1.5, @@ -2073,7 +2073,7 @@ following key: diagonal lines between the corners of the node's bounding box. Here is an example: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \node [cross out,draw=red] at (1.5,1) {cross out}; @@ -2082,14 +2082,14 @@ following key: A useful application is inside text as in the following example: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! \end{codeexample} This shape inherits all anchors from the |rectangle| shape, see also the following figure: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \Huge \begin{tikzpicture} \node[name=s,shape=cross out,shape example] {cross out\vrule width 1pt height 2cm}; @@ -2111,7 +2111,7 @@ Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! This shape is identical to the |cross out| shape, only its foreground path consists of a single line from the lower left to the upper right. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \end{codeexample} @@ -2121,7 +2121,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \begin{shape}{rounded rectangle} This shape is a rectangle which can have optionally rounded sides. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \node[rounded rectangle, draw, fill=red!20]{Hallo}; \end{tikzpicture} @@ -2134,7 +2134,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! Sets the length of the arcs for the rounded ends. Recommended values for \meta{angle} are between |90| and |180|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \matrix[row sep=5pt, every node/.style={draw, rounded rectangle}]{ \node[rounded rectangle arc length=180] {180}; \\ @@ -2148,7 +2148,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! Sets the style of the rounding for the left side. The permitted values for \meta{arc type} are |concave|, |convex|, or |none|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \matrix[row sep=5pt, every node/.style={draw, rounded rectangle}]{ \node[rounded rectangle west arc=concave] {Concave}; \\ @@ -2174,7 +2174,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! border angle). Note that if only one side is rounded, the |center| anchor will not be the precise center of the shape. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \Huge \begin{tikzpicture} \node[name=s,shape=rounded rectangle, shape example, inner xsep=1.5cm, inner ysep=1cm] @@ -2196,7 +2196,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \begin{shape}{chamfered rectangle} This shape is a rectangle with optionally chamfered corners. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \node[chamfered rectangle, white, fill=red, double=red, draw, very thick] {\bf STOP!}; @@ -2209,7 +2209,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \begin{key}{/pgf/chamfered rectangle angle=\meta{angle} (initially 45)} Sets the angle \emph{from the vertical} for the chamfer. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \tikzset{every node/.style={chamfered rectangle, draw}} \node[chamfered rectangle angle=30] {abc}; @@ -2225,7 +2225,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! \meta{length} is ignored and the chamfered edges are drawn so that they meet in the middle. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \tikzset{every node/.style={chamfered rectangle, draw}} \node[chamfered rectangle xsep=2pt] {def}; @@ -2254,7 +2254,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! chamfered. Two additional values |chamfer all| and |chamfer none|, are also permitted. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \begin{tikzpicture} \tikzset{every node/.style={chamfered rectangle, draw}} \node[chamfered rectangle corners=north west] {ghi}; @@ -2266,7 +2266,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! The anchors for this shape are shown below (anchor |60| is an example of a border angle. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{shapes.misc}}] \Huge \begin{tikzpicture} \node[name=s,shape=chamfered rectangle, chamfered rectangle sep=1cm, |