summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex105
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex104
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex136
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex549
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex458
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex212
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex186
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex31
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex40
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex47
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex77
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex143
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex145
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex319
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex31
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex146
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex117
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex38
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex147
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex35
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex19
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex40
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex40
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex36
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex17
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex77
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex36
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex378
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex102
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex3909
42 files changed, 7884 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
new file mode 100644
index 00000000000..3d2cecc732f
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
@@ -0,0 +1,105 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $
+
+
+
+% New coordinate systems:
+
+\tikzdeclarecoordinatesystem{xyz cylindrical}
+{%
+ \pgfset{/tikz/cs/.cd,angle=0,radius=0,z=0,#1}%
+ \pgfpointcylindrical{\tikz@cs@angle}{\tikz@cs@radius}{\tikz@cs@z}%
+}
+
+\tikzdeclarecoordinatesystem{xyz spherical}
+{%
+ \pgfset{/tikz/cs/.cd,angle=0,radius=0,latitude=0,longitude=0,#1}%
+ \pgfpointspherical{\tikz@cs@angle}{\tikz@cs@latitude}{\tikz@cs@radius}%
+}
+
+\pgfset{/tikz/cs/longitude/.store in=\tikz@cs@angle}
+\pgfset{/tikz/cs/latitude/.store in=\tikz@cs@latitude}
+
+
+% Options for transforming into a plane:
+
+\tikzoption{plane origin}{\def\tikz@plane@origin{\tikz@scan@one@point\pgfutil@firstofone#1}}
+\tikzoption{plane x}{\def\tikz@plane@x{\tikz@scan@one@point\pgfutil@firstofone#1}}
+\tikzoption{plane y}{\def\tikz@plane@y{\tikz@scan@one@point\pgfutil@firstofone#1}}
+
+\let\tikz@plane@origin=\pgfpointorigin
+\def\tikz@plain@x{\pgfpointxy{1}{0}}
+\def\tikz@plain@y{\pgfpointxy{0}{1}}
+
+\tikzoption{canvas is plane}[]{
+ \tikz@canvas@is@plane
+}
+\tikzoption{canvas is xy plane at z}{%
+ \tikz@addtransform{\pgftransformshift{\pgfpointxyz{0}{0}{#1}}}%
+}
+\tikzoption{canvas is yx plane at z}[]{%
+ \def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
+ \def\tikz@plane@x{\pgfpointxyz{0}{1}{#1}}%
+ \def\tikz@plane@y{\pgfpointxyz{1}{0}{#1}}%
+ \tikz@canvas@is@plane
+}
+\tikzoption{canvas is xz plane at y}[]{%
+ \def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}%
+ \def\tikz@plane@x{\pgfpointxyz{1}{#1}{0}}%
+ \def\tikz@plane@y{\pgfpointxyz{0}{#1}{1}}%
+ \tikz@canvas@is@plane
+}
+\tikzoption{canvas is zx plane at y}[]{%
+ \def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}%
+ \def\tikz@plane@x{\pgfpointxyz{0}{#1}{1}}%
+ \def\tikz@plane@y{\pgfpointxyz{1}{#1}{0}}%
+ \tikz@canvas@is@plane
+}
+\tikzoption{canvas is yz plane at x}[]{%
+ \def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}%
+ \def\tikz@plane@x{\pgfpointxyz{#1}{1}{0}}%
+ \def\tikz@plane@y{\pgfpointxyz{#1}{0}{1}}%
+ \tikz@canvas@is@plane
+}
+\tikzoption{canvas is zy plane at x}[]{%
+ \def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}%
+ \def\tikz@plane@x{\pgfpointxyz{#1}{0}{1}}%
+ \def\tikz@plane@y{\pgfpointxyz{#1}{1}{0}}%
+ \tikz@canvas@is@plane
+}
+
+
+
+% Transformation code
+
+\def\tikz@canvas@is@plane{
+ \pgf@process{\tikz@plane@x}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@plane@y}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@process{\tikz@plane@origin}%
+ \edef\pgf@marshal{\noexpand\tikz@addtransform{%
+ \noexpand\pgftransformtriangle
+ {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}
+ \noexpand\pgftransformscale{0.035146}%
+ \noexpand\pgfsetxvec{\noexpand\pgfpoint{1cm}{0cm}}%
+ \noexpand\pgfsetyvec{\noexpand\pgfpoint{0cm}{1cm}}%
+ \noexpand\pgfsetzvec{\noexpand\pgfpoint{0cm}{0cm}}%
+ }}%
+ \pgf@marshal%
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
new file mode 100644
index 00000000000..7926021f8e6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
@@ -0,0 +1,14 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $
+
+\usepgflibrary{arrows}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
new file mode 100644
index 00000000000..12b6bddfe0d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
@@ -0,0 +1,104 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex,v 1.2 2008/02/14 10:31:22 tantau Exp $
+
+
+% Styles for states:
+
+\tikzstyle{every state}= []
+
+\tikzstyle{state without output}= [circle,draw,minimum size=2.5em,every state]
+\tikzstyle{state with output}= [circle split,draw,minimum size=2.5em,every state]
+
+\tikzstyle{accepting by arrow}= [after node path=
+{
+ {
+ [to path=
+ {
+ [->,double=none,every accepting by arrow]
+ --
+ ([shift=(\tikz@accepting@angle:\tikz@accepting@distance)]\tikztostart.\tikz@accepting@angle)
+ node [shape=rectangle,anchor=\tikz@accepting@anchor] {\tikz@accepting@text}
+ }]
+ edge ()
+ }
+}]
+\tikzstyle{every accepting by arrow}=[]
+\tikzstyle{accepting by double}= [double,outer sep=.5\pgflinewidth+.3pt] % .3pt is half double width distance
+
+\tikzstyle{initial by arrow}= [after node path=
+{
+ {
+ [to path=
+ {
+ [->,double=none,every initial by arrow]
+ ([shift=(\tikz@initial@angle:\tikz@initial@distance)]\tikztostart.\tikz@initial@angle)
+ node [shape=rectangle,anchor=\tikz@initial@anchor] {\tikz@initial@text}
+ -- (\tikztostart)}]
+ edge ()
+ }
+}]
+\tikzstyle{every initial by arrow}=[]
+
+\tikzstyle{initial by diamond}=[shape=diamond]
+
+
+\tikzoption{initial text}{\tikzaddafternodepathoption{\def\tikz@initial@text{#1}}}
+\tikzoption{accepting text}{\tikzaddafternodepathoption{\def\tikz@accepting@text{#1}}}
+
+\tikzoption{initial where}{\tikzaddafternodepathoption{\csname tikz@initial@compute@#1\endcsname}}
+\tikzoption{accepting where}{\tikzaddafternodepathoption{\csname tikz@accepting@compute@#1\endcsname}}
+
+\tikzoption{initial distance}{\tikzaddafternodepathoption{\def\tikz@initial@distance{#1}}}
+\tikzoption{accepting distance}{\tikzaddafternodepathoption{\def\tikz@accepting@distance{#1}}}
+
+\def\tikz@initial@text{start}
+\def\tikz@accepting@text{}
+
+\def\tikz@initial@distance{3ex}
+\def\tikz@accepting@distance{3ex}
+
+\def\tikz@initial@compute@above{\def\tikz@initial@angle{90}\def\tikz@initial@anchor{south}}
+\def\tikz@initial@compute@below{\def\tikz@initial@angle{270}\def\tikz@initial@anchor{north}}
+\def\tikz@initial@compute@left{\def\tikz@initial@angle{180}\def\tikz@initial@anchor{east}}
+\def\tikz@initial@compute@right{\def\tikz@initial@angle{0}\def\tikz@initial@anchor{west}}
+
+\def\tikz@initial@angle{180}
+\def\tikz@initial@anchor{east}
+
+\def\tikz@accepting@compute@above{\def\tikz@accepting@angle{90}\def\tikz@accepting@anchor{south}}
+\def\tikz@accepting@compute@below{\def\tikz@accepting@angle{270}\def\tikz@accepting@anchor{north}}
+\def\tikz@accepting@compute@left{\def\tikz@accepting@angle{180}\def\tikz@accepting@anchor{east}}
+\def\tikz@accepting@compute@right{\def\tikz@accepting@angle{0}\def\tikz@accepting@anchor{west}}
+
+\def\tikz@accepting@angle{0}
+\def\tikz@accepting@anchor{west}
+
+
+\tikzstyle{initial above}= [initial by arrow,initial where=above]
+\tikzstyle{initial below}= [initial by arrow,initial where=below]
+\tikzstyle{initial left}= [initial by arrow,initial where=left]
+\tikzstyle{initial right}= [initial by arrow,initial where=right]
+
+\tikzstyle{accepting above}= [accepting by arrow,accepting where=above]
+\tikzstyle{accepting below}= [accepting by arrow,accepting where=below]
+\tikzstyle{accepting left}= [accepting by arrow,accepting where=left]
+\tikzstyle{accepting right}= [accepting by arrow,accepting where=right]
+
+
+% Defaults:
+
+\tikzstyle{state}= [state without output]
+\tikzstyle{accepting}= [accepting by double]
+\tikzstyle{initial}= [initial by arrow]
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
new file mode 100644
index 00000000000..c1a25628a08
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
@@ -0,0 +1,136 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $
+
+
+% Layers
+
+\pgfdeclarelayer{background}
+\pgfsetlayers{background,main}
+
+
+% Main style
+
+\tikzstyle{background rectangle}= [draw]
+\tikzstyle{background top}= [draw]
+\tikzstyle{background bottom}= [draw]
+\tikzstyle{background left}= [draw]
+\tikzstyle{background right}= [draw]
+\tikzstyle{background grid}= [help lines,draw]
+
+\tikzoption{inner frame sep}{\def\tikz@framexsep{#1}\def\tikz@frameysep{#1}}
+\tikzoption{inner frame xsep}{\def\tikz@framexsep{#1}}
+\tikzoption{inner frame ysep}{\def\tikz@frameysep{#1}}
+\def\tikz@framexsep{1ex}
+\def\tikz@frameysep{1ex}
+
+\tikzoption{outer frame sep}{\def\tikz@outerframexsep{#1}\def\tikz@outerframeysep{#1}}
+\tikzoption{outer frame xsep}{\def\tikz@outerframexsep{#1}}
+\tikzoption{outer frame ysep}{\def\tikz@outerframeysep{#1}}
+\def\tikz@outerframexsep{0ex}
+\def\tikz@outerframeysep{0ex}
+
+
+% Looseness
+
+\tikzstyle{loose background}= [inner frame sep=2ex]
+\tikzstyle{tight background}= [inner frame sep=0ex]
+
+
+
+% Showing background styles
+
+\tikzstyle{framed}= [style=show background rectangle]
+\tikzstyle{gridded}= [style=show background grid]
+
+\tikzstyle{show background rectangle}=[execute at end picture=\tikz@background@framed]
+\tikzstyle{show background top}= [execute at end picture=\tikz@background@top]
+\tikzstyle{show background bottom}= [execute at end picture=\tikz@background@bottom]
+\tikzstyle{show background left}= [execute at end picture=\tikz@background@left]
+\tikzstyle{show background right}= [execute at end picture=\tikz@background@right]
+\tikzstyle{show background grid}= [execute at end picture=\tikz@background@grid]
+
+
+% Implementation
+
+\def\tikz@background@save{%
+ \pgftransformreset%
+ \ifx\tikz@bg@minx\@undefined%
+ \pgf@xb=\pgf@picminx%
+ \pgf@yb=\pgf@picminy%
+ \pgf@xc=\pgf@picmaxx%
+ \pgf@yc=\pgf@picmaxy%
+ \pgfmathsetlength{\pgf@x}{\tikz@framexsep}%
+ \pgfmathsetlength{\pgf@y}{\tikz@frameysep}%
+ \advance\pgf@xb by-\pgf@x%
+ \advance\pgf@yb by-\pgf@y%
+ \advance\pgf@xc by\pgf@x%
+ \advance\pgf@yc by\pgf@y%
+ \edef\tikz@bg@minx{\the\pgf@xb}%
+ \edef\tikz@bg@miny{\the\pgf@yb}%
+ \edef\tikz@bg@maxx{\the\pgf@xc}%
+ \edef\tikz@bg@maxy{\the\pgf@yc}%
+ \pgfmathsetlength{\pgf@x}{\tikz@outerframexsep}%
+ \pgfmathsetlength{\pgf@y}{\tikz@outerframeysep}%
+ \advance\pgf@xb by-\pgf@x%
+ \advance\pgf@yb by-\pgf@y%
+ \advance\pgf@xc by\pgf@x%
+ \advance\pgf@yc by\pgf@y%
+ \edef\tikz@bg@outerminx{\the\pgf@xb}%
+ \edef\tikz@bg@outerminy{\the\pgf@yb}%
+ \edef\tikz@bg@outermaxx{\the\pgf@xc}%
+ \edef\tikz@bg@outermaxy{\the\pgf@yc}%
+ \fi%
+}
+
+\def\tikz@background@framed{%
+ \tikz@background@save%
+ \pgfonlayer{background}
+ \path[style=background rectangle] (\tikz@bg@minx,\tikz@bg@miny) rectangle (\tikz@bg@maxx,\tikz@bg@maxy);
+ \endpgfonlayer
+}
+
+\def\tikz@background@top{%
+ \tikz@background@save%
+ \pgfonlayer{background}
+ \path[style=background top] (\tikz@bg@outerminx,\tikz@bg@maxy) -- (\tikz@bg@outermaxx,\tikz@bg@maxy);
+ \endpgfonlayer
+}
+
+\def\tikz@background@bottom{%
+ \tikz@background@save%
+ \pgfonlayer{background}
+ \path[style=background bottom] (\tikz@bg@outerminx,\tikz@bg@miny) -- (\tikz@bg@outermaxx,\tikz@bg@miny);
+ \endpgfonlayer
+}
+
+\def\tikz@background@left{%
+ \tikz@background@save%
+ \pgfonlayer{background}
+ \path[style=background left] (\tikz@bg@minx,\tikz@bg@outerminy) -- (\tikz@bg@minx,\tikz@bg@outermaxy);
+ \endpgfonlayer
+}
+
+\def\tikz@background@right{%
+ \tikz@background@save%
+ \pgfonlayer{background}
+ \path[style=background right] (\tikz@bg@maxx,\tikz@bg@outerminy) -- (\tikz@bg@maxx,\tikz@bg@outermaxy);
+ \endpgfonlayer
+}
+
+\def\tikz@background@grid{%
+ \tikz@background@save%
+ \pgfonlayer{background}
+ \path[style=background grid] (\tikz@bg@minx,\tikz@bg@miny) grid (\tikz@bg@maxx,\tikz@bg@maxy);
+ \endpgfonlayer
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
new file mode 100644
index 00000000000..f79f5343bb5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
@@ -0,0 +1,549 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex,v 1.5 2008/02/04 17:19:55 tantau Exp $
+
+%
+%
+% Part I: The let path command
+%
+%
+
+
+%
+% Syntax: let \p{name1} = (coord), \p{name2} = (coord), ... in ...
+%
+% Currently (this may get more fancy in the future), the (coord)s are
+% evaluated one by one. If the first evaluates to, say, (10pt,20pt),
+% the macro \p{name1} is set to "10pt,20pt" (without parantheses), the
+% macro \x{name1} is set to "10pt" and the macro \y{name1} is set to
+% "20pt".
+%
+% If you use a number for {name}, you need no parantheses, so you
+% could write:
+%
+% \draw let
+% \p1 = (1,1),
+% \p2 = ($ 2.5*(3,2) $)
+% in
+% (\x1,\x2) -- (\y1,\y2);
+
+\def\tikz@let@command et{%
+ \let\p=\tikz@cc@dop%
+ \let\x=\tikz@cc@dox%
+ \let\y=\tikz@cc@doy%
+ \let\n=\tikz@cc@don%
+ \pgfutil@ifnextchar i{\tikz@cc@stop@let}{\tikz@cc@handle@line}%
+}
+\def\tikz@cc@handle@line{%
+ \pgfutil@ifnextchar\p{%
+ \tikz@cc@handle@coor%
+ }{%
+ \pgfutil@ifnextchar\n{%
+ \tikz@cc@handle@num%
+ }{%
+ \PackageError{tikz}{``\string\p'' or ``\string\n'' expected}{}%
+ }%
+ }%
+}
+\def\tikz@cc@handle@num\n#1#2=#3{%
+ \pgfmathparse{#3}%
+ \expandafter\edef\csname tikz@cc@n@#1\endcsname{\pgfmathresult\ifpgfmathunitsdeclared pt\fi}
+ \pgfutil@ifnextchar,{\tikz@cc@handle@nextline}{\tikz@cc@stop@let}%
+}
+\def\tikz@cc@handle@coor\p#1#2={%
+ \def\tikz@cc@coord@name{#1}%
+ \tikz@scan@one@point\tikz@cc@dolet%
+}
+\def\tikz@cc@dolet#1{%
+ \pgf@process{#1}%
+ \expandafter\edef\csname tikz@cc@p@\tikz@cc@coord@name\endcsname{\the\pgf@x,\the\pgf@y}%
+ \expandafter\edef\csname tikz@cc@x@\tikz@cc@coord@name\endcsname{\the\pgf@x}%
+ \expandafter\edef\csname tikz@cc@y@\tikz@cc@coord@name\endcsname{\the\pgf@y}%
+ \pgfutil@ifnextchar,{\tikz@cc@handle@nextline}{\tikz@cc@stop@let}%
+}
+\def\tikz@cc@handle@nextline,{%
+ \tikz@cc@handle@line%
+}
+\def\tikz@cc@stop@let in{%
+ \tikz@scan@next@command%
+}%
+
+\def\tikz@cc@dop#1{\csname tikz@cc@p@#1\endcsname}
+\def\tikz@cc@dox#1{\csname tikz@cc@x@#1\endcsname}
+\def\tikz@cc@doy#1{\csname tikz@cc@y@#1\endcsname}
+\def\tikz@cc@don#1{\csname tikz@cc@n@#1\endcsname}
+
+
+
+%
+%
+% Part II: The ($...$) parser
+%
+%
+
+\def\tikz@parse@calculator#1(${%$
+ \def\tikz@cc@command{#1}%
+ \begingroup%
+ %
+ % Parse main computation. It's a series of optional factors in front
+ % of coordiantes.
+ %
+ \pgf@xa=0pt% We accumulate the result in here.
+ \pgf@ya=0pt%
+ \tikz@cc@parse+%
+}
+
+\def\tikz@cc@parse{%
+ \pgfutil@ifnextchar${%$
+ % Ok, we found the end...
+ \tikz@cc@end%
+ }
+ {\pgfutil@ifnextchar+{%
+ % Ok, we found a coordinate...
+ \tikz@cc@add%
+ }{%
+ \pgfutil@ifnextchar-{%
+ \tikz@cc@sub%
+ }{%
+ \PackageError{tikz}{+ or - expected}{}%
+ \tikz@cc@end$%$
+ }%
+ }%
+ }%
+}
+
+%
+% The end is reached with $
+%
+\def\tikz@cc@end$#1){%$
+ \xdef\tikz@marshal{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \endgroup%
+ \expandafter\tikz@cc@command\expandafter{\tikz@marshal}%
+}
+
+
+%
+% Another coordinate with +/-, possibly with a factor
+%
+\def\tikz@cc@add+{%
+ \def\tikz@cc@factor{1}%
+ \tikz@cc@factororcoordinate%
+}
+\def\tikz@cc@sub-{%
+ \def\tikz@cc@factor{-1}%
+ \tikz@cc@factororcoordinate%
+}
+
+%
+% Check for a factor: If we see a (, its a coordinate...
+%
+\def\tikz@cc@factororcoordinate{%
+ \pgfutil@ifnextchar({%)
+ % Ok, found coordinate
+ \tikz@cc@coordinate%
+ }{%
+ \tikz@cc@parse@factor%
+ }%
+}
+
+%
+% ... otherwise it's a factor. It ends at ...*(
+%
+\def\tikz@cc@parse@factor#1*({%
+ \pgfmathparse{#1*\tikz@cc@factor}%
+ \let\tikz@cc@factor=\pgfmathresult%
+ \tikz@cc@coordinate(%)
+}
+
+\def\tikz@cc@coordinate{%
+ \tikz@scan@absolute\tikz@cc@after@coordinate%
+}
+\def\tikz@cc@after@coordinate#1{%
+ \pgf@process{#1}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \tikz@cc@mid@checks%
+}
+
+
+%
+% A coordinate can be followed by !...!(...)
+%
+
+\def\tikz@cc@mid@checks{
+ \pgfutil@ifnextchar!{%
+ \tikz@cc@mid%
+ }{%
+ \advance\pgf@xa by\tikz@cc@factor\pgf@xb%
+ \advance\pgf@ya by\tikz@cc@factor\pgf@yb%
+ \tikz@cc@parse% continue
+ }%
+}
+
+\def\tikz@cc@mid!{%
+ \pgfutil@ifnextchar({%
+ \tikz@scan@one@point\tikz@cc@project%
+ }{%
+ \tikz@cc@mid@num%
+ }%
+}
+
+%
+% Partway case: (coord a)!number!(coord b)
+%
+% Returns the position that is at <number> fraction on the way from a
+% to b. This, (a)!0!(b) is (a), (a)!.5!(b) is the middle and (a)!1!(b)
+% is (b)
+%
+\def\tikz@cc@mid@num#1!{%
+ \pgfmathparse{#1}%
+ \ifpgfmathunitsdeclared%
+ \let\tikz@cc@mid@unit=\pgfmathresult%
+ \expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@unit%
+ \else%
+ \let\tikz@cc@mid@factor=\pgfmathresult%
+ \pgfmathparse{1-\tikz@cc@mid@factor}%
+ \let\tikz@cc@mid@factor@one=\pgfmathresult%
+ \expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@num%
+ \fi%
+}
+
+\def\tikz@cc@after@num#1{%
+ \pgf@process{#1}%
+ \pgf@xb=\tikz@cc@mid@factor@one\pgf@xb%
+ \pgf@yb=\tikz@cc@mid@factor@one\pgf@yb%
+ \advance\pgf@xb by\tikz@cc@mid@factor\pgf@x%
+ \advance\pgf@yb by\tikz@cc@mid@factor\pgf@y%
+ \tikz@cc@mid@checks%
+}
+
+
+
+%
+% Distance case: (coord a)!dimension!(coord b)
+%
+% Returns the position that is at <dimension> removed from (coord a)
+% in the direction of (coord b).
+%
+
+\def\tikz@cc@after@unit#1{%
+ \pgf@process{#1}%
+ \advance\pgf@x by-\pgf@xb%
+ \advance\pgf@y by-\pgf@yb%
+ \pgf@process{\pgfpointnormalised{}}%
+ \advance\pgf@xb by\tikz@cc@mid@unit\pgf@x%
+ \advance\pgf@yb by\tikz@cc@mid@unit\pgf@y%
+ \tikz@cc@mid@checks%
+}
+
+%
+% Projection case: (a)!(p)!(b)
+%
+% Projection of p on line from a to b
+%
+\def\tikz@cc@project#1{%
+ \pgf@process{#1}%
+ % Save in c
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@project\tikz@cc@scan@ex%
+}
+
+\def\tikz@cc@scan@ex!{}
+
+\def\tikz@cc@after@project#1{%
+ \pgf@process{#1}%
+ % Ok, now we need to project (xc,yc) on the line (xb,xc) to (x,y)
+ \advance\pgf@x by-\pgf@xb%
+ \advance\pgf@y by-\pgf@yb%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \pgf@process{\pgfpointnormalised{}}%
+ % Scalar product
+ \pgf@xc=\pgf@sys@tonumber{\pgf@xc}\pgf@x%
+ \advance\pgf@xc by\pgf@sys@tonumber{\pgf@yc}\pgf@y%
+ % and add
+ \advance\pgf@xb by\pgf@sys@tonumber{\pgf@xc}\pgf@x%
+ \advance\pgf@yb by\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \tikz@cc@mid@checks%
+}
+
+%
+% Rotational scanner: radius:(x)
+%
+
+\def\tikz@cc@scan@rot#1{%
+ \pgfutil@ifnextchar({%)
+ \tikz@scan@one@point#1% normal
+ }%
+ {
+ \def\tikz@cc@scan@rot@cmd{#1}
+ \tikz@cc@scan@one@rot%
+ }%
+}
+
+\def\tikz@cc@scan@one@rot#1:{%
+ \def\tikz@cc@scan@rot@angle{#1}%
+ \tikz@scan@one@point\tikz@cc@handle@rot%
+}
+
+\def\tikz@cc@handle@rot#1{%
+ \pgf@process{#1}%
+ % Ok, now we need to rotate x/y around xb/xb by ...rot@angle
+ {%
+ \pgftransformreset%
+ % Save them...
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgftransformshift{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgftransformrotate{\tikz@cc@scan@rot@angle}%
+ \pgftransformshift{\pgfqpoint{-\pgf@xb}{-\pgf@yb}}%
+ \pgfpointtransformed{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \expandafter
+ }%
+ \edef\tikz@marshal{\noexpand\tikz@cc@scan@rot@cmd{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ \tikz@marshal%
+}
+
+
+
+
+%
+%
+% Part III: Calculation coordinate systems
+%
+%
+
+% Tangent cs: Keys are a node and a point. Depending on the type of
+% node, the appropriate tanent computation should be done.
+
+\tikzdeclarecoordinatesystem{tangent}
+{%
+ \tikzset{cs/.cd,#1}%
+ \expandafter\ifx\csname tikz@tangent@\tikz@cs@type\endcsname\relax%
+ \PackageError{tikz}{I do not know how to compute the tangent to
+ a \tikz@cs@type}{}%
+ \pgfpointorigin%
+ \else%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@lib@do@tangent\tikz@cs@point%
+ \fi%
+}
+
+\tikzset{cs/node/.code=\tikz@cs@unpack{\tikz@cs@node}{\tikz@cs@type}{#1}}
+\tikzset{cs/point/.store in=\tikz@cs@point}
+
+\def\tikz@lib@do@tangent{\csname tikz@tangent@\tikz@cs@type\endcsname}
+
+\def\tikz@tangent@coordinate#1{%
+ \pgfpointanchor{\tikz@cs@node}{center}%
+}
+
+\def\tikz@tangent@circle#1{%
+ {%
+ % Step 1: Compute the transformed position of the input:
+ \pgf@process{\pgfpointtransformed{#1}}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ %
+ % Step 2: Compute vector from center of circle to transformed #1
+ %
+ \pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikz@cs@node}{center}}}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ %
+ % Step 2: Reset transformations, they distract...
+ %
+ \pgftransformreset%
+ %
+ % Step 3: Transform to the center of the circle.
+ %
+ \pgftransformshift{\pgfpointanchor{\tikz@cs@node}{center}}%
+ %
+ % Step 4: Compute the radius
+ %
+ \pgf@process{\pgfpointanchor{\tikz@cs@node}{east}}%
+ \pgf@xc=\pgf@x%
+ %
+ % Now, (xa,ya) is a point. Compute the tangent from this point to
+ % a circle around the origin of radius xc.
+ %
+ % acos(radius/veclen(xa,ya)) is the angle of the tangent.
+ \pgfmathparse{veclen(\the\pgf@xa,\the\pgf@ya)}
+ \pgfmathparse{acos(\the\pgf@xc/\pgfmathresult)}
+ \ifnum\pgfkeysvalueof{/tikz/cs/solution}>1\relax%
+ \pgfmathsubtract{0}{\pgfmathresult}%
+ \fi%
+ \let\tikz@lib@temp=\pgfmathresult%
+ %
+ % Now \pgfmathparse contains the desired angle. Use this to
+ % compute the correct position on the circle...
+ %
+ % But, first, rotate to the point.
+ \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}%
+ \pgf@ya=-\pgf@y%
+ \pgftransformcm{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfpointorigin}%
+ % Finally, rotate...
+ \pgf@process{\pgfpointtransformed{\pgfpointpolar{\tikz@lib@temp}{\the\pgf@xc}}}%
+ %
+ % Ok, undo transformations...
+ }%
+ % \pgf@x, \pgf@y have been smuggled outside by \pgf@process
+ {%
+ \pgftransforminvert%
+ \pgf@process{\pgfpointtransformed{}}%
+ }%
+}
+
+
+% Implementation of intersections
+
+
+\def\tikz@intersect@circle@and@circle{%
+ {%
+ \pgftransformreset% transformations only confuse us, here...
+ %
+ % Compute origin and radius of first circle
+ %
+ \pgf@process{\pgfpointanchor{\tikz@cs@node@a}{center}}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointanchor{\tikz@cs@node@a}{east}}%
+ \advance\pgf@x by-\pgf@xa%
+ \pgf@xc=\pgf@x% ok, pgf@xc is first radius, (xa,ya) is center
+ %
+ % Compute origin and radius of second circle
+ %
+ \pgf@process{\pgfpointanchor{\tikz@cs@node@b}{center}}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@process{\pgfpointanchor{\tikz@cs@node@b}{east}}%
+ \advance\pgf@x by-\pgf@xb%
+ \pgf@yc=\pgf@x% \pgf@yc is second radius, (xb,yb) is center
+ %
+ \pgf@process{%
+ \pgfpointintersectionofcircles{\pgfqpoint{\pgf@xa}{\pgf@ya}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}{\pgf@xc}{\pgf@yc}{\pgfkeysvalueof{/tikz/cs/solution}}%
+ }%
+ }%
+ % \pgf@x, \pgf@y have been smuggled outside by \pgf@process,
+ % reinstall transformations...
+ {%
+ \pgftransforminvert%
+ \pgf@process{\pgfpointtransformed{}}%
+ }%
+}
+
+
+\def\tikz@intersect@line@and@circle{%
+ {%
+ %
+ % Step 1: Get line
+ %
+ \expandafter\tikz@scan@one@point\expandafter\tikz@parse@line\tikz@cs@line@a%
+ \pgf@process{\pgfpointtransformed{}}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\pgf@xc}{\pgf@yc}}}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ %
+ % Step 2: Subtract center of circle
+ %
+ \pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikz@cs@node@b}{center}}}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \advance\pgf@xb by-\pgf@x%
+ \advance\pgf@yb by-\pgf@y%
+ %
+ % Step 3: Reset transformations, they distract...
+ %
+ \pgftransformreset%
+ %
+ % Step 4: Transform to the center of the circle.
+ %
+ \pgftransformshift{\pgfpointanchor{\tikz@cs@node@b}{center}}%
+ %
+ % Step 5: Compute the radius
+ %
+ \pgf@process{\pgfpointanchor{\tikz@cs@node@b}{east}}%
+ \edef\tikz@lib@saved@radius{\pgf@sys@tonumber{\pgf@x}}%
+ %
+ % Step 6: Compute projection of origin on line (xa,ya) -- (xb,yb),
+ % store in (xa,ya)
+ \pgf@x=\pgf@xb%
+ \pgf@y=\pgf@yb%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \pgf@process{\pgfpointnormalised{}}%
+ % Scalar product
+ \pgf@xc=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \advance\pgf@xc by\pgf@sys@tonumber{\pgf@ya}\pgf@y%
+ \pgf@xc=-\pgf@xc%
+ % and add
+ \advance\pgf@xa by\pgf@sys@tonumber{\pgf@xc}\pgf@x%
+ \advance\pgf@ya by\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ %
+ % Now, we have a triangle with a right angle at (xa,ya). The
+ % second point of the triangle is the origin. The third point is
+ % sought.
+ % Save x/y
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ % Square radius
+ \pgf@xb=\tikz@lib@saved@radius pt%
+ %
+ % First, make numbers smaller, in case they are too large
+ %
+ \c@pgf@counta=1\relax%
+ \loop%
+ \ifdim\pgf@xb>50pt%
+ \multiply\c@pgf@counta by2\relax%
+ \divide\pgf@xa by2\relax%
+ \divide\pgf@ya by2\relax%
+ \divide\pgf@xb by2\relax%
+ \repeat%
+ \pgf@xb=\pgf@sys@tonumber{\pgf@xb}\pgf@xb%
+ % Subtract xa^2 + ya^2
+ \pgf@yb=\pgf@sys@tonumber{\pgf@xa}\pgf@xa%
+ \advance\pgf@xb by-\pgf@yb%
+ \pgf@yb=\pgf@sys@tonumber{\pgf@ya}\pgf@ya%
+ \advance\pgf@xb by-\pgf@yb%
+ % Square root
+ \ifdim\pgf@xb<0pt%
+ \pgf@xb=0pt%
+ \fi%
+ \pgfmathsqrt@{\pgf@sys@tonumber{\pgf@xb}}%
+ \pgfmathmultiply@{\pgfmathresult}{\the\c@pgf@counta}%
+ \multiply\pgf@xa by\c@pgf@counta\relax%
+ \multiply\pgf@ya by\c@pgf@counta\relax%
+ \ifnum\pgfkeysvalueof{/tikz/cs/solution}>1\relax%
+ \pgfmathsubtract{0}{\pgfmathresult}%
+ \fi%
+ % Ok, now add things...
+ \advance\pgf@xa by \pgfmathresult\pgf@xc%
+ \advance\pgf@ya by \pgfmathresult\pgf@yc%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\pgf@xa}{\pgf@ya}}}%
+ % Ok, undo transformations...
+ }%
+ % \pgf@x, \pgf@y have been smuggled outside by \pgf@process
+ {%
+ \pgftransforminvert%
+ \pgf@process{\pgfpointtransformed{}}%
+ }%
+}
+
+\def\tikz@intersect@circle@and@line{%
+ % Swap
+ {%
+ \let\tikz@cs@node@b=\tikz@cs@node@a%
+ \let\tikz@cs@line@a=\tikz@cs@line@b%
+ \tikz@intersect@line@and@circle%
+ }%
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
new file mode 100644
index 00000000000..09729059297
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
@@ -0,0 +1,458 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $
+
+
+\pgfutil@usemodule{pgfcalendar}
+
+
+%
+% General options (these options affect all calendars typeset unsind \calendar):
+%
+% Start, end, and code executed for each current date
+%
+
+\tikzoption{dates}{\tikz@lib@cal@parse#1\relax}
+\def\tikz@lib@cal@parse#1to#2\relax{%
+ \def\tikz@lib@cal@start{#1}
+ \def\tikz@lib@cal@end{#2}%
+}
+\tikzoption{execute at begin day scope}{\expandafter\def\expandafter\tikz@atbegin@day\expandafter{\tikz@atbegin@day#1}}
+\tikzoption{execute at end day scope}{%
+ \def\pgf@temp{#1}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@atend@day%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@temp\tikz@atend@day}}
+\tikzoption{execute before day scope}{\expandafter\def\expandafter\tikz@before@day\expandafter{\tikz@before@day#1}}
+\tikzoption{execute after day scope}{\expandafter\def\expandafter\tikz@after@day\expandafter{\tikz@after@day#1}}
+
+\let\tikz@atbegin@day=\pgfutil@empty
+\let\tikz@atend@day=\pgfutil@empty
+\let\tikz@before@day=\pgfutil@empty
+\let\tikz@after@day=\pgfutil@empty
+
+
+
+%
+% Options affecting some calendars:
+%
+
+%
+% Shifts and skips
+%
+
+% Shift between days
+
+\tikzoption{day xshift}{\def\tikz@lib@cal@xshift{#1}}
+\tikzoption{day yshift}{\def\tikz@lib@cal@yshift{#1}}
+
+\def\tikz@lib@cal@yshift{3ex}
+\def\tikz@lib@cal@xshift{3.5ex}
+
+
+% Shift between months
+
+\tikzoption{month xshift}{\def\tikz@lib@cal@month@xshift{#1}}
+\tikzoption{month yshift}{\def\tikz@lib@cal@month@yshift{#1}}
+
+\def\tikz@lib@cal@month@yshift{9ex}
+\def\tikz@lib@cal@month@xshift{9ex}
+
+
+
+
+% Templates for typesetting days, month, years
+
+\tikzoption{day code}{\def\tikzdaycode{#1}}
+\tikzoption{day text}{\def\tikzdaytext{#1}}
+\tikzoption{days}{\tikzstyle{every day}+=[#1]}
+\tikzstyle{every day}=[anchor=base east]
+
+\tikzoption{month code}{\def\tikzmonthcode{#1}}
+\tikzoption{month text}{\def\tikzmonthtext{#1}}
+\tikzstyle{every month}=[]
+
+\tikzoption{year code}{\def\tikzyearcode{#1}}
+\tikzoption{year text}{\def\tikzyeartext{#1}}
+\tikzstyle{every year}=[]
+
+\def\tikzdaycode{\node[name=\pgfcalendarsuggestedname,every day]{\tikzdaytext};}
+\def\tikzmonthcode{\node[every month]{\tikzmonthtext};}
+\def\tikzyearcode{\node[every year]{\tikzyeartext};}
+
+\def\tikzdaytext{\%d-}
+\def\tikzmonthtext{\%mt}
+\def\tikzyeartext{\%y0}
+
+
+% Internal option for storing the "width" of a calendar as a number of
+% days
+
+\tikzoption{tikz@lib@cal@width}{\def\tikz@lib@cal@width{#1}}
+
+\def\tikz@lib@cal@width{1}
+
+%
+% Days on a line
+%
+
+\tikzstyle{day list downward}=[%
+ execute before day scope={
+ \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
+ {%
+ % On first of month, except when first date in calendar.
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@month@yshift}%
+ \pgftransformyshift{-\pgf@y}
+ }%
+ }{}%
+ },
+ execute after day scope={\pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}\pgftransformyshift{-\pgf@y}},
+ tikz@lib@cal@width=1
+]
+\tikzstyle{day list upward}=[%
+ execute before day scope={
+ \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
+ {%
+ % On first of month, except when first date in calendar.
+ \pgftransformyshift{\tikz@lib@cal@month@yshift}%
+ }%
+ }{}%
+ },
+ execute after day scope={\pgftransformyshift\tikz@lib@cal@yshift},
+ tikz@lib@cal@width=1
+]
+\tikzstyle{day list right}=[%
+ execute before day scope={
+ \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
+ {%
+ % On first of month, except when first date in calendar.
+ \pgftransformxshift{\tikz@lib@cal@month@xshift}%
+ }%
+ }{}%
+ },
+ execute after day scope={\pgftransformxshift\tikz@lib@cal@xshift},
+ tikz@lib@cal@width=30% not quite right, but close enough in most cases...
+]
+
+\tikzstyle{day list left}=[%
+ execute before day scope={
+ \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
+ {%
+ % On first of month, except when first date in calendar.
+ \pgfmathsetlength{\pgf@x}{\tikz@lib@cal@month@xshift}
+ \pgftransformxshift{-\pgf@x}%
+ }%
+ }{}%
+ },
+ execute after day scope={
+ \pgfmathsetlength{\pgf@x}{\tikz@lib@cal@xshift}
+ \pgftransformxshift{-\pgf@x}%
+ },
+ tikz@lib@cal@width=30% not quite right, but close enough in most cases...
+]
+
+
+
+%
+% Week list
+%
+
+\tikzstyle{week list}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
+ {%
+ % On first of month, except when first date in calendar.
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@month@yshift}%
+ \pgftransformyshift{-\pgf@y}
+ }%
+ }{}%
+ },
+ execute at begin day scope={%
+ \pgfmathsetlength\pgf@x{\tikz@lib@cal@xshift}%
+ \pgf@x=\pgfcalendarcurrentweekday\pgf@x%
+ \pgftransformxshift{\pgf@x}%
+ },
+ execute after day scope={%
+ \ifdate{Sunday}{%
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
+ \pgftransformyshift{-\pgf@y}
+ }{}%
+ },
+ tikz@lib@cal@width=7
+]
+
+
+
+%
+% Month list
+%
+
+\tikzstyle{month list}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
+ {%
+ % On first of month, except when first date in calendar.
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@month@yshift}%
+ \pgftransformyshift{-\pgf@y}
+ }%
+ }{}%
+ \ifdate{day of month=1}
+ {%
+ \edef\tikz@lib@cal@month@list@start{\pgfcalendarcurrentweekday}%
+ }{}%
+ \ifdate{equals=\pgfcalendarbeginiso}%
+ {%
+ % Computer day of week for start of month
+ {%
+ \c@pgf@counta=\pgfcalendarcurrentjulian%
+ \advance\c@pgf@counta by-\pgfcalendarcurrentday%
+ \advance\c@pgf@counta by1\relax%
+ \pgfcalendarjuliantoweekday{\c@pgf@counta}{\c@pgf@countb}%
+ \xdef\pgf@temp{\the\c@pgf@countb}%
+ }%
+ \let\tikz@lib@cal@month@list@start=\pgf@temp%
+ }{}%
+ },
+ execute at begin day scope={%
+ \pgfmathsetlength\pgf@xa{\tikz@lib@cal@xshift}%
+ \pgf@xb=\pgfcalendarcurrentday\pgf@xa%
+ \advance\pgf@xb by\tikz@lib@cal@month@list@start\pgf@xa%
+ \advance\pgf@xb by-\pgf@xa\relax%
+ \pgftransformxshift{\pgf@xb}%
+ },
+ tikz@lib@cal@width=37
+]
+
+
+
+
+%
+% Month labels
+%
+
+\tikzstyle{month label left}=[%
+ execute before day scope={\ifdate{day of month=1}{\tikzmonthcode}{}},
+ every month/.append style={anchor=base east,xshift=-3.5ex}
+]
+
+\tikzstyle{month label left vertical}=[%
+ execute before day scope={\ifdate{day of month=1}{\tikzmonthcode}{}},
+ every month/.append style={anchor=base east,xshift=-4.5ex,yshift=2.25ex,rotate=90}
+]
+
+\tikzstyle{month label right}=[%
+execute before day scope={\ifdate{day of month=1}{%
+ {%
+ \pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
+ \pgftransformxshift{\tikz@lib@cal@width\pgf@xa}%
+ \pgftransformxshift{-\pgf@xa}%
+ \tikzmonthcode%
+ }}{}},
+ every month/.append style={anchor=base west,xshift=1ex}
+]
+
+\tikzstyle{month label right vertical}=[%
+ execute before day scope={\ifdate{day of month=1}{%
+ {%
+ \pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
+ \pgftransformxshift{\tikz@lib@cal@width\pgf@xa}%
+ \pgftransformxshift{-\pgf@xa}%
+ \tikzmonthcode%
+ }}{}},
+ every month/.append style={anchor=base west,xshift=2ex,yshift=2.25ex,rotate=-90}
+]
+
+\tikzstyle{month label above centered}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{%
+ {
+ \pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
+ \pgf@xb=\tikz@lib@cal@width\pgf@xa%
+ \advance\pgf@xb by-\pgf@xa%
+ \pgf@xb=.5\pgf@xb%
+ \pgftransformxshift{\pgf@xb}%
+ \pgftransformxshift{-1.5ex}%
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
+ \pgftransformyshift{1.25\pgf@y}
+ \tikzmonthcode%
+ }
+ }{}},
+ every month/.append style={anchor=base}
+]
+
+\tikzstyle{month label above left}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{%
+ {
+ \pgftransformxshift{-3.25ex}%
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
+ \pgftransformyshift{1.25\pgf@y}
+ \tikzmonthcode%
+ }
+ }{}},
+ every month/.append style={anchor=base west}
+]
+
+
+
+\tikzstyle{month label above right}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{%
+ {
+ \pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
+ \pgf@xb=\tikz@lib@cal@width\pgf@xa%
+ \advance\pgf@xb by-\pgf@xa%
+ \pgftransformxshift{\pgf@xb}%
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
+ \pgftransformyshift{1.25\pgf@y}
+ \tikzmonthcode%
+ }
+ }{}},
+ every month/.append style={anchor=base east}
+]
+
+\tikzstyle{month label below centered}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{%
+ {
+ \pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
+ \pgf@xb=\tikz@lib@cal@width\pgf@xa%
+ \advance\pgf@xb by-\pgf@xa%
+ \pgf@xb=.5\pgf@xb%
+ \pgftransformxshift{\pgf@xb}%
+ \pgftransformxshift{-1.5ex}%
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
+ \pgftransformyshift{-1.25\pgf@y}
+ \tikzmonthcode%
+ }
+ }{}},
+ every month/.append style={anchor=base}
+]
+
+\tikzstyle{month label below left}=[%
+ execute before day scope={%
+ \ifdate{day of month=1}{%
+ {
+ \pgftransformxshift{-3.25ex}%
+ \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
+ \pgftransformyshift{-1.25\pgf@y}
+ \tikzmonthcode%
+ }
+ }{}},
+ every month/.append style={anchor=base west}
+]
+
+
+
+%
+% Code of the actual \calendar command (tikz.code.tex contains \let\calendar=\tikz@lib@cal@calendar):
+%
+
+\def\tikz@lib@cal@calendar{%
+ \begingroup%
+ \let\tikz@lib@cal@ifs=\pgfutil@empty%
+ \tikz@expandcount=1000\relax%
+ \tikzset{name=,at={(0,0)}}%
+ \let\%=\pgfcalendarshorthand%
+ \tikzset{every calendar/.try}%
+ \tikz@lib@cal@scanner%
+}
+
+\def\tikz@lib@cal@scanner{%
+ \afterassignment\tikz@lib@cal@handle\let\@let@token=%
+}
+
+\def\tikz@lib@cal@handle{%
+ \let\@next=\tikz@lib@cal@expand%
+ \ifx\@let@token;%
+ \let\@next=\tikz@lib@cal@stop%
+ \else%
+ \ifx\@let@token(%)
+ \let\@next=\tikz@lib@cal@name%
+ \else%
+ \ifx\@let@token a%
+ \let\@next=\tikz@lib@cal@at%
+ \else%
+ \ifx\@let@token[%
+ \let\@next=\tikz@lib@cal@option%
+ \else%
+ \ifx\@let@token i%
+ \let\@next=\tikz@lib@cal@if%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \@next%
+}
+\def\tikz@lib@cal@expand{%
+ \advance\tikz@expandcount by -1%
+ \ifnum\tikz@expandcount<0\relax%
+ \PackageError{tikz}{Giving up on this calendar}{}%
+ \let\@next=\tikz@lib@cal@end%
+ \else%
+ \let\@next=\tikz@lib@cal@@expand
+ \fi%
+ \@next}
+
+\def\tikz@lib@cal@@expand{\expandafter\tikz@lib@cal@scanner\@let@token}
+
+
+\def\tikz@lib@cal@name#1){%
+ \tikzset{name=#1}%
+ \tikz@lib@cal@scanner%
+}
+\def\tikz@lib@cal@at t#1(#2){%
+ \tikzset{at={(#2)}}%
+ \tikz@lib@cal@scanner%
+}
+\def\tikz@lib@cal@option#1]{%
+ \tikzset{#1}%
+ \tikz@lib@cal@scanner%
+}
+\def\tikz@lib@cal@if f#1(#2){%
+ \pgfutil@ifnextchar[{\tikz@lib@cal@if@opt{#2}}{\tikz@lib@cal@if@code{#2}}}%}
+
+\def\tikz@lib@cal@if@opt#1[#2]{\tikz@lib@cal@if@code{#1}{\tikzset{#2}}}
+\def\tikz@lib@cal@if@code#1#2{%
+ \pgfutil@ifnextchar e{\tikz@lib@cal@if@else{#1}{#2}}{\tikz@lib@cal@if@else{#1}{#2}else{}}}
+
+\def\tikz@lib@cal@if@else#1#2else{%
+ \pgfutil@ifnextchar[{\tikz@lib@cal@if@else@opt{#1}{#2}}{\tikz@lib@cal@if@else@code{#1}{#2}}}%}
+\def\tikz@lib@cal@if@else@opt#1#2[#3]{\tikz@lib@cal@if@else@code{#1}{#2}{\tikzset{#3}}}
+\def\tikz@lib@cal@if@else@code#1#2#3{%
+ \expandafter\def\expandafter\tikz@lib@cal@ifs\expandafter{\tikz@lib@cal@ifs\ifdate{#1}{#2}{#3}}%
+ \tikz@lib@cal@scanner%
+}
+\def\tikz@lib@cal@stop{%
+ \pgftransformshift{\tikz@node@at}%
+ \expandafter\pgfcalendar\expandafter{\tikz@fig@name}{\tikz@lib@cal@start}{\tikz@lib@cal@end}%
+ {%
+ \tikz@before@day%
+ \scope%
+ \tikz@atbegin@day%
+ \tikz@lib@cal@ifs%
+ \tikzdaycode%
+ \tikz@atend@day%
+ \endscope%
+ \tikz@after@day%
+ }%
+ \endgroup%
+}
+
+\tikzoption{if}{%
+ \let\tikz@lib@cal@scanner@orig=\tikz@lib@cal@scanner%
+ \let\tikz@lib@cal@scanner=\relax%
+ \tikz@lib@cal@if f#1\relax%
+ \let\tikz@lib@cal@scanner=\tikz@lib@cal@scanner@orig}
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
new file mode 100644
index 00000000000..0f7e0082611
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
@@ -0,0 +1,212 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex,v 1.4 2008/02/12 23:41:59 tantau Exp $
+
+\tikzset{start chain/.default=,
+ start chain/.code={%
+ \tikz@lib@chain@parse{#1}%
+ \ifx\tikz@lib@chain@name\pgfutil@empty%
+ \def\tikz@lib@chain@name{chain}%
+ \fi%
+ \ifx\tikz@lib@chain@direction\relax%
+ \let\tikz@lib@chain@direction=\tikz@lib@chain@default@direction%
+ \fi%
+ \expandafter\ifx\csname tikz@lib@chain@active@\tikz@lib@chain@name\endcsname\relax%
+ \expandafter\let\csname tikz@lib@chain@active@\tikz@lib@chain@name\endcsname=\pgfutil@empty% does not matter
+ \expandafter\global\expandafter\let\csname tikz@lib@chain@exists@\tikz@lib@chain@name\endcsname=\pgfutil@empty% does not matter
+ % Setup chain parameters
+ \expandafter\gdef\csname tikz@lib@chain@count@\tikz@lib@chain@name\endcsname{0}%
+ \expandafter\global\expandafter\let\csname tikz@lib@chain@dir@\tikz@lib@chain@name\endcsname\tikz@lib@chain@direction%
+ \let\tikz@lib@current@chain=\tikz@lib@chain@name%
+ \let\chainin=\tikz@lib@chainin%
+ \else%
+ \PackageError{tikz}{Chain ``\tikz@lib@chain@name'' is already active}{}%
+ \fi%
+ },
+ continue chain/.default=,
+ continue chain/.code={%
+ \tikz@lib@chain@parse{#1}%
+ \ifx\tikz@lib@chain@name\pgfutil@empty%
+ \let\tikz@lib@chain@name\tikz@lib@current@chain%
+ \fi%
+ \expandafter\ifx\csname tikz@lib@chain@exists@\tikz@lib@chain@name\endcsname\relax%
+ \PackageError{tikz}{Unknown chain ``#1''}{}%
+ \else%
+ \let\tikz@lib@current@chain=\tikz@lib@chain@name%
+ \expandafter\let\csname tikz@lib@chain@active@\tikz@lib@chain@name\endcsname=\pgfutil@empty% does not matter
+ \ifx\tikz@lib@chain@direction\relax%
+ % Just restart...
+ \else%
+ % Setup chain parameters
+ \expandafter\global\expandafter\let\csname tikz@lib@chain@dir@\tikz@lib@chain@name\endcsname\tikz@lib@chain@direction%
+ \fi%
+ \fi%
+ },
+ join/.code=\tikz@lib@parse@join{#1},
+ join/.default={}%
+}
+
+\def\tikz@lib@chain@parse#1{%
+ \pgfutil@in@{going }{#1}%
+ \ifpgfutil@in@%
+ \tikz@lib@chain@going#1\pgf@stop%
+ \else%
+ \pgfutil@in@{placed }{#1}%
+ \ifpgfutil@in@%
+ \tikz@lib@chain@positioning#1\pgf@stop%
+ \else%
+ \def\tikz@lib@chain@name{#1}%
+ \let\tikz@lib@chain@direction\relax%
+ \fi%
+ \fi%
+}
+
+\def\tikz@lib@chain@going#1going #2\pgf@stop{%
+ \def\tikz@lib@chain@name{#1}%
+ \ifx\tikz@lib@chain@name\pgfutil@empty%
+ \else%
+ \tikz@lib@chain@strip#1\pgf@stop%%
+ \fi%
+ \tikz@lib@chain@is@goingtrue%
+ \def\tikz@lib@chain@direction{%
+ \ifx\tikzchainprevious\pgfutil@empty%
+ \else%
+ \tikz@lib@chain@place{#2}%
+ \fi%
+ }%
+}
+
+\def\tikz@lib@chain@positioning#1placed #2\pgf@stop{%
+ \def\tikz@lib@chain@name{#1}%
+ \ifx\tikz@lib@chain@name\pgfutil@empty%
+ \else%
+ \tikz@lib@chain@strip#1\pgf@stop%%
+ \fi%
+ \tikz@lib@chain@is@goingfalse%
+ \def\tikz@lib@chain@direction{\tikz@lib@chain@place{#2}}%
+}
+\newif\iftikz@lib@chain@is@going
+
+
+\tikzset{/tikz/chain default direction/.code=%
+ {%
+ \tikz@lib@chain@parse{#1}%
+ \let\tikz@lib@chain@default@direction=\tikz@lib@chain@direction%
+ },%
+ /tikz/chain default direction=going right
+}
+
+\def\tikz@lib@current@chain{chain}
+
+\pgfutil@g@addto@macro\tikz@node@reset@hook{\let\tikz@lib@chain@caller=\relax}
+\pgfutil@g@addto@macro\tikz@node@begin@hook{\tikz@lib@chain@caller}
+
+\tikzset{
+ on chain/.default=,
+ on chain/.code=\tikz@lib@on@chain{#1}%
+}
+\def\tikz@lib@on@chain#1{%
+ \tikz@lib@chain@parse{#1}%
+ \ifx\tikz@lib@chain@name\pgfutil@empty%
+ \let\tikz@lib@chain@name\tikz@lib@current@chain%
+ \fi%
+ \expandafter\ifx\csname tikz@lib@chain@exists@\tikz@lib@chain@name\endcsname\relax%
+ \PackageError{tikz}{Unknown chain ``\tikz@lib@chain@name''}{}%
+ \else%
+ \c@pgf@counta\csname tikz@lib@chain@count@\tikz@lib@chain@name\endcsname\relax%
+ \ifnum\c@pgf@counta=0\relax%
+ \global\let\tikzchainprevious=\pgfutil@empty%
+ \else
+ \xdef\tikzchainprevious{\tikz@lib@chain@name-\the\c@pgf@counta}%
+ \fi%
+ \advance\c@pgf@counta by1\relax%
+ \xdef\tikzchaincount{\the\c@pgf@counta}%
+ \ifx\tikz@lib@chain@direction\relax%
+ \csname tikz@lib@chain@dir@\tikz@lib@chain@name\endcsname% use default
+ \else%
+ \tikz@lib@chain@direction%
+ \fi%
+ \edef\tikz@lib@chain@caller{\noexpand\tikz@lib@chain@last@found{\tikz@lib@chain@name}}%
+ \fi%
+}
+\def\tikz@lib@chain@last@found#1{%
+ % Increase the count and set name, if necessary.
+ \c@pgf@counta\csname tikz@lib@chain@count@#1\endcsname\relax%
+ \advance\c@pgf@counta by1\relax%
+ \xdef\tikzchaincurrent{#1-\the\c@pgf@counta}%
+ \expandafter\xdef\csname tikz@lib@chain@count@#1\endcsname{\the\c@pgf@counta}%
+ \ifnum\c@pgf@counta=1\relax%
+ \tikzset{alias/.expanded=#1-begin} % Define pseudostart
+ \fi%
+ \tikzset{alias/.expanded=#1-end} % Define pseudostart
+ \tikzset{alias/.expanded=#1-\the\c@pgf@counta} % Define pseudostart
+ \tikz@lib@chain@direction%
+ \tikzset{every on chain/.try}%
+}
+
+
+\def\tikz@lib@chain@place#1{%
+ \pgfutil@in@{=}{#1}%
+ \ifpgfutil@in@%
+ \tikzset{#1}%
+ \else%
+ \tikzset{#1=of \tikzchainprevious}%
+ \fi%
+}
+
+\def\tikz@lib@chain@strip#1 \pgf@stop{%
+ \def\tikz@lib@chain@name{#1}%
+}
+
+\def\tikz@lib@parse@join#1{%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\pgfutil@empty%
+ \tikz@lib@parse@join@by by \pgf@stop%
+ \else%
+ \pgfutil@in@{with }{#1}%
+ \ifpgfutil@in@%
+ \pgfutil@in@{by }{#1}%
+ \ifpgfutil@in@%
+ \tikz@lib@parse@join@with@by#1\pgf@stop%
+ \else%
+ \tikz@lib@parse@join@with@by#1 by \pgf@stop%
+ \fi%
+ \else%
+ \tikz@lib@parse@join@by#1\pgf@stop%
+ \fi%
+ \fi%
+}
+\def\tikz@lib@parse@join@with@by with #1 by #2\pgf@stop{%
+ \tikzset{after node path={(#1)edge[every join,#2](\tikzchaincurrent)}}%
+}
+\def\tikz@lib@parse@join@by by #1\pgf@stop{%
+ \tikzset{after node path={\ifx\tikzchainprevious\pgfutil@empty\else (\tikzchainprevious)edge[every join,#1](\tikzchaincurrent)\fi}}%
+}
+\tikzset{every join/.style=}
+
+
+\def\tikz@lib@chainin#1(#2){\pgfutil@ifnextchar[{\tikz@lib@chainin@{#2}}{\tikz@lib@chainin@{#2}[]}}%]
+\def\tikz@lib@chainin@#1[#2]{\path[late options={name=#1,on chain,every chain in/.try,#2}]}
+
+
+%
+% Branches
+%
+
+\tikzset{start branch/.code={%
+ % save last node on current chain:
+ \let\tikz@lib@save@current\tikz@lib@current@chain%
+ \pgfkeysalso{/tikz/start chain/.expand once=\tikz@lib@current@chain/#1}%
+ \path[late options={name=\tikz@lib@save@current-end,on chain}];%
+ }%
+}
+\tikzset{continue branch/.style={continue chain/.expand once=\tikz@lib@current@chain/#1}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
new file mode 100644
index 00000000000..62d1cbda803
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
@@ -0,0 +1,186 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usepgfmodule{decorations}
+
+% Define the basic decoration stuff for tikz. Load more libraries to
+% "actually use" decorations
+
+\tikzset{decorate/.is if=tikz@decoratepath,
+ /pgf/decoration/name/.store in=\tikz@decoration@name,
+ /pgf/decoration/.unknown/.code=%
+ \pgfifdecoration{\pgfkeyscurrentname}{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
+ {\pgfifmetadecoration{\pgfkeyscurrentname}{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
+ {\pgfkeys{/errors/unknown
+ key={/pgf/decoration/\pgfkeyscurrentname}{#1}}}},%
+ /pgf/decoration/raise/.code={\def\tikz@dec@shift{\pgftransformyshift{#1}}\tikz@dec@trans},
+ /pgf/decoration/mirror/.code={%
+ \csname if#1\endcsname
+ \def\tikz@dec@mirror{\pgftransformyscale{-1}}%
+ \else%
+ \let\tikz@dec@mirror=\relax%
+ \fi%
+ \tikz@dec@trans%
+ },
+ /pgf/decoration/mirror/.default=true,
+ /pgf/decoration/transform/.code={%
+ {%
+ \pgftransformreset%
+ \def\tikz@transform{}%
+ \pgfkeysalso{/tikz/.cd, #1}%
+ \expandafter\gdef\expandafter\tikz@g@temptransform\expandafter{\tikz@transform}%
+ }%
+ \let\tikz@dec@user@transform=\tikz@g@temptransform%
+ \tikz@dec@trans%
+ },%
+ /pgf/decoration/pre/.initial=lineto,
+ /pgf/decoration/post/.initial=lineto,
+ /pgf/decoration/pre length/.initial=0pt,
+ /pgf/decoration/post length/.initial=0pt,
+}
+
+\let\tikz@decoration@name=\tikz@nonetext
+
+\def\tikz@dec@trans{\pgfsetdecorationsegmenttransformation{\tikz@dec@user@transform\tikz@dec@mirror\tikz@dec@shift}}
+\let\tikz@dec@user@transform=\relax
+\let\tikz@dec@shift=\relax
+\let\tikz@dec@mirror=\relax
+
+\pgfdeclaremetadecoration{tikz@internal}{pre}{
+ \state{pre}[width=\pgfkeysvalueof{/pgf/decoration/pre length}, next state=main]
+ {
+ \decoration{\pgfkeysvalueof{/pgf/decoration/pre}}
+ }
+ \state{main}[width=\pgfmetadecoratedremainingdistance-\pgfkeysvalueof{/pgf/decoration/post length}, next state=final]
+ {
+ \decoration{\tikz@decoration@name}
+ }
+ \state{final}
+ {
+ \decoration{\pgfkeysvalueof{/pgf/decoration/post}}
+ }
+}
+
+
+\newif\iftikz@metadecoration
+
+\def\tikz@lib@dec@addtomacro#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
+
+\def\tikz@lib@decoration[#1]{%
+ \begingroup%
+ % Just to be on the save side...
+ %
+ % Now, let's parse the options:
+ \tikzset{#1}%
+ %
+ \ifx\tikz@decoration@name\tikz@nonetext%
+ % Ok, let's forget about this decoration stuff...
+ \else
+ \expandafter\tikz@lib@do@dec%
+ \fi%
+ % Now, we expect a brace.
+ \pgfutil@ifnextchar\bgroup{%
+ \begingroup%
+ \aftergroup\tikz@enddecoration%
+ \afterassignment\tikz@scan@next@command%
+ \let\tikz@lib@next% gobble \bgroup%
+ }%
+ {%
+ \PackageError{tikz}{A decoration must begin with a brace}{}%
+ \tikz@enddecoration%
+ }%
+}
+\def\tikz@lib@do@dec{%
+ % Ok, now what?
+ \pgfifmetadecoration{\tikz@decoration@name}%
+ {\expandafter\pgfmetadecoration\expandafter{\tikz@decoration@name}}%
+ {%
+ \pgfifdecoration{\tikz@decoration@name}%
+ {\tikz@lib@dec@startdecoration}%
+ {\PackageError{tikz}{Unknown (meta-)decoration '\tikz@decoration@name'. Perhaps you
+ misspelled it?}{}}%
+ }%
+ \ifx\pgfdecorateexistingpath\pgfutil@empty%
+ \pgfpathmoveto{\pgfqpoint{\the\tikz@lastxsaved}{\the\tikz@lastysaved}}%
+ \fi%
+}
+
+\def\tikz@enddecoration{%
+ \ifx\tikz@decoration@name\tikz@nonetext%
+ % ignore this.
+ \else
+ % Ok, now what?
+ \iftikz@metadecoration%
+ \endpgfmetadecoration%
+ \else%
+ \tikz@lib@dec@stopdecoration%
+ \fi%
+ \fi
+ \endgroup%
+}
+
+
+\def\tikz@lib@dec@decorate@path{%
+ \ifx\tikz@decoration@name\tikz@nonetext%
+ \else%
+ \pgfgetpath\tikz@lib@dec@currentpath%
+ \pgfsetpath\pgfutil@empty%
+ \pgfifmetadecoration{\tikz@decoration@name}
+ {
+ \expandafter\pgfmetadecoration\expandafter{\tikz@decoration@name}%
+ \pgfsetpath\tikz@lib@dec@currentpath%
+ \endpgfmetadecoration%
+ }
+ {
+ \pgfifdecoration{\tikz@decoration@name}
+ {
+ \tikz@lib@dec@startdecoration%
+ \pgfsetpath\tikz@lib@dec@currentpath%
+ \tikz@lib@dec@stopdecoration%
+ }
+ {
+ \PackageError{tikz}{Unknown (meta-)decoration '\tikz@decoration@name'. Perhaps
+ you misspelled it?}{}
+ }
+ }
+ \fi%
+}
+
+\def\tikz@lib@dec@zpttext{0pt}
+
+\newif\iftikz@lib@dec@temp
+\def\tikz@lib@dec@startdecoration{%
+ \pgfkeysgetvalue{/pgf/decoration/pre length}{\tikz@lib@pre}%
+ \pgfkeysgetvalue{/pgf/decoration/post length}{\tikz@lib@post}%
+ \tikz@lib@dec@tempfalse%
+ \ifx\tikz@lib@pre\tikz@lib@dec@zpttext%
+ \ifx\tikz@lib@post\tikz@lib@dec@zpttext%
+ \else%
+ \tikz@lib@dec@temptrue%
+ \fi%
+ \else%
+ \tikz@lib@dec@temptrue%
+ \fi%
+ \iftikz@lib@dec@temp%
+ \pgfmetadecoration{tikz@internal}%
+ \else%
+ \expandafter\pgfdecoration\expandafter{\expandafter{\tikz@decoration@name}{\pgfdecoratedpathlength}{}{}}%
+ \fi%
+}
+
+\def\tikz@lib@dec@stopdecoration{%
+ \iftikz@lib@dec@temp%
+ \endpgfmetadecoration%
+ \else%
+ \endpgfdecoration%
+ \fi%
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
new file mode 100644
index 00000000000..e4295c10ea7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
@@ -0,0 +1,13 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.footprints}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
new file mode 100644
index 00000000000..dd247ac7e3f
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
@@ -0,0 +1,13 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.fractals}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
new file mode 100644
index 00000000000..eecdfb6ad3f
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
@@ -0,0 +1,31 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.markings}
+
+% Upgrade \arrow command
+\def\pgf@lib@dec@doarrowhead{%
+ \pgfutil@ifnextchar[{\tikz@lib@dec@doarrowhead}{\tikz@lib@dec@doarrowhead[]}%]
+}
+\def\tikz@lib@dec@doarrowhead[#1]#2{%
+ \scope[#1]
+ \pgf@lib@dec@arrowhead{1}{#2}%
+ \endscope
+}
+\def\pgf@lib@dec@doarrowheadrev{%
+ \pgfutil@ifnextchar[{\tikz@lib@dec@doarrowheadrev}{\tikz@lib@dec@doarrowheadrev[]}%]
+}
+\def\tikz@lib@dec@doarrowheadrev[#1]#2{%
+ \scope[#1]
+ \pgf@lib@dec@arrowhead{-1}{#2}%
+ \endscope
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
new file mode 100644
index 00000000000..388f6395f8b
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
@@ -0,0 +1,13 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.pathmorphing}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
new file mode 100644
index 00000000000..f7c86aeba5d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
@@ -0,0 +1,13 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.pathreplacing}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
new file mode 100644
index 00000000000..d9306058442
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
@@ -0,0 +1,13 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.shapes}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
new file mode 100644
index 00000000000..e063ba185f0
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
@@ -0,0 +1,13 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{decorations}
+\usepgflibrary{decorations.text}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
new file mode 100644
index 00000000000..fcacb5d4399
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
@@ -0,0 +1,40 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex,v 1.2 2008/02/20 11:00:42 tantau Exp $
+
+\usetikzlibrary{shapes.geometric}
+
+% Styles for entity types:
+
+\tikzstyle{every entity}= []
+\tikzstyle{entity}= [rectangle,draw,
+ minimum height=2\baselineskip,
+ minimum width=4\baselineskip,every entity]
+
+
+% Styles for relationship types:
+
+\tikzstyle{every relationship}= []
+\tikzstyle{relationship}= [diamond,draw,
+ minimum size=1.5\baselineskip,
+ inner sep=1pt,
+ every relationship]
+
+
+% Styles for relationship types:
+
+\tikzstyle{every attribute}= []
+\tikzstyle{attribute}= [minimum size=1.5\baselineskip,ellipse,draw,every attribute]
+\tikzstyle{key attribute}= [font=\itshape,attribute]
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
new file mode 100644
index 00000000000..ec43475f6a0
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
@@ -0,0 +1,47 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{fadings}
+
+%
+% Environments for creating fadings
+%
+
+\def\tikzfadingfrompicture{%
+ \begingroup%
+ \setbox\pgfpic=\hbox\bgroup%
+ \tikzpicture%
+}
+\def\endtikzfadingfrompicture{%
+ \global\let\tikz@smuggle=\tikz@fig@name%
+ \endtikzpicture
+ \egroup%
+ \pgfdeclarefading{\tikz@smuggle}{\box\pgfpic}%
+ \endgroup%
+}
+
+\let\starttikzfadingfrompicture=\tikzfadingfrompicture
+\let\stopttikzfadingfrompicture=\endtikzfadingfrompicture
+
+\def\tikzfading[#1]{%
+ {%
+ \setbox\pgfpic=\hbox{%
+ \tikzset{#1}%
+ \global\let\tikz@smuggle=\tikz@fig@name%
+ \tikz{%
+ \useasboundingbox(0,0) (100bp,100bp);
+ \node at (50bp,50bp) [rotate=\tikz@shade@angle]
+ {\pgfuseshading{\tikz@shading}};
+ }%
+ }%
+ \pgfdeclarefading{\tikz@smuggle}{\box\pgfpic}%
+ }%
+} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
new file mode 100644
index 00000000000..1181dabea5f
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
@@ -0,0 +1,77 @@
+% Copyright 2007 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex,v 1.2 2008/02/06 22:18:29 tantau Exp $
+
+\pgfkeys{/tikz/fit/.code=\tikz@lib@fit{#1}}
+
+\def\tikz@lib@fit#1{%
+ \pgf@xb=-16000pt\relax%
+ \pgf@xa=16000pt\relax%
+ \pgf@yb=-16000pt\relax%
+ \pgf@ya=16000pt\relax%
+ % Now iterate over the coordinates
+ \tikz@lib@fit@scan#1\pgf@stop%
+ % Now, let's see what has happend
+ \ifdim\pgf@xa>\pgf@xa%
+ % Nothing... Ok, let's just ignore this.
+ \else%
+ % Ok, compute center and width and height
+ \pgf@x=\pgf@xb%
+ \advance\pgf@x by-\pgf@xa%
+ \pgf@y=\pgf@yb%
+ \advance\pgf@y by-\pgf@ya%
+ \advance\pgf@xa by.5\pgf@x%
+ \advance\pgf@ya by.5\pgf@y%
+ \edef\tikz@node@at{\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \pgfkeysalso{/tikz/anchor=center,/tikz/text centered}%
+ \pgfkeysalso{/tikz/text width/.expanded=\the\pgf@x}%
+ \pgf@x=\pgf@y%
+ \pgf@y=.5\pgf@y%
+ \pgfkeysalso{
+ /tikz/text height/.expanded=\the\pgf@y-.5\dp\pgfnodeparttextbox,
+ /tikz/text depth/.expanded=\the\pgf@x-\noexpand\the\ht\pgfnodeparttextbox}%
+ \pgfkeysalso{every fit/.try}%
+ \fi%
+}
+
+\def\tikz@lib@fit@scan{%
+ \pgfutil@ifnextchar\pgf@stop{\pgfutil@gobble}
+ {\tikz@scan@one@point\tikz@lib@fit@scan@handle}}
+
+\def\tikz@lib@fit@scan@handle#1{%
+ \iftikz@shapeborder%
+ % Ok, fit all four external anchors, if they exist
+ \tikz@lib@fit@adjust{\pgfpointanchor{\tikz@shapeborder@name}{west}}%
+ \tikz@lib@fit@adjust{\pgfpointanchor{\tikz@shapeborder@name}{east}}%
+ \tikz@lib@fit@adjust{\pgfpointanchor{\tikz@shapeborder@name}{north}}%
+ \tikz@lib@fit@adjust{\pgfpointanchor{\tikz@shapeborder@name}{south}}%
+ \else%
+ \tikz@lib@fit@adjust{#1}%
+ \fi%
+ \tikz@lib@fit@scan%
+}
+
+\def\tikz@lib@fit@adjust#1{%
+ \pgf@process{#1}%
+ \ifdim\pgf@x<\pgf@xa%
+ \pgf@xa=\pgf@x%
+ \fi%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@ya=\pgf@y%
+ \fi%
+ \ifdim\pgf@x>\pgf@xb%
+ \pgf@xb=\pgf@x%
+ \fi%
+ \ifdim\pgf@y>\pgf@yb%
+ \pgf@yb=\pgf@y%
+ \fi%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
new file mode 100644
index 00000000000..2ecdfeb11c7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
@@ -0,0 +1,143 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+
+%
+% Length of a standard line in a folding
+%
+
+\tikzoption{folding line length}{\pgfmathsetlength\tikz@lib@fold@length{#1}}
+\newdimen\tikz@lib@fold@length
+\tikz@lib@fold@length=2cm
+
+
+\def\tikz@lib@fold@pentagon#1#2#3#4#5#6{%
+ \begin{scope}[xshift=.5\tikz@lib@fold@length,yshift=0.68819\tikz@lib@fold@length]
+ #1
+ \end{scope}
+ \begin{scope}[shift={(108:\tikz@lib@fold@length)},shift={(36:\tikz@lib@fold@length)},rotate=-36]
+ #2
+ \end{scope}
+ \begin{scope}[xshift=\tikz@lib@fold@length,shift={(72:\tikz@lib@fold@length)},rotate=-108]
+ #3
+ \end{scope}
+ \begin{scope}[xshift=\tikz@lib@fold@length,rotate=180]
+ #4
+ \end{scope}
+ \begin{scope}[rotate=108]
+ #5
+ \end{scope}
+ \begin{scope}[shift={(108:\tikz@lib@fold@length)},rotate=36]
+ #6
+ \end{scope}
+}
+
+
+\def\tikz@lib@fold@path{\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);}
+\def\tikz@lib@fold@cut@path{\draw[every cut](0,0) -- (\tikz@lib@fold@length,0pt);}
+\def\tikz@lib@fold@ear@path{
+ \draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);
+ \draw[every cut] (0,0) -- (.5\tikz@lib@fold@length,.2\tikz@lib@fold@length) --(\tikz@lib@fold@length,0pt);}
+
+\tikzstyle{every cut}=[]
+\tikzstyle{every fold}=[help lines]
+
+\tikzoption{face 1}{\def\tikz@lib@fold@face@A{#1}}
+\tikzoption{face 2}{\def\tikz@lib@fold@face@B{#1}}
+\tikzoption{face 3}{\def\tikz@lib@fold@face@C{#1}}
+\tikzoption{face 4}{\def\tikz@lib@fold@face@D{#1}}
+\tikzoption{face 5}{\def\tikz@lib@fold@face@E{#1}}
+\tikzoption{face 6}{\def\tikz@lib@fold@face@F{#1}}
+\tikzoption{face 7}{\def\tikz@lib@fold@face@G{#1}}
+\tikzoption{face 8}{\def\tikz@lib@fold@face@H{#1}}
+\tikzoption{face 9}{\def\tikz@lib@fold@face@I{#1}}
+\tikzoption{face 10}{\def\tikz@lib@fold@face@J{#1}}
+\tikzoption{face 11}{\def\tikz@lib@fold@face@K{#1}}
+\tikzoption{face 12}{\def\tikz@lib@fold@face@L{#1}}
+
+\let\tikz@lib@fold@face@A=\pgfutil@empty
+\let\tikz@lib@fold@face@B=\pgfutil@empty
+\let\tikz@lib@fold@face@C=\pgfutil@empty
+\let\tikz@lib@fold@face@D=\pgfutil@empty
+\let\tikz@lib@fold@face@E=\pgfutil@empty
+\let\tikz@lib@fold@face@F=\pgfutil@empty
+\let\tikz@lib@fold@face@G=\pgfutil@empty
+\let\tikz@lib@fold@face@H=\pgfutil@empty
+\let\tikz@lib@fold@face@I=\pgfutil@empty
+\let\tikz@lib@fold@face@J=\pgfutil@empty
+\let\tikz@lib@fold@face@K=\pgfutil@empty
+\let\tikz@lib@fold@face@L=\pgfutil@empty
+
+\def\tikzfoldingdodecahedron#1[#2]#3;{%
+ \begingroup%
+ \tikzset{#2}%
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@A}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@B}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@C}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@D}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@E}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@F}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@G}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@H}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@I}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@J}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@K}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {
+ \tikz@lib@fold@pentagon{\tikz@lib@fold@face@L}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@cut@path}
+ }
+ }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ \endgroup
+}
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
new file mode 100644
index 00000000000..124e70f2278
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
@@ -0,0 +1,145 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+
+% A matrix of nodes contains a node in each cell.
+
+\tikzstyle{matrix of nodes}=[%
+ matrix,%
+ cells={anchor=base},%
+ nodes={%
+ execute at begin node=,%
+ execute at end node=,
+ name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn%
+ },
+ execute at begin cell=\tikz@lib@matrix@start@cell,%
+ execute at end cell=\tikz@lib@matrix@end@cell,%
+ execute at empty cell=\tikz@lib@matrix@empty@cell
+]
+
+\def\tikz@lib@matrix@empty@cell{\iftikz@lib@matrix@empty\node{};\fi}
+
+\newif\iftikz@lib@matrix@plain
+
+\def\tikz@lib@matrix@start@cell{%
+ \pgfutil@ifnextchar|{\tikz@lib@matrix@with@options}{\tikz@lib@matrix@normal@start@cell}}
+
+\def\tikz@lib@matrix@with@options|#1|{\tikz@lib@matrix@plainfalse\node#1\bgroup\tikz@lib@matrix@startup}
+
+
+\def\tikz@lib@matrix@normal@start@cell{\pgfutil@ifnextchar\let{\tikz@lib@matrix@check}{\tikz@lib@matrix@plainfalse\node\bgroup\tikz@lib@matrix@startup}}%
+
+\def\tikz@lib@matrix@check#1{% evil hackery to find out about start of path
+ \pgfutil@ifnextchar\tikz@signal@path{\tikz@lib@matrix@plaintrue\let}{\tikz@lib@matrix@plainfalse\node\bgroup\tikz@lib@matrix@startup\let}%
+}
+
+\def\tikz@lib@matrix@end@cell{%
+ \iftikz@lib@matrix@plain%
+ \else%
+ \expandafter\egroup\expandafter;%
+ \fi%
+}
+
+\def\tikz@lib@matrix@startup{%
+ \pgfutil@ifnextchar\bgroup{%
+ % Save meaning of \\:
+ \let\tikz@lib@matrix@saved@eol=\\%
+ % Now smuggle meaning inside following group.
+ \let\\=\pgfmatrixendrow%
+ \afterassignment\tikz@lib@matrix@smuggle%
+ \let\tikz@next}
+ {\let\\=\pgfmatrixendrow}%
+}
+\def\tikz@lib@matrix@smuggle{%
+ \bgroup%
+ \let\\=\tikz@lib@matrix@saved@eol%
+}
+
+
+% Fill empty nodes in a matrix of nodes
+
+\newif\iftikz@lib@matrix@empty
+
+\tikzoption{nodes in empty cells}[true]{\csname tikz@lib@matrix@empty#1\endcsname}
+
+
+% Same as a matrix of nodes, but switch on math mode in each cell
+\tikzstyle{matrix of math nodes}=[%
+ matrix of nodes,
+ nodes={%
+ execute at begin node=$,%
+ execute at end node=$%
+ }%
+]
+
+
+
+% Provide a delimiter
+
+\tikzoption{left delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+ {south east}%
+ {south west}%
+ {every delimiter,every left delimiter}%
+ {south}%
+ {north}%
+ {#1}%
+ {.}%
+ {\pgf@y}}}
+
+\tikzoption{right delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+ {south west}%
+ {south east}%
+ {every delimiter,every right delimiter}%
+ {south}%
+ {north}%
+ {.}%
+ {#1}%
+ {\pgf@y}}}
+
+\tikzoption{above delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+ {south east}%
+ {north west}%
+ {every delimiter,every above delimiter,rotate=-90}%
+ {west}%
+ {east}%
+ {#1}%
+ {.}%
+ {\pgf@x}}}
+
+\tikzoption{below delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+ {south west}%
+ {south west}%
+ {every delimiter,every below delimiter,rotate=-90}%
+ {west}%
+ {east}%
+ {.}%
+ {#1}%
+ {\pgf@x}}}
+
+\def\tikz@delimiter#1#2#3#4#5#6#7#8{%
+ \bgroup
+ \pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name}%
+ node[outer sep=0pt,inner sep=0pt,draw=none,fill=none,anchor=#1,at=(\tikz@last@fig@name.#2),#3]
+ {%
+ {\nullfont\pgf@process{\pgfpointdiff{\pgfpointanchor{\tikz@last@fig@name}{#4}}{\pgfpointanchor{\tikz@last@fig@name}{#5}}}}%
+ $\left#6\vcenter{\hrule height .5#8 depth .5#8 width0pt}\right#7$%
+ }
+ \pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name}%
+ \egroup%
+}
+
+\tikzstyle{every delimiter}=[]
+\tikzstyle{every left delimiter}=[]
+\tikzstyle{every right delimiter}=[]
+\tikzstyle{every above delimiter}=[]
+\tikzstyle{every below delimiter}=[]
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
new file mode 100644
index 00000000000..06f42f5c457
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
@@ -0,0 +1,319 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex,v 1.5 2008/02/10 16:29:07 tantau Exp $
+
+
+\usetikzlibrary{trees,decorations}
+
+
+% A decoration for connecting circle nodes
+%
+% Parameters: start radius, end radius, amplitude, angle
+
+\pgfdeclaredecoration{circle connection bar}{initial}
+{
+ \state{initial}[width=0pt,next state=bar]
+ {
+ {
+ \pgftransformxshift{-\pgfkeysvalueof{/pgf/decoration/start radius}}%
+ \pgfpathmoveto{\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}
+ \pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}
+ \pgfutil@tempcnta=-\pgfdecorationsegmentangle\relax
+ \advance\pgfutil@tempcnta by90\relax
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/decoration/start radius}}
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfdecorationsegmentamplitude}
+ \pgfpathcurveto
+ {\pgfpointadd
+ {\pgfpointpolar{-\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}
+ {\pgfpointpolar{\the\pgfutil@tempcnta}{.25\pgfutil@tempdima}}}
+ {\pgfqpoint{1.25\pgfutil@tempdima}{-.5\pgfutil@tempdimb}}
+ {\pgfqpoint{1.5\pgfutil@tempdima}{-.5\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{1.5\pgfutil@tempdima}{.5\pgfutil@tempdimb}}
+ \pgfutil@tempcnta=\pgfdecorationsegmentangle\relax
+ \advance\pgfutil@tempcnta by-90\relax
+ \pgfpathcurveto
+ {\pgfpoint{1.25\pgfutil@tempdima}{.5\pgfutil@tempdimb}}
+ {\pgfpointadd
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}
+ {\pgfpointpolar{\the\pgfutil@tempcnta}{.25\pgfutil@tempdima}}}
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}
+ \pgfpathclose
+ }
+ }
+ \state{bar}[width=0pt,next state=end]
+ {
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/decoration/start radius}}%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/decoration/end radius}}%
+ \pgfmathsetlength\pgf@xc{\pgfdecorationsegmentamplitude}%
+ \pgfpathrectangle
+ {\pgfqpoint{.5\pgfutil@tempdima}{-.5\pgf@xc}}
+ {\pgfpoint{\pgfdecoratedremainingdistance+-.5\pgfutil@tempdimb+-.5\pgfutil@tempdima}{\pgf@xc}}
+ }
+ \state{end}[width=0pt,next state=final]
+ {
+ {
+ \pgftransformxshift{\pgfdecoratedremainingdistance}%
+ \pgftransformxscale{-1}%
+ \pgftransformxshift{-\pgfkeysvalueof{/pgf/decoration/end radius}}%
+ \pgfpathmoveto{\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/end radius}}}
+ \pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/end radius}}
+ \pgfutil@tempcnta=-\pgfdecorationsegmentangle\relax
+ \advance\pgfutil@tempcnta by90\relax
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/decoration/end radius}}
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfdecorationsegmentamplitude}%
+ \pgfpathcurveto
+ {\pgfpointadd
+ {\pgfpointpolar{-\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/end radius}}}
+ {\pgfpointpolar{\the\pgfutil@tempcnta}{.25\pgfutil@tempdima}}}
+ {\pgfqpoint{1.25\pgfutil@tempdima}{-.5\pgfutil@tempdimb}}
+ {\pgfqpoint{1.5\pgfutil@tempdima}{-.5\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{1.5\pgfutil@tempdima}{.5\pgfutil@tempdimb}}
+ \pgfutil@tempcnta=\pgfdecorationsegmentangle\relax
+ \advance\pgfutil@tempcnta by-90\relax
+ \pgfpathcurveto
+ {\pgfpoint{1.25\pgfutil@tempdima}{.5\pgfutil@tempdimb}}
+ {\pgfpointadd
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/end radius}}}
+ {\pgfpointpolar{\the\pgfutil@tempcnta}{.25\pgfutil@tempdima}}}
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/end radius}}}
+ \pgfpathclose
+ }
+ }
+ \state{final}
+ {}
+}
+
+
+
+\pgfkeys{/pgf/decoration/angle=20}
+
+% To paths for connecting circle nodes
+
+\tikzstyle{circle connection bar}=
+[to path={
+ \pgfextra{\tikz@compute@circle@radii\tikz@compute@segmentamplitude}
+ [fill=\tikz@concept@color,draw=none]
+ [every circle connection bar]
+ decorate [decoration=circle connection bar]
+ { -- (\tikztotarget) \tikztonodes}
+}]
+\tikzstyle{every circle connection bar}=[]
+
+\def\tikz@compute@circle@radii{%
+ \pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikztostart}{center}}}%
+ \pgf@xa=\pgf@x%
+ \pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikztostart}{west}}}%
+ \advance\pgf@xa by-\pgf@x%
+ \pgfkeys{/pgf/decoration/start radius/.expanded=\the\pgf@xa}%
+ \pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikztotarget}{center}}}%
+ \pgf@xa=\pgf@x%
+ \pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikztotarget}{west}}}%
+ \advance\pgf@xa by-\pgf@x%
+ \pgfkeys{/pgf/decoration/end radius/.expanded=\the\pgf@xa}%
+}
+\def\tikz@compute@segmentamplitude{%
+ \pgf@x=\pgfkeysvalueof{/pgf/decoration/start radius}\relax%
+ \ifdim\pgf@x>\pgfkeysvalueof{/pgf/decoration/end radius}\relax%
+ \pgf@x=\pgfkeysvalueof{/pgf/decoration/end radius}\relax%
+ \fi%
+ \pgf@x=.175\pgf@x\relax%
+ \edef\pgfdecorationsegmentamplitude{\the\pgf@x}%
+}
+
+
+% Switch color in a mindmap
+
+\tikzoption{circle connection bar switch color}{\tikz@parse@switch#1\pgf@unique}
+\def\tikz@parse@switch from (#1) to (#2)\pgf@unique{%
+ \def\tikz@to@path{%
+ \pgfextra{%
+ \pgfutil@colorlet{tikz@switch@from}{#1}%
+ \pgfutil@colorlet{tikz@switch@to}{#2}%
+ \tikz@compute@circle@radii\tikz@compute@segmentamplitude%
+ \tikz@compute@rotation%
+ }
+ [fill=none,draw=none]
+ [every circle connection bar]
+ decorate [decoration=circle connection bar]
+ {-- (\tikztotarget) \tikztonodes}
+ [shading=tikz@shade@bar]
+ }
+}
+
+\tikzoption{concept color}{%
+ \let\tikz@old@concept@color=\tikz@concept@color%
+ \def\tikz@edge@to@parent@path{
+ (\tikzparentnode)
+ to[circle connection bar switch color=from (\tikz@old@concept@color) to (#1)]
+ (\tikzchildnode)}
+ \def\tikz@concept@color{#1}%
+}
+
+\pgfdeclarehorizontalshading[tikz@switch@from,tikz@switch@to]{tikz@shade@bar}{100bp}{%
+ color(0pt)=(tikz@switch@from);
+ color(50bp)=(tikz@switch@from);
+ color(55bp)=(tikz@switch@to);
+ color(100bp)=(tikz@switch@to)}
+
+\def\tikz@compute@rotation{%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgfpointanchor{\tikztostart}{center}}{\pgfpointanchor{\tikztotarget}{center}}}}%
+ \pgf@ya=-\pgf@y%
+ \edef\pgf@marshal{%
+ \noexpand\pgfsetadditionalshadetransform{%
+ \noexpand\pgftransformcm
+ {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}%
+ {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}%
+ {\noexpand\pgfpointorigin}%
+ }%
+ }%
+ \pgf@marshal%
+}
+
+
+
+
+% A concept node
+
+\tikzstyle{concept}= [circle,fill=\tikz@concept@color,draw=\tikz@concept@color,every concept]
+\tikzstyle{every concept}= []
+
+\def\tikz@concept@color{black}
+
+\tikzstyle{tikz@concept@setting}=[edge from parent path={(\tikzparentnode) to [circle connection bar] (\tikzchildnode)}]
+\tikzstyle{tikz@concept@color@set}=[]
+
+
+\tikzstyle{extra concept}= [concept color=black!50,level 2 concept,concept,every extra concept]
+\tikzstyle{every extra concept}=[]
+
+\tikzstyle{concept connection}=[line width=1mm,shorten <=2mm,shorten >=2mm,cap=round,draw=black!50]
+
+
+% A mindmap
+
+\tikzstyle{mindmap}=
+ [fill,draw,very thick,outer sep=0pt,inner sep=1pt,%
+ every child/.append style={style=tikz@concept@setting,style=tikz@concept@color@set},%
+ root concept,
+ level 1/.append style={level 1 concept},
+ level 2/.append style={level 2 concept},
+ level 3/.append style={level 3 concept},
+ level 4/.append style={level 4 concept},
+ text centered,%
+ segment angle=20,
+ style=every mindmap,
+ ]
+\tikzstyle{every mindmap}=[]
+
+
+\tikzstyle{root concept}= [minimum size=4cm,text width=3.5cm,font=\pgfutil@font@large]
+\tikzstyle{level 1 concept}=[minimum size=2.25cm,
+ level distance=5cm,
+ text width=2cm,
+ sibling angle=60,
+ font=\pgfutil@font@small]
+\tikzstyle{level 2 concept}=[minimum size=1.75cm,%
+ level distance=2.9cm,%
+ text width=1.5cm,%
+ sibling angle=60,%
+ font=\pgfutil@font@footnotesize]
+\tikzstyle{level 3 concept}=[minimum size=1.15cm,%
+ text width=1cm,%
+ level distance=2.4cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@tiny]
+\tikzstyle{level 4 concept}=[minimum size=0.9cm,%
+ text width=0.7cm,
+ level distance=1.85cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@tiny]
+
+\tikzstyle{large mindmap}=
+ [%
+ root concept/.style={minimum size=5.6cm,text width=4.5cm,font=\pgfutil@font@Large},
+ level 1 concept/.style={%
+ minimum size=3.2cm,
+ level distance=7cm,
+ text width=2.8cm,
+ sibling angle=60,
+ font=},%
+ level 2 concept/.style={%
+ minimum size=2.45cm,%
+ level distance=4cm,%
+ text width=2.2cm,%
+ sibling angle=60,%
+ font=\pgfutil@font@small%
+ },%
+ level 3 concept/.style={%
+ minimum size=1.63cm,%
+ text width=1.4cm,%
+ level distance=3.38cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@scriptsize},%
+ level 4 concept/.style={%
+ minimum size=1.27cm,%
+ text width=1cm,
+ level distance=2.60cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@tiny},%
+ mindmap,%
+ line width=2pt
+ ]
+
+\tikzstyle{huge mindmap}=
+ [%
+ root concept/.style={minimum size=8cm,text width=7cm,font=\pgfutil@font@huge},
+ level 1 concept/.style={%
+ minimum size=4.5cm,
+ level distance=10cm,
+ text width=4cm,
+ sibling angle=60,
+ font=\pgfutil@font@large},%
+ level 2 concept/.style={%
+ minimum size=3.5cm,%
+ level distance=5.8cm,%
+ text width=3cm,%
+ sibling angle=60,%
+ font=%
+ },%
+ level 3 concept/.style={%
+ minimum size=2.3cm,%
+ text width=2cm,%
+ level distance=4.8cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@footnotesize},%
+ level 4 concept/.style={%
+ minimum size=1.7cm,%
+ text width=1.4cm,
+ level distance=3.7cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@scriptsize},%
+ mindmap,%
+ line width=3pt
+ ]
+
+
+% Annotations
+
+\tikzstyle{annotation}=[shape=rectangle,
+ minimum size=0pt,
+ text width=3.5cm,
+ outer sep=1.5mm,
+ inner sep=1mm,
+ text badly ragged,
+ rounded corners,
+ font=\pgfutil@font@tiny,
+ every annotation]
+\tikzstyle{every annotation}=[]
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
new file mode 100644
index 00000000000..b6a0d3c9931
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
@@ -0,0 +1,31 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex,v 1.2 2008/01/15 10:27:34 tantau Exp $
+
+\usepgflibrary{patterns}
+
+\tikzoption{pattern color}{\edef\tikz@pattern@color{#1}}
+\tikzoption{pattern}[]{%
+ \edef\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@nonetext%
+ \tikz@addmode{\tikz@mode@fillfalse}%
+ \else%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \tikz@addoption{\pgfsetfillpattern{#1}{\tikz@pattern@color}}%
+ \def\tikz@pattern{#1}%
+ \fi%
+ \tikz@addmode{\tikz@mode@filltrue}%
+ \fi%
+}
+\def\tikz@pattern@color{black}
+\def\tikz@pattern{dots}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
new file mode 100644
index 00000000000..e9e79e986bb
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
@@ -0,0 +1,146 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+
+% Styles for places:
+
+\tikzstyle{every place}= []
+\tikzstyle{place}= [circle,draw,inner sep=0pt,
+ minimum size=5ex,
+ every place]
+
+
+% Styles for transition:
+
+\tikzstyle{every transition}= []
+\tikzstyle{transition}= [rectangle,draw,inner sep=0pt,
+ minimum size=4mm,
+ every transition]
+
+
+% Styles for relationship types:
+
+\tikzstyle{pre}= [<-,shorten <=1pt]
+\tikzstyle{post}= [->,shorten >=1pt]
+\tikzstyle{pre and post}= [<->,shorten >=1pt,shorten <=1pt]
+
+
+
+% Styles for marks:
+
+\tikzstyle{every token}= []
+\tikzstyle{token}= [fill=black,draw=none,circle,
+ inner sep=0.5pt,minimum size=1ex,
+ text=white,font=\pgfutil@font@tiny,every token]
+
+\tikzoption{token distance}{\def\tikz@token@distance{#1}}
+\def\tikz@token@distance{1.5ex}
+
+\tikzstyle{children are tokens}= [growth function=\tikz@grow@tokens,edge from parent path=]
+
+\tikzoption{tokens}{%
+ \ifnum#1>0\relax%
+ \tikz@add@after@node@path{%
+ {[children are tokens]child foreach \tikz@dummy in {1,...,#1} {node[token]{}}}}%
+ \fi}
+
+\tikzoption{colored tokens}{%
+ \tikz@add@after@node@path{%
+ {[children are tokens]child foreach \tikz@child@color in {#1} {node[token,\tikz@child@color]{}}}}%
+ }
+
+\tikzoption{structured tokens}{%
+ \tikz@add@after@node@path{%
+ {[children are tokens]child foreach \tikz@child@name in {#1} {node[token]{\tikz@child@name}}}}%
+ }
+
+
+\def\tikz@grow@tokens{%
+ \pgfmathsetlength{\pgf@xa}{\tikz@token@distance}%
+ \pgfmathsetlength{\pgf@ya}{\tikz@token@distance}%
+ \pgf@xc=0pt%
+ \pgf@yc=0pt%
+ \csname tikz@grow@tokens@placer@\the\tikznumberofchildren @\the\tikznumberofcurrentchild\endcsname%
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+}
+
+\def\tikz@def@grow@tokens#1#2#3#4{%
+ \expandafter\def\csname tikz@grow@tokens@placer@#1@#2\endcsname{%
+ \pgf@xc=#3\pgf@xa%
+ \pgf@yc=#4\pgf@ya}%
+}
+
+
+% Single token
+\tikz@def@grow@tokens{1}{1}{0}{0}
+
+% Two tokens
+\tikz@def@grow@tokens{2}{1}{-.5}{0}
+\tikz@def@grow@tokens{2}{2}{.5}{0}
+
+% Three tokens
+\tikz@def@grow@tokens{3}{1}{0} {0.57}
+\tikz@def@grow@tokens{3}{2}{-.5}{-.306025}
+\tikz@def@grow@tokens{3}{3}{.5} {-.306025}
+
+% Four tokens
+\tikz@def@grow@tokens{4}{1}{-.5}{.5}
+\tikz@def@grow@tokens{4}{2}{.5}{.5}
+\tikz@def@grow@tokens{4}{3}{-.5}{-.5}
+\tikz@def@grow@tokens{4}{4}{.5}{-.5}
+
+% Five tokens
+\tikz@def@grow@tokens{5}{1}{0}{.85}
+\tikz@def@grow@tokens{5}{2}{-0.808398}{0.26266}
+\tikz@def@grow@tokens{5}{3}{0.808398}{0.26266}
+\tikz@def@grow@tokens{5}{4}{-0.499617}{-0.687664}
+\tikz@def@grow@tokens{5}{5}{0.499617}{-0.687664}
+
+% Six tokens
+\tikz@def@grow@tokens{6}{1}{-1}{.5}
+\tikz@def@grow@tokens{6}{2}{0}{.5}
+\tikz@def@grow@tokens{6}{3}{1}{.5}
+\tikz@def@grow@tokens{6}{4}{-1}{-.5}
+\tikz@def@grow@tokens{6}{5}{0}{-.5}
+\tikz@def@grow@tokens{6}{6}{1}{-.5}
+
+% Seven tokens
+\tikz@def@grow@tokens{7}{1}{0}{1}
+\tikz@def@grow@tokens{7}{2}{-1}{.5}
+\tikz@def@grow@tokens{7}{3}{0}{0}
+\tikz@def@grow@tokens{7}{4}{1}{.5}
+\tikz@def@grow@tokens{7}{5}{-1}{-.5}
+\tikz@def@grow@tokens{7}{6}{0}{-1}
+\tikz@def@grow@tokens{7}{7}{1}{-.5}
+
+% Eight tokens
+\tikz@def@grow@tokens{8}{1}{-.5}{1}
+\tikz@def@grow@tokens{8}{2}{.5}{1}
+\tikz@def@grow@tokens{8}{3}{-1}{0}
+\tikz@def@grow@tokens{8}{4}{0}{0}
+\tikz@def@grow@tokens{8}{5}{1}{0}
+\tikz@def@grow@tokens{8}{6}{-1}{-1}
+\tikz@def@grow@tokens{8}{7}{0}{-1}
+\tikz@def@grow@tokens{8}{8}{1}{-1}
+
+% Eight tokens
+\tikz@def@grow@tokens{9}{1}{-1}{1}
+\tikz@def@grow@tokens{9}{2}{0}{1}
+\tikz@def@grow@tokens{9}{3}{1}{1}
+\tikz@def@grow@tokens{9}{4}{-1}{0}
+\tikz@def@grow@tokens{9}{5}{0}{0}
+\tikz@def@grow@tokens{9}{6}{1}{0}
+\tikz@def@grow@tokens{9}{7}{-1}{-1}
+\tikz@def@grow@tokens{9}{8}{0}{-1}
+\tikz@def@grow@tokens{9}{9}{1}{-1}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
new file mode 100644
index 00000000000..f38560bc6a0
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
@@ -0,0 +1,14 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{plothandlers}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
new file mode 100644
index 00000000000..344db60fff0
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
@@ -0,0 +1,14 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{plotmarks}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
new file mode 100644
index 00000000000..0ebb15e18ca
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
@@ -0,0 +1,117 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex,v 1.5 2008/02/12 23:41:59 tantau Exp $
+
+
+\tikzset{above/.code=\tikz@lib@place@handle@{#1}{south}{0}{1}{north}{1}}
+\tikzset{above left/.code=\tikz@lib@place@handle@{#1}{south east}{-1}{1}{north west}{0.707106781}}
+\tikzset{above right/.code=\tikz@lib@place@handle@{#1}{south west}{1}{1}{north east}{0.707106781}}
+\tikzset{base left/.code =\tikz@lib@place@handle@{#1}{base east}{-1}{0}{base west}{1}}
+\tikzset{base right/.code=\tikz@lib@place@handle@{#1}{base west}{1}{0}{base east}{1}}
+\tikzset{below/.code=\tikz@lib@place@handle@{#1}{north}{0}{-1}{south}{1}}
+\tikzset{below left/.code=\tikz@lib@place@handle@{#1}{north east}{-1}{-1}{south west}{0.707106781}}
+\tikzset{below right/.code=\tikz@lib@place@handle@{#1}{north west}{1}{-1}{south east}{0.707106781}}
+\tikzset{left/.code =\tikz@lib@place@handle@{#1}{east}{-1}{0}{west}{1}}
+\tikzset{mid left/.code =\tikz@lib@place@handle@{#1}{mid east}{-1}{0}{base west}{1}}
+\tikzset{mid right/.code=\tikz@lib@place@handle@{#1}{mid west}{1}{0}{base east}{1}}
+\tikzset{right/.code=\tikz@lib@place@handle@{#1}{west}{1}{0}{east}{1}}
+
+\newif\iftikz@lib@ignore@size
+
+% Hook into resets:
+\pgfutil@g@addto@macro\tikz@node@reset@hook{\tikz@addtransform{\tikz@lib@pos@call}\let\tikz@lib@pos@call=\relax}
+
+\tikzset{on grid/.is if=tikz@lib@ignore@size}
+
+\tikzset{node distance=1cm and 1cm}
+
+\def\tikz@lib@place@handle@#1#2#3#4#5#6{%
+ \def\tikz@anchor{#2}%
+ \edef\tikz@temp{#1}%
+ \def\tikz@lib@place@single@factor{#6}%
+ \expandafter\tikz@lib@place@handle@@\expandafter{\tikz@temp}{#3}{#4}{#5}%
+}
+\def\tikz@lib@place@handle@@#1#2#3#4{%
+ \pgfutil@in@{of }{#1}%
+ \ifpgfutil@in@%
+ \tikz@lib@place@of#1\tikz@stop{#4}%
+ \else%
+ \edef\tikz@lib@place@nums{#1}%
+ \fi%
+ \ifx\tikz@lib@place@nums\pgfutil@empty%
+ % Ok, nothing to do, we have set the anchor and we are happy...
+ \else%
+ \expandafter\tikz@lib@place@parse@nums\expandafter{\tikz@lib@place@nums}%
+ \pgf@x=#2\pgf@x%
+ \pgf@y=#3\pgf@y%
+ \edef\tikz@lib@pos@call{\noexpand\pgftransformshift{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ \fi%
+}
+
+\def\tikz@lib@place@parse@nums#1{%
+ \pgfutil@in@{and}{#1}%
+ \ifpgfutil@in@%
+ \tikz@lib@place@parse@nums@#1\tikz@stop%
+ \else%
+ \tikz@lib@place@parse@nums@#1and#1\tikz@stop%
+ \pgf@x=\tikz@lib@place@single@factor\pgf@x%
+ \pgf@y=\tikz@lib@place@single@factor\pgf@y%
+ \fi
+}
+\def\tikz@lib@place@parse@nums@#1and#2\tikz@stop{%
+ \pgfmathparse{#2}%
+ \ifpgfmathunitsdeclared%
+ \pgf@xa=\pgfmathresult pt%
+ \pgf@ya=0pt%
+ \else%
+ \let\tikz@lib@temp=\pgfmathresult%
+ \pgf@process{\pgfpointxy{\tikz@lib@temp}{0}}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \fi%
+ \pgfmathparse{#1}%
+ \ifpgfmathunitsdeclared%
+ \advance\pgf@ya by\pgfmathresult pt%
+ \else%
+ \let\tikz@lib@temp=\pgfmathresult%
+ \pgf@process{\pgfpointxy{0}{\tikz@lib@temp}}%
+ \advance\pgf@xa by\pgf@x%
+ \advance\pgf@ya by\pgf@y%
+ \fi%
+ \pgf@x=\pgf@xa%
+ \pgf@y=\pgf@ya%
+}
+
+\def\tikz@lib@place@of#1of #2\tikz@stop#3{%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\pgfutil@empty%
+ \tikz@lib@place@of@{\tikz@node@distance}{#2}{#3}%
+ \else%
+ \tikz@lib@place@of@{#1}{#2}{#3}%
+ \fi%
+}
+\def\tikz@lib@place@of@#1#2#3{%
+ \tikz@scan@one@point\tikz@lib@place@remember(#2)%
+ \iftikz@shapeborder%
+ % Ok, this is relative to a border.
+ \iftikz@lib@ignore@size%
+ \edef\tikz@node@at{\noexpand\pgfpointanchor{\tikz@shapeborder@name}{center}}%
+ \def\tikz@anchor{center}%
+ \else%
+ \edef\tikz@node@at{\noexpand\pgfpointanchor{\tikz@shapeborder@name}{#3}}%
+ \fi%
+ \fi%
+ \edef\tikz@lib@place@nums{#1}%
+}
+\def\tikz@lib@place@remember#1{\def\tikz@node@at{#1}}
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
new file mode 100644
index 00000000000..4209c3e939d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
@@ -0,0 +1,38 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex,v 1.1 2008/02/08 01:18:38 tantau Exp $
+
+% Redefine the after command hook...
+
+\def\tikz@lib@scope@check{%
+ \pgfutil@ifnextchar\par{%
+ \afterassignment\tikz@lib@scope@check\let\tikz@next%
+ }%
+ {\pgfutil@ifnextchar\bgroup{%gotcha
+ \afterassignment\tikz@lib@scope@gotcha\let\tikz@next%
+ }%
+ {}%
+ }
+}
+
+\def\tikz@lib@scope@gotcha{%
+ \pgfutil@ifnextchar[{%]
+ \tikz@lib@scope@action%
+ }{%
+ % false alarm
+ \bgroup%
+ }%
+}
+\def\tikz@lib@scope@action[#1]{%
+ \scope[#1]\bgroup\aftergroup\endscope%
+ \tikz@lib@scope@check%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
new file mode 100644
index 00000000000..424e19b8502
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
@@ -0,0 +1,147 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex,v 1.3 2008/01/13 15:30:04 tantau Exp $
+
+\usetikzlibrary{fadings}
+
+
+% General options
+\tikzset{
+ /tikz/shadow scale/.initial=1,
+ /tikz/shadow xshift/.initial=0pt,
+ /tikz/shadow yshift/.initial=0pt,
+}
+
+% Basic shadow style
+\tikzset{
+ general shadow/.style={
+ preaction={
+ #1,
+ transform canvas={
+ scale around=\pgfkeysvalueof{/tikz/shadow scale}:(current path bounding box.center),
+ shift={(\pgfkeysvalueof{/tikz/shadow xshift},\pgfkeysvalueof{/tikz/shadow yshift})}
+ },
+ }
+ },
+ every shadow/.style={}
+}
+
+
+
+%
+% Adds a simple drop shadow to a path
+%
+
+\tikzset{
+ /tikz/drop shadow/.style={
+ general shadow={%
+ shadow scale=1,
+ shadow xshift=.5ex,
+ shadow yshift=-.5ex,
+ opacity=.5,
+ fill=black!50,
+ every shadow,
+ #1
+ }
+ }
+}
+
+
+%
+% Adds a circular drop shadow to a path
+%
+
+\tikzset{
+ /tikz/circular drop shadow/.style={
+ general shadow={%
+ shadow scale=1.1,
+ shadow xshift=.3ex,
+ shadow yshift=-.3ex,
+ fill=black!50,
+ path fading={circle with fuzzy edge 15 percent},
+ every shadow,
+ #1
+ }
+ }
+}
+
+
+
+%
+% Adds a circular glow to a path
+%
+
+\tikzset{
+ /tikz/circular glow/.style={
+ general shadow={%
+ shadow scale=1.25,
+ shadow xshift=0pt,
+ shadow yshift=0pt,
+ fill=black!50,
+ path fading={circle with fuzzy edge 15 percent},
+ every shadow,
+ #1,
+ }
+ }
+}
+
+
+
+
+
+%
+% Adds a "copy" version of the path behind it.
+%
+
+\tikzset{
+ /tikz/copy shadow/.style={
+ general shadow={%
+ /utils/exec={\let\tikz@lib@shadow@fill=\tikz@fillcolor\let\tikz@lib@shadow@draw=\tikz@strokecolor},
+ shadow scale=1,
+ shadow xshift=.5ex,
+ shadow yshift=.5ex,
+ fill=\tikz@lib@shadow@fill,
+ draw=\tikz@lib@shadow@draw,
+ every shadow,
+ #1
+ }
+ }
+}
+
+
+%
+% Adds two "copies" of the path behind it.
+%
+
+\tikzset{
+ /tikz/double copy shadow/.style={
+ general shadow={%
+ /utils/exec={\let\tikz@lib@shadow@fill=\tikz@fillcolor\let\tikz@lib@shadow@draw=\tikz@strokecolor},
+ shadow scale=1,
+ shadow xshift=.5ex,
+ shadow yshift=.5ex,
+ fill=\tikz@lib@shadow@fill,
+ draw=\tikz@lib@shadow@draw,
+ #1,
+ shadow xshift/.expanded=2*\pgfkeysvalueof{/tikz/shadow xshift},
+ shadow yshift/.expanded=2*\pgfkeysvalueof{/tikz/shadow yshift},
+ },
+ general shadow={%
+ /utils/exec={\let\tikz@lib@shadow@fill=\tikz@fillcolor\let\tikz@lib@shadow@draw=\tikz@strokecolor},
+ shadow scale=1,
+ shadow xshift=.5ex,
+ shadow yshift=.5ex,
+ fill=\tikz@lib@shadow@fill,
+ draw=\tikz@lib@shadow@draw,
+ #1,
+ },
+ }
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
new file mode 100644
index 00000000000..f8d0604c965
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
@@ -0,0 +1,16 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{shapes.arrows}
+
+\pgfkeys{/tikz/arrow box arrows/.code={\pgf@lib@arrowbox@parsearrows{#1}}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
new file mode 100644
index 00000000000..9bb2d738770
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
@@ -0,0 +1,35 @@
+% Copyright 2006 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usepgflibrary{shapes.callouts}
+
+\pgfkeys{/tikz/callout absolute pointer/.code={%
+ \tikz@scan@one@point\tikz@lib@callout@checkforplus#1\relax%
+ }%
+}
+
+\def\tikz@lib@callout@checkforplus#1{%
+ \pgfutil@ifnextchar+{\def\tikz@lib@callout@originalpoint{#1}\tikz@lib@callout@scan@relative}%
+ {\pgf@lib@callout@makeabsolutepointer{#1}}}%
+
+\def\tikz@lib@callout@scan@relative+{%
+ \pgfutil@ifnextchar+{\tikz@lib@callout@scan@plusplus}{\tikz@lib@callout@scan@plus}}
+\def\tikz@lib@callout@scan@plusplus+{\tikz@scan@one@point\tikz@lib@callout@add}
+\def\tikz@lib@callout@scan@plus{\tikz@scan@one@point\tikz@lib@callout@add}
+\def\tikz@lib@callout@add#1{%
+ \expandafter\pgf@lib@callout@makeabsolutepointer\expandafter{%
+ \expandafter\pgfpointadd\expandafter{\tikz@lib@callout@originalpoint}{#1}}%
+}%
+
+\pgfkeys{/tikz/callout relative pointer/.code={%
+ \tikz@scan@one@point\pgf@lib@callout@makerelativepointer#1\relax%
+ }%
+}
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
new file mode 100644
index 00000000000..83c808071bf
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
@@ -0,0 +1,19 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usetikzlibrary{shapes.geometric}
+\usetikzlibrary{shapes.misc}
+\usetikzlibrary{shapes.symbols}
+\usetikzlibrary{shapes.arrows}
+\usetikzlibrary{shapes.callouts}
+\usetikzlibrary{shapes.multipart}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
new file mode 100644
index 00000000000..ae11747144e
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
@@ -0,0 +1,40 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex,v 1.3 2008/01/27 11:39:49 vibrovski Exp $
+
+\usepgflibrary{shapes.gates.logic.IEC}
+
+\tikzset{%
+ use IEC style logic gates/.code={%
+ \tikzset{%
+ and gate/.style={shape=and gate IEC},
+ nand gate/.style={shape=nand gate IEC},
+ or gate/.style={shape=or gate IEC},
+ nor gate/.style={shape=nor gate IEC},
+ xor gate/.style={shape=xor gate IEC},
+ xnor gate/.style={shape=xnor gate IEC},
+ not gate/.style={shape=not gate IEC},
+ buffer gate/.style={shape=buffer gate IEC},
+ and gate symbol/.style={and gate IEC symbol={##1}},
+ nand gate symbol/.style={nand gate IEC symbol={##1}},
+ or gate symbol/.style={or gate IEC symbol={##1}},
+ nor gate symbol/.style={nor gate IEC symbol={##1}},
+ xor gate symbol/.style={xor gate IEC symbol={##1}},
+ xnor gate symbol/.style={xnor gate IEC symbol={##1}},
+ not gate symbol/.style={not gate IEC symbol={##1}},
+ buffer gate symbol/.style={buffer gate IEC symbol={##1}},
+ logic gate symbol align/.style={/pgf/logic gate IEC symbol align={##1}},
+ logic gate symbol color/.style={/pgf/logic gate IEC symbol color={##1}}
+ }%
+ }%
+}
+\endinput
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
new file mode 100644
index 00000000000..0b8a744126b
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
@@ -0,0 +1,40 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex,v 1.1 2008/01/25 08:26:00 vibrovski Exp $
+
+\usepgflibrary{shapes.gates.logic.US}
+
+\tikzset{%
+ use US style logic gates/.code={%
+ \tikzset{%
+ and gate/.style={shape=and gate US},
+ nand gate/.style={shape=nand gate US},
+ or gate/.style={shape=or gate US},
+ nor gate/.style={shape=nor gate US},
+ xor gate/.style={shape=xor gate US},
+ xnor gate/.style={shape=xnor gate US},
+ not gate/.style={shape=not gate US},
+ buffer gate/.style={shape=buffer gate US}
+ }%
+ },
+ use CDH style logic gates/.code={%
+ \tikzset{%
+ and gate/.style={shape=and gate CDH},
+ nand gate/.style={shape=nand gate CDH},
+ or gate/.style={shape=or gate US},
+ nor gate/.style={shape=nor gate US},
+ xor gate/.style={shape=xor gate US},
+ xnor gate/.style={shape=xnor gate US},
+ not gate/.style={shape=not gate US},
+ buffer gate/.style={shape=buffer gate US}
+ }
+ }
+}
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
new file mode 100644
index 00000000000..dc5aad85554
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
@@ -0,0 +1,14 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{shapes.geometric}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
new file mode 100644
index 00000000000..10794a092d2
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
@@ -0,0 +1,14 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{shapes.misc}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
new file mode 100644
index 00000000000..564c77f8a80
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
@@ -0,0 +1,36 @@
+% Copyright 2007 by Till Tantau and Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\usepgflibrary{shapes.multipart}
+
+\pgfkeys{/tikz/rectangle split/parts/.code={%
+ \pgfkeys{/pgf/rectangle split parts=#1}%
+ }%
+}
+
+\pgfkeys{/tikz/rectangle split use custom fill/.code={%
+ \pgfkeys{/pgf/rectangle split use custom fill=#1}%
+ \pgfkeys{/tikz/fill=none}}%
+}
+
+\pgfkeys{/tikz/rectangle split draw splits/.is if=pgfrectanglesplitdrawsplits}
+
+\pgfkeys{/tikz/rectangle split part align/.code={%
+ \pgfkeys{/pgf/rectangle split part align={#1}}%
+ }%
+}%
+
+\pgfkeys{/tikz/rectangle split part fill/.code={%
+ \pgfkeys{/pgf/rectangle split part fill={#1}}%
+ }%
+}%
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
new file mode 100644
index 00000000000..f3b935dc0bc
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
@@ -0,0 +1,17 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+\pgfkeysifdefined{/tikz/shape border uses incircle}{}{%
+ \pgfkeys{/tikz/shape border uses incircle/.is if=pgfshapeborderusesincircle}}
+
+\usepgflibrary{shapes.symbols}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
new file mode 100644
index 00000000000..363beabe4c7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
@@ -0,0 +1,77 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex,v 1.6 2008/02/05 13:08:05 tantau Exp $
+
+\PackageWarning{tikz}{Snakes have been superseded by
+decorations. Please use the decoration libraries instead of the snakes
+library}
+
+\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes}
+
+
+% Old snakes stuff:
+
+\tikzoption{snake}[]{%
+ \def\tikz@@snake{#1}%
+ \ifx\tikz@@snake\pgfutil@empty%
+ \tikz@snakedtrue%
+ \else%
+ \ifx\tikz@@snake\tikz@nonetext%
+ \tikz@snakedfalse%
+ \else%
+ \tikz@snakedtrue%
+ \let\tikz@snake=\tikz@@snake%
+ \fi%
+ \fi}
+
+\tikzoption{raise snake}{\def\pgf@snake@raise{\pgftransformyshift{#1}}}
+\tikzoption{mirror snake}[true]{%
+ \csname if#1\endcsname
+ \def\pgf@snake@mirror{\pgftransformyscale{-1}}%
+ \else%
+ \let\pgf@snake@mirror=\pgfutil@empty%
+ \fi
+}
+
+\tikzoption{gap before snake}{\def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}}
+\tikzoption{line before snake}{\def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}}
+
+\tikzoption{gap after snake}{\def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}
+\tikzoption{line after snake}{\def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}
+
+\tikzoption{gap around snake}{%
+ \def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
+ \def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
+ \def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}%
+}
+\tikzoption{line around snake}{%
+ \def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
+ \def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
+ \def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}%
+}
+\let\pgf@snake@mirror=\pgfutil@empty
+\let\pgf@snake@raise=\pgfutil@empty
+
+\def\tikz@snake@install@trans{\pgfsetsnakesegmenttransformation{\pgf@snake@mirror\pgf@snake@raise}}
+
+\def\tikz@snake{zigzag}
+
+\let\tikz@presnake=\pgfutil@empty
+\let\tikz@postsnake=\pgfutil@empty
+\def\tikz@mainsnakelength{\pgfsnakeremainingdistance}
+
+
+\tikzstyle{snake triangles 45}= [snake=triangles,segment object length=2.41421356\pgfsnakesegmentamplitude]
+\tikzstyle{snake triangles 60}= [snake=triangles,segment object length=1.73205081\pgfsnakesegmentamplitude]
+\tikzstyle{snake triangles 90}= [snake=triangles,segment object length=\pgfsnakesegmentamplitude]
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
new file mode 100644
index 00000000000..f369a23b830
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
@@ -0,0 +1,36 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex,v 1.1 2008/02/03 19:37:27 tantau Exp $
+
+
+
+\tikzset{circle through/.code={%
+ \pgfkeysalso{shape=circle,inner sep=0pt,outer sep=0pt}%
+ % Save transformations (correct?)
+ \pgfgettransform{\tikz@lib@saved@transform}%
+ \tikz@scan@one@point\tikz@lib@circle@through#1%
+ }}
+
+\def\tikz@lib@circle@through#1{%
+ \tikz@addoption{%
+ {%
+ \pgfsettransform{\tikz@lib@saved@transform}%
+ \pgf@process{\pgfpointtransformed{#1}}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointtransformed{\tikz@node@at}}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \pgfmathparse{2*veclen(\the\pgf@xa,\the\pgf@ya)}%
+ \global\let\tikz@lib@circle@size=\pgfmathresult%
+ }%
+ \pgfset{/pgf/minimum size/.expanded=\tikz@lib@circle@size}%
+ }%
+} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
new file mode 100644
index 00000000000..2be37e7d3d3
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
@@ -0,0 +1,378 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+
+% Straight to
+
+\tikzstyle{line to}= [to path={-- (\tikztotarget) \tikztonodes}]
+
+
+% Curved to
+
+\tikzstyle{every curve to}= []
+\tikzstyle{curve to}= [to path=\tikz@to@curve@path]
+
+\tikzoption{bend angle}{\def\tikz@to@bend{#1}}
+
+\tikzoption{bend left}[]{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \def\tikz@to@bend{#1}%
+ \fi%
+ \let\tikz@to@out=\tikz@to@bend%
+ \c@pgf@counta=180\relax%
+ \advance\c@pgf@counta by-\tikz@to@out\relax%
+ \edef\tikz@to@in{\the\c@pgf@counta}%
+ \tikz@to@switch@on%
+ \tikz@to@relativetrue%
+}
+
+\tikzoption{bend right}[]{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \def\tikz@to@bend{#1}%
+ \fi%
+ % Now, negate
+ \c@pgf@counta=\tikz@to@bend\relax%
+ \c@pgf@counta=-\c@pgf@counta\relax%
+ \edef\tikz@to@out{\the\c@pgf@counta}%
+ \c@pgf@counta=180\relax%
+ \advance\c@pgf@counta by-\tikz@to@out\relax%
+ \edef\tikz@to@in{\the\c@pgf@counta}%
+ \tikz@to@switch@on%
+ \tikz@to@relativetrue%
+}
+
+\tikzoption{relative}[true]{\csname tikz@to@relative#1\endcsname}
+\newif\iftikz@to@relative
+\tikz@to@relativefalse
+
+\tikzoption{in}{\def\tikz@to@in{#1}\tikz@to@switch@on}
+\tikzoption{out}{\def\tikz@to@out{#1}\tikz@to@switch@on}
+
+\tikzoption{in looseness}{\tikz@to@set@in@looseness{#1}}
+\tikzoption{out looseness}{\tikz@to@set@out@looseness{#1}}
+\tikzoption{looseness}{\tikz@to@set@in@looseness{#1}\tikz@to@set@out@looseness{#1}}
+
+\tikzoption{in control}{\tikz@to@set@in@control{#1}}
+\tikzoption{out control}{\tikz@to@set@out@control{#1}}
+\tikzoption{controls}{\tikz@to@parse@controls#1\pgf@stop}
+
+\tikzoption{in min distance}{\tikz@to@set@distances{#1}{}{}{}}
+\tikzoption{in max distance}{\tikz@to@set@distances{}{#1}{}{}}
+\tikzoption{in distance}{\tikz@to@set@distances{#1}{#1}{}{}}
+\tikzoption{out min distance}{\tikz@to@set@distances{}{}{#1}{}}
+\tikzoption{out max distance}{\tikz@to@set@distances{}{}{}{#1}}
+\tikzoption{out distance}{\tikz@to@set@distances{}{}{#1}{#1}}
+\tikzoption{min distance}{\tikz@to@set@distances{#1}{}{#1}{}}
+\tikzoption{max distance}{\tikz@to@set@distances{}{#1}{}{#1}}
+\tikzoption{distance}{\tikz@to@set@distances{#1}{#1}{#1}{#1}}
+
+\def\tikz@to@set@distances#1#2#3#4{%
+ \tikz@to@setifnotempy{#1}{\tikz@to@in@min}{\let\tikz@to@end@compute=\tikz@to@end@compute@looseness}%
+ \tikz@to@setifnotempy{#2}{\tikz@to@in@max}{\let\tikz@to@end@compute=\tikz@to@end@compute@looseness}%
+ \tikz@to@setifnotempy{#3}{\tikz@to@out@min}{\let\tikz@to@start@compute=\tikz@to@start@compute@looseness}%
+ \tikz@to@setifnotempy{#4}{\tikz@to@out@max}{\let\tikz@to@start@compute=\tikz@to@start@compute@looseness}%
+ \tikz@to@switch@on%
+}
+
+\def\tikz@to@setifnotempy#1#2#3{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty\else\def#2{#1}#3\fi%
+}
+
+
+\def\tikz@to@set@in@looseness#1{%
+ \def\tikz@to@in@looseness{#1}%
+ \let\tikz@to@end@compute=\tikz@to@end@compute@looseness%
+ \tikz@to@switch@on%
+}
+\def\tikz@to@set@out@looseness#1{%
+ \def\tikz@to@out@looseness{#1}%
+ \let\tikz@to@start@compute=\tikz@to@start@compute@looseness%
+ \tikz@to@switch@on%
+}
+
+\def\tikz@to@parse@controls#1and#2\pgf@stop{\tikz@to@set@in@control{#2}\tikz@to@set@out@control{#1}}
+
+\def\tikz@to@set@in@control#1{%
+ \def\tikz@to@in@control{#1}%
+ \let\tikz@to@end@compute=\tikz@to@end@compute@control%
+ \tikz@to@switch@on%
+}
+\def\tikz@to@set@out@control#1{%
+ \def\tikz@to@out@control{#1}%
+ \let\tikz@to@start@compute=\tikz@to@start@compute@control%
+ \tikz@to@switch@on%
+}
+
+
+\def\tikz@to@bend{30}
+
+\def\tikz@to@out{45}
+\def\tikz@to@in{135}
+
+\def\tikz@to@out@looseness{1}
+\def\tikz@to@in@looseness{1}
+
+\def\tikz@to@in@min{0pt}
+\def\tikz@to@in@max{10000pt}
+\def\tikz@to@out@min{0pt}
+\def\tikz@to@out@max{10000pt}
+
+\def\tikz@to@switch@on{\let\tikz@to@path=\tikz@to@curve@path}
+
+\def\tikz@to@curve@path{%
+ [every curve to]
+ \pgfextra{\iftikz@to@relative\tikz@to@compute@relative\else\tikz@to@compute\fi}
+ \tikz@computed@path
+ \tikztonodes%
+}
+
+\def\tikz@to@modify#1#2{%
+ \pgfutil@ifundefined{pgf@sh@ns@#1}
+ {}%
+ {\edef#1{#1.#2}}
+}%
+
+\def\tikz@to@compute{%
+ \let\tikz@tofrom=\tikztostart%
+ \let\tikz@toto=\tikztotarget%
+ \tikz@to@modify\tikz@tofrom\tikz@to@out%
+ \tikz@to@modify\tikz@toto\tikz@to@in%
+ \ifx\tikz@to@start@compute\tikz@to@start@compute@looseness%
+ \tikz@to@compute@distance%
+ \else%
+ \ifx\tikz@from@start@compute\tikz@to@start@compute@looseness%
+ \tikz@to@compute@distance%
+ \fi%
+ \fi%
+ \tikz@to@start@compute%
+ \tikz@to@end@compute%
+ \edef\tikz@computed@path{.. controls \tikz@computed@start and \tikz@computed@end .. (\tikz@toto)}
+}
+
+\def\tikz@to@compute@distance{\tikz@scan@one@point\tikz@@to@compute@distance(\tikz@tofrom)}
+\def\tikz@@to@compute@distance#1{%
+ \def\tikz@first@point{#1}%
+ \tikz@scan@one@point\tikz@@@to@compute@distance(\tikz@toto)}
+\def\tikz@@@to@compute@distance#1{%
+ \def\tikz@second@point{#1}%
+ \tikz@to@compute@distance@main%
+}
+\def\tikz@to@compute@distance@main{%
+ \pgf@process{\pgfpointdiff{\tikz@first@point}{\tikz@second@point}}%
+ \ifdim\pgf@x<0pt\pgf@xa=-\pgf@x\else\pgf@xa=\pgf@x\fi%
+ \ifdim\pgf@y<0pt\pgf@ya=-\pgf@y\else\pgf@ya=\pgf@y\fi%
+ %
+ % Calculate length of second to first vector:
+ %
+ \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}%
+ \ifdim\pgf@x>\pgf@y%
+ \c@pgf@counta=\pgf@x%
+ \ifnum\c@pgf@counta=0\relax%
+ \else%
+ \divide\c@pgf@counta by 255\relax%
+ \pgf@xa=16\pgf@xa\relax%
+ \divide\pgf@xa by\c@pgf@counta%
+ \pgf@xa=16\pgf@xa\relax%
+ \fi%
+ \else%
+ \c@pgf@counta=\pgf@y%
+ \ifnum\c@pgf@counta=0\relax%
+ \else%
+ \divide\c@pgf@counta by 255\relax%
+ \pgf@ya=16\pgf@ya\relax%
+ \divide\pgf@ya by\c@pgf@counta%
+ \pgf@xa=16\pgf@ya\relax%
+ \fi%
+ \fi%
+ \pgf@x=0.3915\pgf@xa%
+ \pgf@xa=\tikz@to@out@looseness\pgf@x%
+ \pgf@xb=\tikz@to@in@looseness\pgf@x%
+ % Adjust as necessary
+ \pgfmathsetlength{\pgf@ya}{\tikz@to@out@min}
+ \ifdim\pgf@xa<\pgf@ya%
+ \pgf@xa=\pgf@ya%
+ \fi%
+ \pgfmathsetlength{\pgf@ya}{\tikz@to@out@max}
+ \ifdim\pgf@xa>\pgf@ya%
+ \pgf@xa=\pgf@ya%
+ \fi%
+ \pgfmathsetlength{\pgf@ya}{\tikz@to@in@min}
+ \ifdim\pgf@xb<\pgf@ya%
+ \pgf@xb=\pgf@ya%
+ \fi%
+ \pgfmathsetlength{\pgf@ya}{\tikz@to@in@max}
+ \ifdim\pgf@xb>\pgf@ya%
+ \pgf@xb=\pgf@ya%
+ \fi%
+}
+
+\def\tikz@to@start@compute@looseness{%
+ \edef\tikz@computed@start{([shift=(\tikz@to@out:\the\pgf@xa)]\tikz@tofrom)}%
+}
+\def\tikz@to@end@compute@looseness{%
+ \edef\tikz@computed@end{([shift=(\tikz@to@in:\the\pgf@xb)]\tikz@toto)}%
+}
+\def\tikz@to@start@compute@control{%
+ \let\tikz@computed@start=\tikz@to@out@control%
+}
+\def\tikz@to@end@compute@control{%
+ \let\tikz@computed@end=\tikz@to@in@control%
+}
+
+\let\tikz@to@start@compute=\tikz@to@start@compute@looseness%
+\let\tikz@to@end@compute=\tikz@to@end@compute@looseness%
+
+
+
+
+% Relative curves
+
+\def\tikz@to@compute@relative{%
+ \tikz@scan@one@point\tikz@@to@compute@relative(\tikztostart)%
+}
+\def\tikz@@to@compute@relative#1{%
+ \def\tikz@tofrom{#1}%
+ \tikz@scan@one@point\tikz@@@to@compute@relative(\tikztotarget)%
+}
+\def\tikz@@@to@compute@relative#1{%
+ \def\tikz@toto{#1}%
+ \begingroup
+ %
+ % Adjust start and target so that they lie on the border in the
+ % rotated coordinate system.
+ %
+ \pgfutil@ifundefined{pgf@sh@ns@\tikztostart}
+ {%
+ \let\tikz@first@point=\tikz@tofrom%
+ \let\tikz@tostart@tikz=\pgfutil@empty
+ }%
+ {%
+ % Start computation of new start.
+ {%
+ \tikz@tofrom%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ {%
+ \pgftransformreset%
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \pgftransformrotate{\tikz@to@out}%
+ \pgftransformshift{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}%
+ \pgf@process{\pgfpointtransformed{\tikz@toto}}%
+ }%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgfpointshapeborder{\tikztostart}{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \xdef\tikz@tofrom@smuggle{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ }%
+ \let\tikz@first@point=\tikz@tofrom@smuggle%
+ \tikz@first@point%
+ \edef\tikz@tostart@tikz{(\the\pgf@x,\the\pgf@y)}%
+ }%
+ \pgfutil@ifundefined{pgf@sh@ns@\tikztotarget}
+ {%
+ \let\tikz@second@point=\tikz@toto%
+ }%
+ {%
+ % Start computation of new target.
+ {%
+ \tikz@toto%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ {%
+ \pgftransformreset%
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \pgftransformrotate{180}%
+ \pgftransformrotate{\tikz@to@in}%
+ \pgftransformshift{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}%
+ \pgf@process{\pgfpointtransformed{\tikz@tofrom}}%
+ }%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgfpointshapeborder{\tikztotarget}{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \xdef\tikz@toto@smuggle{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ }%
+ \let\tikz@second@point=\tikz@toto@smuggle%
+ }%
+ \tikz@second@point%
+ \edef\tikz@totarget@tikz{(\the\pgf@x,\the\pgf@y)}%
+ %
+ % Compute distances
+ %
+ \tikz@to@compute@distance@main%
+ \edef\tikz@to@first@distance{\the\pgf@xa}%
+ \edef\tikz@to@second@distance{\the\pgf@xb}%
+ %
+ % Next step: Establish a transformed coordinate system so that the (modified)
+ % start is at the origin and the (modified) target is at (1,0)
+ %
+ \pgftransformreset%
+ \pgf@process{\tikz@first@point}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@second@point}%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \pgfpointnormalised{}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@xb=-\pgf@x%
+ \pgf@yb=-\pgf@y%
+ %
+ % Now compute the control points.
+ %
+ {%
+ \pgftransformshift{\tikz@first@point}%
+ \pgftransformcm{\pgf@sys@tonumber\pgf@xc}{\pgf@sys@tonumber\pgf@yc}{\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@xc}%
+ {\pgfpointorigin}%
+ \pgf@process{\pgfpointtransformed{\pgfpointpolar{\tikz@to@out}{\tikz@to@first@distance}}}%
+ \xdef\tikz@computed@start{(\the\pgf@x,\the\pgf@y)}%
+ }
+ {%
+ \pgftransformshift{\tikz@second@point}%
+ \pgftransformcm{\pgf@sys@tonumber\pgf@xc}{\pgf@sys@tonumber\pgf@yc}{\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@xc}%
+ {\pgfpointorigin}%
+ \pgf@process{\pgfpointtransformed{\pgfpointpolar{\tikz@to@in}{\tikz@to@second@distance}}}%
+ \xdef\tikz@computed@end{(\the\pgf@x,\the\pgf@y)}%
+ }
+ \xdef\tikz@computed@path{
+ \tikz@tostart@tikz
+ .. controls \tikz@computed@start and \tikz@computed@end ..
+ \tikz@totarget@tikz}%
+ \endgroup
+}
+
+
+
+% Loops
+
+\tikzstyle{loop}= [to path={
+ \pgfextra{\let\tikztotarget=\tikztostart}
+ [looseness=8,min distance=5mm,every loop]
+ \tikz@to@curve@path
+ }]
+
+\tikzstyle{every loop}= [->,shorten >=1pt]
+
+\tikzstyle{loop right}= [right,out=15,in=-15,loop]
+\tikzstyle{loop above}= [above,out=105,in=75,loop]
+\tikzstyle{loop left}= [left,out=195,in=165,loop]
+\tikzstyle{loop below}= [below,out=285,in=255,loop]
+
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
new file mode 100644
index 00000000000..838bb20be21
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
@@ -0,0 +1,102 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+
+
+
+%
+% Three point growth
+%
+
+\tikzoption{grow via three points}{\let\tikz@grow=\tikz@grow@three\tikz@parse@three#1}
+
+\def\tikz@parse@three one child at#1(#2)#3and two children at#4(#5)#6and#7(#8){%
+ \def\tikz@tree@one@child{\tikz@scan@one@point\pgf@process(#2)}
+ \def\tikz@tree@left@child{\tikz@scan@one@point\pgf@process(#5)}
+ \def\tikz@tree@right@child{\tikz@scan@one@point\pgf@process(#8)}
+}
+
+\def\tikz@grow@three{%
+ \pgf@process{\tikz@tree@one@child}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@tree@left@child}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \advance\pgf@xb by-\pgf@xa%
+ \advance\pgf@yb by-\pgf@ya%
+ \pgf@process{\tikz@tree@right@child}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xc by-\pgf@xa%
+ \advance\pgf@yc by-\pgf@ya%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \advance\tikznumberofchildren by-1\relax%
+ \pgf@xb=\tikznumberofchildren\pgf@xb\relax%
+ \pgf@yb=\tikznumberofchildren\pgf@yb\relax%
+ \advance\tikznumberofcurrentchild by-1\relax%
+ \pgf@xc=\tikznumberofcurrentchild\pgf@xc\relax%
+ \pgf@yc=\tikznumberofcurrentchild\pgf@yc\relax%
+ \advance\pgf@xa by\pgf@xb%
+ \advance\pgf@xa by\pgf@xc%
+ \advance\pgf@ya by\pgf@yb%
+ \advance\pgf@ya by\pgf@yc%
+ \edef\pgf@temp{\noexpand\pgftransformshift{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}}%
+ \pgf@temp%
+}
+
+%
+% Circle grow
+%
+
+\tikzstyle{grow cyclic}=[growth function=\tikz@grow@circle]
+
+\tikzset{sibling angle/.initial=20}
+
+\def\tikz@grow@circle{%
+ \pgftransformrotate{%
+ (\pgfkeysvalueof{/tikz/sibling angle})*(-.5-.5*\tikznumberofchildren+\tikznumberofcurrentchild)}%
+ \pgftransformxshift{\the\tikzleveldistance}%
+}
+
+\tikzoption{counterclockwise from}{\let\tikz@grow=\tikz@grow@circle@from\def\tikz@grow@circle@from@start{#1}}
+
+\def\tikz@grow@circle@from{%
+ \pgftransformshift{\pgfpointpolar{\tikz@grow@circle@from@start+(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}{\the\tikzleveldistance}}%
+}
+
+\tikzoption{clockwise from}{\let\tikz@grow=\tikz@grow@circle@from@\def\tikz@grow@circle@from@start{#1}}
+
+\def\tikz@grow@circle@from@{%
+ \pgftransformshift{\pgfpointpolar{\tikz@grow@circle@from@start-(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}{\the\tikzleveldistance}}%
+}
+
+
+
+%
+% Connections
+%
+
+\tikzstyle{edge from parent fork down}=
+ [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(0pt,-.5\tikzleveldistance) -| (\tikzchildnode\tikzchildanchor)}]
+
+\tikzstyle{edge from parent fork up}=
+ [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(0pt,.5\tikzleveldistance) -| (\tikzchildnode\tikzchildanchor)}]
+
+\tikzstyle{edge from parent fork left}=
+ [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(-.5\tikzleveldistance,0pt) |- (\tikzchildnode\tikzchildanchor)}]
+
+\tikzstyle{edge from parent fork right}=
+ [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(.5\tikzleveldistance,0pt) |- (\tikzchildnode\tikzchildanchor)}]
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
new file mode 100644
index 00000000000..cb8ad420ea8
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
@@ -0,0 +1,3909 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/tikz.code.tex,v 1.27 2008/02/13 19:48:11 tantau Exp $
+
+
+% Always-present libraries:
+
+\usepgflibrary{plothandlers}
+
+% TikZ is a key family
+\pgfkeys{/tikz/.is family}
+
+\def\tikzset{\pgfqkeys{/tikz}}
+
+
+\newdimen\tikz@lastx
+\newdimen\tikz@lasty
+\newdimen\tikz@lastxsaved
+\newdimen\tikz@lastysaved
+
+\newdimen\tikzleveldistance
+\newdimen\tikzsiblingdistance
+
+\newbox\tikz@figbox
+\newbox\tikz@tempbox
+
+\newcount\tikztreelevel
+\newcount\tikznumberofchildren
+\newcount\tikznumberofcurrentchild
+
+\newcount\tikz@fig@count
+
+\newif\iftikz@node@is@a@label
+\newif\iftikz@snaked
+\newif\iftikz@decoratepath
+
+\let\tikz@options=\pgfutil@empty
+\def\tikz@addoption#1{\expandafter\def\expandafter\tikz@options\expandafter{\tikz@options#1}}
+\def\tikz@addmode#1{\expandafter\def\expandafter\tikz@mode\expandafter{\tikz@mode#1}}
+\def\tikz@addtransform#1{%
+ \ifx\tikz@transform\relax%
+ #1%
+ \else%
+ \expandafter\def\expandafter\tikz@transform\expandafter{\tikz@transform#1}%
+ \fi%
+}
+
+
+
+% TikZ options:
+
+% This command is supported for compatibility only:
+
+\def\tikzoption#1{\pgfutil@ifnextchar[{\tikzoption@opt{#1}}{\tikzoption@noopt{#1}}}%}
+
+\def\tikzoption@opt#1[#2]#3{\pgfkeysdef{/tikz/#1}{#3}\pgfkeyssetvalue{/tikz/#1/.@def}{#2}}
+\def\tikzoption@noopt#1#2{\pgfkeysdef{/tikz/#1}{#2}\pgfkeyssetvalue{/tikz/#1/.@def}{\pgfkeysvaluerequired}}
+
+% Baseline options
+\tikzoption{baseline}[0pt]{\pgfutil@ifnextchar({\tikz@baseline@coordinate}{\tikz@baseline@simple}#1\@nil}%)
+\def\tikz@baseline@simple#1\@nil{\pgfsetbaseline{#1}}
+\def\tikz@baseline@coordinate#1\@nil{\pgfsetbaselinepointlater{\tikz@scan@one@point\pgfutil@firstofone#1}}
+
+% Draw options
+\tikzoption{line width}{\tikz@semiaddlinewidth{#1}}%
+
+\def\tikz@semiaddlinewidth#1{\tikz@addoption{\pgfsetlinewidth{#1}}\pgfmathsetlength\pgflinewidth{#1}}
+
+\tikzoption{cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}}
+\tikzoption{join}{\tikz@addoption{\csname pgfset#1join\endcsname}}
+\tikzoption{line cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}}
+\tikzoption{line join}{\tikz@addoption{\csname pgfset#1join\endcsname}}
+\tikzoption{miter limit}{\tikz@addoption{\pgfsetmiterlimit{#1}}}
+
+\tikzoption{dash pattern}{% syntax: on 2pt off 3pt on 4pt ...
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\pgfutil@empty%
+ \def\tikz@dashpattern{}%
+ \tikz@addoption{\pgfsetdash{}{0pt}}%
+ \else%
+ \def\tikz@dashpattern{}%
+ \expandafter\tikz@scandashon\pgfutil@gobble#1o\@nil%
+ \edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}%
+ \expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}%
+ \fi}
+\tikzoption{dash phase}{%
+ \def\tikz@dashphase{#1}%
+ \edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}%
+ \expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}%
+}%
+\def\tikz@dashphase{0pt}
+
+\def\tikz@scandashon n#1o{%
+ \expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}%
+ \pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashoff}}
+\def\tikz@scandashoff ff#1o{%
+ \expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}%
+ \pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashon}}
+
+\tikzoption{draw opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}}}
+
+% Double draw options
+\tikzoption{double}[]{%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@nonetext%
+ \tikz@addmode{\tikz@mode@doublefalse}%
+ \else%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \def\tikz@double@color{#1}%
+ \fi%
+ \tikz@addmode{\tikz@mode@doubletrue}%
+ \fi}
+\tikzoption{double distance}{%
+ \pgfmathsetlength{\pgf@x}{#1}%
+ \edef\tikz@double@width@distance{\the\pgf@x}%
+ \tikz@addmode{\tikz@mode@doubletrue}}
+
+\def\tikz@double@width@distance{0.6pt}
+\def\tikz@double@color{white}
+
+% Fill options
+
+\tikzoption{even odd rule}[]{\tikz@addoption{\pgfseteorule}}
+\tikzoption{nonzero rule}[]{\tikz@addoption{\pgfsetnonzerorule}}
+
+\tikzoption{fill opacity}{\tikz@addoption{\pgfsetfillopacity{#1}}}
+
+
+% Joined fill/draw options
+
+\tikzoption{opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}\pgfsetfillopacity{#1}}}
+
+
+% Main color options
+\tikzoption{color}{%
+ \tikz@addoption{%
+ \ifx\tikz@fillcolor\pgfutil@empty%
+ \ifx\tikz@strokecolor\pgfutil@empty%
+ \else%
+ \pgfsys@color@reset@inorderfalse%
+ \let\tikz@strokecolor\pgfutil@empty%
+ \let\tikz@fillcolor\pgfutil@empty%
+ \fi%
+ \else%
+ \pgfsys@color@reset@inorderfalse%
+ \let\tikz@strokecolor\pgfutil@empty%
+ \let\tikz@fillcolor\pgfutil@empty%
+ \fi%
+ \pgfutil@colorlet{tikz@color}{#1}%
+ \pgfutil@colorlet{.}{tikz@color}%
+ \pgfsetcolor{.}%
+ \pgfsys@color@reset@inordertrue%
+ }%
+ \def\tikz@textcolor{#1}}
+
+
+
+% Rounding options
+\tikzoption{rounded corners}[4pt]{\pgfsetcornersarced{\pgfpoint{#1}{#1}}}
+\tikzoption{sharp corners}[]{\pgfsetcornersarced{\pgfpointorigin}}
+
+
+
+% Coordinate options
+\tikzoption{x}{\tikz@handle@vec{\pgfsetxvec}{\tikz@handle@x}#1\relax}
+\tikzoption{y}{\tikz@handle@vec{\pgfsetyvec}{\tikz@handle@y}#1\relax}
+\tikzoption{z}{\tikz@handle@vec{\pgfsetzvec}{\tikz@handle@z}#1\relax}
+
+\def\tikz@handle@vec#1#2{\pgfutil@ifnextchar({\tikz@handle@coordinate#1}{\tikz@handle@single#2}}
+\def\tikz@handle@coordinate#1{\tikz@scan@one@point#1}
+\def\tikz@handle@single#1#2\relax{#1{#2}}
+\def\tikz@handle@x#1{\pgfsetxvec{\pgfpoint{#1}{0pt}}}
+\def\tikz@handle@y#1{\pgfsetyvec{\pgfpoint{0pt}{#1}}}
+\def\tikz@handle@z#1{\pgfsetzvec{\pgfpoint{#1}{#1}}}
+
+
+% Transformation options
+\tikzoption{scale}{\tikz@addtransform{\pgftransformscale{#1}}}
+\tikzoption{scale around}{\tikz@addtransform{\def\tikz@aroundaction{\pgftransformscale}\tikz@doaround{#1}}}
+\tikzoption{xscale}{\tikz@addtransform{\pgftransformxscale{#1}}}
+\tikzoption{xslant}{\tikz@addtransform{\pgftransformxslant{#1}}}
+\tikzoption{yscale}{\tikz@addtransform{\pgftransformyscale{#1}}}
+\tikzoption{yslant}{\tikz@addtransform{\pgftransformyslant{#1}}}
+\tikzoption{rotate}{\tikz@addtransform{\pgftransformrotate{#1}}}
+\tikzoption{rotate around}{\tikz@addtransform{\def\tikz@aroundaction{\pgftransformrotate}\tikz@doaround{#1}}}
+\def\tikz@doaround#1{%
+ \edef\tikz@temp{#1}% get rid of active stuff
+ \expandafter\tikz@doparseA\tikz@temp%
+}%
+\def\tikz@doparseA#1:{%
+ \def\tikz@temp@rot{#1}%
+ \tikz@scan@one@point\tikz@doparseB%
+}
+\def\tikz@doparseB#1{%
+ \pgf@process{#1}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \tikz@aroundaction{\tikz@temp@rot}%
+ \pgftransformshift{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}%
+}
+
+\tikzoption{shift}{\tikz@addtransform{\tikz@scan@one@point\pgftransformshift#1\relax}}
+\tikzoption{xshift}{\tikz@addtransform{\pgftransformxshift{#1}}}
+\tikzoption{yshift}{\tikz@addtransform{\pgftransformyshift{#1}}}
+\tikzoption{cm}{\tikz@addtransform{\tikz@parse@cm#1\relax}}
+\tikzoption{reset cm}[]{\tikz@addtransform{\pgftransformreset}}
+\tikzoption{shift only}[]{\tikz@addtransform{\pgftransformresetnontranslations}}
+
+\def\tikz@parse@cm#1,#2,#3,#4,{%
+ \def\tikz@p@cm{{#1}{#2}{#3}{#4}}%
+ \tikz@scan@one@point\tikz@parse@cmA}
+\def\tikz@parse@cmA#1{%
+ \expandafter\pgftransformcm\tikz@p@cm{#1}%
+}
+
+\tikzset{transform canvas/.code=%
+ {%
+ \tikz@addoption
+ {%
+ {%
+ \pgftransformreset%
+ \let\tikz@transform=\relax%
+ \tikzset{#1}%
+ \pgflowlevelsynccm%
+ }%
+ \pgf@relevantforpicturesizefalse%
+ }%
+ }%
+}
+
+
+% Grid options
+\tikzoption{xstep}{\def\tikz@grid@x{#1}}
+\tikzoption{ystep}{\def\tikz@grid@y{#1}}
+\tikzoption{step}{\tikz@handle@vec{\tikz@step@point}{\tikz@step@single}#1\relax}
+\def\tikz@step@single#1{\def\tikz@grid@x{#1}\def\tikz@grid@y{#1}}
+\def\tikz@step@point#1{\pgf@process{#1}\edef\tikz@grid@x{\the\pgf@x}\edef\tikz@grid@y{\the\pgf@y}}
+
+\def\tikz@grid@x{1cm}
+\def\tikz@grid@y{1cm}
+
+
+% Current point updates
+\newif\iftikz@current@point@local
+\tikzset{current point is local/.is if=tikz@current@point@local}
+
+% Path usage options
+\newif\iftikz@mode@double
+\newif\iftikz@mode@fill
+\newif\iftikz@mode@draw
+\newif\iftikz@mode@clip
+\newif\iftikz@mode@boundary
+\newif\iftikz@mode@shade
+\newif\iftikz@mode@fade@path
+\newif\iftikz@mode@fade@scope
+\let\tikz@mode=\pgfutil@empty
+
+\def\tikz@nonetext{none}
+
+\tikzoption{path only}[]{\let\tikz@mode=\pgfutil@empty}
+\tikzoption{shade}[]{\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{fill}[]{%
+ \edef\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@nonetext%
+ \tikz@addmode{\tikz@mode@fillfalse}%
+ \else%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \tikz@addoption{\pgfsetfillcolor{#1}}%
+ \def\tikz@fillcolor{#1}%
+ \fi%
+ \tikz@addmode{\tikz@mode@filltrue}%
+ \fi%
+}
+\tikzoption{draw}[]{%
+ \edef\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@nonetext%
+ \tikz@addmode{\tikz@mode@drawfalse}%
+ \else%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \tikz@addoption{\pgfsetstrokecolor{#1}}%
+ \def\tikz@strokecolor{#1}%
+ \fi%
+ \tikz@addmode{\tikz@mode@drawtrue}%
+ \fi%
+}
+\tikzoption{clip}[]{\tikz@addmode{\tikz@mode@cliptrue}}
+\tikzoption{use as bounding box}[]{\tikz@addmode{\tikz@mode@boundarytrue}}
+
+\tikzoption{save path}{\tikz@addmode{\pgfsyssoftpath@getcurrentpath#1\global\let#1=#1}}
+
+\let\tikz@fillcolor=\pgfutil@empty
+\let\tikz@strokecolor=\pgfutil@empty
+
+
+% Pattern options
+\tikzset{pattern/.code=\PackageError{tikz}{You need to say \string\usetikzlibrary{patterns}}{},
+ pattern color/.style=pattern}
+
+
+% Shading options
+\tikzset{path fading/.code={
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@nonetext%
+ \tikz@addmode{\tikz@mode@fade@pathfalse}%
+ \else%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \def\tikz@path@fading{#1}%
+ \fi%
+ \tikz@addmode{\tikz@mode@fade@pathtrue}%
+ \fi%
+ },
+ path fading/.default=,
+ scope fading/.code={
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@nonetext%
+ \tikz@addmode{\tikz@mode@fade@scopefalse}%
+ \else%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \def\tikz@scope@fading{#1}%
+ \fi%
+ \tikz@addmode{\tikz@mode@fade@scopetrue}%
+ \fi%
+ },
+ scope fading/.default=}
+\tikzset{fit fading/.is if=tikz@fade@adjust}
+\tikzset{fading transform/.store in=\tikz@fade@transform}
+\tikzset{fading angle/.style={fading transform={rotate=#1}}}
+
+\newif\iftikz@fade@adjust
+\tikz@fade@adjusttrue
+\let\tikz@fade@transform\pgfutil@empty
+
+\pgfutil@colorlet{transparent}{pgftransparent}
+\def\tikz@do@fade@transform{\let\tikz@transform=\relax\expandafter\tikzset\expandafter{\tikz@fade@transform}}
+
+
+
+% Transparency groups
+\newif\iftikz@transparency@group
+\tikzset{/tikz/transparency group/.is if=tikz@transparency@group}
+
+
+% Shading options
+\tikzoption{shading}{\def\tikz@shading{#1}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{shading angle}{\def\tikz@shade@angle{#1}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{top color}{%
+ \pgfutil@colorlet{tikz@axis@top}{#1}%
+ \pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
+ \def\tikz@shading{axis}\def\tikz@shade@angle{0}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{bottom color}{%
+ \pgfutil@colorlet{tikz@axis@bottom}{#1}%
+ \pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
+ \def\tikz@shading{axis}\def\tikz@shade@angle{0}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{middle color}{%
+ \pgfutil@colorlet{tikz@axis@middle}{#1}%
+ \def\tikz@shading{axis}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{left color}{%
+ \pgfutil@colorlet{tikz@axis@top}{#1}%
+ \pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
+ \def\tikz@shading{axis}\def\tikz@shade@angle{90}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{right color}{%
+ \pgfutil@colorlet{tikz@axis@bottom}{#1}%
+ \pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
+ \def\tikz@shading{axis}\def\tikz@shade@angle{90}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{ball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{ball}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{inner color}{\pgfutil@colorlet{tikz@radial@inner}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{outer color}{\pgfutil@colorlet{tikz@radial@outer}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}}
+
+\def\tikz@shading{axis}
+\def\tikz@shade@angle{0}
+
+\pgfdeclareverticalshading[tikz@axis@top,tikz@axis@middle,tikz@axis@bottom]{axis}{100bp}{%
+ color(0bp)=(tikz@axis@bottom);
+ color(25bp)=(tikz@axis@bottom);
+ color(50bp)=(tikz@axis@middle);
+ color(75bp)=(tikz@axis@top);
+ color(100bp)=(tikz@axis@top)}
+
+\pgfutil@colorlet{tikz@axis@top}{gray}
+\pgfutil@colorlet{tikz@axis@middle}{gray!50!white}
+\pgfutil@colorlet{tikz@axis@bottom}{white}
+
+\pgfdeclareradialshading[tikz@ball]{ball}{\pgfqpoint{-10bp}{10bp}}{%
+ color(0bp)=(tikz@ball!15!white);
+ color(9bp)=(tikz@ball!75!white);
+ color(18bp)=(tikz@ball!70!black);
+ color(25bp)=(tikz@ball!50!black);
+ color(50bp)=(black)}
+
+\pgfutil@colorlet{tikz@ball}{blue}
+
+\pgfdeclareradialshading[tikz@radial@inner,tikz@radial@outer]{radial}{\pgfpointorigin}{%
+ color(0bp)=(tikz@radial@inner);
+ color(25bp)=(tikz@radial@outer);
+ color(50bp)=(tikz@radial@outer)}
+
+\pgfutil@colorlet{tikz@radial@inner}{gray}
+\pgfutil@colorlet{tikz@radial@outer}{white}
+
+
+% Pin options
+\tikzoption{pin}{\pgfutil@ifnextchar[{\tikz@parse@pin}{\tikz@parse@pin[]}#1\pgf@nil}
+\tikzoption{pin distance}{\def\tikz@pin@distance{#1}}
+\tikzoption{pin edge}{\def\tikz@pin@edge@style{#1}}
+
+\tikzoption{tikz@pin@post}[]{%
+ \tikz@compute@direction{\tikz@label@angle}{\tikz@pin@distance}%
+ \global\let\tikz@pin@edge@style@smuggle=\tikz@pin@edge@style%
+}
+\tikzoption{tikz@pre@pin@edge}[]{\def\pgf@marshal{\tikzstyle{tikz@pin@options}=}
+ \expandafter\pgf@marshal\expandafter[\tikz@pin@edge@style@smuggle]%
+}
+
+\def\tikz@pin@distance{3ex}
+\def\tikz@pin@edge@style{}
+
+\def\tikz@parse@pin[#1]#2:#3\pgf@nil{%
+ \tikz@add@after@node@path{%
+ \bgroup
+ [current point is local=true]
+ \pgfextra{\let\tikz@save@last@node=\tikzlastnode}%
+ node [every pin,tikz@label@angle=#2,#1,at=(\tikzlastnode.\tikz@label@angle),%
+ after node path={(\tikz@save@last@node) edge[every pin edge,tikz@pre@pin@edge,tikz@pin@options] (\tikzlastnode)},
+ tikz@pin@post]
+ {#3}
+ \egroup%
+ }
+}
+
+
+% Label and pin options
+
+\tikzoption{label}{\pgfutil@ifnextchar[{\tikz@parse@label}{\tikz@parse@label[]}#1\pgf@nil}
+\tikzoption{label distance}{\def\tikz@label@distance{#1}}
+
+\tikzoption{tikz@label@angle}{\def\tikz@label@angle{#1}\csname tikz@label@angle@is@#1\endcsname}
+
+\tikzoption{tikz@label@post}[]{\tikz@compute@direction{\tikz@label@angle}{\tikz@label@distance}}
+
+\def\tikz@label@distance{0pt}
+
+\def\tikz@parse@label[#1]#2:#3\pgf@nil{%
+ \tikz@add@after@node@path{
+ \bgroup
+ \pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name}%
+ node
+ [every label,%
+ tikz@label@angle=#2,%
+ #1,%
+ at=(\tikzlastnode.\tikz@label@angle),tikz@label@post]%
+ {#3}%
+ \pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name}%
+ \egroup%
+ }
+}
+
+\expandafter\def\csname tikz@label@angle@is@right\endcsname{\def\tikz@label@angle{0}}
+\expandafter\def\csname tikz@label@angle@is@above right\endcsname{\def\tikz@label@angle{45}}
+\expandafter\def\csname tikz@label@angle@is@above\endcsname{\def\tikz@label@angle{90}}
+\expandafter\def\csname tikz@label@angle@is@above left\endcsname{\def\tikz@label@angle{135}}
+\expandafter\def\csname tikz@label@angle@is@left\endcsname{\def\tikz@label@angle{180}}
+\expandafter\def\csname tikz@label@angle@is@below left\endcsname{\def\tikz@label@angle{225}}
+\expandafter\def\csname tikz@label@angle@is@below\endcsname{\def\tikz@label@angle{270}}
+\expandafter\def\csname tikz@label@angle@is@below right\endcsname{\def\tikz@label@angle{315}}
+
+\def\tikz@compute@direction#1#2{%
+ \let\tikz@do@auto@anchor=\relax
+ \c@pgf@counta=#1\relax%
+ \ifnum\c@pgf@counta<0\relax
+ \advance\c@pgf@counta by 360\relax%
+ \fi%
+ \ifnum\c@pgf@counta>359\relax
+ \advance\c@pgf@counta by-360\relax%
+ \fi%
+ \ifnum\c@pgf@counta<4\relax%
+ \def\tikz@anchor{west}%
+ \else\ifnum\c@pgf@counta<87\relax%
+ \def\tikz@anchor{south west}%
+ \else\ifnum\c@pgf@counta<94\relax%
+ \def\tikz@anchor{south}%
+ \else\ifnum\c@pgf@counta<177\relax%
+ \def\tikz@anchor{south east}%
+ \else\ifnum\c@pgf@counta<184\relax%
+ \def\tikz@anchor{east}%
+ \else\ifnum\c@pgf@counta<267\relax%
+ \def\tikz@anchor{north east}%
+ \else\ifnum\c@pgf@counta<274\relax%
+ \def\tikz@anchor{north}%
+ \else\ifnum\c@pgf@counta<357\relax%
+ \def\tikz@anchor{north west}%
+ \else%
+ \def\tikz@anchor{west}%
+ \fi\fi\fi\fi\fi\fi\fi\fi%
+ \tikz@addtransform{\pgftransformshift{\pgfpointpolar{#1}{#2}}}%
+}
+
+
+
+% General node options
+\tikzoption{name}{\edef\tikz@fig@name{#1}}
+
+\tikzoption{at}{\tikz@scan@one@point\tikz@set@at#1}
+\def\tikz@set@at#1{\def\tikz@node@at{#1}}%
+
+\tikzoption{shape}{\edef\tikz@shape{#1}}
+
+\tikzoption{nodes}{\tikzstyle{every node}+=[#1]}
+
+\tikzset{alias/.code={\tikz@fig@mustbenamed\expandafter\def\expandafter\tikz@alias\expandafter{\tikz@alias\pgfnodealias{#1}{\tikz@fig@name}}}}
+
+\tikzoption{after node path}{\tikz@add@after@node@path{#1}}%
+\def\tikz@add@after@node@path#1{\expandafter\def\expandafter\tikz@after@node\expandafter{\tikz@after@node#1}}
+
+\def\tikzaddafternodepathoption#1{%
+ #1%
+ \expandafter\def\expandafter\tikz@afternodepathoptions\expandafter{\tikz@afternodepathoptions#1}}
+
+\let\tikz@afternodepathoptions=\pgfutil@empty
+
+\tikzoption{anchor}{\def\tikz@anchor{#1}\let\tikz@do@auto@anchor=\relax}
+
+\tikzoption{left}[]{\def\tikz@anchor{east}\tikz@possibly@transform{x}{-}{#1}}
+\tikzoption{right}[]{\def\tikz@anchor{west}\tikz@possibly@transform{x}{}{#1}}
+\tikzoption{above}[]{\def\tikz@anchor{south}\tikz@possibly@transform{y}{}{#1}}
+\tikzoption{below}[]{\def\tikz@anchor{north}\tikz@possibly@transform{y}{-}{#1}}
+\tikzoption{above left}[]%
+ {\def\tikz@anchor{south east}%
+ \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{}{#1}}
+\tikzoption{above right}[]%
+ {\def\tikz@anchor{south west}%
+ \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{}{#1}}
+\tikzoption{below left}[]%
+ {\def\tikz@anchor{north east}%
+ \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{-}{#1}}
+\tikzoption{below right}[]%
+ {\def\tikz@anchor{north west}%
+ \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{-}{#1}}
+
+\tikzoption{node distance}{\def\tikz@node@distance{#1}}
+\def\tikz@node@distance{1cm}
+
+% The following are deprecated:
+\tikzoption{above of}{\tikz@of{#1}{90}}%
+\tikzoption{below of}{\tikz@of{#1}{-90}}%
+\tikzoption{left of}{\tikz@of{#1}{180}}%
+\tikzoption{right of}{\tikz@of{#1}{0}}%
+\tikzoption{above left of}{\tikz@of{#1}{135}}%
+\tikzoption{below left of}{\tikz@of{#1}{-135}}%
+\tikzoption{above right of}{\tikz@of{#1}{45}}%
+\tikzoption{below right of}{\tikz@of{#1}{-45}}%
+\def\tikz@of#1#2{%
+ \def\tikz@anchor{center}%
+ \let\tikz@do@auto@anchor=\relax%
+ \tikz@addtransform{%
+ \expandafter\tikz@extract@node@dist\tikz@node@distance and\pgf@stop%
+ \pgftransformshift{\pgfpointpolar{#2}{\tikz@extracted@node@distance}}}%
+ \def\tikz@node@at{\pgfpointanchor{#1}{center}}}
+\def\tikz@extract@node@dist#1and#2\pgf@stop{%
+ \def\tikz@extracted@node@distance{#1}}
+
+
+\tikzoption{transform shape}[true]{%
+ \csname tikz@fullytransformed#1\endcsname%
+ \iftikz@fullytransformed%
+ \pgfresetnontranslationattimefalse%
+ \else%
+ \pgfresetnontranslationattimetrue%
+ \fi%
+}
+
+\newif\iftikz@fullytransformed
+\pgfresetnontranslationattimetrue%
+
+\def\tikz@anchor{center}%
+\def\tikz@shape{rectangle}%
+
+\def\tikz@possibly@transform#1#2#3{%
+ \let\tikz@do@auto@anchor=\relax%
+ \def\tikz@test{#3}%
+ \ifx\tikz@test\pgfutil@empty%
+ \else%
+ \pgfmathsetlength{\pgf@x}{#3}%
+ \pgf@x=#2\pgf@x\relax%
+ \edef\tikz@marshal{\noexpand\tikz@addtransform{%
+ \expandafter\noexpand\csname pgftransform#1shift\endcsname{\the\pgf@x}}}%
+ \tikz@marshal%
+ \fi%
+}
+
+
+% Inter-picture options
+\tikzoption{remember picture}[true]{\csname pgfrememberpicturepositiononpage#1\endcsname}
+\tikzoption{overlay}[]{\pgf@relevantforpicturesizefalse}
+
+
+
+% Line/curve label placement options
+\tikzoption{sloped}[true]{\csname pgfslopedattime#1\endcsname}
+\tikzoption{allow upside down}[true]{\csname pgfallowupsidedownattime#1\endcsname}
+
+\tikzoption{pos}{\edef\tikz@time{#1}}
+
+\tikzoption{auto}[]{\csname tikz@install@auto@anchor@#1\endcsname}
+\tikzoption{swap}[]{%
+ \def\tikz@temp{left}%
+ \ifx\tikz@auto@anchor@direction\tikz@temp%
+ \def\tikz@auto@anchor@direction{right}%
+ \else%
+ \def\tikz@auto@anchor@direction{left}%
+ \fi%
+}
+
+\def\tikz@time{.5}
+
+\def\tikz@install@auto@anchor@{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on}
+\def\tikz@install@auto@anchor@false{\let\tikz@do@auto@anchor=\relax}
+\def\tikz@install@auto@anchor@left{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on\def\tikz@auto@anchor@direction{left}}
+\def\tikz@install@auto@anchor@right{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on\def\tikz@auto@anchor@direction{right}}
+
+\let\tikz@do@auto@anchor=\relax%
+
+\def\tikz@auto@anchor@on{\csname tikz@auto@anchor@\tikz@auto@anchor@direction\endcsname}
+
+\def\tikz@auto@anchor@left{\tikz@auto@pre\tikz@auto@anchor\tikz@auto@post}
+\def\tikz@auto@anchor@right{\tikz@auto@pre\tikz@auto@anchor@prime\tikz@auto@post}
+
+\def\tikz@auto@anchor@direction{left}
+
+% Text options
+\tikzoption{text}{\def\tikz@textcolor{#1}}
+\tikzoption{font}{\def\tikz@textfont{#1}}
+\tikzoption{text opacity}{\def\tikz@textopacity{#1}}
+\tikzoption{text width}{\def\tikz@text@width{#1}}
+\tikzoption{text height}{\def\tikz@text@height{#1}}
+\tikzoption{text depth}{\def\tikz@text@depth{#1}}
+\tikzoption{text ragged}[]%
+{\def\tikz@text@action{\raggedright\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
+\tikzoption{text badly ragged}[]{\def\tikz@text@action{\raggedright\relax}}
+\tikzoption{text ragged left}[]%
+{\def\tikz@text@action{\raggedleft\leftskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
+\tikzoption{text badly ragged left}[]{\def\tikz@text@action{\raggedleft\relax}}
+\tikzoption{text justified}[]{\def\tikz@text@action{\leftskip\z@\rightskip\z@\relax}}
+\tikzoption{text centered}[]{\def\tikz@text@action{%
+ \leftskip\z@ plus2em%
+ \rightskip\z@ plus2em%
+ \spaceskip.3333em \xspaceskip.5em%
+ \parfillskip=0pt%
+ \let\\=\@centercr% for latex
+ \relax}}
+\tikzoption{text badly centered}[]%
+{\def\tikz@text@action{%
+ \let\\=\@centercr% for latex
+ \parfillskip=0pt%
+ \rightskip\@flushglue%
+ \leftskip\@flushglue\relax}}
+
+\let\tikz@text@width=\pgfutil@empty
+\let\tikz@text@height=\pgfutil@empty
+\let\tikz@text@depth=\pgfutil@empty
+\let\tikz@textcolor=\pgfutil@empty
+\let\tikz@textfont=\pgfutil@empty
+\let\tikz@textopacity=\pgfutil@empty
+
+\def\tikz@text@action{\raggedright\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}
+
+
+
+
+
+% Arrow options
+\tikzoption{arrows}{\tikz@processarrows{#1}}
+
+\tikzoption{>}{%
+ \tikz@set@pointed{\csname pgf@arrows@invert#1\endcsname}{#1}%
+ \expandafter\tikz@processarrows\expandafter{\tikz@current@arrows}%
+}
+
+\tikzoption{shorten <}{\pgfsetshortenstart{#1}}
+\tikzoption{shorten >}{\pgfsetshortenend{#1}}
+
+\def\tikz@set@pointed#1#2{%
+ \pgfutil@ifundefined{pgf@arrow@code@tikze@>@#2}
+ {%
+ \pgfarrowsdeclarealias{tikzs@<@#2}{tikze@>@#2}{#1}{#2}%
+ \pgfarrowsdeclarereversed{tikzs@>@#2}{tikze@<@#2}{#1}{#2}%
+ \pgfarrowsdeclarecombine*{tikz@|<@#2}{tikz@>|@#2}{#1}{#2}{|}{|}%
+ \pgfarrowsdeclaredouble[\pgflinewidth]{tikzs@<<@#2}{tikze@>>@#2}{#1}{#2}%<<
+ \pgfarrowsdeclarereversed{tikzs@>>@#2}{tikze@<<@#2}{tikzs@<<@#2}{tikze@>>@#2}%<<
+ }{}%
+ \pgfutil@namedef{tikz@special@arrow@start<}{tikzs@<@#2}%
+ \pgfutil@namedef{tikz@special@arrow@end>}{tikze@>@#2}%
+ \pgfutil@namedef{tikz@special@arrow@start>}{tikzs@>@#2}%
+ \pgfutil@namedef{tikz@special@arrow@end<}{tikze@<@#2}%
+ \pgfutil@namedef{tikz@special@arrow@start|<}{tikz@|<@#2}%
+ \pgfutil@namedef{tikz@special@arrow@end>|}{tikz@>|@#2}%
+ \pgfutil@namedef{tikz@special@arrow@start<<}{tikzs@<<@#2}%
+ \pgfutil@namedef{tikz@special@arrow@end>>}{tikze@>>@#2}%<<
+ \pgfutil@namedef{tikz@special@arrow@start>>}{tikzs@<<@#2}%<<
+ \pgfutil@namedef{tikz@special@arrow@end<<}{tikze@>>@#2}%<<
+}
+
+\def\tikz@processarrows#1{%
+ \def\tikz@current@arrows{#1}%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else%
+ \tikz@@processarrows#1\@nil
+ \fi%
+}
+\def\tikz@@processarrows#1-#2\@nil{%
+ \expandafter\ifx\csname tikz@special@arrow@start#1\endcsname\relax%
+ \pgfsetarrowsstart{#1}
+ \else%
+ \pgfsetarrowsstart{\csname tikz@special@arrow@start#1\endcsname}%
+ \fi%
+ \expandafter\ifx\csname tikz@special@arrow@end#2\endcsname\relax%
+ \pgfsetarrowsend{#2}
+ \else%
+ \pgfsetarrowsend{\csname tikz@special@arrow@end#2\endcsname}%
+ \fi%
+}
+
+\tikz@set@pointed{\pgf@arrows@invertto}{to}
+\def\tikz@current@arrows{-}
+
+% Parabola options
+\tikzoption{bend}{\tikz@scan@one@point\tikz@set@parabola@bend#1\relax}%
+\tikzoption{bend pos}{\def\tikz@parabola@bend@factor{#1}}
+\tikzoption{parabola height}{%
+ \def\tikz@parabola@bend@factor{.5}%
+ \def\tikz@parabola@bend{\pgfpointadd{\pgfpoint{0pt}{#1}}{\tikz@last@position@saved}}}
+
+\def\tikz@parabola@bend{\tikz@last@position@saved}
+\def\tikz@parabola@bend@factor{0}
+
+\def\tikz@set@parabola@bend#1{\def\tikz@parabola@bend{#1}}
+
+% Axis options
+\tikzoption{domain}{\def\tikz@plot@domain{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}
+\tikzoption{range}{\def\tikz@plot@range{#1}}
+
+% Plot options
+\tikzoption{smooth}[]{\let\tikz@plot@handler=\pgfplothandlercurveto}
+\tikzoption{smooth cycle}[]{\let\tikz@plot@handler=\pgfplothandlerclosedcurve}
+\tikzoption{sharp plot}[]{\let\tikz@plot@handler\pgfplothandlerlineto}
+
+\tikzoption{tension}{\pgfsetplottension{#1}}
+
+\tikzoption{xcomb}[]{\let\tikz@plot@handler=\pgfplothandlerxcomb}
+\tikzoption{ycomb}[]{\let\tikz@plot@handler=\pgfplothandlerycomb}
+\tikzoption{polar comb}[]{\let\tikz@plot@handler=\pgfplothandlerpolarcomb}
+
+\tikzoption{raw gnuplot}[true]{\csname tikz@plot@raw@gnuplot#1\endcsname}
+\tikzoption{prefix}{\def\tikz@plot@prefix{#1}}
+\tikzoption{id}{\def\tikz@plot@id{#1}}
+
+\tikzoption{samples}{\def\tikz@plot@samples{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}
+\tikzoption{samples at}{\def\tikz@plot@samplesat{#1}}
+\tikzoption{parametric}[true]{\csname tikz@plot@parametric#1\endcsname}
+
+\tikzoption{variable}{\def\tikz@plot@var{#1}}
+
+\tikzoption{only marks}[]{\let\tikz@plot@handler\pgfplothandlerdiscard}
+
+\tikzoption{mark}{\def\tikz@plot@mark{#1}}
+\tikzoption{mark options}{\def\tikz@plot@mark@options{#1}}
+\tikzoption{mark size}{\pgfsetplotmarksize{#1}}
+
+\tikzoption{mark indices}{\def\tikz@mark@list{#1}}
+\tikzoption{mark phase}{\pgfsetplotmarkphase{#1}}
+\tikzoption{mark repeat}{\pgfsetplotmarkrepeat{#1}}
+
+\let\tikz@mark@list=\pgfutil@empty
+
+\let\tikz@plot@mark@options=\pgfutil@empty
+
+\let\tikz@plot@handler=\pgfplothandlerlineto
+\let\tikz@plot@mark=\pgfutil@empty
+
+\def\tikz@plot@samples{25}
+\def\tikz@plot@domain{-5:5}
+\def\tikz@plot@var{\x}
+\def\tikz@plot@samplesat{-5,-4.6,...,5}
+\def\tikz@plot@samples@recalc#1:#2\relax{%
+ \pgfmathparse{#1}%
+ \let\tikz@temp@start=\pgfmathresult%
+ \pgfmathparse{#2}%
+ \let\tikz@temp@end=\pgfmathresult%
+ \pgfmathparse{\tikz@temp@start+(\tikz@temp@end-\tikz@temp@start)/\tikz@plot@samples}%
+ \edef\tikz@plot@samplesat{\tikz@temp@start,\pgfmathresult,...,\tikz@temp@end}%
+}
+
+
+\def\tikz@plot@prefix{\jobname.}
+\def\tikz@plot@id{pgf-plot}
+
+\newif\iftikz@plot@parametric
+\newif\iftikz@plot@raw@gnuplot
+
+
+% To options
+\tikzoption{to path}{\def\tikz@to@path{#1}}
+
+\def\tikz@to@path{-- (\tikztotarget) \tikztonodes}
+
+
+
+% Tree options
+\newif\iftikz@child@missing
+\pgfkeys{/tikz/missing/.is if=tikz@child@missing}
+
+\tikzoption{edge from parent path}{\def\tikz@edge@to@parent@path{#1}}
+
+\tikzoption{parent anchor}{\def\tikzparentanchor{.#1}\ifx\tikzparentanchor\tikz@border@text\let\tikzparentanchor\pgfutil@empty\fi}
+\tikzoption{child anchor}{\def\tikzchildanchor{.#1}\ifx\tikzchildanchor\tikz@border@text\let\tikzchildanchor\pgfutil@empty\fi}
+
+\tikzoption{level distance}{\pgfmathsetlength\tikzleveldistance{#1}}
+\tikzoption{sibling distance}{\pgfmathsetlength\tikzsiblingdistance{#1}}
+
+\tikzoption{growth function}{\let\tikz@grow=#1}
+\tikzoption{growth parent anchor}{\def\tikz@growth@anchor{#1}}
+\tikzoption{grow}{\tikz@set@growth{#1}\edef\tikz@special@level{\the\tikztreelevel}}%
+\tikzoption{grow'}{\tikz@set@growth{#1}\tikz@swap@growth\edef\tikz@special@level{\the\tikztreelevel}}%
+
+\def\tikz@growth@anchor{center}
+
+\def\tikz@special@level{-1}% never
+
+\def\tikz@swap@growth{%
+ % Swap left and right
+ \let\tikz@temp=\tikz@angle@grow@right%
+ \let\tikz@angle@grow@right=\tikz@angle@grow@left%
+ \let\tikz@angle@grow@left=\tikz@temp%
+}%
+
+\def\tikz@set@growth#1{%
+ \let\tikz@grow=\tikz@grow@direction%
+ \expandafter\ifx\csname tikz@grow@direction@#1\endcsname\relax%
+ \c@pgf@counta=#1\relax%
+ \else%
+ \c@pgf@counta=\csname tikz@grow@direction@#1\endcsname%
+ \fi%
+ \edef\tikz@angle@grow{\the\c@pgf@counta}%
+ \advance\c@pgf@counta by-90\relax%
+ \edef\tikz@angle@grow@left{\the\c@pgf@counta}%
+ \advance\c@pgf@counta by180\relax%
+ \edef\tikz@angle@grow@right{\the\c@pgf@counta}%
+}
+
+\def\tikz@border@text{.border}
+\let\tikzparentanchor=\pgfutil@empty
+\let\tikzchildanchor=\pgfutil@empty
+\def\tikz@edge@to@parent@path{(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor)}
+
+\tikzleveldistance=15mm
+\tikzsiblingdistance=15mm
+
+\def\tikz@grow@direction@down{-90}
+\def\tikz@grow@direction@up{90}
+\def\tikz@grow@direction@left{180}
+\def\tikz@grow@direction@right{0}
+
+\def\tikz@grow@direction@south{-90}
+\def\tikz@grow@direction@north{90}
+\def\tikz@grow@direction@west{180}
+\def\tikz@grow@direction@east{0}
+
+\expandafter\def\csname tikz@grow@direction@north east\endcsname{45}
+\expandafter\def\csname tikz@grow@direction@north west\endcsname{135}
+\expandafter\def\csname tikz@grow@direction@south east\endcsname{-45}
+\expandafter\def\csname tikz@grow@direction@south west\endcsname{-135}
+
+\def\tikz@grow@direction{%
+ \pgftransformshift{\pgfpointpolar{\tikz@angle@grow}{\tikzleveldistance}}%
+ \ifnum\tikztreelevel=\tikz@special@level%
+ \else%
+ \pgf@xc=.5\tikzsiblingdistance%
+ \c@pgf@counta=\tikznumberofchildren%
+ \advance\c@pgf@counta by1\relax%
+ \pgfutil@tempdima=\c@pgf@counta\pgf@xc%
+ \pgftransformshift{\pgfpointpolar{\tikz@angle@grow@left}{\pgfutil@tempdima}}%
+ \pgftransformshift{\pgfpointpolar{\tikz@angle@grow@right}{\tikznumberofcurrentchild\tikzsiblingdistance}}%
+ \fi%
+}
+
+\tikzset{grow=down}
+
+
+% Snakes are in a lib:
+\tikzset{snake/.code=\PackageError{tikz}{You need to say \string\usetikzlibrary{snakes}}{}}
+
+% Decorations
+\tikzset{decorate/.code=\PackageError{tikz}{You need to load a decoration library}{}}
+
+% Matrix options
+\usepgfmodule{matrix}
+
+\tikzoption{matrix}[true]{\csname tikz@is@matrix#1\endcsname}
+
+\tikzoption{matrix anchor}{\def\tikz@matrix@anchor{#1}}
+
+\tikzoption{column sep}{\def\pgfmatrixcolumnsep{#1}}
+\tikzoption{row sep}{\def\pgfmatrixrowsep{#1}}
+
+\tikzoption{cells}{\tikzstyle{every cell}+=[#1]}
+
+\tikzoption{ampersand replacement}{\def\tikz@ampersand@replacement{#1}}
+
+\newif\iftikz@is@matrix
+\let\tikz@matrix@anchor=\pgfutil@empty
+\let\tikz@ampersand@replacement=\pgfutil@empty
+
+
+% Execute option
+\tikzoption{execute at begin picture}{\expandafter\def\expandafter\tikz@atbegin@picture\expandafter{\tikz@atbegin@picture#1}}
+\tikzoption{execute at end picture}{\expandafter\def\expandafter\tikz@atend@picture\expandafter{\tikz@atend@picture#1}}
+\tikzoption{execute at begin scope}{\expandafter\def\expandafter\tikz@atbegin@scope\expandafter{\tikz@atbegin@scope#1}}
+\tikzoption{execute at end scope}{\expandafter\def\expandafter\tikz@atend@scope\expandafter{\tikz@atend@scope#1}}
+\tikzoption{execute at begin to}{\expandafter\def\expandafter\tikz@atbegin@to\expandafter{\tikz@atbegin@to#1}}
+\tikzoption{execute at end to}{\expandafter\def\expandafter\tikz@atend@to\expandafter{\tikz@atend@to#1}}
+\tikzoption{execute at begin node}{\expandafter\def\expandafter\tikz@atbegin@node\expandafter{\tikz@atbegin@node#1}}
+\tikzoption{execute at end node}{\expandafter\def\expandafter\tikz@atend@node\expandafter{\tikz@atend@node#1}}
+\tikzoption{execute at begin cell}{\expandafter\def\expandafter\tikz@atbegin@cell\expandafter{\tikz@atbegin@cell#1}}
+\tikzoption{execute at end cell}{\expandafter\def\expandafter\tikz@atend@cell\expandafter{\tikz@atend@cell#1}}
+\tikzoption{execute at empty cell}{\expandafter\def\expandafter\tikz@at@emptycell\expandafter{\tikz@at@emptycell#1}}
+
+\let\tikz@atbegin@picture=\pgfutil@empty
+\let\tikz@atend@picture=\pgfutil@empty
+\let\tikz@atbegin@scope=\pgfutil@empty
+\let\tikz@atend@scope=\pgfutil@empty
+\let\tikz@atbegin@to=\pgfutil@empty
+\let\tikz@atend@to=\pgfutil@empty
+\let\tikz@atbegin@node=\pgfutil@empty
+\let\tikz@atend@node=\pgfutil@empty
+\let\tikz@atbegin@cell=\pgfutil@empty
+\let\tikz@atend@cell=\pgfutil@empty
+\let\tikz@at@emptycell=\pgfutil@empty
+
+
+% Pre and post actions
+\tikzset{preaction/.code=\expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\tikz@extra@preaction{#1}}}
+\tikzset{postaction/.code=\expandafter\def\expandafter\tikz@postactions\expandafter{\tikz@postactions\tikz@extra@postaction{#1}}}
+\let\tikz@preactions=\pgfutil@empty
+\let\tikz@postactions=\pgfutil@empty
+
+% Styles
+\tikzoption{set style}{\tikzstyle#1}
+
+% Handled in a special way.
+\def\tikzstyle{\pgfutil@ifnextchar\bgroup\tikz@style@parseA\tikz@style@parseB}
+\def\tikz@style@parseB#1={\tikz@style@parseA{#1}=}
+\def\tikz@style@parseA#1#2=#3[#4]{% check for an optional argument
+ \pgfutil@in@[{#2}%]
+ \ifpgfutil@in@%
+ \tikz@style@parseC{#1}#2={#4}%
+ \else%
+ \tikz@style@parseD{#1}#2={#4}%
+ \fi%
+}%
+
+\def\tikz@style@parseC#1[#2]#3=#4{%
+ \pgfkeys{/tikz/#1/.default={#2}}%
+ \pgfutil@in@+{#3}%
+ \ifpgfutil@in@%
+ \pgfkeys{/tikz/#1/.append style={#4}}%
+ \else%
+ \pgfkeys{/tikz/#1/.style={#4}}%
+ \fi}
+\def\tikz@style@parseD#1#2=#3{%
+ \pgfutil@in@+{#2}%
+ \ifpgfutil@in@%
+ \pgfkeys{/tikz/#1/.append style={#3}}%
+ \else%
+ \pgfkeys{/tikz/#1/.style={#3}}%
+ \fi}
+
+
+%
+%
+% Predefined styles
+%
+%
+
+\tikzstyle{help lines}= [color=gray,line width=0.2pt]
+
+\tikzstyle{every picture}= []
+\tikzstyle{every path}= []
+\tikzstyle{every scope}= []
+\tikzstyle{every plot}= []
+\tikzstyle{every node}= []
+\tikzstyle{every child}= []
+\tikzstyle{every child node}= []
+\tikzstyle{every to}= []
+\tikzstyle{every cell}= []
+\tikzstyle{every matrix}= []
+\tikzstyle{every edge}= [draw]
+\tikzstyle{every label}= [draw=none,fill=none]
+\tikzstyle{every pin}= [draw=none,fill=none]
+\tikzstyle{every pin edge}= [help lines]
+
+\tikzstyle{ultra thin}= [line width=0.1pt]
+\tikzstyle{very thin}= [line width=0.2pt]
+\tikzstyle{thin}= [line width=0.4pt]
+\tikzstyle{semithick}= [line width=0.6pt]
+\tikzstyle{thick}= [line width=0.8pt]
+\tikzstyle{very thick}= [line width=1.2pt]
+\tikzstyle{ultra thick}= [line width=1.6pt]
+
+\tikzstyle{solid}= [dash pattern=]
+\tikzstyle{dotted}= [dash pattern=on \pgflinewidth off 2pt]
+\tikzstyle{densely dotted}= [dash pattern=on \pgflinewidth off 1pt]
+\tikzstyle{loosely dotted}= [dash pattern=on \pgflinewidth off 4pt]
+\tikzstyle{dashed}= [dash pattern=on 3pt off 3pt]
+\tikzstyle{densely dashed}= [dash pattern=on 3pt off 2pt]
+\tikzstyle{loosely dashed}= [dash pattern=on 3pt off 6pt]
+
+\tikzstyle{transparent}= [opacity=0]
+\tikzstyle{ultra nearly transparent}=[opacity=0.05]
+\tikzstyle{very nearly transparent}= [opacity=0.1]
+\tikzstyle{nearly transparent}= [opacity=0.25]
+\tikzstyle{semitransparent}= [opacity=0.5]
+\tikzstyle{nearly opaque}= [opacity=0.75]
+\tikzstyle{very nearly opaque}= [opacity=0.9]
+\tikzstyle{ultra nearly opaque}= [opacity=0.95]
+\tikzstyle{opaque}= [opacity=1]
+
+\tikzstyle{at start}= [pos=0]
+\tikzstyle{very near start}= [pos=0.125]
+\tikzstyle{near start}= [pos=0.25]
+\tikzstyle{midway}= [pos=0.5]
+\tikzstyle{near end}= [pos=0.75]
+\tikzstyle{very near end}= [pos=0.875]
+\tikzstyle{at end}= [pos=1]
+
+\tikzstyle{bend at start}= [bend pos=0,bend={+(0,0)}]
+\tikzstyle{bend at end}= [bend pos=1,bend={+(0,0)}]
+
+\tikzstyle{edge from parent}= [draw]
+
+
+
+%
+% Setting keys
+%
+
+\pgfkeys{/tikz/style/.style=#1}
+
+\pgfkeys{/tikz/.unknown/.code=%
+ % Is it a pgf key?
+ \let\tikz@key\pgfkeyscurrentname%
+ \pgfkeys{/pgf/\tikz@key/.try={#1}}%
+ \ifpgfkeyssuccess%
+ \else%
+ \expandafter\pgfutil@in@\expandafter!\expandafter{\tikz@key}%
+ \ifpgfutil@in@%
+ % this is a color!
+ \expandafter\tikz@addoption\expandafter{\expandafter\pgfutil@color\expandafter{\tikz@key}}%
+ \edef\tikz@textcolor{\tikz@key}%
+ \else%
+ \pgfutil@doifcolorelse{\tikz@key}
+ { %
+ \expandafter\tikz@addoption\expandafter{\expandafter\pgfutil@color\expandafter{\tikz@key}}%
+ \edef\tikz@textcolor{\tikz@key}%
+ }%
+ {%
+ % Ok, second chance: This might be an arrow specification:
+ \expandafter\pgfutil@in@\expandafter-\expandafter{\tikz@key}
+ \ifpgfutil@in@%
+ % Ah, an arrow spec!
+ \expandafter\tikz@processarrows\expandafter{\tikz@key}%
+ \else%
+ % Ok, third chance: A shape!
+ \expandafter\ifx\csname pgf@sh@s@\tikz@key\endcsname\relax%
+ \pgfkeys{/errors/unknown key={/tikz/\tikz@key}{#1}}%
+ \else%
+ \edef\tikz@shape{\tikz@key}%
+ \fi%
+ \fi%
+ }%
+ \fi%
+ \fi%
+}
+
+
+%
+% Main TikZ Environment
+%
+
+\def\tikzpicture{\pgfutil@ifnextchar[\tikz@picture{\tikz@picture[]}}%}
+\def\tikz@picture[#1]{%
+ \pgfpicture%
+ \let\tikz@atbegin@picture=\pgfutil@empty%
+ \let\tikz@atend@picture=\pgfutil@empty%
+ \let\tikz@transform=\relax%
+ \tikz@installcommands\scope[every picture,#1]%
+ \expandafter\tikz@atbegin@picture%
+ \tikz@lib@scope@check%
+}
+\def\endtikzpicture{%
+ \tikz@atend@picture%
+ \global\let\pgf@shift@baseline=\pgf@baseline%
+ \global\let\pgf@remember@smuggle=\ifpgfrememberpicturepositiononpage%
+ \endscope%
+ \let\pgf@baseline=\pgf@shift@baseline%
+ \let\ifpgfrememberpicturepositiononpage=\pgf@remember@smuggle%
+ \endpgfpicture}
+
+
+% Inlined picture
+%
+% #1 - some code to be put in a tikzpicture environment.
+%
+% If the command is not followed by braces, everything up to the next
+% semicolon is used as argument.
+%
+% Example:
+%
+% The rectangle \tikz{\draw (0,0) rectangle (1em,1ex)} has width 1em and
+% height 1ex.
+
+\def\tikz{\pgfutil@ifnextchar[{\tikz@opt}{\tikz@opt[]}}
+\def\tikz@opt[#1]{\tikzpicture[#1]\pgfutil@ifnextchar\bgroup{\tikz@}{\tikz@@}}
+\def\tikz@#1{#1\endtikzpicture}
+\def\tikz@@{%
+ \let\tikz@next=\tikz@collectnormalsemicolon%
+ \ifnum\the\catcode`\;=\active\relax%
+ \let\tikz@next=\tikz@collectactivesemicolon%
+ \fi%
+ \tikz@next}
+\def\tikz@collectnormalsemicolon#1;{#1;\endtikzpicture}
+{
+ \catcode`\;=\active
+ \gdef\tikz@collectactivesemicolon#1;{#1;\endtikzpicture}
+}
+
+
+
+%
+% Environment for scoping graphic state settings
+%
+\def\tikz@scope@env{\pgfutil@ifnextchar[\tikz@@scope@env{\tikz@@scope@env[]}}
+\def\tikz@@scope@env[#1]{%
+ \pgfscope%
+ \begingroup%
+ \let\tikz@atbegin@scope=\pgfutil@empty%
+ \let\tikz@atend@scope=\pgfutil@empty%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@mode=\pgfutil@empty%
+ \tikz@transparency@groupfalse%
+ \tikzset{every scope/.try,#1}%
+ \tikz@options%
+ \iftikz@transparency@group\pgftransparencygroup\fi%
+ \expandafter\tikz@atbegin@scope%
+ \tikz@lib@scope@check%
+}
+\def\endtikz@scope@env{%
+ \tikz@atend@scope%
+ \iftikz@transparency@group\endpgftransparencygroup\fi%
+ \endgroup%
+ \endpgfscope%
+ \tikz@lib@scope@check%
+}
+
+%
+% Install the abbreviated commands
+%
+\def\tikz@installcommands{%
+ \ifnum\the\catcode`\;=\active\relax\expandafter\let\expandafter\tikz@origsemi\expandafter=\tikz@activesemicolon\fi%
+ \ifnum\the\catcode`\:=\active\relax\expandafter\let\expandafter\tikz@origcolon\expandafter=\tikz@activecolon\fi%
+ \ifnum\the\catcode`\|=\active\relax\expandafter\let\expandafter\tikz@origbar\expandafter=\tikz@activebar\fi%
+ \let\tikz@origscope=\scope%
+ \let\tikz@origendscope=\endscope%
+ \let\tikz@origstartscope=\startscope%
+ \let\tikz@origstopscope=\stopscope%
+ \let\tikz@origpath=\path%
+ \let\tikz@origagainpath=\againpath%
+ \let\tikz@origdraw=\draw%
+ \let\tikz@origpattern=\pattern%
+ \let\tikz@origfill=\fill%
+ \let\tikz@origfilldraw=\filldraw%
+ \let\tikz@origshade=\shade%
+ \let\tikz@origshadedraw=\shadedraw%
+ \let\tikz@origclip=\clip%
+ \let\tikz@origuseasboundingbox=\useasboundingbox%
+ \let\tikz@orignode=\node%
+ \let\tikz@origcoordinate=\coordinate%
+ \let\tikz@origmatrix=\matrix%
+ \let\tikz@origcalendar=\calendar%
+ %
+ \tikz@deactivatthings%
+ %
+ \let\scope=\tikz@scope@env%
+ \let\endscope=\endtikz@scope@env%
+ \let\startscope=\scope%
+ \let\stopscope=\endscope%
+ \let\path=\tikz@command@path%
+ \let\againpath=\tikz@command@againpath%
+ %
+ \def\draw{\path[draw]}
+ \def\pattern{\path[pattern]}
+ \def\fill{\path[fill]}
+ \def\filldraw{\path[fill,draw]}
+ \def\shade{\path[shade]}
+ \def\shadedraw{\path[shade,draw]}
+ \def\clip{\path[clip]}
+ \def\useasboundingbox{\path[use as bounding box]}
+ \def\node{\tikz@path@overlay{node}}
+ \def\coordinate{\tikz@path@overlay{coordinate}}
+ \def\matrix{\tikz@path@overlay{node[matrix]}}
+ \def\calendar{\tikz@lib@cal@calendar}%
+}
+\ifx\tikz@lib@cal@calendar\@undefined
+\def\tikz@lib@cal@calendar{\PackageError{tikz}{You need to load the calendar library}{}}
+\fi
+
+\def\tikz@path@overlay#1{%
+ \let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell
+ \pgfutil@ifnextchar<{\tikz@path@overlayed{#1}}{\path #1}}
+\def\tikz@path@overlayed#1<#2>{\path<#2> #1}
+
+\def\tikz@uninstallcommands{%
+ \ifnum\the\catcode`\;=\active\relax\expandafter\let\tikz@activesemicolon=\tikz@origsemi\fi%
+ \ifnum\the\catcode`\:=\active\relax\expandafter\let\tikz@activecolon=\tikz@origcolon\fi%
+ \ifnum\the\catcode`\|=\active\relax\expandafter\let\tikz@activebar=\tikz@origbar\fi%
+ \let\scope=\tikz@origscope%
+ \let\endscope=\tikz@origendscope%
+ \let\startscope=\tikz@origstartscope%
+ \let\stopscope=\tikz@origstopscope%
+ \let\path=\tikz@origpath%
+ \let\againpath=\tikz@origagainpath%
+ \let\draw=\tikz@origdraw%
+ \let\pattern=\tikz@origpattern%
+ \let\fill=\tikz@origfill%
+ \let\filldraw=\tikz@origfilldraw%
+ \let\shade=\tikz@origshade%
+ \let\shadedraw=\tikz@origshadedraw%
+ \let\clip=\tikz@origclip%
+ \let\useasboundingbox=\tikz@origuseasboundingbox%
+ \let\node=\tikz@orignode%
+ \let\coordinate=\tikz@origcoordinate%
+ \let\matrix=\tikz@origmatrix%
+ \let\calendar=\tikz@origcalendar%
+}
+
+
+{
+ \catcode`\;=12
+ \gdef\tikz@nonactivesemicolon{;}
+ \catcode`\:=12
+ \gdef\tikz@nonactivecolon{:}
+ \catcode`\|=12
+ \gdef\tikz@nonactivebar{|}
+ \catcode`\;=\active
+ \catcode`\:=\active
+ \catcode`\|=\active
+ \catcode`\"=\active
+ \gdef\tikz@activesemicolon{;}%
+ \gdef\tikz@activecolon{:}%
+ \gdef\tikz@activebar{|}%
+ \gdef\tikz@activequotes{"}%
+ \gdef\tikz@deactivatthings{%
+ \def;{\tikz@nonactivesemicolon}
+ \def:{\tikz@nonactivecolon}
+ \def|{\tikz@nonactivebar}
+ }
+}
+
+
+
+
+
+% Constructs a path and draws/fills them according to the current
+% settings.
+
+\def\tikz@command@path{%
+ \let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell
+ \pgfutil@ifnextchar[{\tikz@check@earg}%]
+ {\pgfutil@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}}
+\def\tikz@signal@path{\tikz@signal@path}%
+\def\tikz@check@earg[#1]{%
+ \pgfutil@ifnextchar<{\tikz@swap@args[#1]}{\tikz@@command@path[#1]}}
+\def\tikz@swap@args[#1]<#2>{\tikz@command@path<#2>[#1]}
+
+\def\tikz@doopt{%
+ \let\tikz@next=\tikz@eargnormalsemicolon%
+ \ifnum\the\catcode`\;=\active\relax%
+ \let\tikz@next=\tikz@eargactivesemicolon%
+ \fi%
+ \tikz@next}
+\long\def\tikz@eargnormalsemicolon<#1>#2;{\only<#1>{\tikz@@command@path#2;}}
+{
+ \catcode`\;=\active
+ \long\global\def\tikz@eargactivesemicolon<#1>#2;{\only<#1>{\tikz@@command@path#2;}}
+}
+
+\def\tikz@@command@path{%
+ \edef\tikzscope@linewidth{\the\pgflinewidth}%
+ \begingroup%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@mode=\pgfutil@empty%
+ \let\tikz@moveto@waiting=\relax%
+ \let\tikz@timer=\relax%
+ \let\tikz@collected@onpath=\pgfutil@empty%
+ \let\tikz@preactions=\pgfutil@empty%
+ \let\tikz@postactions=\pgfutil@empty%
+ \tikz@snakedfalse%
+ \tikz@decoratepathfalse%
+ \tikz@node@is@a@labelfalse%
+ \tikz@expandcount=1000\relax%
+ \tikz@lastx=0pt%
+ \tikz@lasty=0pt%
+ \tikz@lastxsaved=0pt%
+ \tikz@lastysaved=0pt%
+ \tikzset{every path/.try}%
+ \tikz@scan@next@command%
+}
+\def\tikz@scan@next@command{%
+ \ifx\tikz@collected@onpath\pgfutil@empty%
+ \else%
+ \tikz@invoke@collected@onpath%
+ \fi%
+ \afterassignment\tikz@handle\let\@let@token=%
+}
+\newcount\tikz@expandcount
+
+% Central dispatcher for commands
+\def\tikz@handle{%
+ \let\@next=\tikz@expand%
+ \ifx\@let@token(%)
+ \let\@next=\tikz@movetoabs%
+ \else%
+ \ifx\@let@token+%
+ \let\@next=\tikz@movetorel%
+ \else%
+ \ifx\@let@token-%
+ \let\@next=\tikz@lineto%
+ \else%
+ \ifx\@let@token.%
+ \let\@next=\tikz@dot%
+ \else%
+ \ifx\@let@token r%
+ \let\@next=\tikz@rect%
+ \else%
+ \ifx\@let@token n%
+ \let\@next=\tikz@fig%
+ \else%
+ \ifx\@let@token[%]
+ \let\@next=\tikz@parse@options%
+ \else%
+ \ifx\@let@token c%
+ \let\@next=\tikz@cchar%
+ \else%
+ \ifx\@let@token\bgroup%
+ \let\@next=\tikz@beginscope%
+ \else%
+ \ifx\@let@token\egroup%
+ \let\@next=\tikz@endscope%
+ \else%
+ \ifx\@let@token;%
+ \let\@next=\tikz@finish%
+ \else%
+ \let\@next=\tikz@handle@more%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \@next%
+}
+
+% Continued...
+\def\tikz@handle@more{%
+ \ifx\@let@token a%
+ \let\@next=\tikz@arcA%
+ \else%
+ \ifx\@let@token e%
+ \let\@next=\tikz@e@char%
+ \else%
+ \ifx\@let@token g%
+ \let\@next=\tikz@grid%
+ \else%
+ \ifx\@let@token s%
+ \let\@next=\tikz@sine%
+ \else%
+ \ifx\@let@token |%
+ \let\@next=\tikz@vh@lineto%
+ \else%
+ \ifx\@let@token p%
+ \let\@next=\tikz@pchar%
+ \pgfsetmovetofirstplotpoint%
+ \else%
+ \ifx\@let@token t%
+ \let\@next=\tikz@to%
+ \else%
+ \ifx\@let@token\pgfextra%
+ \let\@next=\tikz@extra%
+ \else%
+ \ifx\@let@token\foreach%
+ \let\@next=\tikz@foreach%
+ \else%
+ \ifx\@let@token\pgf@stop%
+ \let\@next=\relax%
+ \else%
+ \ifx\@let@token\par%
+ \let\@next=\tikz@scan@next@command%
+ \else%
+ \ifx\@let@token d%
+ \let\@next=\tikz@decoration%
+ \else%
+ \ifx\@let@token l%
+ \let\@next=\tikz@let@command%
+ \else%
+ \let\@next=\tikz@expand%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \@next%
+}
+
+\def\tikz@pchar{\pgfutil@ifnextchar l{\tikz@plot}{\tikz@parabola}}
+\def\tikz@cchar{%
+ \pgfutil@ifnextchar i{\tikz@circle}%
+ {\pgfutil@ifnextchar h{\tikz@children}{\tikz@cochar}}}%
+\def\tikz@cochar o{%
+ \pgfutil@ifnextchar o{\tikz@coordinate}{\tikz@cosine}}
+\def\tikz@e@char{%
+ \pgfutil@ifnextchar l{\tikz@ellipse}{\tikz@@e@char}}%
+\def\tikz@@e@char dge{%
+ \pgfutil@ifnextchar f{\tikz@edgetoparent}{\tikz@edge@plain}}%
+
+
+\def\tikz@finish{%
+ % Rendering pipeline
+ %
+ % Step 1: Decorate path
+ %
+ \iftikz@decoratepath%
+ \tikz@lib@dec@decorate@path%
+ \fi%
+ %
+ % Step 1: Preactions
+ %
+ \pgfsyssoftpath@getcurrentpath\tikz@actions@path%
+ \edef\tikz@restorepathsize{%
+ \global\pgf@pathmaxx=\the\pgf@pathmaxx%
+ \global\pgf@pathmaxy=\the\pgf@pathmaxy%
+ \global\pgf@pathminx=\the\pgf@pathminx%
+ \global\pgf@pathminy=\the\pgf@pathminy%
+ }%
+ \tikz@preactions%
+ %
+ % Reset modes
+ %
+ \tikz@mode@fillfalse%
+ \tikz@mode@drawfalse%
+ \tikz@mode@doublefalse%
+ \tikz@mode@clipfalse%
+ \tikz@mode@boundaryfalse%
+ \tikz@mode@fade@pathfalse%
+ \tikz@mode@fade@scopefalse%
+ \edef\tikz@pathextend{%
+ {\noexpand\pgfqpoint{\the\pgf@pathminx}{\the\pgf@pathminy}}%
+ {\noexpand\pgfqpoint{\the\pgf@pathmaxx}{\the\pgf@pathmaxy}}%
+ }%
+ \tikz@mode% installs the mode settings
+ % Path fading counts as an option:
+ \iftikz@mode@fade@path%
+ \tikz@addoption{%
+ \iftikz@fade@adjust%
+ \pgfsetfadingforcurrentpath{\tikz@path@fading}{\tikz@do@fade@transform}%
+ \else%
+ \pgfsetfading{\tikz@path@fading}{\tikz@do@fade@transform}%
+ \fi%
+ \tikz@mode@fade@pathfalse% no more fading...
+ }%
+ \fi%
+ % Rendering pipeline
+ %
+ % Step 2: Install scope fading
+ %
+ \iftikz@mode@fade@scope%
+ \iftikz@fade@adjust%
+ \pgfsetfadingforcurrentpath{\tikz@scope@fading}{\tikz@do@fade@transform}%
+ \else%
+ \pgfsetfading{\tikz@scope@fading}{\tikz@do@fade@transform}%
+ \fi%
+ \tikz@mode@fade@scopefalse%
+ \fi%
+ %
+ % Step 3: Setup options
+ %
+ \ifx\tikz@options\pgfutil@empty%
+ \else%
+ \pgfsys@beginscope%
+ \begingroup%
+ \tikz@options%
+ \fi%
+ %
+ % Step 4: Do a fill if shade follows.
+ %
+ \iftikz@mode@fill%
+ \iftikz@mode@shade%
+ \pgfsyssoftpath@getcurrentpath\tikz@temppath
+ \pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
+ \pgfsyssoftpath@setcurrentpath\tikz@temppath%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@fill%
+ \tikz@mode@fillfalse% no more filling...
+ \fi%
+ \fi%
+ %
+ % Step 5: Do a shade if necessary.
+ %
+ \iftikz@mode@shade%
+ \pgfsyssoftpath@getcurrentpath\tikz@temppath
+ \pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
+ \pgfsyssoftpath@setcurrentpath\tikz@temppath%
+ \pgfshadepath{\tikz@shading}{\tikz@shade@angle}%
+ \tikz@mode@shadefalse% no more shading...
+ \fi%
+ %
+ % Step 6: Double stroke, if necessary
+ %
+ \iftikz@mode@draw%
+ \iftikz@mode@double%
+ % Change line width
+ \begingroup%
+ \pgfsys@beginscope%
+ \pgf@x=2\pgflinewidth%
+ \advance\pgf@x by\tikz@double@width@distance%
+ \pgflinewidth=\pgf@x%
+ \pgfsetlinewidth{\the\pgflinewidth}%
+ \fi%
+ \fi%
+ %
+ % Step 7: Do stroke/fill/clip as needed
+ %
+ \edef\tikz@temp{\noexpand\pgfusepath{%
+ \iftikz@mode@fill fill,\fi%
+ \iftikz@mode@draw draw,\fi%
+ \iftikz@mode@clip clip,\fi%
+ }}%
+ \tikz@temp%
+ \tikz@mode@fillfalse% no more filling
+ %
+ % Step 8: Double stroke, if necessary
+ %
+ \iftikz@mode@draw%
+ \iftikz@mode@double%
+ \pgfsyssoftpath@setcurrentpath\pgf@last@used@path% reinstall
+ \pgf@x=\tikz@double@width@distance%
+ \pgfsetlinewidth{\the\pgf@x}%
+ \pgfsetstrokecolor{\tikz@double@color}%
+ \pgfsyssoftpath@flushcurrentpath%
+ \pgfsys@stroke%
+ \pgfsys@endscope%
+ \ifpgf@drawarrows% set in pgfusepath...
+ \pgf@add@arrows@as@needed%
+ \fi%
+ \endgroup%
+ \fi%
+ \fi%
+ \tikz@mode@drawfalse% no more stroking
+ %
+ % Step 9: Postactions
+ %
+ \tikz@postactions%
+ %
+ % Step 10: Add labels and nodes
+ %
+ \box\tikz@figbox%
+ %
+ % Step 11: Close option brace
+ %
+ \ifx\tikz@options\pgfutil@empty%
+ \else%
+ \endgroup%
+ \pgfsys@endscope%
+ \iftikz@mode@clip%
+ \PackageError{tikz}{Extra options not allowed for clipping path command.}{}%
+ \fi%
+ \fi%
+ \iftikz@mode@clip%
+ \aftergroup\pgf@relevantforpicturesizefalse%
+ \fi%
+ \iftikz@mode@boundary%
+ \aftergroup\pgf@relevantforpicturesizefalse%
+ \fi%
+ \endgroup%
+ \global\pgflinewidth=\tikzscope@linewidth%
+ \tikz@lib@scope@check%
+}
+\let\tikz@lib@scope@check\pgfutil@empty% this is a hook for the scopes library
+
+% Extra actions
+
+\def\tikz@extra@preaction#1{%
+ {%
+ \pgfsys@beginscope%
+ \setbox\tikz@figbox=\box\voidb@x%
+ \path[#1];% do extra path
+ \pgfsyssoftpath@setcurrentpath\tikz@actions@path% restore
+ \tikz@restorepathsize%
+ \pgfsys@endscope%
+ }%
+}
+
+\def\tikz@extra@postaction#1{%
+ {%
+ \pgfsys@beginscope%
+ \setbox\tikz@figbox=\box\voidb@x%
+ \tikz@restorepathsize%
+ \path[#1]\pgfextra{\pgfsyssoftpath@setcurrentpath\tikz@actions@path};% do extra path
+ \pgf@resetpathsizes%
+ \pgfsys@endscope%
+ }%
+}
+
+
+
+\def\tikz@skip#1{\tikz@scan@next@command#1}
+\def\tikz@expand{%
+ \advance\tikz@expandcount by -1%
+ \ifnum\tikz@expandcount<0\relax%
+ \PackageError{tikz}{Giving up on this path. Did you forget a semicolon?}{}%
+ \let\@next=\tikz@finish%
+ \else%
+ \let\@next=\tikz@@expand
+ \fi%
+ \@next}
+
+\def\tikz@@expand{%
+ \expandafter\tikz@scan@next@command\@let@token}
+
+
+
+% Syntax for scopes:
+% {scoped path commands}
+
+\def\tikz@beginscope{\begingroup\tikz@scan@next@command}
+\def\tikz@endscope{%
+ \global\setbox\tikz@tempbox=\box\tikz@figbox%
+ \xdef\tikz@scope@save@lastx{\the\tikz@lastx}%
+ \xdef\tikz@scope@save@lasty{\the\tikz@lasty}%
+ \iftikz@current@point@local%
+ \endgroup%
+ \else%
+ \xdef\tikz@scope@save@lastxsaved{\the\tikz@lastxsaved}%
+ \xdef\tikz@scope@save@lastysaved{\the\tikz@lastysaved}%
+ \endgroup%
+ \tikz@lastxsaved=\tikz@scope@save@lastxsaved%
+ \tikz@lastysaved=\tikz@scope@save@lastysaved%
+ \fi%
+ \tikz@lastx=\tikz@scope@save@lastx%
+ \tikz@lasty=\tikz@scope@save@lasty%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \tikz@scan@next@command}
+
+
+% Syntax for pgfextra:
+% \pgfextra {normal tex text}
+% \pgfextra normal tex text \endpgfextra
+
+\def\tikz@extra{\pgfutil@ifnextchar\bgroup\tikz@@extra\relax}
+\long\def\tikz@@extra#1{#1\tikz@scan@next@command}
+\let\endpgfextra=\tikz@scan@next@command
+
+\def\pgfextra{pgfextra}
+
+
+% Syntax for \foreach:
+% \foreach \var in {list} {path text}
+%
+% Example:
+%
+% \draw (0,0) \foreach \x in {1,2,3} {-- (\x,0) circle (1cm)} -- (5,5);
+
+\def\tikz@foreach{%
+ \def\pgffor@beginhook{\setbox\tikz@figbox=\box\tikz@tempbox\expandafter\tikz@scan@next@command\pgfutil@firstofone}%
+ \def\pgffor@endhook{\pgfextra{%
+ \xdef\tikz@foreach@save@lastx{\the\tikz@lastx}%
+ \xdef\tikz@foreach@save@lasty{\the\tikz@lasty}%
+ \xdef\tikz@foreach@save@lastxsaved{\the\tikz@lastxsaved}%
+ \xdef\tikz@foreach@save@lastysaved{\the\tikz@lastysaved}%
+ \global\setbox\tikz@tempbox=\copy\tikz@figbox\pgfutil@gobble}}%
+ \def\pgffor@afterhook{%
+ \tikz@lastx=\tikz@foreach@save@lastx%
+ \tikz@lasty=\tikz@foreach@save@lasty%
+ \tikz@lastxsaved=\tikz@foreach@save@lastxsaved%
+ \tikz@lastysaved=\tikz@foreach@save@lastysaved%
+ \setbox\tikz@figbox=\box\tikz@tempbox\tikz@scan@next@command}%
+ \global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \foreach}
+
+
+% Syntax for againpath:
+% \againpath \somepathname
+
+\def\tikz@command@againpath#1{%
+ \pgfextra{%
+ \pgfsyssoftpath@getcurrentpath\tikz@temp%
+ \expandafter\pgfutil@g@addto@macro\expandafter\tikz@temp\expandafter{#1}%
+ \pgfsyssoftpath@setcurrentpath\tikz@temp%
+ }
+}
+
+
+
+
+%
+% When this if is set, a just-scanned point is a shape and its border
+% position still needs to be determined, depending on subsequent
+% commands.
+%
+
+\newif\iftikz@shapeborder
+
+
+% Syntax for moveto:
+% <point>
+\def\tikz@movetoabs{\tikz@moveto(}
+\def\tikz@movetorel{\tikz@moveto+}
+\def\tikz@moveto{%
+ \tikz@scan@one@point{\tikz@@moveto}}
+\def\tikz@@moveto#1{%
+ \tikz@make@last@position{#1}%
+ \iftikz@shapeborder%
+ % ok, the moveto will have to wait. flag that we have a moveto in
+ % wainting:
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \else%
+ \pgfpathmoveto{\tikz@last@position}%
+ \let\tikz@moveto@waiting=\relax%
+ \fi%
+ \tikz@scan@next@command%
+}
+
+\let\tikz@moveto@waiting=\relax % normally, nothing is waiting...
+
+\def\tikz@flush@moveto{%
+ \ifx\tikz@moveto@waiting\relax%
+ \else%
+ \pgfpathmoveto{\tikz@last@position}%
+ \fi%
+ \let\tikz@moveto@waiting=\relax%
+}
+
+
+\def\tikz@flush@moveto@toward#1#2#3{%
+ % #1 = a point towards which the last moveto should be corrected
+ % #2 = a dimension to which the corrected x-coordinate should be stored
+ % #3 = a dimension for the corrected y-coordinate
+ \ifx\tikz@moveto@waiting\relax%
+ % do nothing
+ \else%
+ \pgf@process{\pgfpointshapeborder{\tikz@moveto@waiting}{#1}}%
+ #2=\pgf@x%
+ #3=\pgf@y%
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \fi%
+ \let\tikz@moveto@waiting=\relax%
+}
+
+
+%
+% Collecting labels on the path
+%
+
+\def\tikz@collect@coordinate@onpath#1coordinate{%
+ \pgfutil@ifnextchar[{\tikz@@collect@coordinate@opt#1}{\tikz@@collect@coordinate@opt#1[]}}%}
+\def\tikz@@collect@coordinate@opt#1[#2]{%
+ \pgfutil@ifnextchar({\tikz@@collect@coordinate#1[#2]}{%
+ \tikz@collect@label@onpath#1node[shape=coordinate,#2]{}}}%}
+\def\tikz@@collect@coordinate#1[#2](#3){%
+ \tikz@collect@label@onpath#1node[shape=coordinate,#2](#3){}}
+
+\def\tikz@collect@label@onpath#1node{%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath node}%
+ \tikz@collect@label@scan#1}
+
+\def\tikz@collect@label@scan#1{%
+ \pgfutil@ifnextchar({\tikz@collect@paran#1}%
+ {\pgfutil@ifnextchar[{\tikz@collect@options#1}%
+ {\pgfutil@ifnextchar\bgroup{\tikz@collect@arg#1}%
+ {#1}}}%
+}%}}
+
+\def\tikz@collect@paran#1(#2){%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath(#2)}%
+ \tikz@collect@label@scan#1%
+}
+\def\tikz@collect@options#1[#2]{%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath[#2]}%
+ \tikz@collect@label@scan#1%
+}
+\def\tikz@collect@arg#1#2{%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath{#2}}%
+ #1%
+}
+
+
+\def\tikz@invoke@collected@onpath{%
+ \tikz@node@is@a@labeltrue%
+ \let\tikz@temp=\tikz@collected@onpath%
+ \let\tikz@collected@onpath=\pgfutil@empty%
+ \expandafter\tikz@scan@next@command\tikz@temp\pgf@stop%
+ \tikz@node@is@a@labelfalse%
+}
+
+
+
+
+% Syntax for lineto:
+% -- <point>
+
+\def\tikz@lineto{%
+ \pgfutil@ifnextchar |%
+ {\expandafter\tikz@hv@lineto\pgfutil@gobble}%
+ {\expandafter\pgfutil@ifnextchar\tikz@activebar{\expandafter\tikz@hv@lineto\pgfutil@gobble}%
+ {\expandafter\tikz@lineto@mid\pgfutil@gobble}}}
+\def\tikz@lineto@mid{%
+ \pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@lineto@mid}%
+ {%
+ \pgfutil@ifnextchar c{\tikz@close}{%
+ \pgfutil@ifnextchar p{\pgfsetlinetofirstplotpoint\expandafter\tikz@plot\pgfutil@gobble}%
+ {\tikz@scan@one@point{\tikz@@lineto}}}}}
+\def\tikz@@lineto#1{%
+ % Record the starting point for later labels on the path:
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}
+ \iftikz@shapeborder%
+ % ok, target is a shape. recalculate end
+ \pgf@process{\pgfpointshapeborder{\tikz@shapeborder@name}{\tikz@last@position}}%
+ \tikz@make@last@position{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \tikz@flush@moveto@toward{\tikz@last@position}\pgf@x\pgf@y%
+ \tikz@path@lineto{\tikz@last@position}%
+ \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \tikz@make@last@position{#1}%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \else%
+ % target is a reasonable point...
+ % Record the starting point for later labels on the path:
+ \tikz@make@last@position{#1}%
+ \tikz@flush@moveto@toward{\tikz@last@position}\pgf@x\pgf@y%
+ \tikz@path@lineto{\tikz@last@position}%
+ \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \fi%
+ \let\tikz@timer=\tikz@timer@line%
+ \tikz@scan@next@command%
+}
+
+% snake or lineto?
+\def\tikz@path@lineto#1{%
+ \iftikz@snaked%
+ {
+ \pgfsyssoftpathmovetorelevantfalse%
+ \pgfpathsnakesto{\tikz@presnake,{\tikz@snake}{\tikz@mainsnakelength}{\noexpand\tikz@snake@install@trans}{},\tikz@postsnake}{#1}%
+ }
+ \else%
+ \pgfpathlineto{#1}%
+ \fi%
+}
+
+% snake or lineto?
+\def\tikz@path@close#1{%
+ \iftikz@snaked%
+ {%
+ \pgftransformreset%
+ \pgfpathsnakesto{\tikz@presnake,{\tikz@snake}{\tikz@mainsnakelength}{\noexpand\tikz@snake@install@trans}{},\tikz@postsnake}{#1}%
+ }%
+ \fi%
+ \pgfpathclose%
+}
+
+
+% Syntax for lineto horizontal/vertical:
+% -| <point>
+
+\def\tikz@hv@lineto{%
+ \pgfutil@ifnextchar n
+ {\tikz@collect@label@onpath\tikz@hv@lineto}
+ {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@hv@lineto}%
+ {\tikz@scan@one@point{\tikz@@hv@lineto}}}}
+\def\tikz@@hv@lineto#1{%
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \pgf@yc=\tikz@lasty%
+ \tikz@make@last@position{#1}%
+ \tikz@flush@moveto@toward{\pgfqpoint{\tikz@lastx}{\pgf@yc}}\pgf@x\pgf@yc%
+ \iftikz@shapeborder%
+ % ok, target is a shape. have to work now:
+ {%
+ \pgf@process{\pgfpointshapeborder{\tikz@shapeborder@name}{\pgfqpoint{\tikz@lastx}{\pgf@yc}}}%
+ \tikz@make@last@position{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@yc}}%
+ \tikz@path@lineto{\tikz@last@position}%
+ \xdef\tikz@timer@end@temp{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group
+ }%
+ \let\tikz@timer@end=\tikz@timer@end@temp%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \else%
+ \tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@yc}}%
+ \tikz@path@lineto{\tikz@last@position}%
+ \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group
+ \fi%
+ \let\tikz@timer=\tikz@timer@hvline%
+ \tikz@scan@next@command%
+}
+
+% Syntax for lineto vertical/horizontal:
+% |- <point>
+
+\def\tikz@vh@lineto-{\tikz@vh@lineto@next}
+\def\tikz@vh@lineto@next{%
+ \pgfutil@ifnextchar n
+ {\tikz@collect@label@onpath\tikz@vh@lineto@next}
+ {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@vh@lineto@next}%
+ {\tikz@scan@one@point\tikz@@vh@lineto}}}
+\def\tikz@@vh@lineto#1{%
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \pgf@xc=\tikz@lastx%
+ \tikz@make@last@position{#1}%
+ \tikz@flush@moveto@toward{\pgfqpoint{\pgf@xc}{\tikz@lasty}}\pgf@xc\pgf@y%
+ \iftikz@shapeborder%
+ % ok, target is a shape. have to work now:
+ {%
+ \pgf@process{\pgfpointshapeborder{\tikz@shapeborder@name}{\pgfqpoint{\pgf@xc}{\tikz@lasty}}}%
+ \tikz@make@last@position{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \tikz@path@lineto{\pgfqpoint{\pgf@xc}{\tikz@lasty}}%
+ \tikz@path@lineto{\tikz@last@position}%
+ \xdef\tikz@timer@end@temp{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group
+ }%
+ \let\tikz@timer@end=\tikz@timer@end@temp%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \else%
+ \tikz@path@lineto{\pgfqpoint{\pgf@xc}{\tikz@lasty}}%
+ \tikz@path@lineto{\tikz@last@position}%
+ \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \fi%
+ \let\tikz@timer=\tikz@timer@vhline%
+ \tikz@scan@next@command%
+}
+
+% Syntax for cycle:
+% -- cycle
+\def\tikz@close c{%
+ \pgfutil@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@lineto@mid c}% oops, a coordinate
+ {\tikz@@close c}}%
+\def\tikz@@close cycle{%
+ \tikz@flush@moveto%
+ \tikz@path@close{\expandafter\pgfpoint\pgfsyssoftpath@lastmoveto}%
+ \def\pgfstrokehook{}%
+ \let\tikz@timer=\@undefined%
+ \tikz@scan@next@command%
+}
+
+
+% Syntax for options:
+% [options]
+\def\tikz@parse@options#1]{%
+ \tikzset{#1}%
+ \tikz@lib@dec@hook% for decorations...
+ \tikz@scan@next@command%
+}
+\let\tikz@lib@dec@hook=\relax
+
+% Syntax for edges:
+% edge [options] (coordinate)
+% edge [options] node {node text} (coordinate)
+\def\tikz@edge@plain{%
+ \begingroup%
+ \tikz@to@use@whom%
+ \let\tikz@to@or@edge@function=\tikz@do@edge%
+ \tikz@to@or@edge}
+
+% Syntax for to paths:
+% to [options] (coordinate)
+% to [options] node {node text} (coordinate)
+\def\tikz@to o{%
+ \tikz@to@use@last@coordinate%
+ \let\tikz@to@or@edge@function=\tikz@do@to%
+ \tikz@to@or@edge}
+
+\def\tikz@to@or@edge{\pgfutil@ifnextchar[\tikz@@to@or@edge{\tikz@@to@or@edge[]}}%}
+\def\tikz@@to@or@edge[#1]{%
+ \def\tikz@@to@local@options{[#1]}%
+ \let\tikz@collected@onpath=\pgfutil@empty%
+ \tikz@@to@collect%
+}
+\def\tikz@@to@collect{%
+ \pgfutil@ifnextchar(\tikz@@to@or@edge@coordinate
+ {\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@@to@collect}%
+ {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@@to@collect}
+ {\PackageError{tikz}{( expected}{}%}
+ \tikz@@to@or@edge@coordinate()}}}%
+}
+
+\def\tikz@@to@or@edge@coordinate({%
+ \pgfutil@ifnextchar${%$
+ % Ok, parse directly
+ \tikz@scan@one@point\tikz@@to@or@edge@math(%
+ }{%
+ \pgfutil@ifnextchar[{%]
+ \tikz@scan@one@point\tikz@@to@or@edge@math(%
+ }{%
+ \tikz@@to@or@edge@@coordinate(%
+ }%
+ }%
+}
+\def\tikz@@to@or@edge@math#1{%
+ \pgf@process{#1}%
+ \edef\tikztotarget{\the\pgf@x,\the\pgf@y}%
+ \tikz@to@or@edge@function%
+}
+
+\def\tikz@@to@or@edge@@coordinate(#1){%
+ \def\tikztotarget{#1}%
+ \tikz@to@or@edge@function%
+}
+
+\def\tikz@do@edge{%
+ \setbox\tikz@figbox=\hbox\bgroup%
+ \unhbox\tikz@figbox%
+ \hbox\bgroup
+ \bgroup%
+ \pgfinterruptpath%
+ \pgfscope%
+ \let\tikz@transform=\pgfutil@empty%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@tonodes=\tikz@collected@onpath%
+ \def\tikztonodes{{\pgfextra{\tikz@node@is@a@labeltrue}\tikz@tonodes}}%
+ \let\tikz@collected@onpath=\pgfutil@empty%
+ \tikz@options%
+ \tikz@transform%
+ % Typeset node:
+ \tikz@atbegin@to%
+ \path[style=every edge]\tikz@@to@local@options(\tikztostart)\tikz@to@path;%
+ \tikz@atend@to%
+ \endpgfscope%
+ \endpgfinterruptpath%
+ \egroup
+ \egroup%
+ \egroup%
+ \global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \endgroup%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \tikz@scan@next@command%
+}
+
+\def\tikz@do@to{%
+ \let\tikz@tonodes=\tikz@collected@onpath%
+ \def\tikztonodes{{\pgfextra{\tikz@node@is@a@labeltrue}\tikz@tonodes}}%
+ \let\tikz@collected@onpath=\pgfutil@empty%
+ \tikz@scan@next@command%
+ \pgfextra{\tikz@atbegin@to}%
+ [style=every to]\tikz@@to@local@options\tikz@to@path%
+ \pgfextra{\tikz@atend@to}%
+}
+
+
+\def\tikz@to@use@last@coordinate{%
+ \iftikz@shapeborder%
+ \edef\tikztostart{\tikz@shapeborder@name}%
+ \else%
+ \edef\tikztostart{\the\tikz@lastx,\the\tikz@lasty}%
+ \fi%
+}
+\def\tikz@to@use@last@fig@name{%
+ \edef\tikztostart{\tikz@to@last@fig@name}%
+}
+
+
+
+% Syntax for edge from parent:
+% edge from parent [options]
+\def\tikz@edgetoparent from parent{\pgfutil@ifnextchar[\tikz@@edgetoparent{\tikz@@edgetoparent[]}}%}
+\def\tikz@@edgetoparent[#1]{%
+ \let\tikz@edge@to@parent@needed=\pgfutil@empty%
+ \tikz@node@is@a@labeltrue%
+ \tikz@scan@next@command [style=edge from parent,#1] \tikz@edge@to@parent@path%
+}
+
+
+% Syntax for bezier curves
+% .. controls(point) and (point) .. (target)
+% .. controls(point) .. (target)
+% .. (target) % currently not supported
+
+\def\tikz@dot.{\tikz@@dot}%
+\def\tikz@@dot{%
+ \pgfutil@ifnextchar n%
+ {\tikz@collect@label@onpath\tikz@@dot}%
+ {\pgfutil@ifnextchar c{\tikz@curveto@double}{\tikz@curveto@auto}}}
+
+\def\tikz@curveto@double co{%
+ \pgfutil@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@@dot co}
+ {\tikz@cureveto@@double}}
+\def\tikz@cureveto@@double ntrols#1{%
+ \tikz@scan@one@point\tikz@curveA#1%
+}
+\def\tikz@curveA#1{%
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ {%
+ \tikz@make@last@position{#1}%
+ \xdef\tikz@curve@first{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ }%
+ \pgfutil@ifnextchar a
+ {\tikz@curveBand}%
+ {\let\tikz@curve@second\tikz@curve@first\tikz@curveCdots}%
+}
+\def\tikz@curveBand and{%
+ \tikz@scan@one@point\tikz@curveB%
+}
+\def\tikz@curveB#1{%
+ \def\tikz@curve@second{#1}%
+ \tikz@curveCdots}
+\def\tikz@curveCdots{%
+ \afterassignment\tikz@curveCdot\let\@next=}
+\def\tikz@curveCdot.{%
+ \ifx\@next.%
+ \else%
+ \PackageError{tikz}{Dot expected}{}%
+ \fi%
+ \tikz@updatecurrenttrue%
+ \tikz@curveCcheck%
+}
+\def\tikz@curveCcheck{%
+ \pgfutil@ifnextchar n%
+ {\tikz@collect@label@onpath\tikz@curveCcheck}
+ {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@curveCcheck}
+ {\tikz@scan@one@point\tikz@curveC}}%
+}
+\def\tikz@curveC#1{%
+ \tikz@make@last@position{#1}%
+ \edef\tikz@curve@third{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ {%
+ \tikz@lastxsaved=\tikz@lastx%
+ \tikz@lastysaved=\tikz@lasty%
+ \tikz@make@last@position{\tikz@curve@second}%
+ \xdef\tikz@curve@second{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ }%
+ %
+ % Start recalculating things in case start and end are shapes.
+ %
+ % First, the start:
+ \ifx\tikz@moveto@waiting\relax%
+ \else%
+ \pgf@process{\pgfpointshapeborder{\tikz@moveto@waiting}{\tikz@curve@first}}%
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \fi%
+ \let\tikz@timer@cont@one=\tikz@curve@first%
+ \let\tikz@timer@cont@two=\tikz@curve@second%
+ % Second, the end:
+ \iftikz@shapeborder%
+ % ok, target is a shape. recalculate third
+ {%
+ \pgf@process{\pgfpointshapeborder{\tikz@shapeborder@name}{\tikz@curve@second}}%
+ \tikz@make@last@position{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \edef\tikz@curve@third{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \pgfpathcurveto{\tikz@curve@first}{\tikz@curve@second}{\tikz@curve@third}%
+ \global\let\tikz@timer@end@temp=\tikz@curve@third% move out of group
+ }%
+ \let\tikz@timer@end=\tikz@timer@end@temp%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \else%
+ \pgfpathcurveto{\tikz@curve@first}{\tikz@curve@second}{\tikz@curve@third}%
+ \let\tikz@timer@end=\tikz@curve@third
+ \let\tikz@moveto@waiting=\relax%
+ \fi%
+ \let\tikz@timer=\tikz@timer@curve%
+ \tikz@scan@next@command%
+}
+
+
+% Syntax for rectangles:
+% rectangle <corner point>
+\def\tikz@rect ectangle{%
+ \tikz@flush@moveto%
+ \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \tikz@@rect}%
+\def\tikz@@rect{%
+ \pgfutil@ifnextchar n
+ {\tikz@collect@label@onpath\tikz@@rect}
+ {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@@rect}%
+ {
+ \pgf@xa=\tikz@lastx\relax%
+ \pgf@ya=\tikz@lasty\relax%
+ \tikz@scan@one@point\tikz@rectB}}}
+\def\tikz@rectB#1{%
+ \tikz@make@last@position{#1}%
+ \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \let\tikz@timer=\tikz@timer@line%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \tikz@path@lineto{\pgfqpoint{\pgf@xa}{\tikz@lasty}}%
+ \tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
+ \tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@ya}}%
+ \iftikz@snaked%
+ \tikz@path@lineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \fi%
+ \pgfpathclose%
+ \pgfpathmoveto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
+ \def\pgfstrokehook{}%
+ \tikz@scan@next@command%
+}
+
+
+
+% Syntax for grids:
+% grid <corner point>
+\def\tikz@grid rid{%
+ \tikz@flush@moveto%
+ \pgf@xa=\tikz@lastx\relax%
+ \pgf@ya=\tikz@lasty\relax%
+ \pgfutil@ifnextchar[{\tikz@gridA}{\tikz@gridA[]}}%}
+\def\tikz@gridA[#1]{%
+ \def\tikz@grid@options{#1}%
+ \tikz@scan@one@point\tikz@gridB}%
+\def\tikz@gridB#1{%
+ \tikz@make@last@position{#1}%
+ {%
+ \expandafter\tikzset\expandafter{\tikz@grid@options}
+ \tikz@checkunit{\tikz@grid@x}%
+ \iftikz@isdimension%
+ \pgf@process{\pgfpoint{\tikz@grid@x}{0pt}}%
+ \else%
+ \pgf@process{\pgfpointxy{\tikz@grid@x}{0}}%
+ \fi%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \tikz@checkunit{\tikz@grid@y}%
+ \iftikz@isdimension%
+ \pgf@process{\pgfpoint{0pt}{\tikz@grid@y}}%
+ \else%
+ \pgf@process{\pgfpointxy{0}{\tikz@grid@y}}%
+ \fi%
+ \advance\pgf@xb by\pgf@x%
+ \advance\pgf@yb by\pgf@y%
+ \pgfpathgrid[stepx=\pgf@xb,stepy=\pgf@yb]%
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
+ }
+ \tikz@scan@next@command%
+}
+
+
+
+% Syntax for plot:
+% plot [local options] ... % starts with a moveto
+% -- plot [local options] ... % starts with a lineto
+\def\tikz@plot lot{%
+ \tikz@flush@moveto%
+ \pgfutil@ifnextchar[{\tikz@@plot}{\tikz@@plot[]}}%}
+\def\tikz@@plot[#1]{%
+ \begingroup%
+ \let\tikz@options=\pgfutil@empty%
+ \tikzset{every plot/.try}%
+ \tikzset{#1}%
+ \pgfutil@ifnextchar f{\tikz@plot@f}%
+ {\pgfutil@ifnextchar c{\tikz@plot@scan@points}%
+ {\pgfutil@ifnextchar ({\tikz@plot@expression}{%
+ \PackageError{tikz}{Cannot parse this plotting data}{}%
+ \endgroup}}}}
+\def\tikz@plot@f f{\pgfutil@ifnextchar i{\tikz@plot@file}{\tikz@plot@function}}
+
+\def\tikz@plot@file ile#1{\def\tikz@plot@data{\pgfplotxyfile{#1}}\tikz@@@plot}%
+\def\tikz@plot@scan@points coordinates#1{%
+ \pgfplothandlerrecord\tikz@plot@data%
+ \pgfplotstreamstart%
+ \pgfutil@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\pgfutil@gobble}
+ {\tikz@scan@one@point\tikz@plot@next@point}%
+ #1\pgf@stop%
+}
+\def\tikz@plot@next@point#1{%
+ \pgfplotstreampoint{#1}%
+ \pgfutil@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\pgfutil@gobble}%
+ {\tikz@scan@one@point\tikz@plot@next@point}%
+}
+\def\tikz@plot@function unction#1{%
+ \def\tikz@plot@filename{\tikz@plot@prefix\tikz@plot@id}%
+ \iftikz@plot@raw@gnuplot%
+ \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{#1}}%
+ \else%
+ \iftikz@plot@parametric%
+ \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
+ set samples \tikz@plot@samples;
+ set parametric;
+ plot [t=\tikz@plot@domain] #1}}%
+ \else%
+ \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
+ set samples \tikz@plot@samples;
+ plot [x=\tikz@plot@domain] #1}}%
+ \fi%
+ \fi%
+ \tikz@@@plot%
+}
+
+\def\tikz@plot@no@resample{%
+ \pgfutil@IfFileExists{\tikz@plot@filename.table}%
+ {\def\tikz@plot@data{\pgfplotxyfile{\tikz@plot@filename.table}}}%
+ {}%
+}
+
+\def\tikz@plot@expression(#1){%
+ \edef\tikz@plot@data{\noexpand\pgfplotfunction{\expandafter\noexpand\tikz@plot@var}{\tikz@plot@samplesat}}%
+ \expandafter\def\expandafter\tikz@plot@data\expandafter{\tikz@plot@data{\tikz@scan@one@point\pgfutil@firstofone(#1)}}%
+ \tikz@@@plot%
+}
+
+\def\tikz@@@plot{%
+ \def\pgfplotlastpoint{\pgfpointorigin}%
+ \tikz@plot@handler%
+ \tikz@plot@data%
+ \global\let\tikz@@@temp=\pgfplotlastpoint%
+ \ifx\tikz@plot@mark\pgfutil@empty%
+ \else%
+ % Marks are drawn after the path.
+ \setbox\tikz@figbox=\hbox{%
+ \unhbox\tikz@figbox%
+ \hbox{{%
+ \pgfinterruptpath%
+ \pgfscope%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@transform=\pgfutil@empty%
+ \expandafter\tikzset\expandafter{\tikz@plot@mark@options}%
+ \tikz@options%
+ \ifx\tikz@mark@list\pgfutil@empty%
+ \pgfplothandlermark{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}%
+ \else
+ \pgfplothandlermarklisted{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}{\tikz@mark@list}%
+ \fi
+ \tikz@plot@data%
+ \endpgfscope
+ \endpgfinterruptpath%
+ }}%
+ }%
+ \fi%
+ \global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \endgroup%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \tikz@make@last@position{\tikz@@@temp}%
+ \tikz@scan@next@command%
+}
+
+
+\pgfdeclareplotmark{ball}
+{%
+ \def\tikz@shading{ball}%
+ \shade (0,0) circle (\pgfplotmarksize);%
+}
+
+
+
+
+% Syntax for cosine curves:
+% cos <end of quarter-period>
+\def\tikz@cosine s{\tikz@scan@one@point\tikz@@cosine}
+\def\tikz@@cosine#1{%
+ \tikz@flush@moveto%
+ \pgf@process{#1}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xc by-\tikz@lastx%
+ \advance\pgf@yc by-\tikz@lasty%
+ \advance\tikz@lastx by\pgf@xc%
+ \advance\tikz@lasty by\pgf@yc%
+ \tikz@lastxsaved=\tikz@lastx%
+ \tikz@lastysaved=\tikz@lasty%
+ \tikz@updatecurrenttrue%
+ \pgfpathcosine{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \tikz@scan@next@command%
+}
+
+% Syntax for sine curves:
+% sin <end of quarter-period>
+\def\tikz@sine in{\tikz@scan@one@point\tikz@@sine}
+\def\tikz@@sine#1{%
+ \tikz@flush@moveto%
+ \pgf@process{#1}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xc by-\tikz@lastx%
+ \advance\pgf@yc by-\tikz@lasty%
+ \advance\tikz@lastx by\pgf@xc%
+ \advance\tikz@lasty by\pgf@yc%
+ \tikz@lastxsaved=\tikz@lastx%
+ \tikz@lastysaved=\tikz@lasty%
+ \tikz@updatecurrenttrue%
+ \pgfpathsine{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
+ \tikz@scan@next@command%
+}
+
+% Syntax for parabolas:
+% parabola[options] bend <coordinate> <coordinate>
+\def\tikz@parabola arabola{%
+ \pgfutil@ifnextchar[{\tikz@parabola@options}{\tikz@parabola@options[]}}%}
+
+\def\tikz@parabola@options[#1]{%
+ \def\tikz@parabola@option{#1}%
+ \pgfutil@ifnextchar b{\tikz@parabola@scan@bend}{\tikz@scan@one@point\tikz@parabola@semifinal}}
+\def\tikz@parabola@scan@bend bend{\tikz@scan@one@point\tikz@parabola@scan@bendB}
+\def\tikz@parabola@scan@bendB#1{%
+ \def\tikz@parabola@bend{#1}%
+ \tikz@scan@one@point\tikz@parabola@semifinal%
+}
+\def\tikz@parabola@semifinal#1{%
+ \tikz@flush@moveto%
+ % Save original start:
+ \pgf@xb=\tikz@lastx%
+ \pgf@yb=\tikz@lasty%
+ \tikz@make@last@position{#1}%
+ \pgf@xc=\tikz@lastx%
+ \pgf@yc=\tikz@lasty%
+ \begingroup% now calculate bend:
+ \expandafter\tikzset\expandafter{\tikz@parabola@option}%
+ \tikz@lastxsaved=\tikz@parabola@bend@factor\tikz@lastx%
+ \tikz@lastysaved=\tikz@parabola@bend@factor\tikz@lasty%
+ \advance\tikz@lastxsaved by\pgf@xb%
+ \advance\tikz@lastysaved by\pgf@yb%
+ \advance\tikz@lastxsaved by-\tikz@parabola@bend@factor\pgf@xb%
+ \advance\tikz@lastysaved by-\tikz@parabola@bend@factor\pgf@yb%
+ \expandafter\tikz@make@last@position\expandafter{\tikz@parabola@bend}%
+ % Calculate delta from bend
+ \advance\pgf@xc by-\tikz@lastx%
+ \advance\pgf@yc by-\tikz@lasty%
+ % Ok, now calculate delta to bend
+ \advance\tikz@lastx by-\pgf@xb%
+ \advance\tikz@lasty by-\pgf@yb%
+ \xdef\tikz@parabola@b{{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}}%
+ \endgroup%
+ \expandafter\pgfpathparabola\tikz@parabola@b%
+ \tikz@scan@next@command%
+}
+
+
+% Syntax for circles:
+% circle (radius)
+%
+% Syntax for ellipses:
+% ellipse (x-radius and y-radius)
+%
+% radii can be dimensionless, then they are in the xy-system
+\def\tikz@circle ircle{\tikz@flush@moveto\tikz@@circle}
+\def\tikz@ellipse llipse{\tikz@flush@moveto\tikz@@circle}
+\def\tikz@@circle{%
+ \pgfutil@ifnextchar(\tikz@@@circle{%)
+ \advance\tikz@expandcount by -1%
+ \ifnum\tikz@expandcount<0\relax%
+ \let\@next=\tikz@@circle@scangiveup%
+ \else%
+ \let\@next=\tikz@@circle@scanexpand%
+ \fi%
+ \@next%
+ }%
+}
+\def\tikz@@circle@scanexpand{\expandafter\tikz@@circle}
+\def\tikz@@circle@scangiveup#1{\PackageError{tikz}{Cannot parse this radius}{}#1{\tikz@scan@next@command}}
+\def\tikz@@@circle(#1){%
+ \pgfutil@in@{ and }{#1}%
+ \ifpgfutil@in@%
+ \tikz@@ellipseB(#1)%
+ \else%
+ \tikz@@ellipseB({#1} and {#1})%
+ \fi%
+ \tikz@scan@next@command%
+}
+\def\tikz@@ellipseB(#1 and #2){%
+ \pgfmathparse{#1}%
+ \let\tikz@ellipse@x=\pgfmathresult%
+ \ifpgfmathunitsdeclared%
+ \pgfmathparse{#2}%
+ \let\tikz@ellipse@y=\pgfmathresult%
+ \ifpgfmathunitsdeclared%
+ \pgfpathellipse{\tikz@last@position}{%
+ \pgfqpoint{\tikz@ellipse@x pt}{0pt}}{\pgfpoint{0pt}{\tikz@ellipse@y pt}}%
+ \else%
+ \PackageError{tikz}{You cannot mix dimensions and dimensionless values in an ellipse}{}%
+ \fi%
+ \else%
+ \pgfmathparse{#2}%
+ \let\tikz@ellipse@y=\pgfmathresult%
+ \ifpgfmathunitsdeclared%
+ \PackageError{tikz}{You cannot mix dimensions and dimensionless values in an ellipse}{}%
+ \else%
+ \pgfpathellipse{\tikz@last@position}{%
+ \pgfpointxy{\tikz@ellipse@x}{0}}{\pgfpointxy{0}{\tikz@ellipse@y}}%
+ \fi%
+ \fi%
+}
+
+% Syntax 1 for arcs:
+% arc (start angle:end angle:radius)
+%
+% Syntax 2 for arcs:
+% arc (start angle:end angle:x-radius and y-radius)
+%
+% radius can be dimensionless, then the arc is in the xy-coordinate system
+\def\tikz@arcA rc{%
+ \tikz@flush@moveto%
+ \pgfutil@ifnextchar({\tikz@@arcto}{\expandafter\tikz@arcA\expandafter r\expandafter c}}
+
+\def\tikz@@arcto(#1){%
+ \edef\tikz@temp{(#1)}%
+ \expandafter\tikz@@@arcto@check@slashand\tikz@temp%
+}
+
+\def\tikz@@@arcto@check@slashand(#1:#2:#3){%
+ \pgfutil@in@{ and }{#3}%
+ \ifpgfutil@in@%
+ \tikz@parse@arc@and(#1:#2:#3)%
+ \else%
+ \tikz@parse@arc@and(#1:#2:{#3} and {#3})%
+ \fi%
+}
+
+\def\tikz@parse@arc@and(#1:#2:#3 and #4){%
+ \pgfmathparse{#3}%
+ \let\tikz@arc@x=\pgfmathresult%
+ \ifpgfmathunitsdeclared%
+ \pgfmathparse{#4}%
+ \let\tikz@arc@y=\pgfmathresult%
+ \ifpgfmathunitsdeclared%
+ \tikz@@@arcfinal{\pgfpatharc{#1}{#2}{\tikz@arc@x pt and \tikz@arc@y pt}}
+ {\pgfpointpolar{#1}{\tikz@arc@x pt and \tikz@arc@y pt}}
+ {\pgfpointpolar{#2}{\tikz@arc@x pt and \tikz@arc@y pt}}%
+ \else%
+ \PackageError{tikz}{You cannot mix dimensions and dimensionless values in an arc}{}%
+ \fi%
+ \else%
+ \pgfmathparse{#4}%
+ \let\tikz@arc@y=\pgfmathresult%
+ \ifpgfmathunitsdeclared%
+ \PackageError{tikz}{You cannot mix dimensions and dimensionless values in an arc}{}%
+ \else%
+ \tikz@@@arcfinal{\pgfpatharcaxes{#1}{#2}{\pgfpointxy{\tikz@arc@x}{0}}{\pgfpointxy{0}{\tikz@arc@y}}}
+ {\pgfpointpolarxy{#1}{\tikz@arc@x and \tikz@arc@y}}{\pgfpointpolarxy{#2}{\tikz@arc@x and \tikz@arc@y}}%
+ \fi%
+ \fi%
+}
+
+\def\tikz@@@arcfinal#1#2#3{%
+ #1%
+ \pgf@process{#2}%
+ \advance\tikz@lastx by-\pgf@x%
+ \advance\tikz@lasty by-\pgf@y%
+ \pgf@process{#3}%
+ \advance\tikz@lastx by\pgf@x%
+ \advance\tikz@lasty by\pgf@y%
+ \tikz@lastxsaved=\tikz@lastx%
+ \tikz@lastysaved=\tikz@lasty%
+ \tikz@scan@next@command%
+}
+
+
+% Syntax for coordinates:
+% coordinate[options] (coordinate name) at (point)
+% where ``at (point)'' is optional
+\def\tikz@coordinate ordinate{%
+ \pgfutil@ifnextchar[{\tikz@@coordinate@opt}{\tikz@@coordinate@opt[]}}
+\def\tikz@@coordinate@opt[#1]{%
+ \pgfutil@ifnextchar({\tikz@@coordinate[#1]}
+ {\tikz@fig ode[shape=coordinate,#1]{}}}%}
+\def\tikz@@coordinate[#1](#2){%
+ \pgfutil@ifnextchar a{\tikz@@coordinate@at[#1](#2)}
+ {\tikz@fig ode[shape=coordinate,#1](#2){}}}
+\def\tikz@@coordinate@at[#1](#2)at#3({%
+ \def\tikz@coordinate@caller{\tikz@fig ode[shape=coordinate,#1](#2)at}%
+ \tikz@scan@one@point\tikz@@coordinate@at@math(%
+}
+\def\tikz@@coordinate@at@math#1{%
+ \pgf@process{#1}%
+ \edef\tikz@temp{(\the\pgf@x,\the\pgf@y)}%
+ \expandafter\tikz@coordinate@caller\tikz@temp{}%
+}
+
+
+
+% Syntax for nodes:
+% node[options] (node name) {label text}
+%
+% all of [options], (node name) and {label text} are optional. There
+% can be multiple options before the label text as in
+% node[draw] (a) [rotate=10] {text}
+%
+% A label text always ``ends'' the node.
+\def\tikz@fig ode{%
+ \edef\tikz@save@line@width{\the\pgflinewidth}%
+ \begingroup%
+ \let\tikz@fig@name=\pgfutil@empty%
+ \begingroup%
+ \tikz@is@matrixfalse%
+ \let\nodepart=\tikz@nodepart%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@after@node=\pgfutil@empty%
+ \let\tikz@afternodepathoptions=\pgfutil@empty%
+ \let\tikz@transform=\pgfutil@empty%
+ \let\tikz@mode=\pgfutil@empty%
+ \tikz@decoratepathfalse%
+ \let\tikz@preactions=\pgfutil@empty%
+ \let\tikz@postactions=\pgfutil@empty%
+ \let\tikz@alias=\pgfutil@empty%
+ \def\tikz@node@at{\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \iftikz@node@is@a@label%
+ \else%
+ \let\tikz@time=\pgfutil@empty%
+ \fi%
+ \tikz@node@reset@hook%
+ \tikzset{every node/.try}%
+ \tikz@@scan@fig}%
+\def\tikz@@scan@fig{%
+ \pgfutil@ifnextchar a{\tikz@fig@scan@at}
+ {\pgfutil@ifnextchar({\tikz@fig@scan@name}
+ {\pgfutil@ifnextchar[{\tikz@fig@scan@options}%
+ {\pgfutil@ifnextchar\bgroup{\tikz@fig@main}%
+ {\PackageError{tikz}{A node must have a (possibly empty) label text}{}%
+ \tikz@fig@main{}}}}}}%}}
+\def\tikz@fig@scan@at at{%
+ \tikz@scan@one@point\tikz@@fig@scan@at}
+\def\tikz@@fig@scan@at#1{%
+ \def\tikz@node@at{#1}\tikz@@scan@fig}%
+\def\tikz@fig@scan@name(#1){\edef\tikz@fig@name{#1}\tikz@@scan@fig}%
+\def\tikz@fig@scan@options[#1]{\tikzset{#1}\tikz@@scan@fig}%
+\let\tikz@node@reset@hook=\pgfutil@empty%
+\let\tikz@node@begin@hook=\pgfutil@empty%
+\def\tikz@fig@main{\afterassignment\tikz@@fig@main\let\next=}
+\def\tikz@@fig@main{%
+ \pgfutil@ifundefined{pgf@sh@s@\tikz@shape}%
+ {\PackageError{tikz}%
+ {Unknown shape ``\tikz@shape.'' Using ``rectangle'' instead}{}%
+ \def\tikz@shape{rectangle}}%
+ {}%
+ \tikzset{every \tikz@shape\space node/.try}%
+ \tikz@node@begin@hook%
+ \iftikz@is@matrix%
+ \let\tikz@next=\tikz@do@matrix%
+ \else%
+ \let\tikz@next=\tikz@do@fig%
+ \fi%
+ \tikz@next%
+}
+\def\tikz@do@fig{%
+ \setbox\pgfnodeparttextbox=\hbox%
+ \bgroup%
+ \tikzset{every text node part/.try}%
+ \ifx\tikz@textopacity\pgfutil@empty%
+ \else%
+ \pgfsetfillopacity{\tikz@textopacity}%
+ \pgfsetstrokeopacity{\tikz@textopacity}%
+ \fi%
+ \pgfinterruptpicture%
+ \tikz@textfont%
+ \ifx\tikz@text@width\pgfutil@empty%
+ \else%
+ \begingroup%
+ \pgfutil@minipage[t]{\tikz@text@width}%
+ \tikz@text@action%
+ \fi%
+ \tikz@atbegin@node%
+ \bgroup%
+ \aftergroup\unskip%
+ \ifx\tikz@textcolor\pgfutil@empty%
+ \else%
+ \pgfutil@colorlet{.}{\tikz@textcolor}%
+ \fi%
+ \pgfsetcolor{.}%
+ \setbox\tikz@figbox=\box\voidb@x%
+ \tikz@uninstallcommands%
+ \aftergroup\tikz@fig@collectresetcolor%
+ \ignorespaces%
+}
+\def\tikz@fig@collectresetcolor{%
+ \pgfutil@ifnextchar\reset@color%
+ {\reset@color\afterassignment\tikz@fig@collectresetcolor\let\tikz@temp=}%
+ {\tikz@fig@boxdone}%
+}
+\def\tikz@fig@boxdone{%
+ \tikz@atend@node%
+ \ifx\tikz@text@width\pgfutil@empty%
+ \else%
+ \pgfutil@endminipage%
+ \endgroup%
+ \fi%
+ \endpgfinterruptpicture%
+ \egroup%
+ \pgfutil@ifnextchar c{\tikz@fig@mustbenamed\tikz@fig@continue}%
+ {\pgfutil@ifnextchar[{\tikz@fig@mustbenamed\tikz@fig@continue}%
+ {\pgfutil@ifnextchar t{\tikz@fig@mustbenamed\tikz@fig@continue}
+ {\pgfutil@ifnextchar e{\tikz@fig@mustbenamed\tikz@fig@continue}
+ {\ifx\tikz@after@node\pgfutil@empty\expandafter\tikz@fig@continue\else\expandafter\tikz@fig@mustbenamed\expandafter\tikz@fig@continue\fi}}}}}%}
+
+\def\tikz@do@matrix{%
+ \tikzset{every matrix/.try}%
+ \tikz@node@transformations%
+ \tikz@fig@mustbenamed%
+ \setbox\tikz@figbox=\hbox\bgroup%
+ \setbox\pgfutil@tempboxa=\copy\tikz@figbox%
+ \unhbox\pgfutil@tempboxa%
+ \hbox\bgroup\bgroup%
+ \pgfinterruptpath%
+ \pgfscope%
+ \tikz@options%
+ \setbox\tikz@figbox=\box\voidb@x%
+ \let\tikzmatrixname=\tikz@fig@name%
+ \edef\tikz@m@anchor{\ifx\tikz@matrix@anchor\pgfutil@empty\tikz@anchor\else\tikz@matrix@anchor\fi}%
+ \expandafter\pgfutil@in@\expandafter{\expandafter.\expandafter}\expandafter{\tikz@m@anchor}%
+ \ifpgfutil@in@%
+ \expandafter\tikz@matrix@split\tikz@m@anchor\relax%
+ \else%
+ \def\tikz@matrix@shift{\pgfpointorigin}%
+ \fi%
+ \let\tikz@transform=\relax%
+ \pgfmatrix%
+ {\tikz@shape}%
+ {\tikz@m@anchor}%
+ {\tikz@fig@name}%
+ {%
+ \pgfutil@tempdima=\pgflinewidth%
+ {\begingroup\tikz@finish}%
+ \global\pgflinewidth=\pgfutil@tempdima%
+ }%
+ {\tikz@matrix@shift}%
+ {%
+ \tikz@matrix@make@active@ampersand%
+ \def\pgfmatrixbegincode{%
+ \pgfsys@beginscope%
+ \tikz@common@matrix@code%
+ \tikz@atbegin@cell%
+ }%
+ \def\tikz@common@matrix@code{%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@mode=\pgfutil@empty%
+ \tikzset{every cell/.try={\the\pgfmatrixcurrentrow}{\the\pgfmatrixcurrentcolumn}}%
+ \tikzset{column \the\pgfmatrixcurrentcolumn/.try}%
+ \ifodd\pgfmatrixcurrentcolumn%
+ \tikzset{every odd column/.try}%
+ \else%
+ \tikzset{every even column/.try}%
+ \fi%
+ \tikzset{row \the\pgfmatrixcurrentrow/.try}%
+ \ifodd\pgfmatrixcurrentrow%
+ \tikzset{every odd row/.try}%
+ \else%
+ \tikzset{every even row/.try}%
+ \fi%
+ \tikzset{row \the\pgfmatrixcurrentrow\space column \the\pgfmatrixcurrentcolumn/.try}%
+ \tikz@options%
+ }%
+ \def\pgfmatrixendcode{%
+ \tikz@atend@cell%
+ \pgfsys@endscope%
+ }%
+ \def\pgfmatrixemptycode{%
+ \pgfsys@beginscope%
+ \tikz@common@matrix@code%
+ \tikz@at@emptycell%
+ \pgfsys@endscope%
+ }%
+ \aftergroup\tikz@do@matrix@cont}%
+ \bgroup%
+}
+\def\tikz@do@matrix@cont{%
+ \endpgfscope
+ \endpgfinterruptpath%
+ \egroup\egroup%
+ \egroup%
+ %
+ \tikz@node@finish%
+}
+
+{%
+ \catcode`\&=13
+ \gdef\tikz@matrix@make@active@ampersand{%
+ \ifx\tikz@ampersand@replacement\pgfutil@empty%
+ \catcode`\&=13%
+ \let&=\pgfmatrixnextcell%
+ \else%
+ \expandafter\let\tikz@ampersand@replacement=\pgfmatrixnextcell%
+ \fi%
+ }%
+}%
+
+
+\def\tikz@matrix@split#1.#2\relax{%
+ \def\tikz@m@anchor{text}%
+ \def\tikz@matrix@shift{\pgfpointanchor{#1}{#2}}%
+}
+
+\def\tikz@fig@continue{%
+ \ifx\tikz@text@width\pgfutil@empty%
+ \else%
+ \pgfmathsetlength{\pgf@x}{\tikz@text@width}%
+ \wd\pgfnodeparttextbox=\pgf@x%
+ \fi%
+ \ifx\tikz@text@height\pgfutil@empty%
+ \else%
+ \pgfmathsetlength{\pgf@x}{\tikz@text@height}%
+ \ht\pgfnodeparttextbox=\pgf@x%
+ \fi%
+ \ifx\tikz@text@depth\pgfutil@empty%
+ \else%
+ \pgfmathsetlength{\pgf@x}{\tikz@text@depth}%
+ \dp\pgfnodeparttextbox=\pgf@x%
+ \fi%
+ %
+ % Node transformation
+ %
+ \tikz@node@transformations
+ %
+ \setbox\tikz@figbox=\hbox{%
+ \setbox\pgfutil@tempboxa=\copy\tikz@figbox%
+ \unhbox\pgfutil@tempboxa%
+ \hbox{{%
+ \pgfinterruptpath%
+ \pgfscope%
+ \tikz@options%
+ \setbox\tikz@figbox=\box\voidb@x%
+ \pgfmultipartnode{\tikz@shape}{\tikz@anchor}{\tikz@fig@name}{%
+ \pgfutil@tempdima=\pgflinewidth%
+ {\begingroup\tikz@finish}%
+ \global\pgflinewidth=\pgfutil@tempdima%
+ }%
+ \endpgfscope
+ \endpgfinterruptpath%
+ }}%
+ }%
+ %
+ \tikz@alias%
+ \tikz@node@finish%
+}
+
+
+\def\tikz@fig@mustbenamed{%
+ \ifx\tikz@fig@name\pgfutil@empty%
+ % Assign a dummy name
+ \global\advance\tikz@fig@count by1\relax
+ \edef\tikz@fig@name{tikz@f@\the\tikz@fig@count}%
+ \fi%
+}
+
+\def\tikz@node@transformations{
+ %
+ % Possibly, we are ``online''
+ %
+ \ifx\tikz@time\pgfutil@empty%
+ \pgftransformshift{\tikz@node@at}%
+ \iftikz@fullytransformed%
+ \else%
+ \pgftransformresetnontranslations%
+ \fi%
+ \else%
+ \tikz@do@auto@anchor%
+ \tikz@timer%
+ \fi%
+ % Invoke local transformations
+ \tikz@transform%
+}
+
+\def\tikz@node@finish{%
+ \global\let\tikz@last@fig@name=\tikz@fig@name%
+ \global\let\tikz@after@node@smuggle=\tikz@after@node%
+ \global\let\tikz@afternodepathoptions@smuggle=\tikz@afternodepathoptions%
+ % shift box outside group
+ \global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \endgroup\endgroup%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \pgflinewidth=\tikz@save@line@width%
+ \let\tikz@to@last@fig@name=\tikz@last@fig@name%
+ \let\tikz@to@use@whom=\tikz@to@use@last@fig@name%
+ \let\tikzlastnode=\tikz@last@fig@name%
+ \ifx\tikz@after@node@smuggle\pgfutil@empty%
+ \else%
+ \tikz@scan@next@command{\pgfextra{\tikz@afternodepathoptions@smuggle}\tikz@after@node@smuggle}\pgf@stop%
+ \fi%
+ \tikz@scan@next@command%
+}
+\let\tikz@fig@continue@orig=\tikz@fig@continue
+
+
+
+% Syntax for parts of nodes:
+% node ... {... \nodepart{name} ... \nodepart{name} ...}
+
+\def\tikz@nodepart#1{%
+ \tikz@atend@node%
+ \unskip%
+ \gdef\tikz@nodepart@name{#1}%
+ \global\let\tikz@fig@continue=\tikz@nodepart@continue%
+ \pgfutil@ifnextchar x{\egroup\relax}{\egroup\relax}% gobble spaces
+}
+\def\tikz@nodepart@continue{%
+ \global\let\tikz@fig@continue=\tikz@fig@continue@orig%
+ % Now start new box:
+ \expandafter\setbox\csname pgfnodepart\tikz@nodepart@name box\endcsname=\hbox%
+ \bgroup%
+ \tikzset{every \tikz@nodepart@name\space node part/.try}%
+ \pgfinterruptpicture%
+ \tikz@textfont%
+ \ifx\tikz@text@width\pgfutil@empty%
+ \else%
+ \begingroup%
+ \pgfutil@minipage[t]{\tikz@text@width}%
+ \tikz@text@action%
+ \fi%
+ \bgroup%
+ \aftergroup\unskip%
+ \ifx\tikz@textcolor\pgfutil@empty%
+ \else%
+ \pgfutil@colorlet{.}{\tikz@textcolor}%
+ \fi%
+ \pgfsetcolor{.}%
+ \setbox\tikz@figbox=\box\voidb@x%
+ \tikz@uninstallcommands%
+ \tikz@atbegin@node%
+ \aftergroup\tikz@fig@collectresetcolor%
+ \ignorespaces%
+}
+
+%
+% "late" options can be used to "redo" a node
+%
+\tikzset{late options/.code=\tikz@late@options{#1}}
+\def\tikz@late@options#1{%
+ % Do a "virtual" node:
+ \begingroup%
+ \iftikz@shapeborder%
+ \let\tikz@fig@name=\tikz@shapeborder@name%
+ \else%
+ \let\tikz@fig@name=\pgfutil@empty%
+ \fi%
+ \tikz@is@matrixfalse%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@after@node=\pgfutil@empty%
+ \let\tikz@afternodepathoptions=\pgfutil@empty%
+ \let\tikz@alias=\pgfutil@empty%
+ \let\tikz@transform=\pgfutil@empty%
+ \tikz@decoratepathfalse%
+ \tikz@node@reset@hook%
+ \tikzset{every node/.try,#1}%
+ \ifx\tikz@fig@name\pgfutil@empty%
+ \PackageError{tikz}{Late options must reference some existing
+ node}{}%
+ \fi%
+ \tikz@node@begin@hook%
+ \tikz@alias%
+ \global\let\tikz@last@fig@name=\tikz@fig@name%
+ \global\let\tikz@after@node@smuggle=\tikz@after@node%
+ \global\let\tikz@afternodepathoptions@smuggle=\tikz@afternodepathoptions%
+ \endgroup%
+ \let\tikz@to@last@fig@name=\tikz@last@fig@name%
+ \let\tikz@to@use@whom=\tikz@to@use@last@fig@name%
+ \let\tikzlastnode=\tikz@last@fig@name%
+ \ifx\tikz@after@node@smuggle\pgfutil@empty%
+ \else%
+ \tikz@scan@next@command{\pgfextra{\tikz@afternodepathoptions@smuggle}\tikz@after@node@smuggle}\pgf@stop%
+ \fi%
+}
+
+
+% Auto placement
+
+\def\tikz@auto@pre{%
+ \begingroup
+ \pgfresetnontranslationattimefalse
+ \pgfslopedattimetrue%
+ \pgfallowupsidedownattimetrue%
+ \tikz@timer%
+ \pgf@x=\pgf@pt@aa pt%
+ \pgf@y=\pgf@pt@ab pt%
+ \pgfpointnormalised{}%
+}
+
+\def\tikz@auto@post{%
+ \global\let\tikz@anchor@smuggle=\tikz@anchor%
+ \endgroup%
+ \let\tikz@anchor=\tikz@anchor@smuggle%
+}
+
+\def\tikz@auto@anchor{%
+ \ifdim\pgf@x>0.05pt%
+ \ifdim\pgf@y>0.05pt%
+ \def\tikz@anchor{south east}%
+ \else\ifdim\pgf@y<-0.05pt%
+ \def\tikz@anchor{south west}%
+ \else
+ \def\tikz@anchor{south}%
+ \fi\fi%
+ \else\ifdim\pgf@x<-0.05pt%
+ \ifdim\pgf@y>0.05pt%
+ \def\tikz@anchor{north east}%
+ \else\ifdim\pgf@y<-0.05pt%
+ \def\tikz@anchor{north west}%
+ \else
+ \def\tikz@anchor{north}%
+ \fi\fi%
+ \else%
+ \ifdim\pgf@y>0pt%
+ \def\tikz@anchor{east}%
+ \else%
+ \def\tikz@anchor{west}%
+ \fi%
+ \fi\fi%
+}
+
+\def\tikz@auto@anchor@prime{%
+ \ifdim\pgf@x>0.05pt%
+ \ifdim\pgf@y>0.05pt%
+ \def\tikz@anchor{north west}%
+ \else\ifdim\pgf@y<-0.05pt%
+ \def\tikz@anchor{north east}%
+ \else
+ \def\tikz@anchor{north}%
+ \fi\fi%
+ \else\ifdim\pgf@x<-0.05pt%
+ \ifdim\pgf@y>0.05pt%
+ \def\tikz@anchor{south west}%
+ \else\ifdim\pgf@y<-0.05pt%
+ \def\tikz@anchor{south east}%
+ \else
+ \def\tikz@anchor{south}%
+ \fi\fi%
+ \else%
+ \ifdim\pgf@y>0pt%
+ \def\tikz@anchor{west}%
+ \else%
+ \def\tikz@anchor{east}%
+ \fi%
+ \fi\fi%
+}
+
+
+
+
+% Syntax for trees:
+% node {...} child [options] {...} child [options] {...} ...
+% node {...} child [options] foreach \var in {list} [options] {...} ...
+
+\def\tikz@children{%
+ % Start collecting the children:
+ \let\tikz@children@list=\pgfutil@empty%
+ \tikznumberofchildren=0\relax%
+ \tikz@collect@children c}
+
+\def\tikz@collect@children{\pgfutil@ifnextchar c{\tikz@collect@children@cchar}{\tikz@children@collected}}
+\def\tikz@collect@children@cchar c{\pgfutil@ifnextchar h{\tikz@collect@child}{\tikz@children@collected c}}
+\def\tikz@collect@child hild{\pgfutil@ifnextchar[{\tikz@collect@childA}{\tikz@collect@childA[]}}%}
+\def\tikz@collect@childA[#1]{\pgfutil@ifnextchar f{\tikz@collect@children@foreach[#1]}{\tikz@collect@childB[#1]}}
+\def\tikz@collect@childB[#1]{%
+ \advance\tikznumberofchildren by1\relax
+ \expandafter\def\expandafter\tikz@children@list\expandafter{\tikz@children@list \tikz@childnode[#1]}%
+ \pgfutil@ifnextchar\bgroup{\tikz@collect@child@code}{\tikz@collect@child@code{}}}
+\def\tikz@collect@child@code#1{%
+ \expandafter\def\expandafter\tikz@children@list\expandafter{\tikz@children@list{#1}}%
+ \tikz@collect@children%
+}
+\def\tikz@collect@children@foreach[#1]foreach#2in#3{%
+ \pgfutil@ifnextchar\bgroup{\tikz@collect@children@foreachA{#1}{#2}{#3}}{\tikz@collect@children@foreachA{#1}{#2}{#3}{}}}
+\def\tikz@collect@children@foreachA#1#2#3#4{%
+ \expandafter\def\expandafter\tikz@children@list\expandafter
+ {\tikz@children@list\tikz@childrennodes[#1]{#2}{#3}{#4}}%
+ \c@pgf@counta=\tikznumberofchildren%
+ \foreach#2in{#3}%
+ {%
+ \global\advance\c@pgf@counta by1\relax%
+ }%
+ \tikznumberofchildren=\c@pgf@counta%
+ \tikz@collect@children%
+}
+\long\def\tikz@children@collected{%
+ \begingroup%
+ \advance\tikztreelevel by 1\relax%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@transform=\pgfutil@empty%
+ \tikzset{level/.try=\the\tikztreelevel,level \the\tikztreelevel/.try}%
+ \tikz@transform%
+ \let\tikzparentnode=\tikz@last@fig@name%
+ % Transform to center of node
+ \pgftransformshift{\pgfpointanchor{\tikzparentnode}{\tikz@growth@anchor}}%
+ \tikznumberofcurrentchild=0\relax%
+ \tikz@children@list%
+ \global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \endgroup%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \tikz@scan@next@command%
+}
+
+
+% Syntax for children:
+%
+% child [all children options] foreach \var in {values} [child options] {...}
+\def\tikz@childrennodes[#1]#2#3#4{%
+ \c@pgf@counta=\tikznumberofcurrentchild\relax%
+ \setbox\tikz@tempbox=\box\tikz@figbox%
+ \foreach#2in{#3}{%
+ \tikznumberofcurrentchild=\c@pgf@counta\relax%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \tikz@childnode[#1]{#4}%
+ % we must now make the current child number and the figbox survive
+ % the group
+ \global\c@pgf@counta=\tikznumberofcurrentchild\relax%
+ \global\setbox\tikz@tempbox=\box\tikz@figbox%
+ }%
+ \tikznumberofcurrentchild=\c@pgf@counta\relax%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+}
+
+
+% Syntax for child:
+%
+% child
+%
+% child[options]
+%
+% child[options] {node (name) {child node text} ...
+% edge from parent[options] node {label text} node {label text}}
+
+\def\tikz@childnode[#1]#2{%
+ \advance\tikznumberofcurrentchild by1\relax%
+ {\tikzset{every child/.try,#1}\expandafter}%
+ \iftikz@child@missing%
+ \else%
+ \setbox\tikz@figbox=\hbox\bgroup%
+ \unhbox\tikz@figbox%
+ \hbox\bgroup\bgroup%
+ \pgfinterruptpath%
+ \pgfscope%
+ \let\tikz@transform=\pgfutil@empty%
+ \tikzset{every child/.try,#1}%
+ \tikz@options%
+ \tikz@transform%
+ \tikz@grow%
+ % Typeset node:
+ \edef\tikz@parent@node@name{[name=\tikzparentnode-\the\tikznumberofcurrentchild,style=every child node]}%
+ \def\tikz@child@node@text{[shape=coordinate]{}}
+ \tikz@parse@child@node#2\pgf@stop%
+ \expandafter\expandafter\expandafter\node
+ \expandafter\tikz@parent@node@name
+ \tikz@child@node@text
+ \pgfextra{\global\let\tikz@childnode@name=\tikz@last@fig@name};%
+ \let\tikzchildnode=\tikz@childnode@name%
+ {%
+ \def\tikz@edge@to@parent@needed{edge from parent}
+ \ifx\tikz@child@node@rest\pgfutil@empty%
+ \path edge from parent;%
+ \else%
+ \path (0,0) \tikz@child@node@rest \tikz@edge@to@parent@needed;%
+ \fi%
+ }%
+ \endpgfscope%
+ \endpgfinterruptpath%
+ \egroup\egroup%
+ \egroup%
+ \fi%
+}
+
+\def\tikz@parse@child@node{%
+ \pgfutil@ifnextchar n{\tikz@parse@child@node@n}%
+ {\pgfutil@ifnextchar c{\tikz@parse@child@node@c}%
+ {\tikz@parse@child@node@rest}}}
+\def\tikz@parse@child@node@rest#1\pgf@stop{\def\tikz@child@node@rest{#1}}
+\def\tikz@parse@child@node@c c{\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}
+\def\tikz@parse@child@node@co o{\pgfutil@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}}
+\def\tikz@parse@child@node@coordinate ordinate{%
+ \pgfutil@ifnextchar ({\tikz@@parse@child@node@coordinate}{%
+ \def\tikz@child@node@text{[shape=coordinate]{}}%
+ \tikz@parse@child@node@rest}}%}
+\def\tikz@@parse@child@node@coordinate(#1){%
+ \pgfutil@ifnextchar a{\tikz@p@c@n@c@at(#1)}{%
+ \def\tikz@child@node@text{[shape=coordinate,name=#1]{}}%
+ \tikz@parse@child@node@rest}}
+\def\tikz@p@c@n@c@at(#1)at#2({%
+ \def\tikz@child@node@text@pre{[shape=coordinate,name=#1]at}%
+ \tikz@scan@one@point\tikz@p@c@n@c@at@math(%
+}
+\def\tikz@p@c@n@c@at@math#1{%
+ \pgf@process{#1}%
+ \edef\tikz@marshal{(\the\pgf@x,\the\pgf@y){}}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@child@node@text%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@child@node@text@pre\tikz@marshal}%
+ \tikz@parse@child@node@rest%
+}
+\def\tikz@parse@child@node@n node{%
+ \let\tikz@child@node@text=\pgfutil@empty%
+ \tikz@p@c@s}%
+\def\tikz@p@c@s{%
+ \pgfutil@ifnextchar a{\tikz@p@c@s@at}
+ {\pgfutil@ifnextchar ({\tikz@p@c@s@paran}
+ {\pgfutil@ifnextchar [{\tikz@p@c@s@bra}
+ {\pgfutil@ifnextchar \bgroup{\tikz@p@c@s@group}
+ {\PackageError{tikz}{Cannot parse this node}{}}}}}}%}}
+\def\tikz@p@c@s@at at#1({%
+ \tikz@scan@one@point\tikz@p@c@s@at@math(%
+}
+\def\tikz@p@c@s@at@math#1{%
+ \pgf@process{#1}%
+ \edef\tikz@marshal{ at(\the\pgf@x,\the\pgf@y)}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@child@node@text%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@child@node@text\tikz@marshal}
+ \tikz@p@c@s}
+\def\tikz@p@c@s@paran(#1){%
+ \expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text(#1)}
+ \tikz@p@c@s}
+\def\tikz@p@c@s@bra[#1]{%
+ \expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text[#1]}
+ \tikz@p@c@s}
+\def\tikz@p@c@s@group#1{%
+ \expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text{#1}}
+ \tikz@parse@child@node@rest}
+
+
+
+%
+% Syntax for decorated subpaths:
+%
+% decorate [option] { subpath }
+%
+\def\tikz@decoration ecorate{%
+ \pgfutil@ifnextchar[{\tikz@lib@decoration}{\tikz@lib@decoration[]}%]
+}
+
+\def\tikz@lib@decoration[#1]#2{\PackageError{tikz}{You need to load a decoration library}{}}
+
+% The decorate path command:
+\def\tikz@lib@dec@decorate@path{\PackageError{tikz}{You need to load a decoration library}{}}
+
+
+
+%
+% Syntax for let :
+%
+% let \p1 = (coordinate), \p2 = (coordinate),... in
+%
+\def\tikz@let@command et#1in{%
+ \PackageError{tikz}{You need to say \string\usetikzlibrary{calc} to use the let command}{}%
+}
+
+
+
+%
+% Timers
+%
+
+\def\tikz@timer@line{%
+ \pgftransformlineattime{\tikz@time}{\tikz@timer@start}{\tikz@timer@end}%
+}
+
+\def\tikz@timer@vhline{%
+ \ifdim\tikz@time pt<0.5pt% first half
+ \pgf@process{\tikz@timer@start}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@timer@end}%
+ \pgf@xb=\tikz@time pt%
+ \pgf@xb=2\pgf@xb%
+ \edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}{\noexpand\tikz@timer@start}{%
+ \noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@y}}}%
+ \tikz@marshal%
+ \else% second half
+ \pgf@process{\tikz@timer@start}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@timer@end}%
+ \pgf@xb=\tikz@time pt%
+ \pgf@xb=2\pgf@xb%
+ \advance\pgf@xb by-1pt%
+ \edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}%
+ {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@y}}{\noexpand\tikz@timer@end}}%
+ \tikz@marshal%
+ \fi%
+}
+
+\def\tikz@timer@hvline{%
+ \ifdim\tikz@time pt<0.5pt% first half
+ \pgf@process{\tikz@timer@start}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@timer@end}%
+ \pgf@xb=\tikz@time pt%
+ \pgf@xb=2\pgf@xb%
+ \edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}{\noexpand\tikz@timer@start}{%
+ \noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@ya}}}%
+ \tikz@marshal%
+ \else% second half
+ \pgf@process{\tikz@timer@start}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\tikz@timer@end}%
+ \pgf@xb=\tikz@time pt%
+ \pgf@xb=2\pgf@xb%
+ \advance\pgf@xb by-1pt%
+ \edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}%
+ {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@ya}}{\noexpand\tikz@timer@end}}%
+ \tikz@marshal%
+ \fi%
+}
+
+\def\tikz@timer@curve{%
+ \pgftransformcurveattime{\tikz@time}{\tikz@timer@start}{\tikz@timer@cont@one}{\tikz@timer@cont@two}{\tikz@timer@end}%
+}
+
+
+
+%
+% Coordinate systems
+%
+
+\def\tikzdeclarecoordinatesystem#1#2{%
+ \expandafter\def\csname tikz@parse@cs@#1\endcsname(##1){%
+ \pgf@process{%
+ #2%
+ \global\let\tikz@smubble@b=\tikz@shapeborder@name%
+ }%
+ \let\tikz@shapeborder@name=\tikz@smubble@b%
+ \edef\tikz@return@coordinate{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+}
+\def\tikzaliascoordinatesystem#1#2{%
+ \edef\pgf@marshal{\noexpand\let\expandafter\noexpand\csname
+ tikz@parse@cs@#1\endcsname=\expandafter\noexpand\csname
+ tikz@parse@cs@#2\endcsname}%
+ \pgf@marshal%
+}
+
+
+% Default coodinate systems:
+
+\tikzdeclarecoordinatesystem{canvas}
+{%
+ \tikzset{cs/.cd,x=0pt,y=0pt,#1}%
+ \pgfpoint{\tikz@cs@x}{\tikz@cs@y}%
+}
+
+\tikzdeclarecoordinatesystem{canvas polar}
+{%
+ \tikzset{cs/.cd,angle=0,radius=0cm,#1}%
+ \pgfpointpolar{\tikz@cs@angle}{\tikz@cs@xradius and \tikz@cs@yradius}%
+}
+
+\tikzdeclarecoordinatesystem{xyz}
+{%
+ \tikzset{cs/.cd,x=0,y=0,z=0,#1}%
+ \pgfpointxyz{\tikz@cs@x}{\tikz@cs@y}{\tikz@cs@z}%
+}
+
+\tikzdeclarecoordinatesystem{xyz polar}
+{%
+ \tikzset{cs/.cd,angle=0,radius=0,#1}%
+ \pgfpointpolarxy{\tikz@cs@angle}{\tikz@cs@xradius and \tikz@cs@yradius}%
+}
+\tikzaliascoordinatesystem{xy polar}{xyz polar}
+
+
+\tikzdeclarecoordinatesystem{node}
+{%
+ \tikzset{cs/.cd,name=,anchor=none,angle=none,#1}%
+ \ifx\tikz@cs@anchor\tikz@nonetext%
+ \ifx\tikz@cs@angle\tikz@nonetext%
+ \expandafter\ifx\csname pgf@sh@ns@\tikz@cs@node\endcsname\tikz@coordinate@text%
+ \else
+ \aftergroup\tikz@shapebordertrue%
+ \edef\tikz@shapeborder@name{\tikz@cs@node}%
+ \fi%
+ \pgfpointanchor{\tikz@cs@node}{center}%
+ \else%
+ \pgfpointanchor{\tikz@cs@node}{\tikz@cs@angle}%
+ \fi%
+ \else%
+ \pgfpointanchor{\tikz@cs@node}{\tikz@cs@anchor}%
+ \fi%
+}
+
+% Intersection coordinates
+\tikzset{cs/first line/.code=\def\tikz@cs@line@a{#1}\def\tikz@cs@type@a{line}}
+\tikzset{cs/second line/.code=\def\tikz@cs@line@b{#1}\def\tikz@cs@type@b{line}}
+
+\tikzset{cs/first node/.code=\tikz@cs@unpack{\tikz@cs@node@a}{\tikz@cs@type@a}{#1}}
+\tikzset{cs/second node/.code=\tikz@cs@unpack{\tikz@cs@node@b}{\tikz@cs@type@b}{#1}}
+
+\def\tikz@cs@unpack#1#2#3{%
+ \expandafter\ifx\csname pgf@sh@ns@#3\endcsname\relax%
+ \PackageError{tikz}{Undefined node ``#3''}{}%
+ \else%
+ \def#1{#3}%
+ \edef#2{\csname pgf@sh@ns@#3\endcsname}%
+ \fi%
+}
+
+\tikzset{cs/solution/.initial=1}
+
+\tikzset{cs/horizontal line through/.store in=\tikz@cs@hori@line}
+\tikzset{cs/vertical line through/.store in=\tikz@cs@vert@line}
+
+\tikzdeclarecoordinatesystem{intersection}
+{%
+ \tikzset{cs/.cd,#1}%
+ \expandafter\ifx\csname tikz@intersect@\tikz@cs@type@a @and@\tikz@cs@type@b\endcsname\relax%
+ \PackageError{tikz}{I do not know how to compute the intersection
+ of a \tikz@cs@type@a and a \tikz@cs@type@b. Try saying
+ \string\usetikzlibrary{calc}}{}%
+ \pgfpointorigin%
+ \else%
+ \csname tikz@intersect@\tikz@cs@type@a @and@\tikz@cs@type@b\endcsname%
+ \fi%
+}
+
+\def\tikz@intersect@line@and@line{%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@parse@line\tikz@cs@line@a%
+ \pgf@xa=\pgf@xc%
+ \pgf@ya=\pgf@yc%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@parse@line\tikz@cs@line@b%
+ \edef\pgf@marshal{%
+ {\noexpand\pgfpointintersectionoflines%
+ {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}%
+ {\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}}%
+ \pgf@marshal%
+}
+
+\def\tikz@parse@line#1--{%
+ \pgf@process{#1}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \tikz@scan@one@point\pgf@process%
+}
+
+
+\tikzdeclarecoordinatesystem{perpendicular}
+{%
+ \tikzset{cs/.cd,#1}%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@parse@intersection@a\tikz@cs@hori@line%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@parse@intersection@b\tikz@cs@vert@line%
+ \pgfqpoint{\the\pgf@xb}{\the\pgf@ya}
+}
+
+\tikzdeclarecoordinatesystem{barycentric}
+{%
+ {%
+ \pgf@xa=0pt% point
+ \pgf@ya=0pt%
+ \pgf@xb=0pt% sum
+ \tikz@bary@dolist#1,=,%
+ \pgfmathparse{1/\the\pgf@xb}%
+ \global\pgf@x=\pgfmathresult\pgf@xa%
+ \global\pgf@y=\pgfmathresult\pgf@ya%
+ }%
+}
+
+\def\tikz@bary@dolist#1=#2,{%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\pgfutil@empty%
+ \else
+ \pgf@process{\pgfpointanchor{#1}{center}}%
+ \pgfmathparse{#2}%
+ \advance\pgf@xa by\pgfmathresult\pgf@x%
+ \advance\pgf@ya by\pgfmathresult\pgf@y%
+ \advance\pgf@xb by\pgfmathresult pt%
+ \expandafter\tikz@bary@dolist%
+ \fi%
+}
+
+\tikzset{cs/x/.store in=\tikz@cs@x}
+\tikzset{cs/y/.store in=\tikz@cs@y}
+\tikzset{cs/z/.store in=\tikz@cs@z}
+\tikzset{cs/angle/.store in=\tikz@cs@angle}
+\tikzset{cs/x radius/.store in=\tikz@cs@xradius}
+\tikzset{cs/y radius/.store in=\tikz@cs@yradius}
+\tikzset{cs/radius/.style={/tikz/cs/x radius=#1,/tikz/cs/y radius=#1}}
+\tikzset{cs/name/.store in=\tikz@cs@node}
+\tikzset{cs/anchor/.store in=\tikz@cs@anchor}
+
+
+
+
+
+%
+% Coordinate management
+%
+
+
+% Last position visited
+\def\tikz@last@position{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}
+\def\tikz@last@position@saved{\pgfqpoint{\tikz@lastxsaved}{\tikz@lastysaved}}
+
+% Make given point the last position visited
+\def\tikz@make@last@position#1{%
+ \pgf@process{#1}%
+ \tikz@lastx=\pgf@x\relax%
+ \tikz@lasty=\pgf@y\relax%
+ \iftikz@updatecurrent%
+ \tikz@lastxsaved=\pgf@x\relax%
+ \tikz@lastysaved=\pgf@y\relax%
+ \fi%
+ \tikz@updatecurrenttrue%
+}
+
+\newif\iftikz@updatecurrent
+\tikz@updatecurrenttrue
+
+
+
+% Scanner: Scans a point or a relative point.
+% It then calls the first parameter with the argument set to an
+% appropriate pgf command representing that point.
+
+\def\tikz@scan@one@point#1{%
+ \let\tikz@to@use@whom=\tikz@to@use@last@coordinate%
+ \tikz@shapeborderfalse%
+ \pgfutil@ifnextchar+{\tikz@scan@relative#1}{\tikz@scan@absolute#1}}
+\def\tikz@scan@absolute#1{%
+ \pgfutil@ifnextchar({\tikz@scan@@absolute#1}%)
+ {%
+ \advance\tikz@expandcount by -1%
+ \ifnum\tikz@expandcount<0\relax%
+ \let\@next=\tikz@@scangiveup%
+ \else%
+ \let\@next=\tikz@@scanexpand%
+ \fi%
+ \@next{#1}%
+ }%
+}
+\def\tikz@@scanexpand#1{\expandafter\tikz@scan@one@point\expandafter#1}
+\def\tikz@@scangiveup#1{\PackageError{tikz}{Cannot parse this coordinate}{}#1{\pgfpointorigin}}
+\def\tikz@scan@@absolute#1({%
+ \pgfutil@ifnextchar[% uhoh... options!
+ {\def\tikz@scan@point@recall{#1}\tikz@scan@options}%
+ {\tikz@@@scan@@absolute#1(}%
+}
+
+\def\tikz@scan@options[#1]#2{%
+ \def\tikz@scan@point@options{#1}%
+ \tikz@@@scan@@absolute\tikz@scan@handle@options(#2%
+}
+
+\def\tikz@scan@handle@options#1{%
+ {%
+ % Ok, compute point with options set and zero transformation
+ % matrix:
+ \pgftransformreset%
+ \let\tikz@transform=\pgfutil@empty%
+ \expandafter\tikzset\expandafter{\tikz@scan@point@options}%
+ \tikz@transform%
+ \pgf@process{\pgfpointtransformed{#1}}%
+ \xdef\tikz@marshal{\expandafter\noexpand\tikz@scan@point@recall{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ }%
+ \tikz@marshal%
+}
+
+\def\tikz@@@scan@@absolute#1({%
+ \pgfutil@ifnextchar{$}%$
+ {\tikz@parse@calculator#1(}
+ {\tikz@scan@no@calculator#1(}%
+}
+\def\tikz@scan@no@calculator#1(#2){%
+ \edef\tikz@temp{(#2)}%
+ \expandafter\tikz@@scan@@no@calculator\expandafter#1\tikz@temp%
+}
+\def\tikz@@scan@@no@calculator#1(#2){%
+ \pgfutil@in@{cs:}{#2}%
+ \ifpgfutil@in@%
+ \let\@next\tikz@parse@coordinatesystem%
+ \else%
+ \pgfutil@in@{intersection }{#2}%
+ \ifpgfutil@in@%
+ \let\@next\tikz@parse@intersection%
+ \else%
+ \pgfutil@in@|{#2}%
+ \ifpgfutil@in@
+ \pgfutil@in@{-|}{#2}%
+ \ifpgfutil@in@
+ \let\@next\tikz@parse@hv%
+ \else%
+ \let\@next\tikz@parse@vh%
+ \fi%
+ \else%
+ \pgfutil@in@:{#2}%
+ \ifpgfutil@in@
+ \let\@next\tikz@parse@polar%
+ \else%
+ \pgfutil@in@,{#2}%
+ \ifpgfutil@in@%
+ \let\@next\tikz@parse@regular%
+ \else%
+ \let\@next\tikz@parse@node%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \@next#1(#2)%
+}
+
+\def\tikz@parse@calculator#1($#2$){%
+ \PackageError{tikz}{You need to say \string\usetikzlibrary{calc} for
+ coordinate calculation}{}%
+ #1{\pgfpointorigin}%
+}
+
+\def\tikz@parse@coordinatesystem#1(#2 cs:#3){%
+ \let\tikz@return@coordinate=\pgfpointorigin%
+ \pgfutil@ifundefined{tikz@parse@cs@#2}
+ {\PackageError{tikz}{Unknown coordinate system '#2'}{}}
+ {\csname tikz@parse@cs@#2\endcsname(#3)}%
+ \expandafter#1\expandafter{\tikz@return@coordinate}%
+}
+
+
+\newif\iftikz@isdimension
+\def\tikz@checkunit#1{%
+ \pgfmathparse{#1}%
+ \let\iftikz@isdimension=\ifpgfmathunitsdeclared%
+}
+
+\def\tikz@parse@polar#1(#2:#3){%
+ \pgfutil@ifundefined{tikz@polar@dir@#2}
+ {\tikz@@parse@polar#1(#2:#3)}
+ {\tikz@@parse@polar#1(\csname tikz@polar@dir@#2\endcsname:#3)}%
+}
+\def\tikz@@parse@polar#1(#2:#3){%
+ \pgfutil@in@{ and }{#3}%
+ \ifpgfutil@in@%
+ \edef\tikz@args{(#2:#3)}%
+ \else%
+ \edef\tikz@args{(#2:#3 and #3)}%
+ \fi%
+ \expandafter\tikz@@@parse@polar\expandafter#1\tikz@args%
+}
+\def\tikz@@@parse@polar#1(#2:#3 and #4){%
+ \tikz@checkunit{#3}%
+ \iftikz@isdimension%
+ \tikz@checkunit{#4}%
+ \iftikz@isdimension%
+ \def\tikz@next{#1{\pgfpointpolar{#2}{#3 and #4}}}%
+ \else%
+ \PackageError{tikz}{You cannot mix dimension and dimensionless values for polar coordinates}{}
+ \def\tikz@next{#1{\pgfpointorigin}}%
+ \fi%
+ \else%
+ \tikz@checkunit{#4}%
+ \iftikz@isdimension%
+ \PackageError{tikz}{You cannot mix dimension and dimensionless values for polar coordinates}{}
+ \def\tikz@next{#1{\pgfpointorigin}}%
+ \else%
+ \def\tikz@next{#1{\pgfpointpolarxy{#2}{#3 and #4}}}%
+ \fi%
+ \fi%
+ \tikz@next%
+}
+\def\tikz@polar@dir@up{90}
+\def\tikz@polar@dir@down{-90}
+\def\tikz@polar@dir@left{180}
+\def\tikz@polar@dir@right{0}
+\def\tikz@polar@dir@north{90}
+\def\tikz@polar@dir@south{-90}
+\def\tikz@polar@dir@east{0}
+\def\tikz@polar@dir@west{180}
+\expandafter\def\csname tikz@polar@dir@north east\endcsname{45}
+\expandafter\def\csname tikz@polar@dir@north west\endcsname{135}
+\expandafter\def\csname tikz@polar@dir@south east\endcsname{-45}
+\expandafter\def\csname tikz@polar@dir@south west\endcsname{-135}
+
+
+% MW:
+% Check to see if the y-coordinate is inside {}. If it is, scan it and
+% reinsert it into the stream inside an extra group.
+%
+\def\tikz@parse@regular#1(#2,{%
+ \pgfutil@ifnextchar\bgroup{\tikz@@parse@regular#1{#2}}{\tikz@@@parse@regular#1{#2}}%
+}
+\def\tikz@@parse@regular#1#2#3{\tikz@@@parse@regular#1{#2}{{#3}}}%
+
+
+% Originally \def\tikz@parse@regular#1(#2,#3){%
+%
+\def\tikz@@@parse@regular#1#2#3){%
+ \pgfutil@in@,{#3}%
+ \ifpgfutil@in@%
+ \tikz@parse@splitxyz{#1}{#2}#3,%
+ \else%
+ \tikz@checkunit{#2}%
+ \iftikz@isdimension%
+ \tikz@checkunit{#3}%
+ \iftikz@isdimension%
+ \def\@next{#1{\pgfpoint{#2}{#3}}}%
+ \else%
+ \def\@next{#1{\pgfpointadd{\pgfpoint{#2}{0pt}}{\pgfpointxy{0}{#3}}}}%
+ \fi%
+ \else%
+ \tikz@checkunit{#3}%
+ \iftikz@isdimension%
+ \def\@next{#1{\pgfpointadd{\pgfpoint{0pt}{#3}}{\pgfpointxy{#2}{0}}}}%
+ \else%
+ \def\@next{#1{\pgfpointxy{#2}{#3}}}%
+ \fi%
+ \fi%
+ \fi%
+ \@next%
+}
+
+\def\tikz@parse@splitxyz#1#2#3,#4,{%
+ \def\@next{#1{\pgfpointxyz{#2}{#3}{#4}}}%
+}
+
+\def\tikz@coordinate@text{coordinate}
+
+\def\tikz@parse@node#1(#2){%
+ \pgfutil@in@.{#2}% Ok, flag this
+ \ifpgfutil@in@
+ \tikz@calc@anchor#2\tikz@stop%
+ \else%
+ \tikz@calc@anchor#2.center\tikz@stop% to be on the save side, in
+ % case iftikz@shapeborder is ignored...
+ \expandafter\ifx\csname pgf@sh@ns@#2\endcsname\tikz@coordinate@text%
+ \else
+ \tikz@shapebordertrue%
+ \def\tikz@shapeborder@name{#2}%
+ \fi%
+ \fi%
+ \edef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ \tikz@marshal%
+}
+
+\def\tikz@calc@anchor#1.#2\tikz@stop{%
+ \pgfpointanchor{#1}{#2}%
+}
+
+
+\def\tikz@parse@hv#1(#2){%
+ \pgfutil@in@{ -| }{#2}%
+ \ifpgfutil@in@%
+ \let\tikz@next=\tikz@parse@hvboth%
+ \else%
+ \pgfutil@in@{ -|}{#2}%
+ \ifpgfutil@in@%
+ \let\tikz@next=\tikz@parse@hvleft%
+ \else%
+ \pgfutil@in@{-| }{#2}%
+ \ifpgfutil@in@%
+ \let\tikz@next=\tikz@parse@hvright%
+ \else%
+ \let\tikz@next=\tikz@parse@hvdone%
+ \fi%
+ \fi%
+ \fi%
+ \tikz@next#1(#2)}
+\def\tikz@parse@hvboth#1(#2 -| #3){\tikz@parse@vhdone#1(#3|-#2)}
+\def\tikz@parse@hvleft#1(#2 -|#3){\tikz@parse@vhdone#1(#3|-#2)}
+\def\tikz@parse@hvright#1(#2-| #3){\tikz@parse@vhdone#1(#3|-#2)}
+\def\tikz@parse@hvdone#1(#2-|#3){\tikz@parse@vhdone#1(#3|-#2)}
+
+\def\tikz@parse@vh#1(#2){%
+ \pgfutil@in@{ |- }{#2}%
+ \ifpgfutil@in@%
+ \let\tikz@next=\tikz@parse@vhboth%
+ \else%
+ \pgfutil@in@{ |-}{#2}%
+ \ifpgfutil@in@%
+ \let\tikz@next=\tikz@parse@vhleft%
+ \else%
+ \pgfutil@in@{|- }{#2}%
+ \ifpgfutil@in@%
+ \let\tikz@next=\tikz@parse@vhright%
+ \else%
+ \let\tikz@next=\tikz@parse@vhdone%
+ \fi%
+ \fi%
+ \fi%
+ \tikz@next#1(#2)}
+\def\tikz@parse@vhboth#1(#2 |- #3){\tikz@parse@vhdone#1(#2|-#3)}
+\def\tikz@parse@vhleft#1(#2 |-#3){\tikz@parse@vhdone#1(#2|-#3)}
+\def\tikz@parse@vhright#1(#2|- #3){\tikz@parse@vhdone#1(#2|-#3)}
+\def\tikz@parse@vhdone#1(#2|-#3){%
+ {%
+ \tikz@@@scan@@absolute\tikz@parse@vh@mid(#2)%
+ \tikz@@@scan@@absolute\tikz@parse@vh@end(#3)%
+ \xdef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}}%
+ }%
+ \tikz@marshal%
+}
+\def\tikz@parse@vh@mid#1{\pgf@process{#1}\pgf@xa=\pgf@x}
+\def\tikz@parse@vh@end#1{\pgf@process{#1}\pgf@ya=\pgf@y}
+
+\def\tikz@parse@intersection#1(intersection{%
+ \pgfutil@ifnextchar o{%
+ \tikz@parse@main@intersection#1 1%
+ }{%
+ \tikz@parse@main@intersection#1%
+ }%
+}
+\def\tikz@parse@main@intersection#1#2of #3 and #4){%
+ \tikzset{cs/solution=#2}%
+ \pgfutil@in@{--}{#3}%
+ \ifpgfutil@in@%
+ \tikz@reparse@line{first}#3\pgf@stop%
+ \else%
+ \tikzset{cs/first node=#3}%
+ \fi%
+ \pgfutil@in@{--}{#4}%
+ \ifpgfutil@in@%
+ \tikz@reparse@line{second}#4\pgf@stop%
+ \else%
+ \tikzset{cs/second node=#4}%
+ \fi%
+ \tikz@parse@cs@intersection()% advanced hackery...
+ \edef\pgf@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ \pgf@marshal%
+}
+\def\tikz@reparse@line#1#2--#3\pgf@stop{%
+ \tikzset{cs/#1 line={(#2)--(#3)}}%
+}
+
+
+\def\tikz@parse@intersection@a#1{\pgf@process{#1}\pgf@xa=\pgf@x\pgf@ya=\pgf@y}
+\def\tikz@parse@intersection@b#1{\pgf@process{#1}\pgf@xb=\pgf@x\pgf@yb=\pgf@y}
+
+\def\tikz@scan@relative#1+{%
+ \pgfutil@ifnextchar+{\tikz@scan@plusplus#1}{\tikz@scan@oneplus#1}}
+
+\def\tikz@scan@plusplus#1+{%
+ \def\tikz@doafter{#1}%
+ \tikz@scan@absolute\tikz@add%
+}
+\def\tikz@add#1{%
+ \tikz@doafter{\pgfpointadd{#1}{\tikz@last@position@saved}}%
+}
+\def\tikz@scan@oneplus#1{%
+ \def\tikz@doafter{#1}%
+ \tikz@updatecurrentfalse%
+ \tikz@scan@absolute\tikz@add%
+}
+
+
+
+% Loading further libraries
+
+% Include a library file.
+%
+% #1 = List of names of library file.
+%
+% Description:
+%
+% This command includes a list of TikZ library files. For each file X in the
+% list, the file tikzlibraryX.code.tex is included, provided this has
+% not been done earlier.
+%
+% For the convenience of Context users, both round and square brackets
+% are possible for the argument.
+%
+% Example:
+%
+% \usetikzlibrary{arrows}
+% \usetikzlibrary[patterns,topaths]
+
+\def\usetikzlibrary{\pgfutil@ifnextchar[{\use@tikzlibrary}{\use@@tikzlibrary}}%}
+\def\use@tikzlibrary[#1]{\use@@tikzlibrary{#1}}
+\def\use@@tikzlibrary#1{%
+ \edef\pgf@list{#1}%
+ \pgfutil@for\pgf@temp:=\pgf@list\do{%
+ \expandafter\ifx\csname tikz@library@\pgf@temp @loaded\endcsname\relax%
+ \expandafter\global\expandafter\let\csname tikz@library@\pgf@temp @loaded\endcsname=\pgfutil@empty%
+ \expandafter\edef\csname tikz@library@#1@atcode\endcsname{\the\catcode`\@}
+ \expandafter\edef\csname tikz@library@#1@barcode\endcsname{\the\catcode`\|}
+ \catcode`\@=11
+ \catcode`\|=12
+ \input tikzlibrary\pgf@temp.code.tex
+ \catcode`\@=\csname tikz@library@#1@atcode\endcsname
+ \catcode`\|=\csname tikz@library@#1@barcode\endcsname
+ \fi%
+ }%
+}
+
+
+% Always-present libraries:
+
+\usetikzlibrary{topaths}
+
+
+
+
+\endinput