diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf')
58 files changed, 4891 insertions, 1199 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex index 41597300e23..ec8d93af683 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex @@ -1,11 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseimage.code.tex,v 1.2 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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/basiclayer/pgfbaseimage.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % Declare an image @@ -25,23 +27,23 @@ % % \pgfdeclareimage[width=2cm,page=2]{myimage}{imagefilename} -\def\pgfdeclareimage{\@ifnextchar[{\pgf@declareimage}{\pgf@declareimage[]}} +\def\pgfdeclareimage{\pgf@ifnextchar[{\pgf@declareimage}{\pgf@declareimage[]}} \def\pgf@declareimage[#1]#2#3{% \setkeys{pgfimage}{height=,width=,page=,interpolate=false,mask=}% defaults \setkeys{pgfimage}{#1}% % Try to find the file \gdef\pgf@filename{}% % If page= parameter is not empty, try that file first: - \ifx\pgf@imagepage\@empty% + \ifx\pgf@imagepage\pgf@empty% \else% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3.page\pgf@imagepage}% \fi% - \ifx\pgf@filename\@empty% + \ifx\pgf@filename\pgf@empty% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}% \else% \setkeys{pgfimage}{page=}% make page empty \fi% - \ifx\pgf@filename\@empty% + \ifx\pgf@filename\pgf@empty% \PackageWarning{pgf}% {File "#3" not found when defining image "#2".\MessageBreak Tried all extensions in "\pgfsys@imagesuffixlist"}% @@ -62,13 +64,13 @@ \define@key{pgfimage}{interpolate}[true]{\edef\pgf@imageinterpolate{/Interpolate #1}} \define@key{pgfimage}{mask}{% \edef\pgf@imagemask{#1}% - \ifx\pgf@imagemask\@empty% + \ifx\pgf@imagemask\pgf@empty% \else% - \@ifundefined{pgf@mask@#1}% + \pgf@ifundefined{pgf@mask@#1}% {\PackageError{pgf}{Undefined mask "#1".}{}% \edef\pgf@imagemask{}}% {\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}% - \ifx\pgf@imagemask\@empty% + \ifx\pgf@imagemask\pgf@empty% \else \edef\pgf@imagemask{/SMask \pgf@imagemask\space 0 R}% \fi}% @@ -78,20 +80,20 @@ \IfFileExists{#3.#1}% {\xdef\pgf@filename{#3.#1}}% {\def\pgf@mightbeempty{#2}% - \ifx\pgf@mightbeempty\@empty\else% + \ifx\pgf@mightbeempty\pgf@empty\else% \pgf@findfile#2+{#3}% \fi}} \def\pgf@declaredraftimage#1{% - \ifx\pgf@imagewidth\@empty% + \ifx\pgf@imagewidth\pgf@empty% \PackageWarning{pgf}{Missing width for image "#1" in draft mode.\MessageBreak Using 1cm instead}% \edef\pgf@imagewidth{1cm}% \fi% - \ifx\pgf@imageheight\@empty% + \ifx\pgf@imageheight\pgf@empty% \PackageWarning{pgf}{Missing height for image "#1" in draft mode.\MessageBreak Using 1cm instead}% \edef\pgf@imageheight{1cm}% \fi% - \ifx\pgf@imagepage\@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi% + \ifx\pgf@imagepage\pgf@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi% \edef\pgf@image{% \hbox to \pgf@imagewidth{% \vrule\kern-0.4pt% @@ -125,7 +127,7 @@ % \pgfdeclaremask[matte=white]{maskname}{maskfilename} % \pgfdeclareimage[mask=maskname]{image}{imagefilename} -\def\pgfdeclaremask{\@ifnextchar[\pgf@declaremask{\pgf@declaremask[]}} +\def\pgfdeclaremask{\pgf@ifnextchar[\pgf@declaremask{\pgf@declaremask[]}} \def\pgf@declaremask[#1]#2#3{% \setkeys{pgfmask}{matte={1 1 1}}% defaults \setkeys{pgfmask}{#1}% @@ -133,7 +135,7 @@ % Try to find the file \gdef\pgf@filename{}% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}% - \ifx\pgf@filename\@empty% + \ifx\pgf@filename\pgf@empty% \PackageWarning{pgf}% {File "#3" not found when defining mask "#2".\MessageBreak Tried all extensions in "\pgfsys@imagesuffixlist"}% @@ -176,16 +178,16 @@ \def\pgfuseimage#1{% \def\pgf@imagename{pgf@image@#1}% \pgf@tryextensions{\pgf@imagename}{\pgfalternateextension}% - \expandafter\@ifundefined\expandafter{\pgf@imagename}% + \expandafter\pgf@ifundefined\expandafter{\pgf@imagename}% {\PackageError{pgf}{Undefined image "#1"}{}}% {{\leavevmode\csname\pgf@imagename\endcsname}}} \def\pgf@tryextensions#1#2{% \edef\pgf@args{[#2!]}\expandafter\pgf@@tryextensions\pgf@args{#1}} \def\pgf@@tryextensions[#1!#2]#3{% - \expandafter\@ifundefined\expandafter{#3.#1!#2}% + \expandafter\pgf@ifundefined\expandafter{#3.#1!#2}% {\def\pgf@temp{#2}% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \edef#3{#3!}% \else% \pgf@@tryextensions[#2]{#3}% @@ -226,7 +228,7 @@ % % \pgfimage[height=2cm]{filename} -\def\pgfimage{\@ifnextchar[\pgf@imagecom{\pgf@imagecom[]}} +\def\pgfimage{\pgf@ifnextchar[\pgf@imagecom{\pgf@imagecom[]}} \def\pgf@imagecom[#1]#2{% \pgfdeclareimage[#1]{pgflastimage}{#2}% \pgfuseimage{pgflastimage}} diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex index d97d742934e..7603b016a67 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaselayers.code.tex,v 1.2 2005/10/24 15:14:48 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/basiclayer/pgfbaselayers.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % Creates a new pgf layer @@ -86,7 +90,7 @@ \pgfsys@endscope% \fi% \def\pgf@test{#2}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \pgf@dolayer#2,\relax% \fi% @@ -102,7 +106,7 @@ \setbox\csname pgf@layerboxsaved@#1\endcsname=\box\csname pgf@layerbox@#1\endcsname% \fi% \def\pgf@test{#2}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \pgf@dosavelayer#2,\relax% \fi% @@ -118,7 +122,7 @@ \global\setbox\csname pgf@layerbox@#1\endcsname=\box\csname pgf@layerboxsaved@#1\endcsname% \fi% \def\pgf@test{#2}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \pgf@dorestorelayer#2,\relax% \fi% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex new file mode 100644 index 00000000000..2d6116f3ac2 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex @@ -0,0 +1,178 @@ +% 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/basiclayer/pgfbasepatterns.code.tex,v 1.8 2006/10/11 15:22:25 tantau Exp $ + + +% Creates a new uncolored pattern +% +% #1 = pattern name +% #2 = lower left of bounding box +% #3 = upper right of bounding box +% #4 = step vector +% #5 = pattern code +% +% Description: +% +% Declares a new uncolored pattern. An uncolored pattern is a pattern +% that has no inherent color. When the pattern is used, a color for +% the pattern must be supplied. +% +% See the pdf-manual for more details on uncolored patterns. +% +% The bounding box must be a bounding box of the pattern cell. +% +% The step vector must provide the x- and y-step by which the cells +% are spaced. +% +% The pattern code should be pgf code that can be protocolled. +% +% The transformation matrix will be reset prior to invoking the +% pattern code. +% +% Example: +% +% \pgfdeclarepatternformonly{stars}{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +% {\pgfpoint{1cm}{1cm}}{ +% \pgftransformshift{\pgfpoint{.5cm}{.5cm}} +% \pgfpathmoveto{\pgfpointpolar{0}{4mm}} +% \pgfpathlineto{\pgfpointpolar{144}{4mm}} +% \pgfpathlineto{\pgfpointpolar{288}{4mm}} +% \pgfpathlineto{\pgfpointpolar{72}{4mm}} +% \pgfpathlineto{\pgfpointpolar{216}{4mm}} +% \pgfpathclose% +% \pgfusepath{stroke} +% } + +\def\pgfdeclarepatternformonly#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{0}} + +% Creates a new colored pattern +% +% #1 = pattern name +% #2 = lower left of bounding box +% #3 = upper right of bounding box +% #4 = step vector +% #5 = pattern code +% +% Description: +% +% Declares a new colored pattern. Such patterns have a one or more +% fixed inherent colors. See the pdf-manual for more details on +% uncolored patterns. +% +% The parameters have the same effect as for uncolored patterns. +% +% Example: +% +% \pgfdeclarepatterninherentlycolored{red stars}{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +% {\pgfpoint{1cm}{1cm}}{ +% \pgfsetfillcolor{red} +% \pgfsetstrokecolor{black} +% \pgftransformshift{\pgfpoint{.5cm}{.5cm}} +% \pgfpathmoveto{\pgfpointpolar{0}{4mm}} +% \pgfpathlineto{\pgfpointpolar{144}{4mm}} +% \pgfpathlineto{\pgfpointpolar{288}{4mm}} +% \pgfpathlineto{\pgfpointpolar{72}{4mm}} +% \pgfpathlineto{\pgfpointpolar{216}{4mm}} +% \pgfpathclose% +% \pgfusepath{stroke,fill} +% } + +\def\pgfdeclarepatterninherentlycolored#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{1}} + +\def\pgf@declarepattern#1#2#3#4#5#6{% + \pgf@ifundefined{pgf@pattern@name@#1}{% + \pgfsysprotocol@getcurrentprotocol\pgf@pattern@temp% + {% + \pgfinterruptpath% + \pgfpicturetrue% + \pgf@relevantforpicturesizefalse% + \pgftransformreset% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% + \pgfsysprotocol@bufferedtrue% + \pgfsys@beginscope% + #5% + \pgfsys@endscope% + \pgfsysprotocol@getcurrentprotocol\pgf@pattern@code% + \global\let\pgf@pattern@code=\pgf@pattern@code% + \endpgfinterruptpath% + \pgf@process{#2}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#3}% + \pgf@xb=\pgf@x% + \pgf@yb=\pgf@y% + \pgf@process{#4}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + % Now, build a name for the pattern + \@tempcnta=\pgf@pattern@number% + \advance\@tempcnta by1\relax% + \xdef\pgf@pattern@number{\the\@tempcnta}% + \expandafter\xdef\csname pgf@pattern@name@#1\endcsname{\the\@tempcnta}% + \expandafter\gdef\csname pgf@pattern@type@#1\endcsname{#6}% + \xdef\pgf@marshal{\noexpand\pgfsys@declarepattern + {\csname pgf@pattern@name@#1\endcsname} + {\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}{\the\pgf@xc}{\the\pgf@yc}{\pgf@pattern@code}{#6}}% + }% + \pgfsysprotocol@setcurrentprotocol\pgf@pattern@temp% + \expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\pgf@marshal% + } + {% + \PackageError{pgfbasepatterns}{Pattern `#1' already defined}{}% + }% +} + +\def\pgf@pattern@number{0}% + +\def\pgf@ifpatternisinherentlycolored#1#2#3{% + \expandafter\ifnum\csname pgf@pattern@type@#1\endcsname=1\relax#2\else#3\fi% +} + + + +% Set an pattern as fill color +% +% #1 = Name of the pattern +% #2 = Color to be used for the pattern. If the pattern is already +% colored, this parameter is ignored. +% +% Description: +% +% Sets the pattern for subsequent filling operations. +% +% Example: +% +% \pgfsetfillpattern{stars}{red} + +\def\pgfsetfillpattern#1#2{% + \pgf@ifundefined{pgf@pattern@name@#1}{% + \PackageError{pgfbasepatterns}{Undefined pattern `#1'}{}} + {% + \csname pgf@pattern@instantiate@#1\endcsname% + \expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\relax% + \pgf@ifpatternisinherentlycolored{#1}{% + \pgfsys@setpatterncolored{\csname pgf@pattern@name@#1\endcsname}% + }{% + \colorlet{pgf@tempcolor}{#2}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \extractcolorspec{pgf@tempcolor}{\pgf@tempcolor}% + \expandafter\convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% + \expandafter\pgf@set@fill@patternuncolored\pgf@rgbcolor\relax{#1}% + }% + }% +} +\def\pgf@set@fill@patternuncolored#1,#2,#3\relax#4{% + \pgfsys@setpatternuncolored{\csname pgf@pattern@name@#4\endcsname}{#1}{#2}{#3}% +} + + + + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex index f3d9e4f49a7..ffebbfacc0f 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseplot.code.tex,v 1.2 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseplot.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % PGF's plotting interface works as follows: @@ -103,7 +106,7 @@ \def\pgfplothandlerlineto{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@line@handler% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -130,8 +133,8 @@ \def\pgfplothandlerdiscard{% \def\pgf@plotstreamstart{% - \global\let\pgf@plotstreampoint=\@gobble% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreampoint=\pgf@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -200,7 +203,7 @@ \read1 to \pgf@temp% \let\par=\@@par% \edef\pgf@temp{\pgf@temp}% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \else\ifx\pgf@temp\pgf@partext% \else% \expandafter\pgf@parsexyline\pgf@temp\pgf@stop% @@ -245,7 +248,7 @@ \def\pgf@readxyzfile{% \read1 to \pgf@temp% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \else\ifx\pgf@temp\pgf@partext% \else% \expandafter\pgf@parsexyzline\pgf@temp\pgf@stop% @@ -287,7 +290,7 @@ \newwrite\pgf@plotwrite \newif\ifpgf@resample@plot -\def\pgfplotgnuplot{\@ifnextchar[{\pgf@plotgnuplot}{\pgf@plotgnuplot[\jobname]}}%} +\def\pgfplotgnuplot{\pgf@ifnextchar[{\pgf@plotgnuplot}{\pgf@plotgnuplot[\jobname]}}%} \def\pgf@plotgnuplot[#1]#2{% \pgf@resample@plottrue% % Check, whether it is up-to-date diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex index 494f328994d..b6e8140abe3 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseshapes.code.tex,v 1.9 2005/10/13 10:12:31 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/basiclayer/pgfbaseshapes.code.tex,v 1.14 2006/10/11 15:22:25 tantau Exp $ \newbox\pgfnodeparttextbox @@ -33,11 +36,11 @@ % \pgfmultipartnode{rectangle}{center}{Hello}{hellonode}{\pgfusepath{stroke}} \def\pgfmultipartnode#1#2#3#4{% - \@ifundefined{pgf@sh@s@#1}% + \pgf@ifundefined{pgf@sh@s@#1}% {\PackageError{pgf}{Unknown shape ``#1''}{}}% {% {% - \let\pgf@sh@savedpoints=\@empty% + \let\pgf@sh@savedpoints=\pgf@empty% \csname pgf@sh@s@#1\endcsname% \pgf@sh@savedpoints% \pgftransformshift{% @@ -47,19 +50,20 @@ }% % Save the saved points and the transformation matrix \edef\pgf@test{#3}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \expandafter\xdef\csname pgf@sh@ns@#3\endcsname{#1}% \edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@np@#3\endcsname}% \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@savedpoints}% \pgfgettransform\pgf@temp \expandafter\xdef\csname pgf@sh@nt@#3\endcsname{\pgf@temp}% + \expandafter\xdef\csname pgf@sh@pi@#3\endcsname{\pgfpictureid}% \fi% - \@ifundefined{pgf@sh@bbg@#1}{} + \pgf@ifundefined{pgf@sh@bbg@#1}{} {{\pgfscope\csname pgf@sh@bbg@#1\endcsname\endpgfscope}}% - \@ifundefined{pgf@sh@bg@#1}{}% + \pgf@ifundefined{pgf@sh@bg@#1}{}% {\csname pgf@sh@bg@#1\endcsname#4}% - \@ifundefined{pgf@sh@fbg@#1}{} + \pgf@ifundefined{pgf@sh@fbg@#1}{} {{\pgfscope\csname pgf@sh@fbg@#1\endcsname\endpgfscope}}% {% \expandafter\@for\expandafter\pgf@shape@com\expandafter:\expandafter=\csname pgf@sh@boxes@#1\endcsname\do{% @@ -69,11 +73,11 @@ }% }% }% - \@ifundefined{pgf@sh@bfg@#1}{}% + \pgf@ifundefined{pgf@sh@bfg@#1}{}% {{\pgfscope\csname pgf@sh@bfg@#1\endcsname\endpgfscope}}% - \@ifundefined{pgf@sh@fg@#1}{}% + \pgf@ifundefined{pgf@sh@fg@#1}{}% {\csname pgf@sh@fg@#1\endcsname#4}% - \@ifundefined{pgf@sh@ffg@#1}{}% + \pgf@ifundefined{pgf@sh@ffg@#1}{}% {{\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope}}% }% }% @@ -115,7 +119,7 @@ \def\pgf@sh@resavedanchor#1#2{% \pgf@process{#2}% \edef\pgf@sh@marshal{% - \noexpand\g@addto@macro\noexpand\pgf@sh@savedpoints{% + \noexpand\pgf@g@addto@macro\noexpand\pgf@sh@savedpoints{% \noexpand\def\noexpand#1{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% }}% \pgf@sh@marshal% @@ -125,7 +129,7 @@ \def\pgf@sh@resaveddimen#1#2{% {#2\global\pgf@x=\pgf@x}% \edef\pgf@sh@marshal{% - \noexpand\g@addto@macro\noexpand\pgf@sh@savedpoints{% + \noexpand\pgf@g@addto@macro\noexpand\pgf@sh@savedpoints{% \noexpand\def\noexpand#1{\the\pgf@x}% }}% \pgf@sh@marshal% @@ -133,7 +137,7 @@ % Invoke an anchor \def\pgf@sh@reanchor#1#2{% - \@ifundefined{pgf@anchor@#1@#2}% + \pgf@ifundefined{pgf@anchor@#1@#2}% {% \setcounter{pgf@counta}{#2}% \csname pgf@anchor@#1@border\endcsname{\pgfpointpolar{\c@pgf@counta}{1pt}}% @@ -159,7 +163,7 @@ \def\pgfpointanchor#1#2{% % Ok, check whether #1 is known! - \@ifundefined{pgf@sh@ns@#1} + \pgf@ifundefined{pgf@sh@ns@#1} {\PackageError{pgf}{No shape named #1 is known}{}% \pgfpointorigin}% {% @@ -173,6 +177,8 @@ \global\pgf@x=\pgf@x% \global\pgf@y=\pgf@y% }% + % Add inter picture transformation + \pgf@shape@interpictureshift{#1}% % Undo current transformation \pgftransforminvert% \pgf@pos@transform{\pgf@x}{\pgf@y}% @@ -180,6 +186,24 @@ }% } +\def\pgf@shape@interpictureshift#1{% + \expandafter\ifx\csname pgf@sh@pi@#1\endcsname\pgfpictureid% + \else% + \pgfsys@getposition{\csname pgf@sh@pi@#1\endcsname}\pgf@shape@original@pos% + \pgfsys@getposition{\pgfpictureid}\pgf@shape@current@pos% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{\pgfpointorigin\pgf@shape@current@pos}% + \advance\pgf@xa by-\pgf@x% + \advance\pgf@ya by-\pgf@y% + \pgf@process{\pgfpointorigin\pgf@shape@original@pos}% + \advance\pgf@xa by\pgf@x% + \advance\pgf@ya by\pgf@y% + \pgf@x=\pgf@xa% + \pgf@y=\pgf@ya% + \fi% +} + % Retrieves a border point of a shape @@ -201,7 +225,7 @@ \def\pgfpointshapeborder#1#2{% % Ok, check whether #1 is known! - \@ifundefined{pgf@sh@ns@#1} + \pgf@ifundefined{pgf@sh@ns@#1} {\PackageError{pgf}{No shape named #1 is known}{}% \pgfpointorigin}% {% @@ -216,6 +240,7 @@ \pgf@xa=\pgf@x% \pgf@ya=\pgf@y% \pgf@process{\csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @center\endcsname}% + \pgf@process{\pgf@shape@interpictureshift{#1}}%% \advance\pgf@xa by-\pgf@x% \advance\pgf@ya by-\pgf@y% \csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @border\endcsname{\pgfpoint{\pgf@xa}{\pgf@ya}}% @@ -224,6 +249,8 @@ \global\pgf@x=\pgf@x% \global\pgf@y=\pgf@y% }% + % Add inter picture transformation + \pgf@shape@interpictureshift{#1}% % Undo current transformation \pgftransforminvert% \pgf@pos@transform{\pgf@x}{\pgf@y}% @@ -326,15 +353,15 @@ \anchorborder{\csname pgf@anchor@#1@center\endcsname}% \anchor{text}{\pgfpointorigin}% \nodeparts{text}% - \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\@empty% + \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\pgf@empty% #2 } } \def\pgf@sh@savedanchor#1#2{% - \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}} + \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}} \def\pgf@sh@saveddimen#1#2{% - \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resaveddimen{#1}{#2}}} + \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resaveddimen{#1}{#2}}} \def\pgf@sh@anchor#1#2{\expandafter\gdef\csname pgf@anchor@\shape@name @#1\endcsname{#2}} \def\pgf@sh@anchorborder#1{\expandafter\gdef\csname pgf@anchor@\shape@name @border\endcsname##1{\pgf@process{##1}#1}} \long\def\pgf@sh@behindbgpath#1{\expandafter\gdef\csname pgf@sh@bbg@\shape@name\endcsname{#1}} @@ -346,7 +373,7 @@ \def\pgf@sh@boxes#1{\expandafter\gdef\csname pgf@sh@boxes@\shape@name\endcsname{#1}} \def\pgf@sh@inheritsavedanchors[from=#1]{% - \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\csname pgf@sh@s@#1\endcsname}} + \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\csname pgf@sh@s@#1\endcsname}} \def\pgf@sh@inheritanchor[from=#1]#2{% \edef\pgf@marshal{\global\let\expandafter\noexpand\csname pgf@anchor@\shape@name @#2\endcsname=\expandafter\noexpand\csname @@ -667,6 +694,27 @@ \def\northeast{\pgfpoint{\pgf@picmaxx}{\pgf@picmaxy}}% } \expandafter\def\csname pgf@sh@nt@current bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}} +\expandafter\def\csname pgf@sh@pi@current bounding box\endcsname{\pgfpictureid} + + +% Special current path bounding box rectangle: +\expandafter\def\csname pgf@sh@ns@current path bounding box\endcsname{rectangle} +\expandafter\def\csname pgf@sh@np@current path bounding box\endcsname{% + \def\southwest{\pgfpoint{\pgf@pathminx}{\pgf@pathminy}}% + \def\northeast{\pgfpoint{\pgf@pathmaxx}{\pgf@pathmaxy}}% +} +\expandafter\def\csname pgf@sh@nt@current path bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}} +\expandafter\def\csname pgf@sh@pi@current path bounding box\endcsname{\pgfpictureid} + + +% Special current page bounding box rectangle: +\expandafter\def\csname pgf@sh@ns@current page\endcsname{rectangle} +\expandafter\def\csname pgf@sh@np@current page\endcsname{% + \def\southwest{\pgfpoint{0pt}{0pt}}% + \def\northeast{\pgfpoint{\paperwidth}{\paperheight}}% +} +\expandafter\def\csname pgf@sh@nt@current page\endcsname{{1}{0}{0}{1}{0pt}{0pt}} +\expandafter\def\csname pgf@sh@pi@current page\endcsname{pgfpageorigin} diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex index 00169368ae1..b4842e3dc29 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbasesnakes.code.tex,v 1.6 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbasesnakes.code.tex,v 1.9 2006/10/11 15:22:25 tantau Exp $ \newdimen\pgfsnakeremainingdistance \newdimen\pgfsnakecompleteddistance @@ -42,7 +45,7 @@ \long\def\pgfdeclaresnake#1#2#3{% \def\pgf@snake@name{#1}% - \@namedef{pgf@snake@@#1@initial}{#2}% + \pgf@namedef{pgf@snake@@#1@initial}{#2}% \let\pgf@orig@state=\state% \let\state=\pgf@snake@state #3 @@ -85,10 +88,10 @@ % \pgfpathlineto{\pgfpoint{10pt}{0pt}} % } -\def\pgf@snake@state#1{\@ifnextchar[{\pgf@@snake@start#1}{\pgf@@snake@start#1[]}}%} +\def\pgf@snake@state#1{\pgf@ifnextchar[{\pgf@@snake@start#1}{\pgf@@snake@start#1[]}}%} \def\pgf@@snake@start#1[#2]#3{% - \@namedef{pgf@snake@@\pgf@snake@name @#1@options}{#2}% - \@namedef{pgf@snake@@\pgf@snake@name @#1@code}{#3}% + \pgf@namedef{pgf@snake@@\pgf@snake@name @#1@options}{#2}% + \pgf@namedef{pgf@snake@@\pgf@snake@name @#1@code}{#3}% } @@ -122,7 +125,7 @@ \pgf@process{\pgfpointnormalised{}}% % ok, now computer length (arghh...) % In theory that's easy: divide the larger of the values x or y by - % the normalizes x or y. Well... + % the normalized x or y. Well... % % First, make xa and ya positive: \ifdim\pgf@xa<0pt% @@ -162,7 +165,7 @@ \pgf@xb=\pgf@x% \pgf@yb=\pgf@y% \@for\pgf@temp:=\pgf@list\do{% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \else% \expandafter\pgf@snake@invoke\pgf@temp% \fi% @@ -224,7 +227,7 @@ % \pgfpathsnakealongvector{zig zag}{100pt}{\pgfpolar{30}{1pt}} \def\pgfpathsnakealongvector#1#2#3{% - \@ifundefined{pgf@snake@@#1@initial}{\PackageError{pgf}{Undefined snake ``#1''}{}} + \pgf@ifundefined{pgf@snake@@#1@initial}{\PackageError{pgf}{Undefined snake ``#1''}{}} { \begingroup% keep things local \pgftransformreset% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex index 0a3df3dec31..80e932c4571 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.3 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/basiclayer/pgfcore.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ \newif\ifpgf@draftmode diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex index 0283f40c4d2..d813fe20973 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.2 2005/07/10 20:11:23 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.5 2006/10/11 15:22:25 tantau Exp $ % Sets the end arrow @@ -17,13 +20,13 @@ \def\pgfsetarrowsend#1{\pgf@arrowset{end}{#1}} \def\pgf@arrowset#1#2{% - \@ifundefined{pgf@arrow@code@#2} + \pgf@ifundefined{pgf@arrow@code@#2} {\PackageError{pgf}{Arrow #1 type ``#2'' unknown}{}} {% \edef\pgf@arrow@temp{#2}% - \ifx\pgf@arrow@temp\@empty% ah. clear! - \expandafter\let\csname pgf@#1arrow\endcsname=\@empty% - \expandafter\let\csname pgf@shorten@#1\endcsname=\@empty% + \ifx\pgf@arrow@temp\pgf@empty% ah. clear! + \expandafter\let\csname pgf@#1arrow\endcsname=\pgf@empty% + \expandafter\let\csname pgf@shorten@#1\endcsname=\pgf@empty% \else% %\pgf@arrow@prepare{#2}% \expandafter\def\csname pgf@#1arrow\endcsname{\pgf@arrow@call{#2}}% @@ -66,18 +69,18 @@ } \def\pgf@arrows@checked#1#2#3{% - \@ifundefined{pgf@arrow@code@#2}% + \pgf@ifundefined{pgf@arrow@code@#2}% {% \PackageError{pgf}{Arrow end type ``#2'' unknown}{}}% {% - \@ifundefined{pgf@arrow@code@\csname pgf@arrows@invert#1\endcsname} + \pgf@ifundefined{pgf@arrow@code@\csname pgf@arrows@invert#1\endcsname} {\PackageError{pgf}{Arrow start type ``#1'' unknown}{}}% {#3}% }% } \def\pgf@arrows@check@already#1#2#3{% - \@ifundefined{pgf@arrow@code@#2} + \pgf@ifundefined{pgf@arrow@code@#2} {#3}% {\PackageError{pgf}{Arrow end type ``#2'' already defined}{}}% } @@ -93,7 +96,7 @@ \let\pgfusepath=\pgf@nousepath@here% \pgf@relevantforpicturesizefalse% \pgftransformreset% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% \pgfsysprotocol@bufferedtrue% \pgfsys@beginscope% \csname pgf@arrow@code@#1\endcsname% @@ -101,8 +104,8 @@ \pgfsysprotocol@getcurrentprotocol\pgf@@arrow@temp% \global\let\pgf@@arrow@temp=\pgf@@arrow@temp% \endpgfinterruptpath% - \expandafter\xdef\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname{% - \noexpand\pgfsys@invoke{\pgf@@arrow@temp}}% + \expandafter\def\expandafter\pgf@temp\expandafter{\expandafter\pgfsys@invoke\expandafter{\pgf@@arrow@temp}}% + \expandafter\global\expandafter\let\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname=\pgf@temp% }% \pgfsysprotocol@setcurrentprotocol\pgf@arrow@temp% \fi% @@ -265,9 +268,9 @@ % \pgfarrowsdeclarecombine*{|<}{>|}{|}{|}{<}{>} % \pgfarrowsdeclarecombine{<<}{>>}{<}{>}{<}{>} -\def\pgfarrowsdeclarecombine{\@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}} +\def\pgfarrowsdeclarecombine{\pgf@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}} -\def\pgf@@arrowsdeclarecombine{\@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}} +\def\pgf@@arrowsdeclarecombine{\pgf@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}} \def\pgf@arrowsdeclarecombine[#1]#2#3#4#5#6#7{% \pgf@arrows@check@already{#2}{#3}% {% @@ -303,7 +306,7 @@ }% } -\def\pgfarrowsdeclarecombine@star*{\@ifnextchar[{\pgf@arrowsdeclarecombine@star}{\pgf@arrowsdeclarecombine@star[0pt]}} +\def\pgfarrowsdeclarecombine@star*{\pgf@ifnextchar[{\pgf@arrowsdeclarecombine@star}{\pgf@arrowsdeclarecombine@star[0pt]}} \def\pgf@arrowsdeclarecombine@star[#1]#2#3#4#5#6#7{% \pgf@arrows@check@already{#2}{#3}% {% @@ -353,9 +356,9 @@ % % \pgfarrowsdeclaredouble{<<}{>>}{<}{>} -\def\pgfarrowsdeclaredouble{\@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}} +\def\pgfarrowsdeclaredouble{\pgf@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}} \def\pgf@arrowsdeclaredouble[#1]#2#3#4#5{\pgfarrowsdeclarecombine[#1]{#2}{#3}{#4}{#5}{#4}{#5}} -\def\pgfarrowsdeclaretriple{\@ifnextchar[{\pgf@arrowsdeclaretriple}{\pgf@arrowsdeclaretriple[0pt]}} +\def\pgfarrowsdeclaretriple{\pgf@ifnextchar[{\pgf@arrowsdeclaretriple}{\pgf@arrowsdeclaretriple[0pt]}} \def\pgf@arrowsdeclaretriple[#1]#2#3#4#5{% \pgfarrowsdeclarecombine[#1]{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}{#4}{#5}% \pgfarrowsdeclarecombine[#1]{#2}{#3}{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex index f417efcab54..3eb07f2897a 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.3 2005/09/21 00:05:34 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.5 2006/10/11 15:22:25 tantau Exp $ % Globals @@ -63,7 +67,7 @@ \let\pgf@next=\relax% \else% \setlength\pgf@x{#1}% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \edef\pgf@temp{\the\pgf@x}% \else% \edef\pgf@temp{\pgf@temp,\the\pgf@x}% @@ -81,7 +85,7 @@ \def\pgfsetstrokecolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@setstrokecolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@setstrokecolor#1#2#3#4#5{% @@ -95,7 +99,7 @@ \def\pgf@uncomma#1,{% \def\pgf@coltest{#1}% - \ifx\pgf@coltest\@empty% + \ifx\pgf@coltest\pgf@empty% \let\pgf@colnext=\relax% \else% \expandafter\def\expandafter\pgf@colmarshal\expandafter{\pgf@colmarshal{#1}}% @@ -113,7 +117,7 @@ \def\pgfsetfillcolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@setfillcolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@setfillcolor#1#2#3#4#5{% @@ -135,7 +139,7 @@ \def\pgfsetcolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@setcolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@setcolor#1#2#3#4#5{% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex index a05d934f12b..44c4e208d5c 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoremath.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoremath.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $ % Mathematical stuff diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex index fd12c5d9146..557558d82ef 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreobjects.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreobjects.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $ % Object reuse diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex index 97df7f0cf34..f6c61229ff1 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex @@ -1,9 +1,14 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.1 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.5 2006/10/11 15:22:25 tantau Exp $ + \newdimen\pgf@path@lastx \newdimen\pgf@path@lasty @@ -197,6 +202,7 @@ \global\pgf@path@lasty=\pgf@yb% } + % Append an arc to the current point, where the current point is at % angle #1 and the end is at angle #2. If #2 > #1, the arc is drawn % counter-clockwise, otherwise it is clockwise. @@ -336,6 +342,30 @@ \pgf@protocolsizes{\pgf@xc}{\pgf@yc}% } +% Append an arc to the current point, where the arc is on an ellipse +% given by two axis vectors. +% +% #1 = angle of first point +% #2 = angle of second point +% #3 = first axis +% #4 = second axis +% +% Example: +% +% \pgfpathmoveto{\pgfxy(0,0)} +% \pgfpatharcaxes{0}{90}{\pgfpointxy{2}{0}}{\pgfpointxy{0}{2}} +% \pgfstroke + +\def\pgfpatharcaxes#1#2#3#4{% + {% + \pgftransformtriangle{\pgfpointorigin}{#3}{#4}% + \pgfpatharc{#1}{#2}{1pt}% + }% +} + + + + % Append an ellipse to the current path. % % #1 = center @@ -481,6 +511,7 @@ + % Append a rectangle to the current path % % #1 = lower left corner point of rectangle @@ -528,7 +559,7 @@ \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}% \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}% \pgfpathclose% - \pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@xb}}% + \pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@yb}}% } % Append a rectangle to the current path @@ -574,7 +605,7 @@ \define@key{pgfbase}{stepy}{\setlength{\pgf@y}{#1}\relax} \define@key{pgfbase}{step}{\pgf@process{#1}} -\def\pgfpathgrid{\@ifnextchar[{\pgf@pathgrid}{\pgf@pathgrid[]}} +\def\pgfpathgrid{\pgf@ifnextchar[{\pgf@pathgrid}{\pgf@pathgrid[]}} \def\pgf@pathgrid[#1]#2#3{% \setkeys{pgfbase}{stepx=1cm,stepy=1cm}% \setkeys{pgfbase}{#1}% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex index db2a9d7c068..4fbed5e37ea 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.2 2005/10/03 15:52:27 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ @@ -26,7 +30,7 @@ \def\pgfprocesspathcleanup#1{% {% - \let\pgf@newpath=\@empty% + \let\pgf@newpath=\pgf@empty% \expandafter\pgf@cleanupprocessor#1\pgf@stop% }% \let#1=\pgf@newpath% @@ -34,7 +38,7 @@ \def\pgf@cleanupprocessor#1{% \ifx#1\pgf@stop% - \let\next=\@gobble% ok, done + \let\next=\pgf@gobble% ok, done \else% \ifx#1\pgfsyssoftpath@movetotoken% \let\next=\pgf@cleanupmoveto% @@ -46,7 +50,7 @@ } \def\pgf@cleanupredo#1#2#3{% - \g@addto@macro\pgf@newpath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@newpath{#1{#2}{#3}}% \pgf@cleanupprocessor% } @@ -54,7 +58,7 @@ \ifx#4\pgfsyssoftpath@movetotoken% % Ok, skip \else% - \g@addto@macro\pgf@newpath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@newpath{#1{#2}{#3}}% \fi% \pgf@cleanupprocessor#4% } @@ -88,7 +92,7 @@ % % \pgfpointlastonpath is now \pgfpoint{40bp}{40bp} \def\pgfprocesspathextractpoints#1{% - \ifx#1\@empty% + \ifx#1\pgf@empty% \let\pgfpointfirstonpath=\pgfpointorigin% \let\pgfpointsecondonpath=\pgfpointorigin% \let\pgfpointsecondlastonpath=\pgfpointorigin% @@ -105,7 +109,7 @@ \let\pgfpointsecondonpath=\pgfpointfirstonpath% \let\pgfpointsecondlastonpath=\pgfpointfirstonpath% \let\pgfpointlastonpath=\pgfpointfirstonpath% - \let\next=\@gobble% + \let\next=\pgf@gobble% \else \let\next=\pgf@extractprocessorsecond% \fi% @@ -127,7 +131,7 @@ \let\pgfpointlastonpath=\pgfpointsecondonpath% \ifx#4\pgf@stop% % short path... - \let\next=\@gobble% + \let\next=\pgf@gobble% \else \let\next=\pgf@extractprocessorother% \fi% @@ -148,7 +152,7 @@ \def\pgfpointlastonpath{\pgfpoint{#2}{#3}}% \ifx#4\pgf@stop% % end! - \let\next=\@gobble% + \let\next=\pgf@gobble% \fi% \next#4% } @@ -171,14 +175,14 @@ \def\pgfprocesscheckclosed#1#2{% {% \global\let\pgf@proc@todo=\relax% - \let\pgfsyssoftpath@movetotoken=\@gobbletwo% - \let\pgfsyssoftpath@linetotoken=\@gobbletwo% - \let\pgfsyssoftpath@curvetosupportatoken=\@gobbletwo% - \let\pgfsyssoftpath@curvetosupportbtoken=\@gobbletwo% - \let\pgfsyssoftpath@curvetotoken=\@gobbletwo% - \def\pgfsyssoftpath@rectcornertoken{\gdef\pgf@proc@todo{#2}\@gobbletwo}% - \def\pgfsyssoftpath@rectsizetoken{\gdef\pgf@proc@todo{#2}\@gobbletwo}% - \def\pgfsyssoftpath@closepathtoken{\gdef\pgf@proc@todo{#2}\@gobbletwo}% + \let\pgfsyssoftpath@movetotoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@linetotoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@curvetosupportatoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@curvetosupportbtoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@curvetotoken=\pgf@gobbletwo% + \def\pgfsyssoftpath@rectcornertoken{\gdef\pgf@proc@todo{#2}\pgf@gobbletwo}% + \def\pgfsyssoftpath@rectsizetoken{\gdef\pgf@proc@todo{#2}\pgf@gobbletwo}% + \def\pgfsyssoftpath@closepathtoken{\gdef\pgf@proc@todo{#2}\pgf@gobbletwo}% #1% }% \pgf@proc@todo% @@ -204,7 +208,7 @@ \def\pgf@processroundcheck#1#2#3\pgfsyssoftpath@specialroundtoken#4\pgf@stop{% \def\pgf@test{#4}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% % ok, nothing to be done! \let#2=#1% \else% @@ -215,15 +219,15 @@ \def\pgf@@processround#1#2{% - \let\pgfprocess@newpath\@empty% - \let\pgfprocess@moveto\@empty% - \let\pgfprocess@firstto\@empty% - \let\pgfprocess@segment\@empty% + \let\pgfprocess@newpath\pgf@empty% + \let\pgfprocess@moveto\pgf@empty% + \let\pgfprocess@firstto\pgf@empty% + \let\pgfprocess@segment\pgf@empty% \pgf@xa=0pt% \pgf@ya=0pt% \expandafter\pgfprocess@round#1\pgf@stop{0pt}{0pt}% - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% \let#2=\pgfprocess@newpath% } @@ -241,20 +245,20 @@ \fi% \fi% \else% - \ifx\pgfprocess@firstto\@empty% + \ifx\pgfprocess@firstto\pgf@empty% \def\pgfprocess@firstto{{#2}{#3}}% \fi% \pgf@xa=#2% \pgf@ya=#3% \ifx#1\pgfsyssoftpath@movetotoken% % ok, move old segment to newpath - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% \def\pgfprocess@moveto{#1{#2}{#3}}% - \let\pgfprocess@firstto=\@empty% - \let\pgfprocess@segment=\@empty% + \let\pgfprocess@firstto=\pgf@empty% + \let\pgfprocess@segment=\pgf@empty% \else% - \g@addto@macro\pgfprocess@segment{#1{#2}{#3}}% + \pgf@g@addto@macro\pgfprocess@segment{#1{#2}{#3}}% \fi% \let\next=\pgfprocess@round% \fi% @@ -263,7 +267,7 @@ } \def\pgfprocess@specialround#1#2#3{% - \ifx\pgfprocess@firstto\@empty% + \ifx\pgfprocess@firstto\pgf@empty% \def\pgfprocess@firstto{{#2}{#3}}% \fi% \let\next=\pgfprocess@round% default: do nothing @@ -319,7 +323,7 @@ } \def\pgfprocess@@specialround#1#2#3{% - \g@addto@macro\pgfprocess@segment{#1}% + \pgf@g@addto@macro\pgfprocess@segment{#1}% % calculate start coordinate of the curve \pgf@xb=#2% \pgf@yb=#3% @@ -332,7 +336,7 @@ \pgf@xa=\pgf@x% save start point of added curve \pgf@ya=\pgf@y% \edef\pgfprocess@addition{{\the\pgf@x}{\the\pgf@y}}% - \expandafter\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% % % now add curve % @@ -352,7 +356,7 @@ \advance\pgf@xa by 0.555\pgf@x% \advance\pgf@ya by 0.555\pgf@y% \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetosupportatoken{\the\pgf@xa}{\the\pgf@ya}}% - \expandafter\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% }% % calculate second support: {% @@ -363,11 +367,11 @@ \advance\pgf@xc by 0.555\pgf@x% \advance\pgf@yc by 0.555\pgf@y% \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetosupportbtoken{\the\pgf@xc}{\the\pgf@yc}}% - \expandafter\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% }% % add end: \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetotoken{\the\pgf@xc}{\the\pgf@yc}}% - \expandafter\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% % % continue! % @@ -377,16 +381,16 @@ } \def\pgfprocess@specialroundcurveto#1#2#3#4#5#6{% - \g@addto@macro\pgfprocess@segment{#1{#2}{#3}#4{#5}{#6}}% supports + \pgf@g@addto@macro\pgfprocess@segment{#1{#2}{#3}#4{#5}{#6}}% supports \pgf@xa=#5% \pgf@ya=#6% \pgfprocess@specialroundcope} \def\pgfprocess@specialroundclose{% \let\next=\pgfprocess@round% - \ifx\pgfprocess@moveto\@empty% + \ifx\pgfprocess@moveto\pgf@empty% \else% - \ifx\pgfprocess@firstto\@empty% + \ifx\pgfprocess@firstto\pgf@empty% \else% \expandafter\pgfprocess@@specialclosetarget\pgfprocess@firstto% \let\pgfprocess@continueafterrounding=\pgfprocess@cleanupafterclose% @@ -445,9 +449,9 @@ \def\pgfprocesspathreplacestartandend#1#2#3{% {% - \let\pgf@newpath=\@empty% - \let\pgf@prepath=\@empty% - \ifx#1\@empty% + \let\pgf@newpath=\pgf@empty% + \let\pgf@prepath=\pgf@empty% + \ifx#1\pgf@empty% \else% \pgf@process{#3}% \pgf@xa=\pgf@x% @@ -466,7 +470,7 @@ \def\pgf@temppath{#1{#2}{#3}}% \edef\pgf@newpath{\noexpand#1{\the\pgf@x}{\the\pgf@y}}% \ifx#4\pgf@stop% - \let\next=\@gobble% + \let\next=\pgf@gobble% \else% \let\next=\pgf@replaceprocessother% \fi% @@ -489,11 +493,11 @@ \def\pgf@@replaceprocessother#1#2#3#4{% \ifx#4\pgf@stop% \edef\pgf@newpathaddition{{\noexpand#1{\the\pgf@xa}{\the\pgf@ya}}}% - \expandafter\g@addto@macro\expandafter\pgf@newpath\pgf@newpathaddition% - \let\next=\@gobble% + \expandafter\pgf@g@addto@macro\expandafter\pgf@newpath\pgf@newpathaddition% + \let\next=\pgf@gobble% \else% - \g@addto@macro\pgf@temppath{#1{#2}{#3}}% - \g@addto@macro\pgf@newpath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@temppath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@newpath{#1{#2}{#3}}% \let\next=\pgf@replaceprocessother% \fi% \next#4% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex index 38bbdf07bba..0d5b5482a57 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.2 2005/07/17 22:34:19 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.6 2006/10/11 15:22:25 tantau Exp $ % Stroke/fill/clip/etc. the current path. Depending on the options, @@ -36,18 +40,18 @@ \define@key{pgfup}{use as bounding box}[]{\def\pgf@up@bb{\pgf@relevantforpicturesizefalse}} \def\pgfusepath#1{% - \let\pgf@up@stroke\@empty% - \let\pgf@up@fill\@empty% - \let\pgf@up@clip\@empty% - \let\pgf@up@discard\@empty% - \let\pgf@up@bb\@empty% + \let\pgf@up@stroke\pgf@empty% + \let\pgf@up@fill\pgf@empty% + \let\pgf@up@clip\pgf@empty% + \let\pgf@up@discard\pgf@empty% + \let\pgf@up@bb\pgf@empty% \setkeys{pgfup}{#1}% \expandafter\def\expandafter\pgf@up@action\expandafter{\csname pgfsys@\pgf@up@fill\pgf@up@stroke\endcsname}% - \ifx\pgf@up@stroke\@empty% - \ifx\pgf@up@fill\@empty% - \ifx\pgf@up@clip\@empty% - \let\pgf@up@action=\@empty% - \pgfsyssoftpath@setcurrentpath\@empty% + \ifx\pgf@up@stroke\pgf@empty% + \ifx\pgf@up@fill\pgf@empty% + \ifx\pgf@up@clip\pgf@empty% + \let\pgf@up@action=\pgf@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \else% % only clipping \let\pgf@up@action=\pgfsys@discardpath% @@ -56,25 +60,28 @@ \fi% \pgfprocessround{\pgfsyssoftpath@currentpath}{\pgfsyssoftpath@currentpath}% change the current path % - % Check whether the path is stroked. If so, add half the path width + % Check whether the path is stroked. If so, add half the line width % to the bounding box. % \ifpgf@relevantforpicturesize% - \ifx\pgf@up@stroke\@empty% + \ifx\pgf@up@stroke\pgf@empty% \else% - \pgf@x=\pgf@pathminx\advance\pgf@x by-.5\pgflinewidth% - \ifdim\pgf@x<\pgf@picminx\global\pgf@picminx\pgf@x\fi% - \pgf@y=\pgf@pathminy\advance\pgf@y by-.5\pgflinewidth% - \ifdim\pgf@y<\pgf@picminy\global\pgf@picminy\pgf@y\fi% - \pgf@x=\pgf@pathmaxx\advance\pgf@x by.5\pgflinewidth% - \ifdim\pgf@x>\pgf@picmaxx\global\pgf@picmaxx\pgf@x\fi% - \pgf@y=\pgf@pathmaxy\advance\pgf@y by.5\pgflinewidth% - \ifdim\pgf@y>\pgf@picmaxy\global\pgf@picmaxy\pgf@y\fi% + \ifdim\pgf@picmaxx=-16000pt\relax% + \else% + \pgf@x=\pgf@pathminx\advance\pgf@x by-.5\pgflinewidth% + \ifdim\pgf@x<\pgf@picminx\global\pgf@picminx\pgf@x\fi% + \pgf@y=\pgf@pathminy\advance\pgf@y by-.5\pgflinewidth% + \ifdim\pgf@y<\pgf@picminy\global\pgf@picminy\pgf@y\fi% + \pgf@x=\pgf@pathmaxx\advance\pgf@x by.5\pgflinewidth% + \ifdim\pgf@x>\pgf@picmaxx\global\pgf@picmaxx\pgf@x\fi% + \pgf@y=\pgf@pathmaxy\advance\pgf@y by.5\pgflinewidth% + \ifdim\pgf@y>\pgf@picmaxy\global\pgf@picmaxy\pgf@y\fi% + \fi% \fi% \fi% % - \ifx\pgf@up@clip\@empty% - \ifx\pgf@up@stroke\@empty% + \ifx\pgf@up@clip\pgf@empty% + \ifx\pgf@up@stroke\pgf@empty% \pgfsyssoftpath@invokecurrentpath% \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% \pgf@up@action% @@ -85,7 +92,7 @@ \pgfsyssoftpath@invokecurrentpath% \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% \pgf@up@action% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \pgf@add@arrows@as@needed% \else% \pgfsyssoftpath@invokecurrentpath% @@ -101,7 +108,7 @@ \pgf@relevantforpicturesizefalse% \fi% \pgf@up@bb% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \pgf@resetpathsizes% \ignorespaces% } @@ -128,13 +135,13 @@ \def\pgf@check@for@arrows{% \pgf@drawarrowsfalse% - \ifx\pgf@startarrow\@empty\else\pgf@drawarrowstrue\fi% - \ifx\pgf@endarrow\@empty\else\pgf@drawarrowstrue\fi% + \ifx\pgf@startarrow\pgf@empty\else\pgf@drawarrowstrue\fi% + \ifx\pgf@endarrow\pgf@empty\else\pgf@drawarrowstrue\fi% \ifdim\pgf@shorten@end@additional=0pt\relax\else\pgf@drawarrowstrue\fi% \ifdim\pgf@shorten@start@additional=0pt\relax\else\pgf@drawarrowstrue\fi% \ifpgf@drawarrows% \pgfsyssoftpath@getcurrentpath\pgf@arrowpath% - \ifx\pgf@arrowpath\@empty% + \ifx\pgf@arrowpath\pgf@empty% \pgf@drawarrowsfalse% \else% \pgfprocesscheckclosed{\pgf@arrowpath}{\pgf@drawarrowsfalse}% @@ -145,14 +152,14 @@ \newdimen\pgf@shorten@end@additional \newdimen\pgf@shorten@start@additional -\let\pgf@shorten@end=\@empty -\let\pgf@shorten@start=\@empty +\let\pgf@shorten@end=\pgf@empty +\let\pgf@shorten@start=\pgf@empty \def\pgf@shorten@path@as@needed{% \pgfprocesspathextractpoints{\pgf@arrowpath}% \let\pgf@arrow@next=\pgf@shorten@now% - \ifx\pgf@shorten@start\@empty% - \ifx\pgf@shorten@end\@empty% + \ifx\pgf@shorten@start\pgf@empty% + \ifx\pgf@shorten@end\pgf@empty% \ifdim\pgf@shorten@end@additional=0pt\relax% \ifdim\pgf@shorten@start@additional=0pt\relax% \let\pgf@arrow@next=\relax% @@ -169,33 +176,41 @@ \pgf@shorten@start% \advance\pgf@x by\pgf@shorten@start@additional% \pgf@xc=\pgf@x% - \pgf@process{\pgfpointlineatdistance{\pgf@xc}{\pgfpointfirstonpath}{\pgfpointsecondonpath}}% - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% + \pgfpointlineatdistance{\pgf@xc}{\pgfpointfirstonpath}{\pgfpointsecondonpath}% + \global\pgf@xb=\pgf@x% + \global\pgf@yb=\pgf@y% + \pgf@process{\pgfpointsecondonpath}% + \global\advance\pgf@x by\pgf@xa% + \global\advance\pgf@y by\pgf@ya% }% - \edef\pgfpointfirstonpath{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% + \edef\pgfpointfirstonpath{\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}% + \edef\pgfpointsecondonpath{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% {% \pgf@x=0pt% \pgf@shorten@end% \advance\pgf@x by\pgf@shorten@end@additional% \pgf@xc=\pgf@x% - \pgf@process{\pgfpointlineatdistance{\pgf@xc}{\pgfpointlastonpath}{\pgfpointsecondlastonpath}}% - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% + \pgfpointlineatdistance{\pgf@xc}{\pgfpointlastonpath}{\pgfpointsecondlastonpath}% + \global\pgf@xb=\pgf@x% + \global\pgf@yb=\pgf@y% + \pgf@process{\pgfpointsecondlastonpath}% + \global\advance\pgf@x by\pgf@xa% + \global\advance\pgf@y by\pgf@ya% }% - \edef\pgfpointlastonpath{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% + \edef\pgfpointlastonpath{\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}% + \edef\pgfpointsecondlastonpath{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% \pgfprocesspathreplacestartandend{\pgf@arrowpath}{\pgfpointfirstonpath}{\pgfpointlastonpath}% \pgfsyssoftpath@setcurrentpath\pgf@arrowpath% } \def\pgf@add@arrows@as@needed{% - \ifx\pgf@startarrow\@empty% + \ifx\pgf@startarrow\pgf@empty% \else% \pgflowlevelobj% {\pgftransformarrow{\pgfpointsecondonpath}{\pgfpointfirstonpath}} {\pgf@startarrow}% \fi% - \ifx\pgf@endarrow\@empty% + \ifx\pgf@endarrow\pgf@empty% \else% \pgflowlevelobj% {\pgftransformarrow{\pgfpointsecondlastonpath}{\pgfpointlastonpath}} @@ -203,7 +218,7 @@ \fi% } -\let\pgf@startarrow=\@empty -\let\pgf@endarrow=\@empty +\let\pgf@startarrow=\pgf@empty +\let\pgf@endarrow=\pgf@empty \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex index 26e63666e02..e4cde74a4f8 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.5 2006/10/11 15:22:25 tantau Exp $ \newdimen\pgf@picminx \newdimen\pgf@picmaxx @@ -53,12 +57,29 @@ % % Example: % -% \pgfpathmoveto{\pgfpoint{2pt}{3cm}} +% \pgfpathmoveto{\pgfpoint{2pt+3cm}{3cm}} \def\pgfpoint#1#2{% \setlength\pgf@x{#1}% \setlength\pgf@y{#2}\ignorespaces} + +% Quickly a point +% +% #1 = x-coordinate of the point (no calculations done) +% #2 = y-coordinate of the point (no calculations done) +% +% x = #1 +% y = #2 +% +% Example: +% +% \pgfpathmoveto{\pgfqpoint{2pt}{3cm}} + +\def\pgfqpoint#1#2{\pgf@x=#1\pgf@y=#2} + + + % Return the origin. % % x = 0 @@ -283,6 +304,8 @@ % % x = x-component of start + #1*(normalise(end-start)) % y = y-component of start + #1*(normalise(end-start)) +% xa = #1*(normalise(end-start)) +% ya = #1*(normalise(end-start)) % % Example: % @@ -380,19 +403,19 @@ -% Store a value in polar-coordinates +% A polar coordinate % % #1 = a degree -% #2 = a radius +% #2 = a radius -- either a dimension or two dimensions separated by a +% slash. % -% x = #2 * cos(#1) -% y = #2 * sin(#2) +% x = (first dimension in #2) * cos(#1) +% y = (second dimension in #2) * sin(#2) % % Example: % -% % Create a slanted rectangle -% % \pgfpathmoveto{\pgfpointpolar{30}{1cm}} +% \pgfpathlineto{\pgfpointpolar{30}{1cm/2cm}} \def\pgfpointpolar#1#2{% \pgfsincos{#1}% @@ -413,6 +436,83 @@ } +% A polar coordinate in the xy plane. +% +% #1 = a degree +% #2 = a radius given as a number or two radi +% +% result = (first dim in #2) * x-vector * cos(#1) + +% (second dim in #2) * y-vector * sin(#1) +% +% Example: +% +% \pgfpathmoveto{\pgfpointpolarxy{30}{2}} + +\def\pgfpointpolarxy#1#2{% + \pgfsincos{#1}% + \in@/{#2}% + \ifin@% + \pgf@polarxy@#2\@@% + \else% + \pgf@polarxy@#2/#2\@@% + \fi% + \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@xx% + \advance\pgf@x by \pgf@sys@tonumber{\pgf@ya}\pgf@yx% + \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@xy% + \advance\pgf@y by \pgf@sys@tonumber{\pgf@ya}\pgf@yy} + +\def\pgf@polarxy@#1/#2\@@{% + \pgf@xa=#1\pgf@y% + \pgf@ya=#2\pgf@x% +} + + + +% A cylindrical coordinate. +% +% #1 = a degree +% #2 = a radius given as a number +% #3 = a height given as a number +% +% result = #2*(x-vector * cos(#1) + y-vector * sin(#1)) + #3*z-vector +% +% Example: +% +% \pgfpathmoveto{\pgfpointcylindrical{30}{2}{1}} + +\def\pgfpointcylindrical#1#2#3{% + \pgfpointpolarxy{#1}{#2}% + \advance\pgf@x by #3\pgf@zx% + \advance\pgf@y by #3\pgf@zy} + + +% A spherical coordinate. +% +% #1 = a longitude +% #2 = a latitude +% #3 = a radius +% +% result = #3*(cos(#2)*(x-vector * cos(#1) + y-vector * sin(#1)) + sin(#2)*z-vector) +% +% Example: +% +% \pgfpathmoveto{\pgfpointspherical{30}{30}{2}} + +\def\pgfpointspherical#1#2#3{% + \pgfsincos{#1}% + \pgf@xb=\pgf@sys@tonumber{\pgf@y}\pgf@xx% + \advance\pgf@xb by \pgf@sys@tonumber{\pgf@x}\pgf@yx% + \pgf@yb=\pgf@sys@tonumber{\pgf@y}\pgf@xy% + \advance\pgf@yb by \pgf@sys@tonumber{\pgf@x}\pgf@yy% + \pgfsincos{#2}% + \pgf@xc=\pgf@sys@tonumber{\pgf@y}\pgf@xb% + \advance\pgf@xc by \pgf@sys@tonumber{\pgf@x}\pgf@zx% + \pgf@yc=\pgf@sys@tonumber{\pgf@y}\pgf@yb% + \advance\pgf@yc by \pgf@sys@tonumber{\pgf@x}\pgf@zy% + \pgf@x=#3\pgf@xc% + \pgf@y=#3\pgf@yc% +} + % Store the vector #1 * x-vec + #2 * y-vec % @@ -800,7 +900,7 @@ \def\pgfextractx#1#2{% \pgf@process{#2}% - #1=1.00374\pgf@x\relax} + #1=\pgf@x\relax} % Extract the y-coordinate of a point to a dimensions @@ -816,7 +916,7 @@ \def\pgfextracty#1#2{% \pgf@process{#2}% - #1=1.00374\pgf@y\relax} + #1=\pgf@y\relax} \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex index 50c63ac22c7..84a432ceadb 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorequick.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorequick.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $ % Quick version of basic drawing commands. Most high-level commands % are not available if these commands are used. diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex index f0b862575b7..bad6e237ecb 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.12 2005/11/15 17:46:37 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.18 2006/10/11 15:22:25 tantau Exp $ % Globals @@ -12,6 +16,61 @@ \newbox\pgf@layerbox@main +\newcount\pgf@picture@serial@count + + + +% This if decides whether the position of pictures on the page is +% protocolled or not. Normally, +% this is switched off as it works only with certain drivers and it +% causes external files to be written. When switched on, the position +% of pgfpictures are protocolled and can be referenced using +% \pgfsys@getposition{XXX} where XXX is the value of \pgfpictureid +% inside the picture. +\newif\ifpgfrememberpicturepositiononpage + + + +% Library files inclusion + + +% Include a library file. +% +% #1 = List of names of library file. +% +% Description: +% +% This command includes a list of library files. For each file X in the +% list, the file pgflibraryX.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: +% +% \usepgflibrary{arrows} +% \usepgflibrary[patterns,snakes] + +\def\usepgflibrary{\pgf@ifnextchar[{\use@pgflibrary}{\use@@pgflibrary}}%} +\def\use@pgflibrary[#1]{\use@@pgflibrary{#1}} +\def\use@@pgflibrary#1{% + \edef\pgf@list{#1}% + \@for\pgf@temp:=\pgf@list\do{% + \expandafter\ifx\csname pgf@library@\pgf@temp @loaded\endcsname\relax% + \expandafter\let\csname pgf@library@\pgf@temp @loaded\endcsname=\pgf@empty% + \expandafter\edef\csname pgf@library@#1@atcode\endcsname{\the\catcode`\@} + \expandafter\edef\csname pgf@library@#1@barcode\endcsname{\the\catcode`\|} + \catcode`\@=11 + \catcode`\|=12 + \input pgflibrary\pgf@temp.code.tex + \catcode`\@=\csname pgf@library@#1@atcode\endcsname + \catcode`\|=\csname pgf@library@#1@barcode\endcsname + \fi% + }% +} + + % Scopes @@ -27,7 +86,7 @@ % \end{pgfscope} \def\pgfscope{% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \pgfsys@beginscope% \pgf@resetpathsizes% \edef\pgfscope@linewidth{\the\pgflinewidth}% @@ -86,7 +145,7 @@ % \pgftransformshift{\pgfpoint{1cm}{0cm}} % \pgftext{Hello World!} -\def\pgftext{\@ifnextchar[\pgf@text{\pgf@text[]}}% +\def\pgftext{\pgf@ifnextchar[\pgf@text{\pgf@text[]}}% \def\pgf@text[#1]{% \def\pgf@text@options{#1}% \pgf@maketext\pgf@after@text} @@ -141,7 +200,7 @@ \let\next=% } \def\pgf@collectresetcolor{% - \@ifnextchar\reset@color% + \pgf@ifnextchar\reset@color% {\reset@color\afterassignment\pgf@collectresetcolor\let\pgf@temp=}% {\pgf@textdone}% } @@ -157,7 +216,6 @@ #1% \endpgfinterruptpicture% }}} - @@ -176,14 +234,16 @@ \def\pgfpicture{% \begingroup% - \pgfpicturetrue% - \pgf@picmaxx=-16000pt\relax% - \pgf@picminx=16000pt\relax% - \pgf@picmaxy=-16000pt\relax% - \pgf@picminy=16000pt\relax% - \pgf@relevantforpicturesizetrue% - \pgf@resetpathsizes% - \@ifnextchar\bgroup\pgf@oldpicture\pgf@picture} + \pgfpicturetrue% + \global\advance\pgf@picture@serial@count by1\relax% + \edef\pgfpictureid{pgfid@\the\pgf@picture@serial@count}% + \pgf@picmaxx=-16000pt\relax% + \pgf@picminx=16000pt\relax% + \pgf@picmaxy=-16000pt\relax% + \pgf@picminy=16000pt\relax% + \pgf@relevantforpicturesizetrue% + \pgf@resetpathsizes% + \pgf@ifnextchar\bgroup\pgf@oldpicture\pgf@picture} \def\pgf@oldpicture#1#2#3#4{% \setlength\pgf@picminx{#1}% \setlength\pgf@picminy{#2}% @@ -198,10 +258,10 @@ \pgfsys@beginpicture% \pgfsys@beginscope% \begingroup% - \color{.}% + \pgfsetcolor{.}% \pgfsetlinewidth{0.4pt}% \pgftransformreset% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \begingroup% \let\pgf@setlengthorig=\setlength% \let\pgf@addtolengthorig=\addtolength% @@ -214,8 +274,21 @@ \begingroup% } \def\endpgfpicture{% + \ifpgfrememberpicturepositiononpage% + \hbox to0pt{\pgfsys@markposition{\pgfpictureid}}% + \fi% + % ok, now let's position the box + \ifdim\pgf@picmaxx=-16000pt\relax% + % empty picture. make size 0. + \global\pgf@picmaxx=0pt\relax% + \global\pgf@picminx=0pt\relax% + \global\pgf@picmaxy=0pt\relax% + \global\pgf@picminy=0pt\relax% + \fi% % Shift baseline outside: - \global\let\pgf@shift@baseline=\pgf@baseline% + \pgf@relevantforpicturesizefalse% + \pgf@process{\pgf@baseline}% + \gdef\pgf@shift@baseline{\the\pgf@y}% \endgroup% \hss% \egroup% @@ -228,14 +301,6 @@ \endgroup% \hss \egroup% - % ok, now let's position the box - \ifdim\pgf@picmaxx=-16000pt\relax% - % empty picture. make size 0. - \pgf@picmaxx=0pt\relax% - \pgf@picminx=0pt\relax% - \pgf@picmaxy=0pt\relax% - \pgf@picminy=0pt\relax% - \fi% \pgfsys@typesetpicturebox\pgfpic% \endgroup% } @@ -245,6 +310,41 @@ } + + +% Sets the baseline at the y-coordinate of a given point +% +% #1 = point +% +% Sets the baseline of the picture to the y-coordinate of a given +% point. However, the point will be evaluated *at the end of the +% picture*. +% +% Example: +% +% \pgfsetbaselinepointlater{\pgfpointanchor{mynode}{base}} + +\def\pgfsetbaselinepointlater#1{\def\pgf@baseline{#1}} + + +% Sets the baseline at the y-coordinate of a given point, now +% +% #1 = point +% +% Sets the baseline of the picture to the y-coordinate of a given +% point. +% +% Example: +% +% \pgfsetbaselinepointnow{\pgfpoint{1cm}{2pt}} + +\def\pgfsetbaselinepointnow#1{% + \pgf@process{#1}% + \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% + \pgfsetbaselinepointlater{\pgf@setter@baseline}% +} + + % Sets the baseline % % #1 = baseline @@ -256,13 +356,12 @@ % % \pgfsetbaseline{1cm+2pt} -\def\pgfsetbaseline#1{\def\pgf@baseline{#1}} +\def\pgfsetbaseline#1{\pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}} \pgfsetbaseline{\pgf@picminy} - % Interrupt path % % Description: @@ -291,7 +390,7 @@ \edef\pgf@interrupt@savey{\the\pgf@path@lasty}% \pgf@getpathsizes\pgf@interrupt@pathsizes% \pgfsyssoftpath@getcurrentpath\pgf@interrupt@path% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \edef\pgfscope@linewidth{\the\pgflinewidth}% \let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto% \begingroup% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex index 707c1708789..2eebc7d6035 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.3 2005/07/17 22:34:19 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.6 2006/10/11 15:22:25 tantau Exp $ % % Parsing functions @@ -17,16 +20,16 @@ \edef\temp{{\pgf@rgbconv}}% \expandafter\pgf@@parsefunc\temp} \def\pgf@@parsefunc#1{% - \let\pgf@bounds=\@empty% - \let\pgf@funcs=\@empty% - \let\pgf@psfuncs=\@empty% - \let\pgf@encode=\@empty% - \let\pgf@sys@shading@ranges=\@empty% + \let\pgf@bounds=\pgf@empty% + \let\pgf@funcs=\pgf@empty% + \let\pgf@psfuncs=\pgf@empty% + \let\pgf@encode=\pgf@empty% + \let\pgf@sys@shading@ranges=\pgf@empty% \pgf@sys@shading@range@num=0\relax% \pgf@parsefirst[#1; ]% \pgf@parselastdom[#1; ]% \pgf@parsemid[#1; ]% - \ifx\pgf@bounds\@empty% + \ifx\pgf@bounds\pgf@empty% \edef\pgf@pdfparseddomain{0 1}% \edef\pgf@pdfparsedfunction{\pgf@singlefunc\space}% \else% @@ -51,7 +54,7 @@ \edef\pgf@prevcolor{\pgf@rgb}% \edef\pgf@firstcolor{\pgf@rgb}} \def\pgf@parselastdom[rgb(#1)=(#2,#3,#4); {% - \@ifnextchar]{% + \pgf@ifnextchar]{% \setlength\pgf@x{#1}% \edef\pgf@sys@shading@end@pos{\the\pgf@x}% \pgf@max=\pgf@x\relax% @@ -59,11 +62,11 @@ \edef\pgf@domb{\pgf@sys@tonumber{\pgf@x}}% \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% \edef\pgf@sys@shading@end@rgb{\pgf@sys@rgb}% - \@gobble}{\pgf@parselastdom[}} + \pgf@gobble}{\pgf@parselastdom[}} \def\pgf@parsemid[rgb(#1)=(#2,#3,#4); {\pgf@parserest[} \def\pgf@parserest[rgb(#1)=(#2,#3,#4); {% \advance\pgf@sys@shading@range@num by1\relax% - \@ifnextchar]{% + \pgf@ifnextchar]{% \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% \edef\pgf@singlefunc{\space% << /FunctionType 2 /Domain [0 1] /C0 @@ -76,7 +79,7 @@ \edef\pgf@sys@shading@ranges{\pgf@sys@shading@ranges{{\pgf@sys@prevpos}{\the\pgf@x}{\pgf@sys@prevcolor}{\pgf@sys@rgb}}}% \edef\pgf@sys@prevpos{\the\pgf@x}% \let\pgf@sys@prevcolor=\pgf@sys@rgb% - \@gobble}{% + \pgf@gobble}{% \setlength\pgf@x{#1}% \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% \edef\pgf@sys@shading@ranges{\pgf@sys@shading@ranges{{\pgf@sys@prevpos}{\the\pgf@x}{\pgf@sys@prevcolor}{\pgf@sys@rgb}}}% @@ -98,7 +101,7 @@ \def\pgf@getrgbtuplewithmixin#1#2#3{% \definecolor{pgfshadetemp}{rgb}{#1,#2,#3}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}% \extractcolorspec{pgfshadetemp}{\pgf@tempcolor}% \expandafter\convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% \expandafter\pgf@getrgb@@\pgf@rgbcolor!} @@ -113,15 +116,15 @@ \pgf@converttorgb#1]% } \def\pgf@converttorgb{% - \@ifnextchar]{\@gobble}%done! + \pgf@ifnextchar]{\pgf@gobble}%done! {% - \@ifnextchar;{\pgf@grabsemicolor}% + \pgf@ifnextchar;{\pgf@grabsemicolor}% {% - \@ifnextchar r{\pgf@grabrgb}% + \pgf@ifnextchar r{\pgf@grabrgb}% {% - \@ifnextchar g{\pgf@grabgray}% + \pgf@ifnextchar g{\pgf@grabgray}% {% - \@ifnextchar c{\pgf@grabcolor}% + \pgf@ifnextchar c{\pgf@grabcolor}% {\PackageError{pgfshade}{Illformed shading specification}{}\pgf@converttorgb}% }% @@ -171,15 +174,15 @@ % The following bar is 2cm long: \pgfuseshading{redtogreentoblue}. % \end{document} -\def\pgfdeclarehorizontalshading{\@ifnextchar[\pgf@declarehorizontalshading{\pgf@declarehorizontalshading[]}}% +\def\pgfdeclarehorizontalshading{\pgf@ifnextchar[\pgf@declarehorizontalshading{\pgf@declarehorizontalshading[]}}% \def\pgf@declarehorizontalshading[#1]#2#3#4{% \expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}% - \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\@empty% + \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgf@empty% \pgfsys@horishading{#2}{#3}{#4}% \else% \expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@horishading}% \expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}% - \expandafter\let\csname @pgfshading#2!\endcsname=\@empty% + \expandafter\let\csname @pgfshading#2!\endcsname=\pgf@empty% \fi} @@ -200,15 +203,15 @@ % The following bar is 2cm high: \pgfuseshading{redtogreentoblue}. % \end{document} -\def\pgfdeclareverticalshading{\@ifnextchar[\pgf@declareverticalshading{\pgf@declareverticalshading[]}}% +\def\pgfdeclareverticalshading{\pgf@ifnextchar[\pgf@declareverticalshading{\pgf@declareverticalshading[]}}% \def\pgf@declareverticalshading[#1]#2#3#4{% \expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}% - \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\@empty% + \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgf@empty% \pgfsys@vertshading{#2}{#3}{#4}% \else% \expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@vertshading}% \expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}% - \expandafter\let\csname @pgfshading#2!\endcsname=\@empty% + \expandafter\let\csname @pgfshading#2!\endcsname=\pgf@empty% \fi} @@ -242,15 +245,15 @@ % The following ball has diameter 3cm: \pgfuseshading{redtogreentoblue}. % \end{document} -\def\pgfdeclareradialshading{\@ifnextchar[\pgf@declareradialshading{\pgf@declareradialshading[]}}% +\def\pgfdeclareradialshading{\pgf@ifnextchar[\pgf@declareradialshading{\pgf@declareradialshading[]}}% \def\pgf@declareradialshading[#1]#2#3#4{% \expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}% - \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\@empty% + \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgf@empty% \pgfsys@radialshading{#2}{#3}{#4}% \else% \expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@radialshading}% \expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}% - \expandafter\let\csname @pgfshading#2!\endcsname=\@empty% + \expandafter\let\csname @pgfshading#2!\endcsname=\pgf@empty% \fi} @@ -266,19 +269,19 @@ \def\pgfuseshading#1{% \edef\pgf@shadingname{@pgfshading#1}% \pgf@tryextensions{\pgf@shadingname}{\pgfalternateextension}% - \expandafter\@ifundefined\expandafter{\pgf@shadingname}% + \expandafter\pgf@ifundefined\expandafter{\pgf@shadingname}% {\PackageError{pgfshade}{Undefined shading "#1"}{}}% {% {% \globalcolorsfalse% \def\pgf@shade@adds{}% - \@ifundefined{pgf@deps\pgf@shadingname}% + \pgf@ifundefined{pgf@deps\pgf@shadingname}% {}% {% \edef\@list{\csname pgf@deps\pgf@shadingname\endcsname}% \@for\@temp:=\@list\do{% {% - \@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}% \extractcolorspec{\@temp}{\pgf@tempcolor}% \expandafter\convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% \xdef\pgf@shade@adds{\pgf@shade@adds,\pgf@rgbcolor}% @@ -286,7 +289,7 @@ }% }% \expandafter\pgf@strip@shadename\pgf@shadingname!!% - \@ifundefined{@pgfshading\pgf@basename\pgf@shade@adds!}% + \pgf@ifundefined{@pgfshading\pgf@basename\pgf@shade@adds!}% {% {% \expandafter\def\expandafter\@temp\expandafter{\csname pgf@func\pgf@shadingname\endcsname}% @@ -352,6 +355,9 @@ % completely covers the path. Then the path will be used (locally) for % clipping and the shading is drawn. % +% In addition to the rotation, any transformation set by the +%\pgfsetadditionalshadetransform will also be applied. +% % After all this, the path can still be used for the normal % stroking/clipping operations. % @@ -400,10 +406,31 @@ \pgfsys@transformcm% {\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@x}}% {\pgf@sys@tonumber{\pgf@xa}}{\pgf@sys@tonumber{\pgf@y}}{0pt}{0pt}% + \ifx\pgf@shade@extra@transform\pgf@empty% + \else% + \pgflowlevel{\pgf@shade@extra@transform}% + \fi% \pgfuseshading{#1}% \pgfsys@endscope% \endgroup% \fi% } + +% Additionally transform shade paths +% +% #1 = Transformation code that is used in addition to the normal +% shading transformation. +% +% Example: +% +% \pgfsetadditionalshadetransform{\pgftransformrotate{30}} + +\def\pgfsetadditionalshadetransform#1{\def\pgf@shade@extra@transform{#1}} +\let\pgf@shade@extra@transform=\pgf@empty + + + + + \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex index b9c1e51cff0..54eff0c9c0e 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % Position transformations @@ -233,6 +236,37 @@ +% Transformation into a given triangle. The three corners of the +% triangle are called "origin", "x" and "y" are given. After this +% transformation has been applied, the canvas origin is at "origin", +% the vector (1pt,0pt) lies at "x" and the vector (0pt,1pt) lies at +% "y". +% +% #1 = origin +% #2 = x +% #3 = y +% +% Example: +% +% \pgftransformtriangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}{\pgfpoint{-1cm}{1cm}} + +\def\pgftransformtriangle#1#2#3{% + \pgf@process{#2}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#3}% + \pgf@xb=\pgf@x% + \pgf@yb=\pgf@y% + \pgf@process{#1}% + \advance\pgf@xa by-\pgf@x% + \advance\pgf@ya by-\pgf@y% + \advance\pgf@xb by-\pgf@x% + \advance\pgf@yb by-\pgf@y% + \pgftransformcm% + {\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@ya}% + {\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@yb}% + {\pgfpoint{\pgf@x}{\pgf@y}}% +} @@ -333,12 +367,16 @@ -% The following two if's have the following effect: +% The following if's have the following effect: % % \ifpgfslopedattime decides whether the coordinate system of an % xxxattime transformation command should be rotated such that text % drawn on the line should be tangent to the line % +% \ifpgfallowupsidedowattime decides whether the transformation should +% be done in such a way that the text is always ``upright,'' that is, +% text drawn in this coordiante system is never upside-down. +% % \ifpgfresetnontranslationattime decides whether the coordinate % system of an xxxattime transformation command should be reset % (concerning the non-translations) before a possible rotation is @@ -347,6 +385,7 @@ % to the text, but you do want the rotation to applyu. \newif\ifpgfslopedattime +\newif\ifpgfallowupsidedownattime \newif\ifpgfresetnontranslationattime @@ -382,9 +421,12 @@ \pgf@process{#3}% \advance\pgf@x by-\pgf@xa% \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x<0pt% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% + \ifpgfallowupsidedownattime% + \else% + \ifdim\pgf@x<0pt% + \pgf@x=-\pgf@x% + \pgf@y=-\pgf@y% + \fi% \fi% \pgfpointnormalised{}% x/y = normalised vector \pgf@ya=-\pgf@y% @@ -426,13 +468,16 @@ \pgftransformresetnontranslations% \fi% \ifpgfslopedattime% - \pgf@x=\pgf@xb% - \pgf@y=\pgf@yb% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x<0pt% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% + \pgf@x=\pgf@xa% + \pgf@y=\pgf@ya% + \advance\pgf@x by-\pgf@xb% + \advance\pgf@y by-\pgf@yb% + \ifpgfallowupsidedownattime% + \else% + \ifdim\pgf@x<0pt% + \pgf@x=-\pgf@x% + \pgf@y=-\pgf@y% + \fi% \fi% \pgfpointnormalised{}% x/y = normalised vector \pgf@ya=-\pgf@y% diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex index 8541b57607a..ceeaaacb863 100644 --- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex @@ -1,10 +1,22 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz.code.tex,v 1.35 2005/11/09 15:49:25 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.code.tex,v 1.65 2006/10/11 15:22:25 tantau Exp $ + + +% Always-present libraries: + +\usepgflibrary{plothandlers} + +\let\tikz@orig@setkeys=\setkeys % guard against changes, later +\let\tikz@orig@define@key=\define@key \newdimen\tikz@lastx \newdimen\tikz@lasty @@ -26,8 +38,7 @@ \newif\iftikz@node@is@a@label \newif\iftikz@snaked -\let\tikz@options=\@empty -\let\tikz@transform=\relax +\let\tikz@options=\pgf@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{% @@ -40,30 +51,38 @@ +% TikZ options: + +\def\tikzoption{\tikz@orig@define@key{tikz}} + + + % Baseline options -\define@key{tikz}{baseline}[0pt]{\pgfsetbaseline{#1}}% +\tikzoption{baseline}[0pt]{\pgf@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\@firstofone#1}} % Draw options -\define@key{tikz}{line width}{\tikz@semiaddlinewidth{#1}}% +\tikzoption{line width}{\tikz@semiaddlinewidth{#1}}% \def\tikz@semiaddlinewidth#1{\tikz@addoption{\pgfsetlinewidth{#1}}\setlength\pgflinewidth{#1}} -\define@key{tikz}{cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}} -\define@key{tikz}{join}{\tikz@addoption{\csname pgfset#1join\endcsname}} -\define@key{tikz}{miter limit}{\tikz@addoption{\pgfsetmiterlimit{#1}}} +\tikzoption{cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}} +\tikzoption{join}{\tikz@addoption{\csname pgfset#1join\endcsname}} +\tikzoption{miter limit}{\tikz@addoption{\pgfsetmiterlimit{#1}}} -\define@key{tikz}{dash pattern}{% syntax: on 2pt off 3pt on 4pt ... +\tikzoption{dash pattern}{% syntax: on 2pt off 3pt on 4pt ... \def\tikz@temp{#1}% - \ifx\tikz@temp\@empty% + \ifx\tikz@temp\pgf@empty% \def\tikz@dashpattern{}% \tikz@addoption{\pgfsetdash{}{0pt}}% \else% \def\tikz@dashpattern{}% - \expandafter\tikz@scandashon\@gobble#1o\@nil% + \expandafter\tikz@scandashon\pgf@gobble#1o\@nil% \edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}% \expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}% \fi} -\define@key{tikz}{dash phase}{% +\tikzoption{dash phase}{% \def\tikz@dashphase{#1}% \edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}% \expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}% @@ -72,22 +91,26 @@ \def\tikz@scandashon n#1o{% \expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}% - \@ifnextchar\@nil{\@gobble}{\tikz@scandashoff}} + \pgf@ifnextchar\@nil{\pgf@gobble}{\tikz@scandashoff}} \def\tikz@scandashoff ff#1o{% \expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}% - \@ifnextchar\@nil{\@gobble}{\tikz@scandashon}} + \pgf@ifnextchar\@nil{\pgf@gobble}{\tikz@scandashon}} -\define@key{tikz}{draw opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}}} +\tikzoption{draw opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}}} % Double draw options -\define@key{tikz}{double}[]{% +\tikzoption{double}[]{% \def\tikz@temp{#1}% - \ifx\tikz@temp\@empty% + \ifx\tikz@temp\tikz@nonetext% + \tikz@addmode{\tikz@mode@doublefalse}% \else% - \def\tikz@double@color{#1}% - \fi% - \tikz@addmode{\tikz@mode@doubletrue}} -\define@key{tikz}{double distance}{% + \ifx\tikz@temp\pgf@empty% + \else% + \def\tikz@double@color{#1}% + \fi% + \tikz@addmode{\tikz@mode@doubletrue}% + \fi} +\tikzoption{double distance}{% \setlength{\pgf@x}{#1}% \edef\tikz@double@width@distance{\the\pgf@x}% \tikz@addmode{\tikz@mode@doubletrue}} @@ -97,51 +120,53 @@ % Fill options -\define@key{tikz}{even odd rule}[]{\tikz@addoption{\pgfseteorule}} -\define@key{tikz}{nonzero rule}[]{\tikz@addoption{\pgfsetnonzerorule}} +\tikzoption{even odd rule}[]{\tikz@addoption{\pgfseteorule}} +\tikzoption{nonzero rule}[]{\tikz@addoption{\pgfsetnonzerorule}} -\define@key{tikz}{fill opacity}{\tikz@addoption{\pgfsetfillopacity{#1}}} +\tikzoption{fill opacity}{\tikz@addoption{\pgfsetfillopacity{#1}}} % Joined fill/draw options -\define@key{tikz}{opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}\pgfsetfillopacity{#1}}} +\tikzoption{opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}\pgfsetfillopacity{#1}}} % Main color options -\define@key{tikz}{color}{% +\tikzoption{color}{% \tikz@addoption{% - \ifx\tikz@fillcolor\@empty% - \ifx\tikz@strokecolor\@empty% + \ifx\tikz@fillcolor\pgf@empty% + \ifx\tikz@strokecolor\pgf@empty% \else% \pgfsys@color@reset@inorderfalse% - \let\tikz@strokecolor\@empty% - \let\tikz@fillcolor\@empty% + \let\tikz@strokecolor\pgf@empty% + \let\tikz@fillcolor\pgf@empty% \fi% \else% \pgfsys@color@reset@inorderfalse% - \let\tikz@strokecolor\@empty% - \let\tikz@fillcolor\@empty% + \let\tikz@strokecolor\pgf@empty% + \let\tikz@fillcolor\pgf@empty% \fi% \colorlet{tikz@color}{#1}% - \color{tikz@color}% + \colorlet{.}{tikz@color}% + \pgfsetcolor{.}% \pgfsys@color@reset@inordertrue% }% \def\tikz@textcolor{#1}} + % Rounding options -\define@key{tikz}{rounded corners}[4pt]{\pgfsetcornersarced{\pgfpoint{#1}{#1}}} -\define@key{tikz}{sharp corners}[]{\pgfsetcornersarced{\pgfpointorigin}} +\tikzoption{rounded corners}[4pt]{\pgfsetcornersarced{\pgfpoint{#1}{#1}}} +\tikzoption{sharp corners}[]{\pgfsetcornersarced{\pgfpointorigin}} % Coordinate options -\define@key{tikz}{x}{\tikz@handle@vec{\pgfsetxvec}{\tikz@handle@x}#1\relax} -\define@key{tikz}{y}{\tikz@handle@vec{\pgfsetyvec}{\tikz@handle@y}#1\relax} -\define@key{tikz}{z}{\tikz@handle@vec{\pgfsetzvec}{\tikz@handle@z}#1\relax} +\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{\@ifnextchar({\tikz@handle@coordinate#1}{\tikz@handle@single#2}} +\def\tikz@handle@vec#1#2{\pgf@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}}} @@ -150,13 +175,13 @@ % Transformation options -\define@key{tikz}{scale}{\tikz@addtransform{\pgftransformscale{#1}}} -\define@key{tikz}{xscale}{\tikz@addtransform{\pgftransformxscale{#1}}} -\define@key{tikz}{xslant}{\tikz@addtransform{\pgftransformxslant{#1}}} -\define@key{tikz}{yscale}{\tikz@addtransform{\pgftransformyscale{#1}}} -\define@key{tikz}{yslant}{\tikz@addtransform{\pgftransformyslant{#1}}} -\define@key{tikz}{rotate}{\tikz@addtransform{\pgftransformrotate{#1}}} -\define@key{tikz}{rotate around}{\tikz@addtransform{\tikz@rotatearound{#1}}} +\tikzoption{scale}{\tikz@addtransform{\pgftransformscale{#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{\tikz@rotatearound{#1}}} \def\tikz@rotatearound#1{% \edef\tikz@temp{#1}% get rid of active stuff \expandafter\tikz@rotateparseA\tikz@temp% @@ -169,16 +194,16 @@ \pgf@process{#1}% \pgf@xc=\pgf@x% \pgf@yc=\pgf@y% - \pgftransformshift{\pgfpoint{\pgf@xc}{\pgf@yc}}% + \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}% \pgftransformrotate{\tikz@temp@rot}% - \pgftransformshift{\pgfpoint{-\pgf@xc}{-\pgf@yc}}% + \pgftransformshift{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}% } -\define@key{tikz}{shift}{\tikz@addtransform{\tikz@scan@one@point\pgftransformshift#1\relax}} -\define@key{tikz}{xshift}{\tikz@addtransform{\pgftransformxshift{#1}}} -\define@key{tikz}{yshift}{\tikz@addtransform{\pgftransformyshift{#1}}} -\define@key{tikz}{cm}{\tikz@addtransform{\tikz@parse@cm#1\relax}} -\define@key{tikz}{reset cm}{\tikz@addtransform{\pgftransformreset}} +\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}} \def\tikz@parse@cm#1,#2,#3,#4,{% \def\tikz@p@cm{{#1}{#2}{#3}{#4}}% @@ -190,9 +215,11 @@ % Grid options -\define@key{tikz}{xstep}{\def\tikz@grid@x{#1}} -\define@key{tikz}{ystep}{\def\tikz@grid@y{#1}} -\define@key{tikz}{step}{\def\tikz@grid@x{#1}\def\tikz@grid@y{#1}} +\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} @@ -205,18 +232,18 @@ \newif\iftikz@mode@clip \newif\iftikz@mode@boundary \newif\iftikz@mode@shade -\let\tikz@mode=\@empty +\let\tikz@mode=\pgf@empty \def\tikz@nonetext{none} -\define@key{tikz}{path only}[]{\let\tikz@mode=\@empty} -\define@key{tikz}{shade}[]{\tikz@addmode{\tikz@mode@shadetrue}} -\define@key{tikz}{fill}[]{% +\tikzoption{path only}[]{\let\tikz@mode=\pgf@empty} +\tikzoption{shade}[]{\tikz@addmode{\tikz@mode@shadetrue}} +\tikzoption{fill}[]{% \def\tikz@temp{#1}% \ifx\tikz@temp\tikz@nonetext% \tikz@addmode{\tikz@mode@fillfalse}% \else% - \ifx\tikz@temp\@empty% + \ifx\tikz@temp\pgf@empty% \else% \tikz@addoption{\pgfsetfillcolor{#1}}% \def\tikz@fillcolor{#1}% @@ -224,12 +251,12 @@ \tikz@addmode{\tikz@mode@filltrue}% \fi% } -\define@key{tikz}{draw}[]{% +\tikzoption{draw}[]{% \def\tikz@temp{#1}% \ifx\tikz@temp\tikz@nonetext% \tikz@addmode{\tikz@mode@drawfalse}% \else% - \ifx\tikz@temp\@empty% + \ifx\tikz@temp\pgf@empty% \else% \tikz@addoption{\pgfsetstrokecolor{#1}}% \def\tikz@strokecolor{#1}% @@ -237,40 +264,59 @@ \tikz@addmode{\tikz@mode@drawtrue}% \fi% } -\define@key{tikz}{clip}[]{\tikz@addmode{\tikz@mode@cliptrue}} -\define@key{tikz}{use as bounding box}[]{\tikz@addmode{\tikz@mode@boundarytrue}} +\tikzoption{clip}[]{\tikz@addmode{\tikz@mode@cliptrue}} +\tikzoption{use as bounding box}[]{\tikz@addmode{\tikz@mode@boundarytrue}} -\define@key{tikz}{save path}{\tikz@addmode{\pgfsyssoftpath@getcurrentpath#1\global\let#1=#1}} +\tikzoption{save path}{\tikz@addmode{\pgfsyssoftpath@getcurrentpath#1\global\let#1=#1}} -\let\tikz@fillcolor=\@empty -\let\tikz@strokecolor=\@empty +\let\tikz@fillcolor=\pgf@empty +\let\tikz@strokecolor=\pgf@empty + + +% Pattern options +\tikzoption{pattern color}{\def\tikz@pattern@color{#1}} +\tikzoption{pattern}[]{% + \def\tikz@temp{#1}% + \ifx\tikz@temp\tikz@nonetext% + \tikz@addmode{\tikz@mode@fillfalse}% + \else% + \ifx\tikz@temp\pgf@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} % Shading options -\define@key{tikz}{shading}{\def\tikz@shading{#1}\tikz@addmode{\tikz@mode@shadetrue}} -\define@key{tikz}{shading angle}{\def\tikz@shade@angle{#1}\tikz@addmode{\tikz@mode@shadetrue}} -\define@key{tikz}{top color}{% +\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}{% \colorlet{tikz@axis@top}{#1}% \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}} -\define@key{tikz}{bottom color}{% +\tikzoption{bottom color}{% \colorlet{tikz@axis@bottom}{#1}% \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}} -\define@key{tikz}{middle color}{% +\tikzoption{middle color}{% \colorlet{tikz@axis@middle}{#1}% \def\tikz@shading{axis}\tikz@addmode{\tikz@mode@shadetrue}} -\define@key{tikz}{left color}{% +\tikzoption{left color}{% \colorlet{tikz@axis@top}{#1}% \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}} -\define@key{tikz}{right color}{% +\tikzoption{right color}{% \colorlet{tikz@axis@bottom}{#1}% \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}} -\define@key{tikz}{ball color}{\colorlet{tikz@ball}{#1}\def\tikz@shading{ball}\tikz@addmode{\tikz@mode@shadetrue}} -\define@key{tikz}{inner color}{\colorlet{tikz@radial@inner}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}} -\define@key{tikz}{outer color}{\colorlet{tikz@radial@outer}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}} +\tikzoption{ball color}{\colorlet{tikz@ball}{#1}\def\tikz@shading{ball}\tikz@addmode{\tikz@mode@shadetrue}} +\tikzoption{inner color}{\colorlet{tikz@radial@inner}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}} +\tikzoption{outer color}{\colorlet{tikz@radial@outer}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}} \def\tikz@shading{axis} \def\tikz@shade@angle{0} @@ -286,7 +332,7 @@ \colorlet{tikz@axis@middle}{gray!50!white} \colorlet{tikz@axis@bottom}{white} -\pgfdeclareradialshading[tikz@ball]{ball}{\pgfpoint{-10bp}{10bp}}{% +\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); @@ -304,46 +350,170 @@ \colorlet{tikz@radial@outer}{white} +% Pin options +\tikzoption{pin}{\pgf@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 + \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}{\pgf@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 shape options -\define@key{tikz}{name}{\edef\tikz@fig@name{#1}} +\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}}% -\define@key{tikz}{shape}{\edef\tikz@shape{#1}} +\tikzoption{shape}{\edef\tikz@shape{#1}} -\define@key{tikz}{inner sep}{\def\pgfshapeinnerxsep{#1}\def\pgfshapeinnerysep{#1}} -\define@key{tikz}{inner xsep}{\def\pgfshapeinnerxsep{#1}} -\define@key{tikz}{inner ysep}{\def\pgfshapeinnerysep{#1}} +\tikzoption{inner sep}{\def\pgfshapeinnerxsep{#1}\def\pgfshapeinnerysep{#1}} +\tikzoption{inner xsep}{\def\pgfshapeinnerxsep{#1}} +\tikzoption{inner ysep}{\def\pgfshapeinnerysep{#1}} -\define@key{tikz}{outer sep}{\def\pgfshapeouterxsep{#1}\def\pgfshapeouterysep{#1}} -\define@key{tikz}{outer xsep}{\def\pgfshapeouterxsep{#1}} -\define@key{tikz}{outer ysep}{\def\pgfshapeouterysep{#1}} +\tikzoption{outer sep}{\def\pgfshapeouterxsep{#1}\def\pgfshapeouterysep{#1}} +\tikzoption{outer xsep}{\def\pgfshapeouterxsep{#1}} +\tikzoption{outer ysep}{\def\pgfshapeouterysep{#1}} -\define@key{tikz}{minimum width}{\def\pgfshapeminwidth{#1}} -\define@key{tikz}{minimum height}{\def\pgfshapeminheight{#1}} -\define@key{tikz}{minimum size}{\def\pgfshapeminwidth{#1}\def\pgfshapeminheight{#1}} +\tikzoption{minimum width}{\def\pgfshapeminwidth{#1}} +\tikzoption{minimum height}{\def\pgfshapeminheight{#1}} +\tikzoption{minimum size}{\def\pgfshapeminwidth{#1}\def\pgfshapeminheight{#1}} -\define@key{tikz}{anchor}{\def\tikz@anchor{#1}} +\tikzoption{aspect}{\pgfsetshapeaspect{#1}} -\define@key{tikz}{left}[]{\def\tikz@anchor{east}\tikz@possibly@transform{x}{-}{#1}} -\define@key{tikz}{right}[]{\def\tikz@anchor{west}\tikz@possibly@transform{x}{}{#1}} -\define@key{tikz}{above}[]{\def\tikz@anchor{south}\tikz@possibly@transform{y}{}{#1}} -\define@key{tikz}{below}[]{\def\tikz@anchor{north}\tikz@possibly@transform{y}{-}{#1}} -\define@key{tikz}{above left}[]% +\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=\pgf@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}} -\define@key{tikz}{above right}[]% +\tikzoption{above right}[]% {\def\tikz@anchor{south west}% \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{}{#1}} -\define@key{tikz}{below left}[]% +\tikzoption{below left}[]% {\def\tikz@anchor{north east}% \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{-}{#1}} -\define@key{tikz}{below right}[]% +\tikzoption{below right}[]% {\def\tikz@anchor{north west}% \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{-}{#1}} -\define@key{tikz}{transform shape}[true]{% +\tikzoption{node distance}{\def\tikz@node@distance{#1}} +\def\tikz@node@distance{1cm} + +\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{\pgftransformshift{\pgfpointpolar{#2}{\tikz@node@distance}}}% + \def\tikz@node@at{\pgfpointanchor{#1}{center}}} + +\tikzoption{transform shape}[true]{% \csname tikz@fullytransformed#1\endcsname% \iftikz@fullytransformed% \pgfresetnontranslationattimefalse% @@ -359,8 +529,9 @@ \def\tikz@shape{rectangle}% \def\tikz@possibly@transform#1#2#3{% + \let\tikz@do@auto@anchor=\relax% \def\tikz@test{#3}% - \ifx\tikz@test\@empty% + \ifx\tikz@test\pgf@empty% \else% \setlength{\pgf@x}{#3}% \pgf@x=#2\pgf@x\relax% @@ -371,45 +542,78 @@ } +% Inter-picture options +\tikzoption{remember picture}[true]{\csname pgfrememberpicturepositiononpage#1\endcsname} +\tikzoption{overlay}[]{\pgf@relevantforpicturesizefalse} + + + % Line/curve label placement options -\define@key{tikz}{sloped}[true]{\csname pgfslopedattime#1\endcsname} +\tikzoption{sloped}[true]{\csname pgfslopedattime#1\endcsname} +\tikzoption{allow upside down}[true]{\csname pgfallowupsidedownattime#1\endcsname} -\define@key{tikz}{pos}{\edef\tikz@time{#1}} +\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 -\define@key{tikz}{text}{\def\tikz@textcolor{#1}} -\define@key{tikz}{font}{\def\tikz@textfont{#1}} -\define@key{tikz}{text opacity}{\def\tikz@textopacity{#1}} -\define@key{tikz}{text width}{\def\tikz@text@width{#1}} -\define@key{tikz}{text ragged}[]% +\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}} -\define@key{tikz}{text badly ragged}[]{\def\tikz@text@action{\raggedright\relax}} -\define@key{tikz}{text ragged left}[]% +\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}} -\define@key{tikz}{text badly ragged left}[]{\def\tikz@text@action{\raggedleft\relax}} -\define@key{tikz}{text justified}[]{\def\tikz@text@action{\leftskip\z@\rightskip\z@\relax}} -\define@key{tikz}{text centered}[]{\def\tikz@text@action{% +\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}} -\define@key{tikz}{text badly centered}[]% +\tikzoption{text badly centered}[]% {\def\tikz@text@action{% \let\\=\@centercr% for latex \parfillskip=0pt% \rightskip\@flushglue% \leftskip\@flushglue\relax}} -\let\tikz@text@width=\@empty -\let\tikz@textcolor=\@empty -\let\tikz@textfont=\@empty -\let\tikz@textopacity=\@empty +\let\tikz@text@width=\pgf@empty +\let\tikz@text@height=\pgf@empty +\let\tikz@text@depth=\pgf@empty +\let\tikz@textcolor=\pgf@empty +\let\tikz@textfont=\pgf@empty +\let\tikz@textopacity=\pgf@empty \def\tikz@text@action{\raggedright\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax} @@ -418,18 +622,18 @@ % Arrow options -\define@key{tikz}{arrows}{\tikz@processarrows{#1}} +\tikzoption{arrows}{\tikz@processarrows{#1}} -\define@key{tikz}{>}{% +\tikzoption{>}{% \tikz@set@pointed{\csname pgf@arrows@invert#1\endcsname}{#1}% \expandafter\tikz@processarrows\expandafter{\tikz@current@arrows}% } -\define@key{tikz}{shorten <}{\pgfsetshortenstart{#1}} -\define@key{tikz}{shorten >}{\pgfsetshortenend{#1}} +\tikzoption{shorten <}{\pgfsetshortenstart{#1}} +\tikzoption{shorten >}{\pgfsetshortenend{#1}} \def\tikz@set@pointed#1#2{% - \@ifundefined{pgf@arrow@code@tikze@>@#2} + \pgf@ifundefined{pgf@arrow@code@tikze@>@#2} {% \pgfarrowsdeclarealias{tikzs@<@#2}{tikze@>@#2}{#1}{#2}% \pgfarrowsdeclarereversed{tikzs@>@#2}{tikze@<@#2}{#1}{#2}% @@ -437,22 +641,22 @@ \pgfarrowsdeclaredouble[\pgflinewidth]{tikzs@<<@#2}{tikze@>>@#2}{#1}{#2}% \pgfarrowsdeclarereversed{tikzs@>>@#2}{tikze@<<@#2}{tikzs@<<@#2}{tikze@>>@#2}% }{}% - \@namedef{tikz@special@arrow@start<}{tikzs@<@#2}% - \@namedef{tikz@special@arrow@end>}{tikze@>@#2}% - \@namedef{tikz@special@arrow@start>}{tikzs@>@#2}% - \@namedef{tikz@special@arrow@end<}{tikze@<@#2}% - \@namedef{tikz@special@arrow@start|<}{tikz@|<@#2}% - \@namedef{tikz@special@arrow@end>|}{tikz@>|@#2}% - \@namedef{tikz@special@arrow@start<<}{tikzs@<<@#2}% - \@namedef{tikz@special@arrow@end>>}{tikze@>>@#2}% - \@namedef{tikz@special@arrow@start>>}{tikzs@<<@#2}% - \@namedef{tikz@special@arrow@end<<}{tikze@>>@#2}% + \pgf@namedef{tikz@special@arrow@start<}{tikzs@<@#2}% + \pgf@namedef{tikz@special@arrow@end>}{tikze@>@#2}% + \pgf@namedef{tikz@special@arrow@start>}{tikzs@>@#2}% + \pgf@namedef{tikz@special@arrow@end<}{tikze@<@#2}% + \pgf@namedef{tikz@special@arrow@start|<}{tikz@|<@#2}% + \pgf@namedef{tikz@special@arrow@end>|}{tikz@>|@#2}% + \pgf@namedef{tikz@special@arrow@start<<}{tikzs@<<@#2}% + \pgf@namedef{tikz@special@arrow@end>>}{tikze@>>@#2}% + \pgf@namedef{tikz@special@arrow@start>>}{tikzs@<<@#2}% + \pgf@namedef{tikz@special@arrow@end<<}{tikze@>>@#2}% } \def\tikz@processarrows#1{% \def\tikz@current@arrows{#1}% \def\tikz@temp{#1}% - \ifx\tikz@temp\@empty% + \ifx\tikz@temp\pgf@empty% \else% \tikz@@processarrows#1\@nil \fi% @@ -474,9 +678,9 @@ \def\tikz@current@arrows{-} % Parabola options -\define@key{tikz}{bend}{\tikz@scan@one@point\tikz@set@parabola@bend#1\relax}% -\define@key{tikz}{bend pos}{\def\tikz@parabola@bend@factor{#1}} -\define@key{tikz}{parabola height}{% +\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}}} @@ -486,37 +690,43 @@ \def\tikz@set@parabola@bend#1{\def\tikz@parabola@bend{#1}} % Axis options -\define@key{tikz}{domain}{\def\tikz@plot@domain{#1}} -\define@key{tikz}{range}{\def\tikz@plot@range{#1}} +\tikzoption{domain}{\def\tikz@plot@domain{#1}} +\tikzoption{range}{\def\tikz@plot@range{#1}} % Plot options -\define@key{tikz}{smooth}[]{\let\tikz@plot@handler=\pgfplothandlercurveto} -\define@key{tikz}{smooth cycle}[]{\let\tikz@plot@handler=\pgfplothandlerclosedcurve} -\define@key{tikz}{sharp plot}[]{\let\tikz@plot@handler\pgfplothandlerlineto} +\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}} -\define@key{tikz}{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} -\define@key{tikz}{xcomb}[]{\let\tikz@plot@handler=\pgfplothandlerxcomb} -\define@key{tikz}{ycomb}[]{\let\tikz@plot@handler=\pgfplothandlerycomb} -\define@key{tikz}{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}} -\define@key{tikz}{raw gnuplot}[true]{\csname tikz@plot@raw@gnuplot#1\endcsname} -\define@key{tikz}{prefix}{\def\tikz@plot@prefix{#1}} -\define@key{tikz}{id}{\def\tikz@plot@id{#1}} +\tikzoption{samples}{\def\tikz@plot@sampels{#1}} +\tikzoption{parametric}[true]{\csname tikz@plot@parametric#1\endcsname} -\define@key{tikz}{samples}{\def\tikz@plot@sampels{#1}} -\define@key{tikz}{parametric}[true]{\csname tikz@plot@parametric#1\endcsname} +\tikzoption{only marks}[]{\let\tikz@plot@handler\pgfplothandlerdiscard} -\define@key{tikz}{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}} -\define@key{tikz}{mark}{\def\tikz@plot@mark{#1}} -\define@key{tikz}{mark options}{\def\tikz@plot@mark@options{#1}} -\define@key{tikz}{mark size}{\pgfsetplotmarksize{#1}} +\tikzoption{mark indices}{\def\tikz@mark@list{#1}} +\tikzoption{mark phase}{\pgfsetplotmarkphase{#1}} +\tikzoption{mark repeat}{\pgfsetplotmarkrepeat{#1}} -\let\tikz@plot@mark@options=\@empty +\let\tikz@mark@list=\pgf@empty + +\let\tikz@plot@mark@options=\pgf@empty \let\tikz@plot@handler=\pgfplothandlerlineto -\let\tikz@plot@mark=\@empty +\let\tikz@plot@mark=\pgf@empty \def\tikz@plot@sampels{25} \def\tikz@plot@domain{-5:5} @@ -528,18 +738,25 @@ \newif\iftikz@plot@raw@gnuplot +% To options +\tikzoption{to path}{\def\tikz@to@path{#1}} + +\def\tikz@to@path{-- (\tikztotarget) \tikztonodes} + + + % Tree options -\define@key{tikz}{edge from parent path}{\def\tikz@edge@to@parent@path{#1}} +\tikzoption{edge from parent path}{\def\tikz@edge@to@parent@path{#1}} -\define@key{tikz}{parent anchor}{\def\tikzparentanchor{.#1}\ifx\tikzparentanchor\tikz@border@text\let\tikzparentanchor\@empty\fi} -\define@key{tikz}{child anchor}{\def\tikzchildanchor{.#1}\ifx\tikzchildanchor\tikz@border@text\let\tikzchildanchor\@empty\fi} +\tikzoption{parent anchor}{\def\tikzparentanchor{.#1}\ifx\tikzparentanchor\tikz@border@text\let\tikzparentanchor\pgf@empty\fi} +\tikzoption{child anchor}{\def\tikzchildanchor{.#1}\ifx\tikzchildanchor\tikz@border@text\let\tikzchildanchor\pgf@empty\fi} -\define@key{tikz}{level distance}{\setlength\tikzleveldistance{#1}} -\define@key{tikz}{sibling distance}{\setlength\tikzsiblingdistance{#1}} +\tikzoption{level distance}{\setlength\tikzleveldistance{#1}} +\tikzoption{sibling distance}{\setlength\tikzsiblingdistance{#1}} -\define@key{tikz}{growth function}{\let\tikz@grow=#1} -\define@key{tikz}{grow}{\tikz@set@growth{#1}\edef\tikz@special@level{\the\tikztreelevel}}% -\define@key{tikz}{grow'}{\tikz@set@growth{#1}\tikz@swap@growth\edef\tikz@special@level{\the\tikztreelevel}}% +\tikzoption{growth function}{\let\tikz@grow=#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@special@level{-1}% never @@ -566,8 +783,8 @@ } \def\tikz@border@text{.border} -\let\tikzparentanchor=\@empty -\let\tikzchildanchor=\@empty +\let\tikzparentanchor=\pgf@empty +\let\tikzchildanchor=\pgf@empty \def\tikz@edge@to@parent@path{(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor)} \tikzleveldistance=15mm @@ -601,15 +818,15 @@ \fi% } -\setkeys{tikz}{grow=down} +\tikz@orig@setkeys{tikz}{grow=down} % Snake options -\define@key{tikz}{snake}[]{% +\tikzoption{snake}[]{% \def\tikz@@snake{#1}% - \ifx\tikz@@snake\@empty% + \ifx\tikz@@snake\pgf@empty% \tikz@snakedtrue% \else% \ifx\tikz@@snake\tikz@nonetext% @@ -620,83 +837,97 @@ \fi% \fi} -\define@key{tikz}{segment amplitude}{\setlength{\pgfsnakesegmentamplitude}{#1}} -\define@key{tikz}{segment length}{\setlength{\pgfsnakesegmentlength}{#1}} -\define@key{tikz}{segment angle}{\def\pgfsnakesegmentangle{#1}} -\define@key{tikz}{segment aspect}{\def\pgfsnakesegmentaspect{#1}} +\tikzoption{segment amplitude}{\setlength{\pgfsnakesegmentamplitude}{#1}} +\tikzoption{segment length}{\setlength{\pgfsnakesegmentlength}{#1}} +\tikzoption{segment angle}{\def\pgfsnakesegmentangle{#1}} +\tikzoption{segment aspect}{\def\pgfsnakesegmentaspect{#1}} -\define@key{tikz}{segment object length}{\def\pgfsnakesegmentobjectlength{#1}} +\tikzoption{segment object length}{\def\pgfsnakesegmentobjectlength{#1}} -\define@key{tikz}{raise snake}{\def\pgf@snake@raise{\pgftransformyshift{#1}}} -\define@key{tikz}{mirror snake}[true]{% +\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=\@empty% + \let\pgf@snake@mirror=\pgf@empty% \fi } -\define@key{tikz}{gap before snake}{\def\tikz@presnake{{moveto}{#1}}} -\define@key{tikz}{line before snake}{\def\tikz@presnake{{lineto}{#1}}} +\tikzoption{gap before snake}{\def\tikz@presnake{{moveto}{#1}}} +\tikzoption{line before snake}{\def\tikz@presnake{{lineto}{#1}}} -\define@key{tikz}{gap after snake}{\def\tikz@postsnake{{moveto}{#1}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}} -\define@key{tikz}{line after snake}{\def\tikz@postsnake{{lineto}{#1}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}} +\tikzoption{gap after snake}{\def\tikz@postsnake{{moveto}{#1}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}} +\tikzoption{line after snake}{\def\tikz@postsnake{{lineto}{#1}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}} -\define@key{tikz}{gap around snake}{% +\tikzoption{gap around snake}{% \def\tikz@presnake{{moveto}{#1}}% \def\tikz@postsnake{{moveto}{#1}}% \def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}% } -\define@key{tikz}{line around snake}{% +\tikzoption{line around snake}{% \def\tikz@presnake{{lineto}{#1}}% \def\tikz@postsnake{{lineto}{#1}}% \def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}% } -\let\pgf@snake@mirror=\@empty -\let\pgf@snake@raise=\@empty +\let\pgf@snake@mirror=\pgf@empty +\let\pgf@snake@raise=\pgf@empty \pgfsetsnakesegmenttransformation{\pgf@snake@mirror\pgf@snake@raise} \def\tikz@snake{zigzag} -\let\tikz@presnake=\@empty -\let\tikz@postsnake=\@empty +\let\tikz@presnake=\pgf@empty +\let\tikz@postsnake=\pgf@empty \def\tikz@mainsnakelength{\pgfsnakeremainingdistance} % Execute option -\define@key{tikz}{execute at begin picture}{\expandafter\def\expandafter\tikz@atbegin@picture\expandafter{\tikz@atbegin@picture#1}} -\define@key{tikz}{execute at end picture}{\expandafter\def\expandafter\tikz@atend@picture\expandafter{\tikz@atend@picture#1}} -\define@key{tikz}{execute at begin scope}{\expandafter\def\expandafter\tikz@atbegin@scope\expandafter{\tikz@atbegin@scope#1}} -\define@key{tikz}{execute at end scope}{\expandafter\def\expandafter\tikz@atend@scope\expandafter{\tikz@atend@scope#1}} +\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}} -\let\tikz@atbegin@picture=\@empty -\let\tikz@atend@picture=\@empty -\let\tikz@atbegin@scope=\@empty -\let\tikz@atend@scope=\@empty +\let\tikz@atbegin@picture=\pgf@empty +\let\tikz@atend@picture=\pgf@empty +\let\tikz@atbegin@scope=\pgf@empty +\let\tikz@atend@scope=\pgf@empty +\let\tikz@atbegin@to=\pgf@empty +\let\tikz@atend@to=\pgf@empty +\let\tikz@atbegin@node=\pgf@empty +\let\tikz@atend@node=\pgf@empty % Styles -\define@key{tikz}{set style}{\tikzstyle#1} +\tikzoption{set style}{\tikzstyle#1} % Handled in a special way. -\def\tikzstyle#1=#2[#3]{% #2 is dummy - \in@+{#1}% +\def\tikzstyle#1#2=#3[#4]{% #2 and #3 are dummy + \in@+{#2}% \ifin@% - \tikz@style#1{#3}% + \tikz@style{#1}{#4}% \else% - \expandafter\def\csname tikz@st@#1\endcsname{#3}% + \expandafter\def\csname tikz@st@#1\endcsname{#4}% \fi} -\def\tikz@style#1+#2{% - \edef\tikz@marshal{\def\expandafter\noexpand\csname tikz@st@#1\endcsname}% - \expandafter\expandafter\expandafter\tikz@marshal\expandafter\expandafter\expandafter{\csname tikz@st@#1\endcsname,#2}} +\def\tikz@style#1#2{% + \iftikzstyleempty{#1} + {\expandafter\def\csname tikz@st@#1\endcsname{#2}}% + {% + \edef\tikz@marshal{\def\expandafter\noexpand\csname tikz@st@#1\endcsname}% + \expandafter\expandafter\expandafter\tikz@marshal\expandafter\expandafter\expandafter{\csname + tikz@st@#1\endcsname,#2}% + }% +} \def\iftikzstyleempty#1#2#3{% - \expandafter\ifx\csname tikz@st@#1\endcsname\@empty% + \expandafter\ifx\csname tikz@st@#1\endcsname\pgf@empty% \let\pgf@next=\@firstoftwo% \else% \expandafter\ifx\csname tikz@st@#1\endcsname\relax% @@ -708,7 +939,6 @@ \pgf@next{#2}{#3}} - % % % Predefined styles @@ -724,6 +954,11 @@ \tikzstyle{every node}= [] \tikzstyle{every child}= [] \tikzstyle{every child node}= [] +\tikzstyle{every to}= [] +\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] @@ -773,11 +1008,11 @@ % Setting keys % -\let\tikz@late@keys=\@empty% +\let\tikz@late@keys=\pgf@empty% \def\tikz@set@one@key#1{% - \setkeys*{tikz}{#1}% - \ifx\XKV@rm\@empty% + \tikz@orig@setkeys*{tikz}{#1}% + \ifx\XKV@rm\pgf@empty% % fine \else% \expandafter\in@\expandafter!\expandafter{\XKV@rm}% @@ -813,11 +1048,11 @@ \def\tikz@@setkeys#1,#2\pgf@stop{% \def\tikz@key@test{#1}% \def\tikz@key@rest{#2}% - \ifx\tikz@key@test\@empty% + \ifx\tikz@key@test\pgf@empty% \else% - \@ifnextchar s{\tikz@parse@key}{\tikz@parse@key}#1==\pgf@stop% + \pgf@ifnextchar s{\tikz@parse@key}{\tikz@parse@key}#1==\pgf@stop% \fi% - \ifx\tikz@key@rest\@empty% + \ifx\tikz@key@rest\pgf@empty% \else% \expandafter\expandafter\expandafter\tikz@@setkeys\expandafter\tikz@key@rest\expandafter\pgf@stop% \fi% @@ -829,7 +1064,7 @@ \def\tikz@key@test{#1}% \ifx\tikz@key@test\tikz@style@text% % Ok, style! - \@ifundefined{tikz@st@#2}% + \pgf@ifundefined{tikz@st@#2}% {\PackageError{tikz}{Unknown style ``#2}''{}} {% \expandafter\let\expandafter\tikz@temp\expandafter=\csname tikz@st@#2\endcsname% @@ -841,7 +1076,7 @@ \expandafter\ifx\csname tikz@st@#1\endcsname\relax% % Ok, normal! \def\tikz@test{#3}% - \ifx\tikz@test\@empty% + \ifx\tikz@test\pgf@empty% \tikz@set@one@key{#1}% \else% \tikz@set@one@key{#1={#2}}% @@ -872,19 +1107,22 @@ % Main TikZ Environment % -\def\tikzpicture{\@ifnextchar[\tikz@picture{\tikz@picture[]}}%} +\def\tikzpicture{\pgf@ifnextchar[\tikz@picture{\tikz@picture[]}}%} \def\tikz@picture[#1]{% \pgfpicture% - \let\tikz@atbegin@picture=\@empty% - \let\tikz@atend@picture=\@empty% + \let\tikz@atbegin@picture=\pgf@empty% + \let\tikz@atend@picture=\pgf@empty% + \let\tikz@transform=\relax% \tikz@installcommands\scope[style=every picture,#1]% \tikz@atbegin@picture% } \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} @@ -901,8 +1139,8 @@ % The rectangle \tikz{\draw (0,0) rectangle (1em,1ex)} has width 1em and % height 1ex. -\def\tikz{\@ifnextchar[{\tikz@opt}{\tikz@opt[]}} -\def\tikz@opt[#1]{\@ifnextchar\bgroup{\tikz@[#1]}{\tikz@@[#1]}} +\def\tikz{\pgf@ifnextchar[{\tikz@opt}{\tikz@opt[]}} +\def\tikz@opt[#1]{\pgf@ifnextchar\bgroup{\tikz@[#1]}{\tikz@@[#1]}} \def\tikz@[#1]#2{\tikzpicture[#1]#2\endtikzpicture} \def\tikz@@{% \let\tikz@next=\tikz@collectnormalsemicolon% @@ -921,14 +1159,14 @@ % % Environment for scoping graphic state settings % -\def\tikz@scope@env{\@ifnextchar[\tikz@@scope@env{\tikz@@scope@env[]}} +\def\tikz@scope@env{\pgf@ifnextchar[\tikz@@scope@env{\tikz@@scope@env[]}} \def\tikz@@scope@env[#1]{% \pgfscope% \begingroup% - \let\tikz@atbegin@scope=\@empty% - \let\tikz@atend@scope=\@empty% - \let\tikz@options=\@empty% - \let\tikz@mode=\@empty% + \let\tikz@atbegin@scope=\pgf@empty% + \let\tikz@atend@scope=\pgf@empty% + \let\tikz@options=\pgf@empty% + \let\tikz@mode=\pgf@empty% \tikz@every@style{every scope}% \tikz@setkeys{#1}% \tikz@options% @@ -950,9 +1188,12 @@ \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% @@ -960,16 +1201,19 @@ \let\tikz@origclip=\clip% \let\tikz@origuseasboundingbox=\useasboundingbox% \let\tikz@orignode=\node% - \let\tikz@orignode=\coordiante% + \let\tikz@origcoordinate=\coordinate% % \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]} @@ -986,9 +1230,12 @@ \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% @@ -996,6 +1243,7 @@ \let\clip=\tikz@origclip% \let\useasboundingbox=\tikz@origuseasboundingbox% \let\node=\tikz@orignode% + \let\coordinate=\tikz@origcoordinate% } @@ -1029,10 +1277,10 @@ % settings. \def\tikz@command@path{% - \@ifnextchar[{\tikz@check@earg}%] - {\@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}} + \pgf@ifnextchar[{\tikz@check@earg}%] + {\pgf@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}} \def\tikz@check@earg[#1]{% - \@ifnextchar<{\tikz@swap@args[#1]}{\tikz@@command@path[#1]}} + \pgf@ifnextchar<{\tikz@swap@args[#1]}{\tikz@@command@path[#1]}} \def\tikz@swap@args[#1]<#2>{\tikz@command@path<#2>[#1]} \def\tikz@doopt{% @@ -1050,11 +1298,11 @@ \def\tikz@@command@path{% \edef\tikzscope@linewidth{\the\pgflinewidth}% \begingroup% - \let\tikz@options=\@empty% - \let\tikz@mode=\@empty% + \let\tikz@options=\pgf@empty% + \let\tikz@mode=\pgf@empty% \let\tikz@moveto@waiting=\relax% \let\tikz@timer=\relax% - \let\tikz@collected@onpath=\@empty% + \let\tikz@collected@onpath=\pgf@empty% \tikz@snakedfalse% \tikz@node@is@a@labelfalse% \tikz@expandcount=1000\relax% @@ -1066,7 +1314,7 @@ \tikz@scan@next@command% } \def\tikz@scan@next@command{% - \ifx\tikz@collected@onpath\@empty% + \ifx\tikz@collected@onpath\pgf@empty% \else% \tikz@invoke@collected@onpath% \fi% @@ -1129,17 +1377,21 @@ \let\@next=\tikz@pchar% \pgfsetmovetofirstplotpoint% \else% - \ifx\@let@token\pgfextra% - \let\@next=\tikz@extra% + \ifx\@let@token t% + \let\@next=\tikz@to% \else% - \ifx\@let@token\foreach% - \let\@next=\tikz@foreach% + \ifx\@let@token\pgfextra% + \let\@next=\tikz@extra% \else% - \ifx\@let@token\pgf@stop% - \let\@next=\relax% + \ifx\@let@token\foreach% + \let\@next=\tikz@foreach% \else% - \ifx\@let@token\par% - \let\@next=\tikz@scan@next@command% + \ifx\@let@token\pgf@stop% + \let\@next=\relax% + \else% + \ifx\@let@token\par% + \let\@next=\tikz@scan@next@command% + \fi% \fi% \fi% \fi% @@ -1164,14 +1416,16 @@ \@next% } -\def\tikz@pchar{\@ifnextchar l{\tikz@plot}{\tikz@parabola}} +\def\tikz@pchar{\pgf@ifnextchar l{\tikz@plot}{\tikz@parabola}} \def\tikz@cchar{% - \@ifnextchar i{\tikz@circle}% - {\@ifnextchar h{\tikz@children}{\tikz@cochar}}}% + \pgf@ifnextchar i{\tikz@circle}% + {\pgf@ifnextchar h{\tikz@children}{\tikz@cochar}}}% \def\tikz@cochar o{% - \@ifnextchar o{\tikz@coordinate}{\tikz@cosine}} + \pgf@ifnextchar o{\tikz@coordinate}{\tikz@cosine}} \def\tikz@e@char{% - \@ifnextchar l{\tikz@ellipse}{\tikz@edgetoparent}} + \pgf@ifnextchar l{\tikz@ellipse}{\tikz@@e@char}}% +\def\tikz@@e@char dge{% + \pgf@ifnextchar f{\tikz@edgetoparent}{\tikz@edge@plain}}% \def\tikz@finish{% @@ -1181,15 +1435,15 @@ \tikz@mode@clipfalse% \tikz@mode@boundaryfalse% \edef\tikz@pathextend{% - {\noexpand\pgfpoint{\the\pgf@pathminx}{\the\pgf@pathminy}}% - {\noexpand\pgfpoint{\the\pgf@pathmaxx}{\the\pgf@pathmaxy}}% + {\noexpand\pgfqpoint{\the\pgf@pathminx}{\the\pgf@pathminy}}% + {\noexpand\pgfqpoint{\the\pgf@pathmaxx}{\the\pgf@pathmaxy}}% }% \tikz@mode% installs the mode settings % Rendering pipeline: % % Step 1: Setup options % - \ifx\tikz@options\@empty% + \ifx\tikz@options\pgf@empty% \else% \pgfsys@beginscope% \begingroup% @@ -1263,7 +1517,7 @@ % % Step 8: Close option brace % - \ifx\tikz@options\@empty% + \ifx\tikz@options\pgf@empty% \else% \endgroup% \pgfsys@endscope% @@ -1313,8 +1567,12 @@ % Syntax for pgfextra: % \pgfextra {normal tex text} +% \pgfextra normal tex text \endpgfextra + +\def\tikz@extra{\pgf@ifnextchar\bgroup\tikz@@extra\relax} +\long\def\tikz@@extra#1{#1\tikz@scan@next@command} +\let\endpgfextra=\tikz@scan@next@command -\long\def\tikz@extra#1{#1\tikz@scan@next@command} \def\pgfextra{pgfextra} @@ -1327,7 +1585,7 @@ \def\tikz@foreach{% \def\pgffor@beginhook{\setbox\tikz@figbox=\box\tikz@tempbox\expandafter\tikz@scan@next@command\@firstofone}% - \def\pgffor@endhook{\pgfextra{\global\setbox\tikz@tempbox=\copy\tikz@figbox\@gobble}}% + \def\pgffor@endhook{\pgfextra{\global\setbox\tikz@tempbox=\copy\tikz@figbox\pgf@gobble}}% \def\pgffor@afterhook{\setbox\tikz@figbox=\box\tikz@tempbox\tikz@scan@next@command}% \global\setbox\tikz@tempbox=\copy\tikz@figbox% \foreach} @@ -1338,7 +1596,7 @@ \def\tikz@command@againpath#1{% \pgfextra{% \pgfsyssoftpath@getcurrentpath\tikz@temp% - \expandafter\g@addto@macro\expandafter\tikz@temp\expandafter{#1}% + \expandafter\pgf@g@addto@macro\expandafter\tikz@temp\expandafter{#1}% \pgfsyssoftpath@setcurrentpath\tikz@temp% } } @@ -1395,8 +1653,8 @@ \pgf@process{\pgfpointshapeborder{\tikz@moveto@waiting}{#1}}% #2=\pgf@x% #3=\pgf@y% - \edef\tikz@timer@start{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% - \pgfpathmoveto{\pgfpoint{\pgf@x}{\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% } @@ -1407,9 +1665,9 @@ % \def\tikz@collect@coordinate@onpath#1coordinate{% - \@ifnextchar[{\tikz@@collect@coordinate@opt#1}{\tikz@@collect@coordinate@opt#1[]}}%} + \pgf@ifnextchar[{\tikz@@collect@coordinate@opt#1}{\tikz@@collect@coordinate@opt#1[]}}%} \def\tikz@@collect@coordinate@opt#1[#2]{% - \@ifnextchar({\tikz@@collect@coordinate#1[#2]}{% + \pgf@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){}} @@ -1419,9 +1677,9 @@ \tikz@collect@label@scan#1} \def\tikz@collect@label@scan#1{% - \@ifnextchar({\tikz@collect@paran#1}% - {\@ifnextchar[{\tikz@collect@options#1}% - {\@ifnextchar\bgroup{\tikz@collect@arg#1}% + \pgf@ifnextchar({\tikz@collect@paran#1}% + {\pgf@ifnextchar[{\tikz@collect@options#1}% + {\pgf@ifnextchar\bgroup{\tikz@collect@arg#1}% {#1}}}% }%}} @@ -1442,7 +1700,7 @@ \def\tikz@invoke@collected@onpath{% \tikz@node@is@a@labeltrue% \let\tikz@temp=\tikz@collected@onpath% - \let\tikz@collected@onpath=\@empty% + \let\tikz@collected@onpath=\pgf@empty% \expandafter\tikz@scan@next@command\tikz@temp\pgf@stop% \tikz@node@is@a@labelfalse% } @@ -1454,26 +1712,26 @@ % -- <point> \def\tikz@lineto{% - \@ifnextchar |% - {\expandafter\tikz@hv@lineto\@gobble}% - {\expandafter\@ifnextchar\tikz@activebar{\expandafter\tikz@hv@lineto\@gobble}% - {\expandafter\tikz@lineto@mid\@gobble}}} + \pgf@ifnextchar |% + {\expandafter\tikz@hv@lineto\pgf@gobble}% + {\expandafter\pgf@ifnextchar\tikz@activebar{\expandafter\tikz@hv@lineto\pgf@gobble}% + {\expandafter\tikz@lineto@mid\pgf@gobble}}} \def\tikz@lineto@mid{% - \@ifnextchar n{\tikz@collect@label@onpath\tikz@lineto@mid}% + \pgf@ifnextchar n{\tikz@collect@label@onpath\tikz@lineto@mid}% {% - \@ifnextchar c{\tikz@close}{% - \@ifnextchar p{\pgfsetlinetofirstplotpoint\expandafter\tikz@plot\@gobble}% + \pgf@ifnextchar c{\tikz@close}{% + \pgf@ifnextchar p{\pgfsetlinetofirstplotpoint\expandafter\tikz@plot\pgf@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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}} + \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{\pgfpoint{\pgf@x}{\pgf@y}}% + \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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \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% @@ -1482,7 +1740,7 @@ \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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% \fi% \let\tikz@timer=\tikz@timer@line% \tikz@scan@next@command% @@ -1500,7 +1758,10 @@ % snake or lineto? \def\tikz@path@close#1{% \iftikz@snaked% - \pgfpathsnakesto{\tikz@presnake,{\tikz@snake}{\tikz@mainsnakelength},\tikz@postsnake}{#1}% + {% + \pgftransformreset% + \pgfpathsnakesto{\tikz@presnake,{\tikz@snake}{\tikz@mainsnakelength},\tikz@postsnake}{#1}% + }% \pgfpathclose% \else% \pgfpathclose% @@ -1512,30 +1773,30 @@ % -| <point> \def\tikz@hv@lineto{% - \@ifnextchar n + \pgf@ifnextchar n {\tikz@collect@label@onpath\tikz@hv@lineto} - {\@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@hv@lineto}% + {\pgf@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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \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{\pgfpoint{\tikz@lastx}{\pgf@yc}}\pgf@x\pgf@yc% + \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}{\pgfpoint{\tikz@lastx}{\pgf@yc}}}% - \tikz@make@last@position{\pgfpoint{\pgf@x}{\pgf@y}}% - \tikz@path@lineto{\pgfpoint{\tikz@lastx}{\pgf@yc}}% + \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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group + \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{\pgfpoint{\tikz@lastx}{\pgf@yc}}% + \tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@yc}}% \tikz@path@lineto{\tikz@last@position}% - \edef\tikz@timer@end{\noexpand\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group + \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% @@ -1546,30 +1807,30 @@ \def\tikz@vh@lineto-{\tikz@vh@lineto@next} \def\tikz@vh@lineto@next{% - \@ifnextchar n + \pgf@ifnextchar n {\tikz@collect@label@onpath\tikz@vh@lineto@next} - {\@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@vh@lineto@next}% + {\pgf@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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \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{\pgfpoint{\pgf@xc}{\tikz@lasty}}\pgf@xc\pgf@y% + \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}{\pgfpoint{\pgf@xc}{\tikz@lasty}}}% - \tikz@make@last@position{\pgfpoint{\pgf@x}{\pgf@y}}% - \tikz@path@lineto{\pgfpoint{\pgf@xc}{\tikz@lasty}}% + \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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group + \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{\pgfpoint{\pgf@xc}{\tikz@lasty}}% + \tikz@path@lineto{\pgfqpoint{\pgf@xc}{\tikz@lasty}}% \tikz@path@lineto{\tikz@last@position}% - \edef\tikz@timer@end{\noexpand\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% \fi% \let\tikz@timer=\tikz@timer@vhline% \tikz@scan@next@command% @@ -1578,7 +1839,7 @@ % Syntax for cycle: % -- cycle \def\tikz@close c{% - \@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@lineto@mid c}% oops, a coordinate + \pgf@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@lineto@mid c}% oops, a coordinate {\tikz@@close c}}% \def\tikz@@close cycle{% \tikz@flush@moveto% @@ -1596,13 +1857,100 @@ \tikz@scan@next@command% } +% 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{\pgf@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=\pgf@empty% + \tikz@@to@collect% +} +\def\tikz@@to@collect{% + \pgf@ifnextchar(\tikz@@to@or@edge@coordinate + {\pgf@ifnextchar n{\tikz@collect@label@onpath\tikz@@to@collect}% + {\pgf@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@@to@collect} + {\PackageError{tikz}{( expected}{}%} + \tikz@@to@or@edge@coordinate()}}}% +} + +\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=\pgf@empty% + \let\tikz@options=\pgf@empty% + \let\tikz@tonodes=\tikz@collected@onpath% + \def\tikztonodes{{\pgfextra{\tikz@node@is@a@labeltrue}\tikz@tonodes}}% + \let\tikz@collected@onpath=\pgf@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=\pgf@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 dge from parent{\@ifnextchar[\tikz@@edgetoparent{\tikz@@edgetoparent[]}}%} +\def\tikz@edgetoparent from parent{\pgf@ifnextchar[\tikz@@edgetoparent{\tikz@@edgetoparent[]}}%} \def\tikz@@edgetoparent[#1]{% - \let\tikz@edge@to@parent@needed=\@empty% + \let\tikz@edge@to@parent@needed=\pgf@empty% \tikz@node@is@a@labeltrue% \tikz@scan@next@command [style=edge from parent,#1] \tikz@edge@to@parent@path% } @@ -1615,23 +1963,23 @@ \def\tikz@dot.{\tikz@@dot}% \def\tikz@@dot{% - \@ifnextchar n% + \pgf@ifnextchar n% {\tikz@collect@label@onpath\tikz@@dot}% - {\@ifnextchar c{\tikz@curveto@double}{\tikz@curveto@auto}}} + {\pgf@ifnextchar c{\tikz@curveto@double}{\tikz@curveto@auto}}} \def\tikz@curveto@double co{% - \@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@@dot co} + \pgf@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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% {% \tikz@make@last@position{#1}% - \xdef\tikz@curve@first{\noexpand\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \xdef\tikz@curve@first{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% }% - \@ifnextchar a + \pgf@ifnextchar a {\tikz@curveBand}% {\let\tikz@curve@second\tikz@curve@first\tikz@curveCdots}% } @@ -1652,19 +2000,19 @@ \tikz@curveCcheck% } \def\tikz@curveCcheck{% - \@ifnextchar n% + \pgf@ifnextchar n% {\tikz@collect@label@onpath\tikz@curveCcheck} - {\@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@curveCcheck} + {\pgf@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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \xdef\tikz@curve@second{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% }% % % Start recalculating things in case start and end are shapes. @@ -1673,8 +2021,8 @@ \ifx\tikz@moveto@waiting\relax% \else% \pgf@process{\pgfpointshapeborder{\tikz@moveto@waiting}{\tikz@curve@first}}% - \edef\tikz@timer@start{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% - \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}% + \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% @@ -1683,8 +2031,8 @@ % ok, target is a shape. recalculate third {% \pgf@process{\pgfpointshapeborder{\tikz@shapeborder@name}{\tikz@curve@second}}% - \tikz@make@last@position{\pgfpoint{\pgf@x}{\pgf@y}}% - \edef\tikz@curve@third{\noexpand\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \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 }% @@ -1704,26 +2052,26 @@ % rectangle <corner point> \def\tikz@rect ectangle{% \tikz@flush@moveto% - \edef\tikz@timer@start{\noexpand\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% \tikz@@rect}% \def\tikz@@rect{% - \@ifnextchar n + \pgf@ifnextchar n {\tikz@collect@label@onpath\tikz@@rect} - {\@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@@rect}% + {\pgf@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\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% \let\tikz@timer=\tikz@timer@line% - \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}% - \tikz@path@lineto{\pgfpoint{\pgf@xa}{\tikz@lasty}}% - \tikz@path@lineto{\pgfpoint{\tikz@lastx}{\tikz@lasty}}% - \tikz@path@lineto{\pgfpoint{\tikz@lastx}{\pgf@ya}}% - \tikz@path@close{\pgfpoint{\pgf@xa}{\pgf@ya}}% - \pgfpathmoveto{\pgfpoint{\tikz@lastx}{\tikz@lasty}}% + \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}}% + \tikz@path@close{\pgfqpoint{\pgf@xa}{\pgf@ya}}% + \pgfpathmoveto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}% \def\pgfstrokehook{}% \tikz@scan@next@command% } @@ -1736,11 +2084,33 @@ \tikz@flush@moveto% \pgf@xa=\tikz@lastx\relax% \pgf@ya=\tikz@lasty\relax% + \pgf@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}% - \pgfpathgrid[stepx=\tikz@grid@x,stepy=\tikz@grid@y]% - {\pgfpoint{\pgf@xa}{\pgf@ya}}{\pgfpoint{\tikz@lastx}{\tikz@lasty}}% + {% + \expandafter\tikz@setkeys\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% } @@ -1751,29 +2121,29 @@ % -- plot [local options] ... % starts with a lineto \def\tikz@plot lot{% \tikz@flush@moveto% - \@ifnextchar[{\tikz@@plot}{\tikz@@plot[]}}%} + \pgf@ifnextchar[{\tikz@@plot}{\tikz@@plot[]}}%} \def\tikz@@plot[#1]{% \begingroup% - \let\tikz@options=\@empty% + \let\tikz@options=\pgf@empty% \tikz@every@style{every plot}% \tikz@setkeys{#1}% - \@ifnextchar f{\tikz@plot@f}% - {\@ifnextchar c{\tikz@plot@scan@points}% + \pgf@ifnextchar f{\tikz@plot@f}% + {\pgf@ifnextchar c{\tikz@plot@scan@points}% {\PackageError{tikz}{Cannot parse this plotting data}{}% \endgroup}}} -\def\tikz@plot@f f{\@ifnextchar i{\tikz@plot@file}{\tikz@plot@function}} +\def\tikz@plot@f f{\pgf@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% - \@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\@gobble} + \pgf@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\pgf@gobble} {\tikz@scan@one@point\tikz@plot@next@point}% #1\pgf@stop% } \def\tikz@plot@next@point#1{% \pgfplotstreampoint{#1}% - \@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\@gobble}% + \pgf@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\pgf@gobble}% {\tikz@scan@one@point\tikz@plot@next@point}% } \def\tikz@plot@function unction#1{% @@ -1807,7 +2177,7 @@ \tikz@plot@handler% \tikz@plot@data% \global\let\tikz@@@temp=\pgfplotlastpoint% - \ifx\tikz@plot@mark\@empty% + \ifx\tikz@plot@mark\pgf@empty% \else% % Marks are drawn after the path. \setbox\tikz@figbox=\hbox{% @@ -1815,11 +2185,15 @@ \hbox{{% \pgfinterruptpath% \pgfscope% - \let\tikz@options=\@empty% - \let\tikz@transform=\@empty% + \let\tikz@options=\pgf@empty% + \let\tikz@transform=\pgf@empty% \expandafter\tikz@setkeys\expandafter{\tikz@plot@mark@options}% \tikz@options% - \pgfplothandlermark{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}% + \ifx\tikz@mark@list\pgf@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% @@ -1858,7 +2232,7 @@ \tikz@lastxsaved=\tikz@lastx% \tikz@lastysaved=\tikz@lasty% \tikz@updatecurrenttrue% - \pgfpathcosine{\pgfpoint{\pgf@xc}{\pgf@yc}}% + \pgfpathcosine{\pgfqpoint{\pgf@xc}{\pgf@yc}}% \tikz@scan@next@command% } @@ -1877,24 +2251,25 @@ \tikz@lastxsaved=\tikz@lastx% \tikz@lastysaved=\tikz@lasty% \tikz@updatecurrenttrue% - \pgfpathsine{\pgfpoint{\pgf@xc}{\pgf@yc}}% + \pgfpathsine{\pgfqpoint{\pgf@xc}{\pgf@yc}}% \tikz@scan@next@command% } % Syntax for parabolas: % parabola[options] bend <coordinate> <coordinate> \def\tikz@parabola arabola{% - \@ifnextchar[{\tikz@parabola@options}{\tikz@parabola@options[]}}%} + \pgf@ifnextchar[{\tikz@parabola@options}{\tikz@parabola@options[]}}%} \def\tikz@parabola@options[#1]{% \def\tikz@parabola@option{#1}% - \@ifnextchar b{\tikz@parabola@scan@bend}{\tikz@scan@one@point\tikz@parabola@semifinal}} + \pgf@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% @@ -1916,7 +2291,7 @@ % Ok, now calculate delta to bend \advance\tikz@lastx by-\pgf@xb% \advance\tikz@lasty by-\pgf@yb% - \xdef\tikz@parabola@b{{\noexpand\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}{\noexpand\pgfpoint{\the\pgf@xc}{\the\pgf@yc}}}% + \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% @@ -1927,12 +2302,13 @@ % circle (radius) % % Syntax for ellipses: -% ellipse (x-radius/y-radius) -\def\tikz@circle ircle{\tikz@@circle} -\def\tikz@ellipse llipse{\tikz@@circle} +% 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{% - \tikz@flush@moveto% - \@ifnextchar(\tikz@@@circle{%) + \pgf@ifnextchar(\tikz@@@circle{%) \advance\tikz@expandcount by -1% \ifnum\tikz@expandcount<0\relax% \let\@next=\tikz@@circle@scangiveup% @@ -1954,42 +2330,64 @@ \tikz@scan@next@command% } \def\tikz@@ellipseB(#1 and #2){% - \pgfpathellipse{\tikz@last@position}{\pgfpoint{#1}{0pt}}{\pgfpoint{0pt}{#2}}% + \tikz@checkunit{#1}% + \iftikz@isdimension% + \pgfpathellipse{\tikz@last@position}{\pgfpoint{#1}{0pt}}{\pgfpoint{0pt}{#2}}% + \else% + \pgfpathellipse{\tikz@last@position}{\pgfpointxy{#1}{0}}{\pgfpointxy{0}{#2}}% + \fi% } % Syntax 1 for arcs: % arc (start angle:end angle:radius) % % Syntax 2 for arcs: -% arc (start angle:end angle:x-radius/y-radius) +% 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% - \@ifnextchar({\tikz@@arcto}{\expandafter\tikz@arcA\expandafter r\expandafter c}} + \pgf@ifnextchar({\tikz@@arcto}{\expandafter\tikz@arcA\expandafter r\expandafter c}} \def\tikz@@arcto(#1){% \edef\tikz@temp{(#1)}% - \expandafter\tikz@@@arcto@and\tikz@temp% + \expandafter\tikz@@@arcto@check@slashand\tikz@temp% } -\def\tikz@@@arcto@and(#1:#2:#3){% - \in@{ and }{#3}% +\def\tikz@@@arcto@check@slashand(#1:#2:#3){% + \in@{/}{#3}% \ifin@% - \tikz@parse@arc@and(#1:#2:#3)% + \tikz@parse@arc@replace@slash@and(#1:#2:#3)% \else% - \tikz@@@arcto(#1:#2:#3)% + \in@{ and }{#3}% + \ifin@% + \tikz@parse@arc@and(#1:#2:#3)% + \else% + \tikz@parse@arc@and(#1:#2:#3 and #3)% + \fi% \fi% } +\def\tikz@parse@arc@replace@slash@and(#1:#2:#3/#4){\tikz@parse@arc@and(#1:#2:#3 and #4)} + \def\tikz@parse@arc@and(#1:#2:#3 and #4){% - \tikz@@@arcto(#1:#2:#3/#4)% + \tikz@checkunit{#3}% + \iftikz@isdimension% + \tikz@@@arcfinal{\pgfpatharc{#1}{#2}{#3/#4}} + {\pgfpointpolar{#1}{#3/#4}} + {\pgfpointpolar{#2}{#3/#4}}% + \else% + \tikz@@@arcfinal{\pgfpatharcaxes{#1}{#2}{\pgfpointxy{#3}{0}}{\pgfpointxy{0}{#4}}} + {\pgfpointpolarxy{#1}{#3/#4}}{\pgfpointpolarxy{#2}{#3/#4}}% + \fi% } -\def\tikz@@@arcto(#1:#2:#3){% - \pgfpatharc{#1}{#2}{#3}% - \pgf@process{\pgfpointpolar{#1}{#3}}% +\def\tikz@@@arcfinal#1#2#3{% + #1% + \pgf@process{#2}% \advance\tikz@lastx by-\pgf@x% \advance\tikz@lasty by-\pgf@y% - \pgf@process{\pgfpointpolar{#2}{#3}}% + \pgf@process{#3}% \advance\tikz@lastx by\pgf@x% \advance\tikz@lasty by\pgf@y% \tikz@lastxsaved=\tikz@lastx% @@ -1999,16 +2397,18 @@ % Syntax for coordinates: -% coordinate (coordinate name) at (point) +% coordinate[options] (coordinate name) at (point) % where ``at (point)'' is optional \def\tikz@coordinate ordinate{% - \@ifnextchar({\tikz@@coordinate} - {\tikz@fig ode[shape=coordinate]{}}}%} -\def\tikz@@coordinate(#1){% - \@ifnextchar a{\tikz@@coordinate@at(#1)} - {\tikz@fig ode[shape=coordinate](#1){}}} -\def\tikz@@coordinate@at(#1)at#2(#3){% - \tikz@fig ode[shape=coordinate](#1)at(#3){}} + \pgf@ifnextchar[{\tikz@@coordinate@opt}{\tikz@@coordinate@opt[]}} +\def\tikz@@coordinate@opt[#1]{% + \pgf@ifnextchar({\tikz@@coordinate[#1]} + {\tikz@fig ode[shape=coordinate,#1]{}}}%} +\def\tikz@@coordinate[#1](#2){% + \pgf@ifnextchar a{\tikz@@coordinate@at[#1](#2)} + {\tikz@fig ode[shape=coordinate,#1](#2){}}} +\def\tikz@@coordinate@at[#1](#2)at#3(#4){% + \tikz@fig ode[shape=coordinate,#1](#2)at(#4){}} @@ -2021,25 +2421,28 @@ % % A label text always ``ends'' the node. \def\tikz@fig ode{% + \edef\tikz@save@line@width{\the\pgflinewidth}% \begingroup% - \let\tikz@fig@name=\@empty% + \let\tikz@fig@name=\pgf@empty% \begingroup% \let\nodepart=\tikz@nodepart% - \let\tikz@options=\@empty% - \let\tikz@transform=\@empty% - \let\tikz@mode=\@empty% - \def\tikz@node@at{\pgfpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + \let\tikz@options=\pgf@empty% + \let\tikz@after@node=\pgf@empty% + \let\tikz@afternodepathoptions=\pgf@empty% + \let\tikz@transform=\pgf@empty% + \let\tikz@mode=\pgf@empty% + \def\tikz@node@at{\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% \iftikz@node@is@a@label% \else% - \let\tikz@time=\@empty% + \let\tikz@time=\pgf@empty% \fi% \tikz@every@style{every node}% \tikz@@scan@fig}% \def\tikz@@scan@fig{% - \@ifnextchar a{\tikz@fig@scan@at} - {\@ifnextchar({\tikz@fig@scan@name} - {\@ifnextchar[{\tikz@fig@scan@options}% - {\@ifnextchar\bgroup{\tikz@fig@main}% + \pgf@ifnextchar a{\tikz@fig@scan@at} + {\pgf@ifnextchar({\tikz@fig@scan@name} + {\pgf@ifnextchar[{\tikz@fig@scan@options}% + {\pgf@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{% @@ -2047,10 +2450,10 @@ \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]{\tikz@setkeys{#1}\tikz@@scan@fig}% +\def\tikz@fig@scan@options[#1]{\tikz@setkeys{#1}\def\test{#1}\tikz@@scan@fig}% \def\tikz@fig@main{\afterassignment\tikz@@fig@main\let\next=} \def\tikz@@fig@main{% - \@ifundefined{pgf@sh@s@\tikz@shape}% + \pgf@ifundefined{pgf@sh@s@\tikz@shape}% {\PackageError{tikz}% {Unknown shape ``\tikz@shape.'' Using ``rectangle'' instead}{}% \def\tikz@shape{rectangle}}% @@ -2059,47 +2462,53 @@ \setbox\pgfnodeparttextbox=\hbox% \bgroup% \tikz@every@style{every text node part}% - \ifx\tikz@textopacity\@empty% + \ifx\tikz@textopacity\pgf@empty% \else% \pgfsetfillopacity{\tikz@textopacity}% \pgfsetstrokeopacity{\tikz@textopacity}% \fi% \pgfinterruptpicture% - \ifx\tikz@text@width\@empty% + \tikz@textfont% + \ifx\tikz@text@width\pgf@empty% \else% \begingroup% \minipage[t]{\tikz@text@width}% \tikz@text@action% \fi% + \tikz@atbegin@node% \bgroup% \aftergroup\unskip% - \ifx\tikz@textcolor\@empty% - \color{.}% + \ifx\tikz@textcolor\pgf@empty% \else% - \color{\tikz@textcolor}% + \colorlet{.}{\tikz@textcolor}% \fi% - \tikz@textfont% + \pgfsetcolor{.}% \setbox\tikz@figbox=\box\voidb@x% \tikz@uninstallcommands% \aftergroup\tikz@fig@collectresetcolor% \ignorespaces% } \def\tikz@fig@collectresetcolor{% - \@ifnextchar\reset@color% + \pgf@ifnextchar\reset@color% {\reset@color\afterassignment\tikz@fig@collectresetcolor\let\tikz@temp=}% {\tikz@fig@boxdone}% } \def\tikz@fig@boxdone{% - \ifx\tikz@text@width\@empty% + \tikz@atend@node% + \ifx\tikz@text@width\pgf@empty% \else% \endminipage% \endgroup% \fi% \endpgfinterruptpicture% \egroup% - \@ifnextchar c{\tikz@fig@withchildren}{\@ifnextchar[{\tikz@fig@withchildren}{\tikz@fig@continue}}}%} -\def\tikz@fig@withchildren{% - \ifx\tikz@fig@name\@empty% + \pgf@ifnextchar c{\tikz@fig@mustbenamed}% + {\pgf@ifnextchar[{\tikz@fig@mustbenamed}% + {\pgf@ifnextchar t{\tikz@fig@mustbenamed} + {\pgf@ifnextchar e{\tikz@fig@mustbenamed} + {\ifx\tikz@after@node\pgf@empty\expandafter\tikz@fig@continue\else\expandafter\tikz@fig@mustbenamed\fi}}}}}%} +\def\tikz@fig@mustbenamed{% + \ifx\tikz@fig@name\pgf@empty% % Assign a dummy name \global\advance\tikz@fig@count by1\relax \edef\tikz@fig@name{tikz@f@\the\tikz@fig@count}% @@ -2107,19 +2516,30 @@ \tikz@fig@continue% } \def\tikz@fig@continue{% - \ifx\tikz@text@width\@empty% + \ifx\tikz@text@width\pgf@empty% \else% \setlength{\pgf@x}{\tikz@text@width}% \wd\pgfnodeparttextbox=\pgf@x% \fi% + \ifx\tikz@text@height\pgf@empty% + \else% + \setlength{\pgf@x}{\tikz@text@height}% + \ht\pgfnodeparttextbox=\pgf@x% + \fi% + \ifx\tikz@text@depth\pgf@empty% + \else% + \setlength{\pgf@x}{\tikz@text@depth}% + \dp\pgfnodeparttextbox=\pgf@x% + \fi% % Possibly, we are ``online'' - \ifx\tikz@time\@empty% + \ifx\tikz@time\pgf@empty% \pgftransformshift{\tikz@node@at}% \iftikz@fullytransformed% \else% \pgftransformresetnontranslations \fi% \else% + \tikz@do@auto@anchor% \tikz@timer% \fi% % Invoke local transformations @@ -2141,24 +2561,35 @@ \endpgfinterruptpath% }}% }% + % + \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% - \global\let\tikz@last@fig@name=\tikz@fig@name% \endgroup\endgroup% - \setbox\tikz@figbox=\box\tikz@tempbox% + \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\pgf@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% - \@ifnextchar x{\egroup\relax}{\egroup\relax}% gobble spaces + \pgf@ifnextchar x{\egroup\relax}{\egroup\relax}% gobble spaces } \def\tikz@nodepart@continue{% \global\let\tikz@fig@continue=\tikz@fig@continue@orig% @@ -2167,7 +2598,8 @@ \bgroup% \tikz@every@style{every \tikz@nodepart@name\space node part}% \pgfinterruptpicture% - \ifx\tikz@text@width\@empty% + \tikz@textfont% + \ifx\tikz@text@width\pgf@empty% \else% \begingroup% \minipage[t]{\tikz@text@width}% @@ -2175,44 +2607,117 @@ \fi% \bgroup% \aftergroup\unskip% - \ifx\tikz@textcolor\@empty% - \color{.}% + \ifx\tikz@textcolor\pgf@empty% \else% - \color{\tikz@textcolor}% + \colorlet{.}{\tikz@textcolor}% \fi% - \tikz@textfont% + \pgfsetcolor{.}% \setbox\tikz@figbox=\box\voidb@x% \tikz@uninstallcommands% + \tikz@atbegin@node% \aftergroup\tikz@fig@collectresetcolor% \ignorespaces% } +% 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 {...} children [options] \var in {list} [options] {...} ... +% node {...} child [options] foreach \var in {list} [options] {...} ... \def\tikz@children{% % Start collecting the children: - \let\tikz@children@list=\@empty% + \let\tikz@children@list=\pgf@empty% \tikznumberofchildren=0\relax% \tikz@collect@children c} -\def\tikz@collect@children{\@ifnextchar c{\tikz@collect@children@cchar}{\tikz@children@collected}} -\def\tikz@collect@children@cchar c{\@ifnextchar h{\tikz@collect@child}{\tikz@children@collected c}} -\def\tikz@collect@child hild{\@ifnextchar[{\tikz@collect@childA}{\tikz@collect@childA[]}}%} -\def\tikz@collect@childA[#1]{\@ifnextchar f{\tikz@collect@children@foreach[#1]}{\tikz@collect@childB[#1]}} +\def\tikz@collect@children{\pgf@ifnextchar c{\tikz@collect@children@cchar}{\tikz@children@collected}} +\def\tikz@collect@children@cchar c{\pgf@ifnextchar h{\tikz@collect@child}{\tikz@children@collected c}} +\def\tikz@collect@child hild{\pgf@ifnextchar[{\tikz@collect@childA}{\tikz@collect@childA[]}}%} +\def\tikz@collect@childA[#1]{\pgf@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]}% - \@ifnextchar\bgroup{\tikz@collect@child@code}{\tikz@collect@child@code{}}} + \pgf@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{% - \@ifnextchar\bgroup{\tikz@collect@children@foreachA{#1}{#2}{#3}}{\tikz@collect@children@foreachA{#1}{#2}{#3}{}}} + \pgf@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}}% @@ -2227,10 +2732,9 @@ \long\def\tikz@children@collected{% \begingroup% \advance\tikztreelevel by 1\relax% - \let\tikz@options=\@empty% - \let\tikz@transform=\@empty% + \let\tikz@options=\pgf@empty% + \let\tikz@transform=\pgf@empty% \tikz@every@style{level \the\tikztreelevel}% - \tikz@options% \tikz@transform% \let\tikzparentnode=\tikz@last@fig@name% % Transform to center of node @@ -2246,7 +2750,7 @@ % Syntax for children: % -% children [all children options] \var in {values} [child options] {...} +% 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% @@ -2280,8 +2784,7 @@ \hbox\bgroup\bgroup% \pgfinterruptpath% \pgfscope% - \let\tikz@options=\@empty% - \let\tikz@transform=\@empty% + \let\tikz@transform=\pgf@empty% \tikz@every@style{every child}% \tikz@setkeys{#1}% \tikz@options% @@ -2298,7 +2801,7 @@ \let\tikzchildnode=\tikz@childnode@name% {% \def\tikz@edge@to@parent@needed{edge from parent} - \ifx\tikz@child@node@rest\@empty% + \ifx\tikz@child@node@rest\pgf@empty% \path edge from parent;% \else% \path (0,0) \tikz@child@node@rest \tikz@edge@to@parent@needed;% @@ -2311,31 +2814,31 @@ } \def\tikz@parse@child@node{% - \@ifnextchar n{\tikz@parse@child@node@n}% - {\@ifnextchar c{\tikz@parse@child@node@c}% + \pgf@ifnextchar n{\tikz@parse@child@node@n}% + {\pgf@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{\@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}} -\def\tikz@parse@child@node@co o{\@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}} +\def\tikz@parse@child@node@c c{\pgf@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}} +\def\tikz@parse@child@node@co o{\pgf@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}} \def\tikz@parse@child@node@coordinate ordinate{% - \@ifnextchar ({\tikz@@parse@child@node@coordinate}{% + \pgf@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){% - \@ifnextchar a{\tikz@p@c@n@c@at(#1)}{% + \pgf@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(#3){% \def\tikz@child@node@text{[shape=coordinate,name=#1]at(#3){}}% \tikz@parse@child@node@rest}% \def\tikz@parse@child@node@n node{% - \let\tikz@child@node@text=\@empty% + \let\tikz@child@node@text=\pgf@empty% \tikz@p@c@s}% \def\tikz@p@c@s{% - \@ifnextchar a{\tikz@p@c@s@at} - {\@ifnextchar ({\tikz@p@c@s@paran} - {\@ifnextchar [{\tikz@p@c@s@bra} - {\@ifnextchar \bgroup{\tikz@p@c@s@group} + \pgf@ifnextchar a{\tikz@p@c@s@at} + {\pgf@ifnextchar ({\tikz@p@c@s@paran} + {\pgf@ifnextchar [{\tikz@p@c@s@bra} + {\pgf@ifnextchar \bgroup{\tikz@p@c@s@group} {\PackageError{tikz}{Cannot parse this node}{}}}}}}%}} \def\tikz@p@c@s@at at#1(#2){% \expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text at(#2)} @@ -2368,7 +2871,7 @@ \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\pgfpoint{\the\pgf@xa}{\the\pgf@y}}}% + \noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@y}}}% \tikz@marshal% \else% second half \pgf@process{\tikz@timer@start}% @@ -2379,7 +2882,7 @@ \pgf@xb=2\pgf@xb% \advance\pgf@xb by-1pt% \edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}% - {\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@y}}{\noexpand\tikz@timer@end}}% + {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@y}}{\noexpand\tikz@timer@end}}% \tikz@marshal% \fi% } @@ -2393,7 +2896,7 @@ \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\pgfpoint{\the\pgf@x}{\the\pgf@ya}}}% + \noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@ya}}}% \tikz@marshal% \else% second half \pgf@process{\tikz@timer@start}% @@ -2404,7 +2907,7 @@ \pgf@xb=2\pgf@xb% \advance\pgf@xb by-1pt% \edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}% - {\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@ya}}{\noexpand\tikz@timer@end}}% + {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@ya}}{\noexpand\tikz@timer@end}}% \tikz@marshal% \fi% } @@ -2415,6 +2918,128 @@ +% +% Coordinate systems +% + +\def\tikzdeclarecoordinatesystem#1#2{% + \expandafter\def\csname tikz@parse@cs@#1\endcsname(##1){% + \pgf@process{% + #2% + % Smuggle outside: + \iftikz@shapeborder% + \global\let\tikz@smuggle@a=\tikz@shapebordertrue% + \else% + \global\let\tikz@smuggle@a=\tikz@shapeborderfalse% + \fi% + \global\let\tikz@smubble@b=\tikz@shapeborder@name% + }% + \tikz@smuggle@a% + \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} +{% + \tikz@orig@setkeys{tikzcskeys}{x=0pt,y=0pt,#1}% + \pgfpoint{\tikz@cs@x}{\tikz@cs@y}% +} + +\tikzdeclarecoordinatesystem{canvas polar} +{% + \tikz@orig@setkeys{tikzcskeys}{angle=0,radius=0cm,#1}% + \pgfpointpolar{\tikz@cs@angle}{\tikz@cs@xradius/\tikz@cs@yradius}% +} + +\tikzdeclarecoordinatesystem{xyz} +{% + \tikz@orig@setkeys{tikzcskeys}{x=0,y=0,z=0,#1}% + \pgfpointxyz{\tikz@cs@x}{\tikz@cs@y}{\tikz@cs@z}% +} + +\tikzdeclarecoordinatesystem{xyz polar} +{% + \tikz@orig@setkeys{tikzcskeys}{angle=0,radius=0,#1}% + \pgfpointpolarxy{\tikz@cs@angle}{\tikz@cs@xradius/\tikz@cs@yradius}% +} +\tikzaliascoordinatesystem{xy polar}{xyz polar} + + +\tikzdeclarecoordinatesystem{node} +{% + \tikz@orig@setkeys{tikzcskeys}{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 + \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% +} + +\tikzdeclarecoordinatesystem{intersection} +{% + \tikz@orig@setkeys{tikzcskeys}{#1}% + \expandafter\tikz@@@scan@@absolute\expandafter\tikz@parse@intersection@a\tikz@cs@line@a@begin% + \expandafter\tikz@@@scan@@absolute\expandafter\tikz@parse@intersection@b\tikz@cs@line@a@end% + \expandafter\tikz@@@scan@@absolute\expandafter\tikz@parse@intersection@c\tikz@cs@line@b@begin% + \expandafter\tikz@@@scan@@absolute\expandafter\tikz@parse@intersection@d\tikz@cs@line@b@end% + \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% +} + +\tikzdeclarecoordinatesystem{perpendicular} +{% + \tikz@orig@setkeys{tikzcskeys}{#1}% + \expandafter\tikz@@@scan@@absolute\expandafter\tikz@parse@intersection@a\tikz@cs@hori@line% + \expandafter\tikz@@@scan@@absolute\expandafter\tikz@parse@intersection@b\tikz@cs@vert@line% + \pgfqpoint{\the\pgf@xb}{\the\pgf@ya} +} + +\tikz@orig@define@key{tikzcskeys}{x}{\def\tikz@cs@x{#1}} +\tikz@orig@define@key{tikzcskeys}{y}{\def\tikz@cs@y{#1}} +\tikz@orig@define@key{tikzcskeys}{z}{\def\tikz@cs@z{#1}} +\tikz@orig@define@key{tikzcskeys}{angle}{\def\tikz@cs@angle{#1}} +\tikz@orig@define@key{tikzcskeys}{radius}{\def\tikz@cs@xradius{#1}\def\tikz@cs@yradius{#1}} +\tikz@orig@define@key{tikzcskeys}{x radius}{\def\tikz@cs@xradius{#1}} +\tikz@orig@define@key{tikzcskeys}{y radius}{\def\tikz@cs@yradius{#1}} +\tikz@orig@define@key{tikzcskeys}{name}{\def\tikz@cs@node{#1}} +\tikz@orig@define@key{tikzcskeys}{anchor}{\def\tikz@cs@anchor{#1}} + +\tikz@orig@define@key{tikzcskeys}{first line}{\tikz@parse@cs@line{tikz@cs@line@a}#1} +\tikz@orig@define@key{tikzcskeys}{second line}{\tikz@parse@cs@line{tikz@cs@line@b}#1} + +\def\tikz@parse@cs@line#1(#2)--(#3){% + \expandafter\def\csname #1@begin\endcsname{(#2)}% + \expandafter\def\csname #1@end\endcsname{(#3)}% +} + +\tikz@orig@define@key{tikzcskeys}{horizontal line through}{\def\tikz@cs@hori@line{#1}} +\tikz@orig@define@key{tikzcskeys}{vertical line through}{\def\tikz@cs@vert@line{#1}} + + + % % Coordinate management @@ -2422,8 +3047,8 @@ % Last position visited -\def\tikz@last@position{\pgfpoint{\tikz@lastx}{\tikz@lasty}} -\def\tikz@last@position@saved{\pgfpoint{\tikz@lastxsaved}{\tikz@lastysaved}} +\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{% @@ -2447,16 +3072,17 @@ % appropriate pgf command representing that point. \def\tikz@scan@one@point#1{% + \let\tikz@to@use@whom=\tikz@to@use@last@coordinate% \tikz@shapeborderfalse% - \@ifnextchar+{\tikz@scan@relative#1}{\tikz@scan@absolute#1}} + \pgf@ifnextchar+{\tikz@scan@relative#1}{\tikz@scan@absolute#1}} \def\tikz@scan@absolute#1{% - \@ifnextchar({\tikz@scan@@absolute#1}%) + \pgf@ifnextchar({\tikz@scan@@absolute#1}%) {% \advance\tikz@expandcount by -1% \ifnum\tikz@expandcount<0\relax% \let\@next=\tikz@@scangiveup% \else% - \let\@next=\tikz@@scanexpand + \let\@next=\tikz@@scanexpand% \fi% \@next{#1}% }% @@ -2468,7 +3094,7 @@ \expandafter\tikz@@scan@@absolute\expandafter#1\tikz@temp% } \def\tikz@@scan@@absolute#1({% - \@ifnextchar[% uhoh... options! + \pgf@ifnextchar[% uhoh... options! {\def\tikz@scan@point@recall{#1}\tikz@scan@options}% {\tikz@@@scan@@absolute#1(}% } @@ -2483,11 +3109,11 @@ % Ok, compute point with options set and zero transformation % matrix: \pgftransformreset% - \let\tikz@transform=\@empty% + \let\tikz@transform=\pgf@empty% \expandafter\tikz@setkeys\expandafter{\tikz@scan@point@options}% \tikz@transform% \pgf@process{\pgfpointtransformed{#1}}% - \xdef\tikz@marshal{\expandafter\noexpand\tikz@scan@point@recall{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}}% + \xdef\tikz@marshal{\expandafter\noexpand\tikz@scan@point@recall{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}% }% \tikz@marshal% } @@ -2506,15 +3132,20 @@ \let\@next\tikz@parse@vh% \fi% \else% - \in@:{#2}% - \ifin@ - \let\@next\tikz@parse@polar% + \in@{cs:}{#2}% + \ifin@% + \let\@next\tikz@parse@coordinatesystem% \else% - \in@,{#2}% - \ifin@% - \let\@next\tikz@parse@regular% + \in@:{#2}% + \ifin@ + \let\@next\tikz@parse@polar% \else% - \let\@next\tikz@parse@node% + \in@,{#2}% + \ifin@% + \let\@next\tikz@parse@regular% + \else% + \let\@next\tikz@parse@node% + \fi% \fi% \fi% \fi% @@ -2522,23 +3153,47 @@ \@next#1(#2)% } +\def\tikz@parse@coordinatesystem#1(#2 cs:#3){% + \let\tikz@return@coordinate=\pgfpointorigin% + \pgf@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{% \@tempdima\z@% \afterassignment\tikz@@checkunit% \@tempdima#1\@tempdima\tikz@unique% } -\def\tikz@@checkunit{\@ifnextchar\tikz@unique{\tikz@checkunit@number}{\tikz@checkunit@dimension}} +\def\tikz@@checkunit{\pgf@ifnextchar\tikz@unique{\tikz@checkunit@number}{\tikz@checkunit@dimension}} \def\tikz@checkunit@number\tikz@unique{\tikz@isdimensionfalse} \def\tikz@checkunit@dimension#1\tikz@unique{\tikz@isdimensiontrue} \def\tikz@parse@polar#1(#2:#3){% - \@ifundefined{tikz@polar@dir@#2} - {#1{\pgfpointpolar{#2}{#3}}} - {% - \edef\tikz@marshal{\noexpand#1{\noexpand\pgfpointpolar{\csname tikz@polar@dir@#2\endcsname}{#3}}}% - \tikz@marshal% - }% + \pgf@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){% + \in@{ and }{#3}% + \ifin@% + \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% + \def\tikz@next{#1{\pgfpointpolar{#2}{#3/#4}}}% + \else% + \def\tikz@next{#1{\pgfpointpolarxy{#2}{#3/#4}}}% + \fi% + \tikz@next% } \def\tikz@polar@dir@up{90} \def\tikz@polar@dir@down{-90} @@ -2587,7 +3242,7 @@ \def\tikz@shapeborder@name{#2}% \fi% \fi% - \edef\tikz@marshal{\noexpand#1{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}}% + \edef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}% \tikz@marshal% } @@ -2644,7 +3299,7 @@ {% \tikz@@@scan@@absolute\tikz@parse@vh@mid(#2)% \tikz@@@scan@@absolute\tikz@parse@vh@end(#3)% - \xdef\tikz@marshal{\noexpand#1{\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}}}% + \xdef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}}% }% \tikz@shapeborderfalse% \tikz@marshal% @@ -2659,10 +3314,10 @@ \tikz@@@scan@@absolute\tikz@parse@intersection@c(#4)% \tikz@@@scan@@absolute\tikz@parse@intersection@d(#5)% \xdef\tikz@marshal{\noexpand#1{\noexpand\pgfpointintersectionoflines% - {\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}}% - {\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}% - {\noexpand\pgfpoint{\the\pgf@xc}{\the\pgf@yc}}% - {\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}}}% + {\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}}}}% }% \tikz@shapeborderfalse% \tikz@marshal% @@ -2674,7 +3329,7 @@ \def\tikz@parse@intersection@d#1{\pgf@process{#1}} \def\tikz@scan@relative#1+{% - \@ifnextchar+{\tikz@scan@plusplus#1}{\tikz@scan@oneplus#1}} + \pgf@ifnextchar+{\tikz@scan@plusplus#1}{\tikz@scan@oneplus#1}} \def\tikz@scan@plusplus#1+{% \def\tikz@doafter{#1}% @@ -2690,4 +3345,51 @@ } + +% 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 pgflibrarytikzX.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{\pgf@ifnextchar[{\use@tikzlibrary}{\use@@tikzlibrary}}%} +\def\use@tikzlibrary[#1]{\use@@tikzlibrary{#1}} +\def\use@@tikzlibrary#1{% + \edef\pgf@list{#1}% + \@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=\pgf@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 pgflibrarytikz\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 diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex index e953e2d28b1..a0b9a108d60 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryarrows.code.tex,v 1.2 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryarrows.code.tex,v 1.5 2006/10/11 15:22:26 tantau Exp $ % A square bracket shaped arrow @@ -703,6 +707,38 @@ \pgfarrowsdeclarereversed{hooks reversed}{hooks reversed}{hooks}{hooks} +% An arrow that looks like a serif of the computer modern font + +\pgfarrowsdeclare{serif cm}{serif cm} +{ + \@tempdima=0.4pt% + \advance\@tempdima by.45\pgflinewidth% + \pgfarrowsleftextend{-.75\@tempdima} + \pgfarrowsrightextend{.04\pgflinewidth} +} +{ + \@tempdima=0.4pt% + \advance\@tempdima by.45\pgflinewidth% + \pgftransformxshift{.04\pgflinewidth} + \pgfpathmoveto{\pgfpoint{-.75\@tempdima}{.5\pgflinewidth}} + \pgfpathcurveto + {\pgfpoint{-.375\@tempdima}{.5\pgflinewidth}} + {\pgfpoint{-.375\@tempdima}{.7\pgflinewidth}} + {\pgfpoint{-.375\@tempdima}{1.95\@tempdima}} + \pgfpathlineto{\pgfpoint{0pt}{1.95\@tempdima}} + \pgfpathcurveto + {\pgfpoint{-.04\pgflinewidth}{.5\@tempdima}} + {\pgfpoint{-.04\pgflinewidth}{-.5\@tempdima}} + {\pgfpoint{0pt}{-1.95\@tempdima}} + \pgfpathlineto{\pgfpoint{-.375\@tempdima}{-1.95\@tempdima}} + \pgfpathcurveto + {\pgfpoint{-.375\@tempdima}{-.7\pgflinewidth}} + {\pgfpoint{-.375\@tempdima}{-.5\pgflinewidth}} + {\pgfpoint{-.75\@tempdima}{-.5\pgflinewidth}} + \pgfpathclose + \pgfusepathqfill +} + % Round cap diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryautomata.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryautomata.code.tex deleted file mode 100644 index be801d0a7df..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryautomata.code.tex +++ /dev/null @@ -1,189 +0,0 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryautomata.code.tex,v 1.1 2005/10/13 10:12:31 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. -% -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - -\newbox\pgfnodepartoutputbox - - - -% -% Node for states without output. This is just an alias for a circle -% node. -% -\pgfdeclareshape{state} -{ - \inheritsavedanchors[from=circle] % this is a circle - \inheritanchorborder[from=circle] - \inheritanchor[from=circle]{north} - \inheritanchor[from=circle]{north west} - \inheritanchor[from=circle]{north east} - \inheritanchor[from=circle]{center} - \inheritanchor[from=circle]{west} - \inheritanchor[from=circle]{east} - \inheritanchor[from=circle]{mid} - \inheritanchor[from=circle]{mid west} - \inheritanchor[from=circle]{mid east} - \inheritanchor[from=circle]{base} - \inheritanchor[from=circle]{base west} - \inheritanchor[from=circle]{base east} - \inheritanchor[from=circle]{south} - \inheritanchor[from=circle]{south west} - \inheritanchor[from=circle]{south east} - \inheritbackgroundpath[from=circle] -} - - -% -% Moore state node (a state with output). -% -% This node consists of two parts: The main part is the state -% name. The second part is the (optional) state output. This output is -% shown in the lower half of the node. -% -% Parts: text (=state name), output - -\pgfdeclareshape{state with output} -{ - % - % Node parts - % - \nodeparts{text,output} - - % - % Anchors - % - \savedanchor\centerpoint{% - \pgf@x=.5\wd\pgfnodeparttextbox% - \setlength{\pgf@y}{\pgfshapeinnerysep}% - \pgf@y=-\pgf@y% - \advance\pgf@y by-\dp\pgfnodeparttextbox% - \advance\pgf@y by-.5\pgflinewidth% - }% - \savedanchor\outputanchor{% - \pgf@x=-.5\wd\pgfnodepartoutputbox% - \advance\pgf@x by.5\wd\pgfnodeparttextbox% - \setlength{\pgf@y}{\pgfshapeinnerysep}% - \pgf@y=-2\pgf@y% - \advance\pgf@y by-\ht\pgfnodepartoutputbox% - \advance\pgf@y by-.5\pgflinewidth% - \advance\pgf@y by-\dp\pgfnodeparttextbox% - \advance\pgf@y by-.5\pgflinewidth% - } - - \saveddimen\radius{% - % - % Caculate ``height radius'' - % - \pgf@ya=.5\ht\pgfnodeparttextbox% - \advance\pgf@ya by.5\dp\pgfnodeparttextbox% - \advance\pgf@ya by.5\ht\pgfnodepartoutputbox% - \advance\pgf@ya by.5\dp\pgfnodepartoutputbox% - \advance\pgf@ya by.5\pgflinewidth% - \setlength\pgf@yb{\pgfshapeinnerysep}% - \advance\pgf@ya by2\pgf@yb% - % - % Caculate ``width radius'' - % - \pgf@xa=.5\wd\pgfnodeparttextbox% - \ifdim\pgf@xa<.5\wd\pgfnodepartoutputbox% - \pgf@xa=.5\wd\pgfnodepartoutputbox% - \fi% - \setlength\pgf@xb{\pgfshapeinnerxsep}% - \advance\pgf@xa by\pgf@xb% - % - % Calculate length of radius vector: - % - \pgf@process{\pgfpointnormalised{\pgfpoint{\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=\pgf@xa% - % - % If necessary, adjust radius so that the size requirements are - % met: - % - \setlength{\pgf@xb}{\pgfshapeminwidth}% - \setlength{\pgf@yb}{\pgfshapeminheight}% - \ifdim\pgf@x<.5\pgf@xb% - \pgf@x=.5\pgf@xb% - \fi% - \ifdim\pgf@x<.5\pgf@yb% - \pgf@x=.5\pgf@yb% - \fi% - % - % Now, add larger of outer sepearations. - % - \setlength{\pgf@xb}{\pgfshapeouterxsep}% - \setlength{\pgf@yb}{\pgfshapeouterysep}% - \ifdim\pgf@xb<\pgf@yb% - \advance\pgf@x by\pgf@yb% - \else% - \advance\pgf@x by\pgf@xb% - \fi% - } - - % - % Anchors - % - \inheritanchorborder[from=circle] - \inheritanchor[from=circle]{north} - \inheritanchor[from=circle]{north west} - \inheritanchor[from=circle]{north east} - \inheritanchor[from=circle]{center} - \inheritanchor[from=circle]{west} - \inheritanchor[from=circle]{east} - \inheritanchor[from=circle]{mid} - \inheritanchor[from=circle]{mid west} - \inheritanchor[from=circle]{mid east} - \inheritanchor[from=circle]{base} - \inheritanchor[from=circle]{base west} - \inheritanchor[from=circle]{base east} - \inheritanchor[from=circle]{south} - \inheritanchor[from=circle]{south west} - \inheritanchor[from=circle]{south east} - \anchor{output}{\outputanchor} - - % - % Background path - % - \inheritbackgroundpath[from=circle] - \beforebackgroundpath{ - \@tempdima=\radius% - \setlength{\pgf@xb}{\pgfshapeouterxsep}% - \setlength{\pgf@yb}{\pgfshapeouterysep}% - \ifdim\pgf@xb<\pgf@yb% - \advance\@tempdima by-\pgf@yb% - \else% - \advance\@tempdima by-\pgf@xb% - \fi% - \advance\@tempdima by-.5\pgflinewidth% - \pgfsetarrows{-}% - \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfpoint{-\@tempdima}{0pt}}}% - \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfpoint{\@tempdima}{0pt}}}% - \pgfusepath{stroke}% - } -} - - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex new file mode 100644 index 00000000000..aebb9fb5ce6 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex @@ -0,0 +1,140 @@ +% 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/libraries/pgflibrarypatterns.code.tex,v 1.7 2006/10/11 15:22:26 tantau Exp $ + + +% Lines in different directions + +\pgfdeclarepatternformonly{horizontal lines}{\pgfpointorigin}{\pgfpoint{100pt}{1pt}}{\pgfpoint{100pt}{3pt}}% +{ + \pgfsetlinewidth{0.4pt} + \pgfpathmoveto{\pgfpoint{0pt}{0.5pt}} + \pgfpathlineto{\pgfpoint{100pt}{0.5pt}} + \pgfusepath{stroke} +} + +\pgfdeclarepatternformonly{vertical lines}{\pgfpointorigin}{\pgfpoint{1pt}{100pt}}{\pgfpoint{3pt}{100pt}}% +{ + \pgfsetlinewidth{0.4pt} + \pgfpathmoveto{\pgfpoint{0.5pt}{0pt}} + \pgfpathlineto{\pgfpoint{0.5pt}{100pt}} + \pgfusepath{stroke} +} + +\pgfdeclarepatternformonly{north east lines}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}% +{ + \pgfsetlinewidth{0.4pt} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{3.1pt}{3.1pt}} + \pgfusepath{stroke} +} + +\pgfdeclarepatternformonly{north west lines}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}% +{ + \pgfsetlinewidth{0.4pt} + \pgfpathmoveto{\pgfpoint{0pt}{3pt}} + \pgfpathlineto{\pgfpoint{3.1pt}{-0.1pt}} + \pgfusepath{stroke} +} + +% Crossed lines in different directions + +\pgfdeclarepatternformonly{grid}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}% +{ + \pgfsetlinewidth{0.4pt} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{3.1pt}} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{3.1pt}{0pt}} + \pgfusepath{stroke} +} + +\pgfdeclarepatternformonly{crosshatch}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}% +{ + \pgfsetlinewidth{0.4pt} + \pgfpathmoveto{\pgfpoint{3.1pt}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{3.1pt}} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{3.1pt}{3.1pt}} + \pgfusepath{stroke} +} + + +% Dotted regions + +\pgfdeclarepatternformonly{dots}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{1pt}{1pt}}{\pgfpoint{3pt}{3pt}}% +{ + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{.5pt} + \pgfusepath{fill} +} + +\pgfdeclarepatternformonly{crosshatch dots}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{2.5pt}{2.5pt}}{\pgfpoint{3pt}{3pt}}% +{ + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{.5pt} + \pgfpathcircle{\pgfpoint{1.5pt}{1.5pt}}{.5pt} + \pgfusepath{fill} +} + + + + +% Star shaped patterns + +\pgfdeclarepatternformonly{fivepointed stars}{\pgfpointorigin}{\pgfpoint{3mm}{3mm}}{\pgfpoint{3mm}{3mm}}% +{ + \pgftransformshift{\pgfpoint{1mm}{1mm}} + \pgfpathmoveto{\pgfpointpolar{18}{1mm}} + \pgfpathlineto{\pgfpointpolar{162}{1mm}} + \pgfpathlineto{\pgfpointpolar{306}{1mm}} + \pgfpathlineto{\pgfpointpolar{90}{1mm}} + \pgfpathlineto{\pgfpointpolar{234}{1mm}} + \pgfpathclose% + \pgfusepath{fill} +} + +\pgfdeclarepatternformonly{sixpointed stars}{\pgfpointorigin}{\pgfpoint{3mm}{3mm}}{\pgfpoint{3mm}{3mm}}% +{ + \pgftransformshift{\pgfpoint{1mm}{1mm}} + \pgfpathmoveto{\pgfpointpolar{30}{1mm}} + \pgfpathlineto{\pgfpointpolar{150}{1mm}} + \pgfpathlineto{\pgfpointpolar{270}{1mm}} + \pgfpathclose% + \pgfpathmoveto{\pgfpointpolar{-30}{1mm}} + \pgfpathlineto{\pgfpointpolar{-270}{1mm}} + \pgfpathlineto{\pgfpointpolar{-150}{1mm}} + \pgfpathclose% + \pgfsetnonzerorule + \pgfusepath{fill} +} + + + +% Bricks + +\pgfdeclarepatternformonly{bricks}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{5mm}{5mm}}{\pgfpoint{4mm}{4mm}}% +{ + \pgfsetlinewidth{0.8pt} + \pgfpathmoveto{\pgfpoint{0mm}{1mm}} + \pgfpathlineto{\pgfpoint{4mm}{1mm}} + \pgfpathmoveto{\pgfpoint{0mm}{3mm}} + \pgfpathlineto{\pgfpoint{4mm}{3mm}} + \pgfpathmoveto{\pgfpoint{1mm}{0mm}} + \pgfpathlineto{\pgfpoint{1mm}{1mm}} + \pgfpathmoveto{\pgfpoint{3mm}{1mm}} + \pgfpathlineto{\pgfpoint{3mm}{3mm}} + \pgfpathmoveto{\pgfpoint{1mm}{3mm}} + \pgfpathlineto{\pgfpoint{1mm}{4mm}} + \pgfusepath{stroke} +} + + + + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex index 7bbaa4b24bb..afd5f3509b4 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.3 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.7 2006/10/11 15:22:26 tantau Exp $ \newif\ifpgf@plot@started @@ -23,7 +26,7 @@ \def\pgfplothandlercurveto{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@curveto@handler@initial% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\pgf@plot@curveto@handler@finish% \global\pgf@plot@startedfalse% }% @@ -113,7 +116,7 @@ \def\pgfplothandlerclosedcurve{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@initial% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\pgf@plot@closedcurve@handler@finish% }% } @@ -276,7 +279,7 @@ \def\pgfplothandlerxcomb{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@xcomb@handler% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -302,7 +305,7 @@ \def\pgfplothandlerycomb{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@ycomb@handler% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -331,7 +334,7 @@ \def\pgfplothandlerpolarcomb{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@polarcomb@handler% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -359,19 +362,86 @@ % \pgfplotxyfile{mytable} \def\pgfplothandlermark#1{% + \pgf@plothandlermark{% + \ifnum\pgf@plot@mark@count<\pgf@plot@mark@repeat\relax% + \else% + \global\pgf@plot@mark@count=0\relax% + #1% + \fi% + }% +} + +\newcount\pgf@plot@mark@count +\def\pgf@plot@mark@phase{0} + +\def\pgf@plothandlermark#1{% \def\pgf@plot@mark{#1}% \def\pgf@plotstreamstart{% + \global\pgf@plot@mark@count=\pgf@plot@mark@repeat\relax% + \global\advance\pgf@plot@mark@count by-\pgf@plot@mark@phase\relax% \global\let\pgf@plotstreampoint=\pgf@plot@mark@handler% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } \def\pgf@plot@mark@handler#1{% + \global\advance\pgf@plot@mark@count by1\relax% {\pgftransformshift{#1}\pgf@plot@mark}% } +% Set the repeat count for marks. For example, if 3 is given as a +% value, only every third point will get a mark. +% +% #1 = repeat count +% +% Example: +% +% \pgfsetplotmarkrepeat{2} + +\def\pgfsetplotmarkrepeat#1{\def\pgf@plot@mark@repeat{#1}} +\pgfsetplotmarkrepeat{1} + + +% Set the phase for marks. For example, if 3 is the repeat and 3 is +% the phase, already the first point will be marked. +% +% #1 = the index of the first point that should be marked. +% +% Example: +% +% \pgfsetplotmarkphase{3} + +\def\pgfsetplotmarkphase#1{\def\pgf@plot@mark@phase{#1}} +\pgfsetplotmarkphase{1} + + + +% This handler draws a given mark at those points whose number is +% given in the (pgffor-like) list. +% +% #1 = some code to be executed at each point (with the coordinate +% system translated to that point). +% Typically, this code will be \pgfuseplotmark{whatever}. +% #2 = list of positions like "1,2,4,...,9,10" +% +% Example: +% +% \pgfplothandlermarklisted{\pgfuseplotmark{*}}{1,2,4,...,9} +% \pgfplotxyfile{mytable} + +\def\pgfplothandlermarklisted#1#2{% + \let\pgf@plot@mark@list=\pgf@empty% + \edef\pgf@marshal{\noexpand\foreach\noexpand\pgf@temp in{#2}} + \pgf@marshal{\xdef\pgf@plot@mark@list{\pgf@plot@mark@list(\pgf@temp)}}% + \pgf@plothandlermark{% + \edef\pgf@marshal{\noexpand\in@{(\the\pgf@plot@mark@count)}{\pgf@plot@mark@list}}% + \pgf@marshal% + \ifin@#1\fi}% +} + + % Define a new plot mark for use with \pgfplotmark. % % #1 = a plot mark mnemonic diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex index 760998738b4..a821e6f65cf 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplotmarks.code.tex,v 1.2 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/libraries/pgflibraryplotmarks.code.tex,v 1.4 2006/10/11 15:22:26 tantau Exp $ % A stroked circle mark diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex index 2c777ef5504..a6965b60e3b 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.code.tex,v 1.5 2005/10/13 10:12:31 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/libraries/pgflibraryshapes.code.tex,v 1.9 2006/10/11 15:22:26 tantau Exp $ \pgfdeclareshape{ellipse} % @@ -191,6 +194,293 @@ } + + +% Set the recommended shape aspect ratio +% +% #1 = aspect ratio +% +% Example: +% +% \pgfsetshapeminwidth{1.5} + +\def\pgfsetshapeaspect#1{% + \def\pgfshapeaspect{#1}% + % Invert + \@tempdima=#1pt% + \@tempdima=.125\@tempdima% + \c@pgf@counta=\@tempdima\relax% 8192*determinant + \@tempdima=8192pt% + \divide\@tempdima by\c@pgf@counta% + \edef\pgfshapeaspectinverse{\pgf@sys@tonumber{\@tempdima}} +} +\pgfsetshapeaspect{1} + + + +\pgfdeclareshape{diamond} +{ + \savedanchor\outernortheast{% + % + % Calculate width and height of the inner rectangle + % + \pgf@xa=.5\wd\pgfnodeparttextbox% + \setlength\pgf@xc{\pgfshapeinnerxsep}% + \advance\pgf@xa by\pgf@xc% + \pgf@ya=.5\ht\pgfnodeparttextbox% + \advance\pgf@ya by.5\dp\pgfnodeparttextbox% + \setlength\pgf@yc{\pgfshapeinnerysep}% + \advance\pgf@ya by\pgf@yc% + % + % Calculate width and height of diamond + % + \pgf@x=\pgf@xa% + \advance\pgf@x by\pgfshapeaspect\pgf@ya% + \pgf@y=\pgfshapeaspectinverse\pgf@xa% + \advance\pgf@y by\pgf@ya% + % + % Check against minimum height/width + % + \setlength\pgf@xb{\pgfshapeminwidth}% + \ifdim\pgf@x<\pgf@xb% + % yes, too small. Enlarge... + \pgf@x=\pgf@xb% + \fi% + \setlength\pgf@yb{\pgfshapeminheight}% + \ifdim\pgf@y<\pgf@yb% + % yes, too small. Enlarge... + \pgf@y=\pgf@yb% + \fi% + % + % Add outer border + % + \setlength\pgf@xa{\pgfshapeouterxsep}% + \advance\pgf@x by\pgf@xa% + \setlength\pgf@ya{\pgfshapeouterysep}% + \advance\pgf@y by\pgf@ya% + } + \savedanchor\text{% + \pgf@x=-.5\wd\pgfnodeparttextbox% + \pgf@y=-.5\ht\pgfnodeparttextbox% + \advance\pgf@y by.5\dp\pgfnodeparttextbox% + } + + % + % Anchors + % + \anchor{text}{\text}% + \anchor{center}{\pgfpointorigin}% + \anchor{mid}{% + \pgf@process{\text}% + \pgf@x=0pt% + \setlength\pgf@ya{.5ex} + \advance\pgf@y by\pgf@ya% + } + \anchor{base}{\pgf@process{\text}\pgf@x=0pt } + \anchor{north}{\pgf@process{\outernortheast}\pgf@x=0pt} + \anchor{south}{\pgf@process{\outernortheast}\pgf@x=0pt\pgf@y=-\pgf@y} + \anchor{west}{\pgf@process{\outernortheast}\pgf@x=-\pgf@x\pgf@y=0pt} + \anchor{north west}{\pgf@process{\outernortheast}\pgf@x=-.5\pgf@x\pgf@y=.5\pgf@y} + \anchor{south west}{\pgf@process{\outernortheast}\pgf@x=-.5\pgf@x\pgf@y=-.5\pgf@y} + \anchor{east}{\pgf@process{\outernortheast}\pgf@y=0pt} + \anchor{north east}{\pgf@process{\outernortheast}\pgf@x=.5\pgf@x\pgf@y=.5\pgf@y} + \anchor{south east}{\pgf@process{\outernortheast}\pgf@x=.5\pgf@x\pgf@y=-.5\pgf@y} + \anchorborder{% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{\outernortheast}% + \ifdim\pgf@xa>0pt% + \else% + \pgf@x=-\pgf@x% + \fi% + \ifdim\pgf@ya>0pt% + \else% + \pgf@y=-\pgf@y% + \fi% + \edef\pgf@marshal{% + \noexpand\pgfpointintersectionoflines + {\noexpand\pgfpointorigin} + {\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}} + {\noexpand\pgfpoint{\the\pgf@x}{0pt}} + {\noexpand\pgfpoint{0pt}{\the\pgf@y}}% + }% + \pgf@process{\pgf@marshal}% + } + + % + % Background path + % + \backgroundpath{ + \pgf@process{\outernortheast}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + \setlength{\pgf@xa}{\pgfshapeouterxsep}% + \setlength{\pgf@ya}{\pgfshapeouterysep}% + \advance\pgf@xc by-1.414213\pgf@xa% + \advance\pgf@yc by-1.414213\pgf@ya% + \pgfpathmoveto{\pgfpoint{\pgf@xc}{0pt}}% + \pgfpathlineto{\pgfpoint{0pt}{\pgf@yc}}% + \pgfpathlineto{\pgfpoint{-\pgf@xc}{0pt}}% + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@yc}}% + \pgfpathclose% + } +} + + + +\newbox\pgfnodepartlowerbox + +% +% A circle that is split in the middle into an upper and a lower part. +% +% This node consists of two parts: The upper (main) part is shown in +% the upper half of the circle. The second part is the (optional) +% lower part. +% +% Parts: text, lower + +\pgfdeclareshape{circle split} +{ + % + % Node parts + % + \nodeparts{text,lower} + + % + % Anchors + % + \savedanchor\centerpoint{% + \pgf@x=.5\wd\pgfnodeparttextbox% + \setlength{\pgf@y}{\pgfshapeinnerysep}% + \pgf@y=-\pgf@y% + \advance\pgf@y by-\dp\pgfnodeparttextbox% + \advance\pgf@y by-.5\pgflinewidth% + }% + \savedanchor\loweranchor{% + \pgf@x=-.5\wd\pgfnodepartlowerbox% + \advance\pgf@x by.5\wd\pgfnodeparttextbox% + \setlength{\pgf@y}{\pgfshapeinnerysep}% + \pgf@y=-2\pgf@y% + \advance\pgf@y by-\ht\pgfnodepartlowerbox% + \advance\pgf@y by-.5\pgflinewidth% + \advance\pgf@y by-\dp\pgfnodeparttextbox% + \advance\pgf@y by-.5\pgflinewidth% + } + + \saveddimen\radius{% + % + % Caculate ``height radius'' + % + \pgf@ya=.5\ht\pgfnodeparttextbox% + \advance\pgf@ya by.5\dp\pgfnodeparttextbox% + \advance\pgf@ya by.5\ht\pgfnodepartlowerbox% + \advance\pgf@ya by.5\dp\pgfnodepartlowerbox% + \advance\pgf@ya by.5\pgflinewidth% + \setlength\pgf@yb{\pgfshapeinnerysep}% + \advance\pgf@ya by2\pgf@yb% + % + % Caculate ``width radius'' + % + \pgf@xa=.5\wd\pgfnodeparttextbox% + \ifdim\pgf@xa<.5\wd\pgfnodepartlowerbox% + \pgf@xa=.5\wd\pgfnodepartlowerbox% + \fi% + \setlength\pgf@xb{\pgfshapeinnerxsep}% + \advance\pgf@xa by\pgf@xb% + % + % Calculate length of radius vector: + % + \pgf@process{\pgfpointnormalised{\pgfpoint{\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=\pgf@xa% + % + % If necessary, adjust radius so that the size requirements are + % met: + % + \setlength{\pgf@xb}{\pgfshapeminwidth}% + \setlength{\pgf@yb}{\pgfshapeminheight}% + \ifdim\pgf@x<.5\pgf@xb% + \pgf@x=.5\pgf@xb% + \fi% + \ifdim\pgf@x<.5\pgf@yb% + \pgf@x=.5\pgf@yb% + \fi% + % + % Now, add larger of outer sepearations. + % + \setlength{\pgf@xb}{\pgfshapeouterxsep}% + \setlength{\pgf@yb}{\pgfshapeouterysep}% + \ifdim\pgf@xb<\pgf@yb% + \advance\pgf@x by\pgf@yb% + \else% + \advance\pgf@x by\pgf@xb% + \fi% + } + + % + % Anchors + % + \inheritanchorborder[from=circle] + \inheritanchor[from=circle]{north} + \inheritanchor[from=circle]{north west} + \inheritanchor[from=circle]{north east} + \inheritanchor[from=circle]{center} + \inheritanchor[from=circle]{west} + \inheritanchor[from=circle]{east} + \inheritanchor[from=circle]{mid} + \inheritanchor[from=circle]{mid west} + \inheritanchor[from=circle]{mid east} + \inheritanchor[from=circle]{base} + \inheritanchor[from=circle]{base west} + \inheritanchor[from=circle]{base east} + \inheritanchor[from=circle]{south} + \inheritanchor[from=circle]{south west} + \inheritanchor[from=circle]{south east} + \anchor{lower}{\loweranchor} + + % + % Background path + % + \inheritbackgroundpath[from=circle] + \beforebackgroundpath{ + \@tempdima=\radius% + \setlength{\pgf@xb}{\pgfshapeouterxsep}% + \setlength{\pgf@yb}{\pgfshapeouterysep}% + \ifdim\pgf@xb<\pgf@yb% + \advance\@tempdima by-\pgf@yb% + \else% + \advance\@tempdima by-\pgf@xb% + \fi% + \advance\@tempdima by-.5\pgflinewidth% + \pgfsetshortenstart{0pt}% + \pgfsetshortenend{0pt}% + \pgfsetarrows{-}% + \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfpoint{-\@tempdima}{0pt}}}% + \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfpoint{\@tempdima}{0pt}}}% + \pgfusepath{stroke}% + } +} + + + \pgfdeclareshape{cross out} { \inheritsavedanchors[from=rectangle] % this is nearly a rectangle diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex index 3440477499e..f9795dc4a99 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarysnakes.code.tex,v 1.9 2005/10/13 10:12:31 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarysnakes.code.tex,v 1.14 2006/10/11 15:22:26 tantau Exp $ \newdimen\pgfsnakesegmentamplitude @@ -280,6 +284,35 @@ +% crosses snakes +% +% Parameters: \pgfsnakesegmentlength, \pgfsnakeobjectsize, \pgfsnakesegmentamplitude + +\pgfdeclaresnake{crosses}{crosses} +{ + \state{crosses}[switch if less than=\pgfsnakesegmentlength to last, + width=\pgfsnakesegmentlength] + { + \pgfpathmoveto{\pgfpoint{0pt}{\pgfsnakesegmentamplitude}} + \pgfpathlineto{\pgfpoint{\pgfsnakesegmentobjectlength}{-\pgfsnakesegmentamplitude}} + \pgfpathmoveto{\pgfpoint{0pt}{-\pgfsnakesegmentamplitude}} + \pgfpathlineto{\pgfpoint{\pgfsnakesegmentobjectlength}{\pgfsnakesegmentamplitude}} + } + \state{last}[width=\pgfsnakesegmentobjectlength,next state=final] + { + \pgfpathmoveto{\pgfpoint{0pt}{\pgfsnakesegmentamplitude}} + \pgfpathlineto{\pgfpoint{\pgfsnakesegmentobjectlength}{-\pgfsnakesegmentamplitude}} + \pgfpathmoveto{\pgfpoint{0pt}{-\pgfsnakesegmentamplitude}} + \pgfpathlineto{\pgfpoint{\pgfsnakesegmentobjectlength}{\pgfsnakesegmentamplitude}} + } + \state{final} + { + \pgfpathmoveto{\pgfpoint{\pgfsnakeremainingdistance}{0pt}} + } +} + + + % ticks snakes % % Parameters: \pgfsnakesegmentlength, \pgfsnakesegmentamplitude @@ -366,4 +399,26 @@ +% bent snake +% +% A snake that looks like someone bent the line a bit. +% +% Parameters: \pgfsnakesegmentamplitude, \pgfsnakesegmentaspect + +\pgfdeclaresnake{bent}{bent} +{ + \state{bent}[width=\pgfsnakeremainingdistance,next state=final] + { + \pgfpathcurveto + {\pgfpoint{\pgfsnakesegmentaspect\pgfsnakeremainingdistance}{\pgfsnakesegmentamplitude}} + {\pgfpointadd{\pgfpoint{\pgfsnakeremainingdistance}{0pt}} + {\pgfpoint{-\pgfsnakesegmentaspect\pgfsnakeremainingdistance}{\pgfsnakesegmentamplitude}}} + {\pgfpoint{\pgfsnakeremainingdistance}{0pt}} + } + \state{final} + {} +} + + + \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikz3d.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikz3d.code.tex new file mode 100644 index 00000000000..d980b557feb --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikz3d.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/libraries/pgflibrarytikz3d.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $ + + + +% New coordinate systems: + +\tikzdeclarecoordinatesystem{xyz cylindrical} +{% + \setkeys{tikzcskeys}{angle=0,radius=0,z=0,#1}% + \pgfpointcylindrical{\tikz@cs@angle}{\tikz@cs@radius}{\tikz@cs@z}% +} + +\tikzdeclarecoordinatesystem{xyz spherical} +{% + \setkeys{tikzcskeys}{angle=0,radius=0,latitude=0,longitude=0,#1}% + \pgfpointspherical{\tikz@cs@angle}{\tikz@cs@latitude}{\tikz@cs@radius}% +} + +\define@key{tikzcskeys}{longitude}{\def\tikz@cs@angle{#1}} +\define@key{tikzcskeys}{latitude}{\def\tikz@cs@latitude{#1}} + + +% Options for transforming into a plane: + +\tikzoption{plane origin}{\def\tikz@plane@origin{\tikz@scan@one@point\@firstofone#1}} +\tikzoption{plane x}{\def\tikz@plane@x{\tikz@scan@one@point\@firstofone#1}} +\tikzoption{plane y}{\def\tikz@plane@y{\tikz@scan@one@point\@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/libraries/pgflibrarytikzarrows.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzarrows.code.tex new file mode 100644 index 00000000000..2ca988c5493 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzarrows.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/libraries/pgflibrarytikzarrows.code.tex,v 1.2 2006/10/11 15:22:26 tantau Exp $ + +\usepgflibrary{arrows} + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzautomata.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzautomata.code.tex new file mode 100644 index 00000000000..d30f8abb767 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzautomata.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/libraries/pgflibrarytikzautomata.code.tex,v 1.3 2006/10/11 15:22:26 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}=[] + + +\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@initial@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/libraries/pgflibrarytikzbackgrounds.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzbackgrounds.code.tex index 260a8f9a28a..6fa6b9963cc 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzbackgrounds.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzbackgrounds.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarytikzbackgrounds.code.tex,v 1.1 2005/08/13 18:59:56 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/libraries/pgflibrarytikzbackgrounds.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $ % Layers diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzer.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzer.code.tex new file mode 100644 index 00000000000..3056d59185e --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzer.code.tex @@ -0,0 +1,39 @@ +% 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/libraries/pgflibrarytikzer.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $ + + +% 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/libraries/pgflibrarytikzmindmap.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzmindmap.code.tex new file mode 100644 index 00000000000..80a2ca35f55 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzmindmap.code.tex @@ -0,0 +1,320 @@ +% 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/libraries/pgflibrarytikzmindmap.code.tex,v 1.14 2006/10/11 15:22:26 tantau Exp $ + + + +% A snake for connecting circle nodes +% +% Parameters: \pgfsnakecirclestartradius, \pgfsnakecircleendradius, +% \pgfsnakesegmentamplitude, \pgfsnakesegmentangle + +\pgfdeclaresnake{circle connection bar}{initial} +{ + \state{initial}[width=0pt,next state=bar] + { + { + \pgftransformxshift{-\pgfsnakecirclestartradius}% + \pgfpathmoveto{\pgfpointpolar{\pgfsnakesegmentangle}{\pgfsnakecirclestartradius}} + \pgfpatharc{\pgfsnakesegmentangle}{-\pgfsnakesegmentangle}{\pgfsnakecirclestartradius} + \@tempcnta=-\pgfsnakesegmentangle\relax + \advance\@tempcnta by90\relax + \setlength\@tempdima{\pgfsnakecirclestartradius} + \setlength\@tempdimb{\pgfsnakesegmentamplitude} + \pgfpathcurveto + {\pgfpointadd + {\pgfpointpolar{-\pgfsnakesegmentangle}{\pgfsnakecirclestartradius}} + {\pgfpointpolar{\the\@tempcnta}{.25\@tempdima}}} + {\pgfpoint{1.25\@tempdima}{-.5\@tempdimb}} + {\pgfpoint{1.5\@tempdima}{-.5\@tempdimb}} + \pgfpathlineto{\pgfpoint{1.5\@tempdima}{.5\@tempdimb}} + \@tempcnta=\pgfsnakesegmentangle\relax + \advance\@tempcnta by-90\relax + \pgfpathcurveto + {\pgfpoint{1.25\@tempdima}{.5\@tempdimb}} + {\pgfpointadd + {\pgfpointpolar{\pgfsnakesegmentangle}{\pgfsnakecirclestartradius}} + {\pgfpointpolar{\the\@tempcnta}{.25\@tempdima}}} + {\pgfpointpolar{\pgfsnakesegmentangle}{\pgfsnakecirclestartradius}} + \pgfpathclose + } + } + \state{bar}[width=0pt,next state=end] + { + \setlength\@tempdima{\pgfsnakecirclestartradius}% + \setlength\@tempdimb{\pgfsnakecircleendradius}% + \setlength\pgf@xc{\pgfsnakesegmentamplitude}% + \pgfpathrectangle + {\pgfpoint{.5\@tempdima}{-.5\pgf@xc}} + {\pgfpoint{\pgfsnakeremainingdistance-.5\@tempdimb-.5\@tempdima}{\pgf@xc}} + } + \state{end}[width=0pt,next state=final] + { + { + \pgftransformxshift{\pgfsnakeremainingdistance}% + \pgftransformxscale{-1}% + \pgftransformxshift{-\pgfsnakecircleendradius}% + \pgfpathmoveto{\pgfpointpolar{\pgfsnakesegmentangle}{\pgfsnakecircleendradius}} + \pgfpatharc{\pgfsnakesegmentangle}{-\pgfsnakesegmentangle}{\pgfsnakecircleendradius} + \@tempcnta=-\pgfsnakesegmentangle\relax + \advance\@tempcnta by90\relax + \setlength\@tempdima{\pgfsnakecircleendradius} + \setlength\@tempdimb{\pgfsnakesegmentamplitude}% + \pgfpathcurveto + {\pgfpointadd + {\pgfpointpolar{-\pgfsnakesegmentangle}{\pgfsnakecircleendradius}} + {\pgfpointpolar{\the\@tempcnta}{.25\@tempdima}}} + {\pgfpoint{1.25\@tempdima}{-.5\@tempdimb}} + {\pgfpoint{1.5\@tempdima}{-.5\@tempdimb}} + \pgfpathlineto{\pgfpoint{1.5\@tempdima}{.5\@tempdimb}} + \@tempcnta=\pgfsnakesegmentangle\relax + \advance\@tempcnta by-90\relax + \pgfpathcurveto + {\pgfpoint{1.25\@tempdima}{.5\@tempdimb}} + {\pgfpointadd + {\pgfpointpolar{\pgfsnakesegmentangle}{\pgfsnakecircleendradius}} + {\pgfpointpolar{\the\@tempcnta}{.25\@tempdima}}} + {\pgfpointpolar{\pgfsnakesegmentangle}{\pgfsnakecircleendradius}} + \pgfpathclose + } + } + \state{final} + {} +} + + +\def\pgfsnakecirclestartradius{1cm} +\def\pgfsnakecircleendradius{1cm} +\def\pgfsnakesegmentangle{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] + [snake=circle connection bar] + [every 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% + \edef\pgfsnakecirclestartradius{\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% + \edef\pgfsnakecircleendradius{\the\pgf@xa}% +} +\def\tikz@compute@segmentamplitude{% + \pgf@x=\pgfsnakecirclestartradius\relax% + \ifdim\pgf@x>\pgfsnakecircleendradius\relax% + \pgf@x=\pgfsnakecircleendradius\relax% + \fi% + \pgf@x=.175\pgf@x\relax% + \edef\pgfsnakesegmentamplitude{\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{% + \colorlet{tikz@switch@from}{#1}% + \colorlet{tikz@switch@to}{#2}% + \tikz@compute@circle@radii\tikz@compute@segmentamplitude% + \tikz@compute@rotation% + } + [fill=none,draw=none] + [snake=circle connection bar] + [every 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(45bp)=(tikz@switch@from); + color(50bp)=(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,% + set style={{every child}+=[style=tikz@concept@setting,style=tikz@concept@color@set]},% + style=root concept, + set style={{level 1}+=[style=level 1 concept]}, + set style={{level 2}+=[style=level 2 concept]}, + set style={{level 3}+=[style=level 3 concept]}, + set style={{level 4}+=[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=\large] +\tikzstyle{level 1 concept}=[minimum size=2.25cm, + level distance=5cm, + text width=2cm, + sibling angle=60, + font=\small] +\tikzstyle{level 2 concept}=[minimum size=1.75cm,% + level distance=2.9cm,% + text width=1.5cm,% + sibling angle=60,% + font=\footnotesize] +\tikzstyle{level 3 concept}=[minimum size=1.15cm,% + text width=1cm,% + level distance=2.4cm,% + sibling angle=30,% + font=\tiny] +\tikzstyle{level 4 concept}=[minimum size=0.9cm,% + text width=0.7cm, + level distance=1.85cm,% + sibling angle=30,% + font=\tiny] + +\tikzstyle{large mindmap}= + [% + set style={{root concept}=[minimum size=5.6cm,text width=4.5cm,font=\Large]}, + set style={{level 1 concept}=[% + minimum size=3.2cm, + level distance=7cm, + text width=2.8cm, + sibling angle=60, + font=]},% + set style={{level 2 concept}=[% + minimum size=2.45cm,% + level distance=4cm,% + text width=2.2cm,% + sibling angle=60,% + font=\small% + ]},% + set style={{level 3 concept}=[% + minimum size=1.63cm,% + text width=1.4cm,% + level distance=3.38cm,% + sibling angle=30,% + font=\scriptsize]},% + set style={{level 4 concept}=[% + minimum size=1.27cm,% + text width=1cm, + level distance=2.60cm,% + sibling angle=30,% + font=\tiny]},% + mindmap,% + line width=2pt + ] + +\tikzstyle{huge mindmap}= + [% + set style={{root concept}=[minimum size=8cm,text width=7cm,font=\huge]}, + set style={{level 1 concept}+=[% + minimum size=4.5cm, + level distance=10cm, + text width=4cm, + sibling angle=60, + font=\large]},% + set style={{level 2 concept}+=[% + minimum size=3.5cm,% + level distance=5.8cm,% + text width=3cm,% + sibling angle=60,% + font=% + ]},% + set style={{level 3 concept}+=[% + minimum size=2.3cm,% + text width=2cm,% + level distance=4.8cm,% + sibling angle=30,% + font=\footnotesize]},% + set style={{level 4 concept}+=[% + minimum size=1.7cm,% + text width=1.4cm, + level distance=3.7cm,% + sibling angle=30,% + 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=\tiny, + every annotation] +\tikzstyle{every annotation}=[] + +\endinput + diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzpatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzpatterns.code.tex new file mode 100644 index 00000000000..7766f66d8d5 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzpatterns.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/libraries/pgflibrarytikzpatterns.code.tex,v 1.2 2006/10/11 15:22:26 tantau Exp $ + +\usepgflibrary{patterns} + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzpetri.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzpetri.code.tex new file mode 100644 index 00000000000..ebb43bca13f --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzpetri.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/libraries/pgflibrarytikzpetri.code.tex,v 1.3 2006/10/11 15:22:26 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=\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{% + \setlength{\pgf@xa}{\tikz@token@distance}% + \setlength{\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/libraries/pgflibrarytikzplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzplothandlers.code.tex new file mode 100644 index 00000000000..d9179187394 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzplothandlers.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/libraries/pgflibrarytikzplothandlers.code.tex,v 1.2 2006/10/11 15:22:26 tantau Exp $ + +\usepgflibrary{plothandlers} + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzplotmarks.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzplotmarks.code.tex new file mode 100644 index 00000000000..4455e03aac2 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzplotmarks.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/libraries/pgflibrarytikzplotmarks.code.tex,v 1.2 2006/10/11 15:22:26 tantau Exp $ + +\usepgflibrary{plotmarks} + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzshapes.code.tex new file mode 100644 index 00000000000..ef4dcca2a7b --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzshapes.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/libraries/pgflibrarytikzshapes.code.tex,v 1.2 2006/10/11 15:22:26 tantau Exp $ + +\usepgflibrary{shapes} + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzsnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzsnakes.code.tex new file mode 100644 index 00000000000..0274721bd36 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzsnakes.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/libraries/pgflibrarytikzsnakes.code.tex,v 1.2 2006/10/11 15:22:26 tantau Exp $ + +\usepgflibrary{snakes} + +\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikztopaths.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikztopaths.code.tex new file mode 100644 index 00000000000..c26ce1c018f --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikztopaths.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/libraries/pgflibrarytikztopaths.code.tex,v 1.4 2006/10/11 15:22:26 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\pgf@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\pgf@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\pgf@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{% + \pgf@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{\pgfpoint{\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 + \setlength{\pgf@ya}{\tikz@to@out@min} + \ifdim\pgf@xa<\pgf@ya% + \pgf@xa=\pgf@ya% + \fi% + \setlength{\pgf@ya}{\tikz@to@out@max} + \ifdim\pgf@xa>\pgf@ya% + \pgf@xa=\pgf@ya% + \fi% + \setlength{\pgf@ya}{\tikz@to@in@min} + \ifdim\pgf@xb<\pgf@ya% + \pgf@xb=\pgf@ya% + \fi% + \setlength{\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. + % + \pgf@ifundefined{pgf@sh@ns@\tikztostart} + {% + \let\tikz@first@point=\tikz@tofrom% + \let\tikz@tostart@tikz=\pgf@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\pgfpoint{\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)}% + }% + \pgf@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\pgfpoint{\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/libraries/pgflibrarytikztrees.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikztrees.code.tex index 8f472237604..841b534fed3 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikztrees.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikztrees.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarytikztrees.code.tex,v 1.4 2005/09/02 16:05:44 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarytikztrees.code.tex,v 1.7 2006/10/11 15:22:26 tantau Exp $ @@ -72,6 +75,27 @@ \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{% + \c@pgf@counta=\tikz@sibling@angle\relax% + \multiply\c@pgf@counta by\tikznumberofcurrentchild\relax% + \advance\c@pgf@counta by-\tikz@sibling@angle\relax% + \advance\c@pgf@counta by\tikz@grow@circle@from@start\relax% + \pgftransformshift{\pgfpointpolar{\the\c@pgf@counta}{\the\tikzleveldistance}}% +} + +\tikzoption{clockwise from}{\let\tikz@grow=\tikz@grow@circle@from@\def\tikz@grow@circle@from@start{#1}} + +\def\tikz@grow@circle@from@{% + \c@pgf@counta=\tikz@sibling@angle\relax% + \multiply\c@pgf@counta by-\tikznumberofcurrentchild\relax% + \advance\c@pgf@counta by\tikz@sibling@angle\relax% + \advance\c@pgf@counta by\tikz@grow@circle@from@start\relax% + \pgftransformshift{\pgfpointpolar{\the\c@pgf@counta}{\the\tikzleveldistance}}% +} + + % % Connections diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg index a719fda2380..0bed39c0541 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgf.cfg,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgf.cfg,v 1.2 2006/10/11 15:22:26 tantau Exp $ % Default driver: \ifx\pgfsysdriver\@undefined diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def index 3f2c726beb8..bdc3c16b905 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf.def,v 1.4 2005/10/18 18:03:38 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf.def,v 1.6 2006/10/11 15:22:26 tantau Exp $ % Driver commands for pdf @@ -58,15 +60,15 @@ \def\pgfsys@color@gray@fill#1{\pgfsysprotocol@literal{#1 g}} % Opacity -\def\pgf@sys@pdf@addtopageresources#1{\pgf@sys@fail{adding to page resources}} -\def\pgf@sys@pdf@readdtopageresources#1{}% not always used +\def\pgf@sys@pdf@addtopageresources@extgs#1{\pgf@sys@fail{adding to page resources}} +\def\pgf@sys@pdf@readdtopageresources@extgs#1{}% not always used \def\pgfsys@stroke@opacity#1{% \expandafter\ifx\csname pgf@sys@pdf@so@#1\endcsname\relax% % Hmm... define... \expandafter\gdef\csname pgf@sys@pdf@so@#1\endcsname{/pgf@CA#1}% - \pgf@sys@pdf@addtopageresources{/pgf@CA#1 << /CA #1 >>}% + \pgf@sys@pdf@addtopageresources@extgs{/pgf@CA#1 << /CA #1 >>}% \else% - \pgf@sys@pdf@readdtopageresources{/pgf@CA#1 << /CA #1 >>}% + \pgf@sys@pdf@readdtopageresources@extgs{/pgf@CA#1 << /CA #1 >>}% \fi% \pgfsysprotocol@literal{\csname pgf@sys@pdf@so@#1\endcsname\space gs}% } @@ -74,15 +76,14 @@ \expandafter\ifx\csname pgf@sys@pdf@fo@#1\endcsname\relax% % Hmm... define... \expandafter\gdef\csname pgf@sys@pdf@fo@#1\endcsname{/pgf@ca#1}% - \pgf@sys@pdf@addtopageresources{/pgf@ca#1 << /ca #1 >>}% + \pgf@sys@pdf@addtopageresources@extgs{/pgf@ca#1 << /ca #1 >>}% \else% - \pgf@sys@pdf@readdtopageresources{/pgf@ca#1 << /ca #1 >>}% + \pgf@sys@pdf@readdtopageresources@extgs{/pgf@ca#1 << /ca #1 >>}% \fi% \pgfsysprotocol@literal{\csname pgf@sys@pdf@fo@#1\endcsname\space gs}% } - \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def index 81b062a6a6e..89d1d34f958 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.7 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.14 2006/10/11 15:22:26 tantau Exp $ % Driver commands for postscript @@ -155,7 +157,7 @@ \expandafter\xdef\csname#1\endcsname{\the\pgf@objectcount}% \pgfsysprotocol@getcurrentprotocol\pgfsys@temp% {% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% \pgfsysprotocol@bufferedtrue% #4% \pgfsysprotocol@getcurrentprotocol\pgfsys@@temp% @@ -166,7 +168,7 @@ \def\pgfsys@useobject#1#2{% \pgfsysprotocol@getcurrentprotocol\pgfsys@temp% {% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% \pgfsysprotocol@bufferedfalse% #2% \pgfsysprotocol@invokecurrentprotocol% @@ -187,7 +189,7 @@ \expandafter\xdef\csname @pgfshading#1!\endcsname{\hbox to \the\pgf@max{% \noexpand\vrule width0pt height\the\pgf@xa% \noexpand\pgfsys@beginpurepicture% - \noexpand\pgfsys@rect{0pt}{0pt}{\the\pgf@y}{\the\pgf@x}% + \noexpand\pgfsys@rect{0pt}{0pt}{\the\pgf@max}{\the\pgf@xa}% \noexpand\pgfsys@clipnext% \noexpand\pgfsys@discardpath% \noexpand\pgfsys@invoke{\pgf@domb\space \pgf@sys@tonumber{\pgf@x} pgfH \pgf@psfuncs\space pop}% @@ -206,7 +208,7 @@ \expandafter\xdef\csname @pgfshading#1!\endcsname{\hbox to\the\pgf@xa{% \noexpand\vrule width0pt height\the\pgf@max% \noexpand\pgfsys@beginpurepicture% - \noexpand\pgfsys@rect{0pt}{0pt}{\the\pgf@x}{\the\pgf@y}% + \noexpand\pgfsys@rect{0pt}{0pt}{\the\pgf@xa}{\the\pgf@max}% \noexpand\pgfsys@clipnext% \noexpand\pgfsys@discardpath% \noexpand\pgfsys@invoke{\pgf@domb\space \pgf@sys@tonumber{\pgf@x} pgfV \pgf@psfuncs\space pop}% @@ -218,6 +220,8 @@ {% \pgf@parsefunc{#3}% \pgf@process{#2}% + \pgf@sys@bp@correct{\pgf@x}% + \pgf@sys@bp@correct{\pgf@y}% \pgf@xa=2\pgf@max% \pgf@sys@bp@correct{\pgf@max}% \advance\pgf@x by \pgf@max% @@ -233,7 +237,69 @@ }% } -\AtBeginDocument{ +% +% Patterns +% + + +\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{% + % Start building the pattern dictionary: + \pgf@xa=#2\relax% + \pgf@ya=#3\relax% + \pgf@xb=#4\relax% + \pgf@yb=#5\relax% + \pgf@xc=#6\relax% + \pgf@yc=#7\relax% + \pgf@sys@bp@correct\pgf@xa% + \pgf@sys@bp@correct\pgf@ya% + \pgf@sys@bp@correct\pgf@xb% + \pgf@sys@bp@correct\pgf@yb% + \pgf@sys@bp@correct\pgf@xc% + \pgf@sys@bp@correct\pgf@yc% + \pgfsys@outerinvoke{ + save true setglobal globaldict begin /pgfpat#1 + { + \ifnum#9=0 [/Pattern /DeviceRGB] \else /Pattern \fi\space + setcolorspace + gsave + initgraphics + << + /Type /Pattern + /PatternType 1 + /PaintType \ifnum#9=0 2 \else 1 \fi + /TilingType 1 + /BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb] + /XStep \pgf@sys@tonumber\pgf@xc\space + /YStep \pgf@sys@tonumber\pgf@yc\space + /PaintProc + { begin 2 dict begin #8\space end end } bind + >> + matrix + makepattern + %/pgfpat#1\space exch def + grestore + setcolor + } bind def end restore + }% +} + +\def\pgfsys@setpatternuncolored#1#2#3#4{% + \pgfsysprotocol@literal{/pgffc{#2 #3 #4 pgfpat#1}def}% +% [/Pattern /DeviceRGB] setcolorspace +% #2 #3 #4 pgfpat#1\space setcolor +% }def}% + \pgf@fillcolortrue% +} + +\def\pgfsys@setpatterncolored#1{% + \pgfsysprotocol@literal{/pgffc{pgfpat#1}def}%/Pattern setcolorspace +% pgfpat#1\space setcolor}def}% + \pgf@fillcolortrue% +} + + + +\def\pgfsys@atbegindocument{% % Parameters to horizontal pre axishade: \pgf@domb x \pgf@sys@postscript@header{/pgfH{% /pgfheight exch def 0.75 setlinewidth [] 0 setdash diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def index 0046ff5a2c1..03a422f95e1 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def @@ -1,18 +1,20 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-svg.def,v 1.13 2005/11/15 17:46:37 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-svg.def,v 1.17 2006/10/11 15:22:26 tantau Exp $ % Driver commands for svg % Helping functions: -\let\pgf@sys@svgpath=\@empty +\let\pgf@sys@svgpath=\pgf@empty \def\pgf@sys@svgnum#1{% {% \pgf@x=#1\relax% @@ -22,12 +24,12 @@ }% } \def\pgf@sys@addtosvgpath#1{\g@addto@macro\pgf@sys@svgpath{#1\space}} -\def\pgf@sys@flushsvgpath{\pgfsysprotocol@literal{\pgf@sys@svgpath}\global\let\pgf@sys@svgpath=\@empty} +\def\pgf@sys@flushsvgpath{\pgfsysprotocol@literal{\pgf@sys@svgpath}\global\let\pgf@sys@svgpath=\pgf@empty} \def\pgf@sys@svg@gs#1{% {\pgfsysprotocol@literal{<g #1>\Hnewline }}\global\advance\pgf@sys@svg@scopecount by1\relax% } \newcount\pgf@sys@svg@objectcount -\let\Hnewline=\@empty +\let\Hnewline=\pgf@empty % Path construction: \def\pgfsys@lineto#1#2{\pgf@sys@addtosvgpath{L }\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}} @@ -77,7 +79,7 @@ \pgf@sys@svg@gs{clip-path="url(\#pgfcp\the\pgf@sys@svg@objectcount)"} \pgf@sys@svg@clipnextfalse% \else% - \global\let\pgf@sys@svgpath=\@empty + \global\let\pgf@sys@svgpath=\pgf@empty \fi} % Fill rules: @@ -114,7 +116,7 @@ % Graphics state \def\pgfsys@setdash#1#2{% \edef\pgf@test@dashpattern{#1}% - \ifx\pgf@test@dashpattern\@empty% + \ifx\pgf@test@dashpattern\pgf@empty% \pgf@sys@svg@gs{stroke-dasharray="none" stroke-dashoffset="#2"}% \else% \pgf@sys@svg@gs{stroke-dasharray="#1" stroke-dashoffset="#2"}% @@ -191,30 +193,34 @@ }% } +\def\pgf@sys@svg@gs@color#1{% + \ifpgfpicture\pgf@sys@svg@gs{#1}\fi% +} + \def\pgfsys@color@rgb@stroke#1#2#3{% \pgf@sys@svg@color@rgb#1,#2,#3\relax% - \pgf@sys@svg@gs{stroke="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}} \def\pgfsys@color@rgb@fill#1#2#3{% \pgf@sys@svg@color@rgb#1,#2,#3\relax% - \pgf@sys@svg@gs{fill="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}} \def\pgfsys@color@cmyk@stroke#1#2#3#4{% \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax% - \pgf@sys@svg@gs{stroke="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}} \def\pgfsys@color@cmyk@fill#1#2#3#4{% \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax% - \pgf@sys@svg@gs{fill="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}} \def\pgfsys@color@cmy@stroke#1#2#3{% \pgf@sys@svg@color@cmy#1,#2,#3\relax% - \pgf@sys@svg@gs{stroke="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}} \def\pgfsys@color@cmy@fill#1#2#3{% \pgf@sys@svg@color@cmy#1,#2,#3\relax% - \pgf@sys@svg@gs{fill="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}} \def\pgfsys@color@gray@stroke#1{% \pgf@sys@svg@color@gray#1\relax% - \pgf@sys@svg@gs{stroke="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}} \def\pgfsys@color@gray@fill#1{% \pgf@sys@svg@color@gray#1\relax% - \pgf@sys@svg@gs{fill="\pgf@sys@svg@prepared"}} + \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}} % Shadings: @@ -231,7 +237,7 @@ } \def\pgf@sys@svg@shading@dostops#1{% \edef\pgf@test{#1}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \expandafter\pgf@sys@svg@shading@dostop\pgf@test% \expandafter\pgf@sys@svg@shading@dostops% @@ -255,7 +261,7 @@ \pgf@sys@svg@addtostops{\pgf@sys@svg@prepared}% } -\let\pgf@sys@svg@thestops=\@empty +\let\pgf@sys@svg@thestops=\pgf@empty \def\pgf@sys@svg@addtostops#1{% \edef\pgf@temp{#1}% \expandafter\expandafter\expandafter\def @@ -345,6 +351,55 @@ } +% Patterns + +\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{% + % Start building the pattern dictionary: + \pgf@xa=#2\relax% + \pgf@ya=#3\relax% + \pgf@xb=#4\relax% + \pgf@yb=#5\relax% + \pgf@xc=#6\relax% + \pgf@yc=#7\relax% + \ifnum#9=1\relax% + % Colored. That's easy: + \pgfsysprotocol@literal{ + <pattern + id="pgfpat#1" + patternUnits="userSpaceOnUse" + width="\the\pgf@xc" + height="\the\pgf@yc"> + #8 + </pattern>}% + \else% + % Uncolored. Yikes! + \pgfsysprotocol@literal{ + <pattern + id="pgfpat#1" + patternUnits="userSpaceOnUse" + width="\the\pgf@xc" + height="\the\pgf@yc"/> + <symbol id="pgfsym#1"> + #8 + </symbol>}% + \fi% +} + +\def\pgfsys@setpatternuncolored#1#2#3#4{% + \global\advance\pgf@sys@svg@objectcount by1\relax% + \pgf@sys@svg@color@rgb#2,#3,#4\relax% + \pgfsysprotocol@literal{ + <pattern id="pgfupat\the\pgf@sys@svg@objectcount" xlink:href="\#pgfpat#1"> + <g stroke="\pgf@sys@svg@prepared" fill="\pgf@sys@svg@prepared"> <use xlink:href="\#pgfsym#1"/> </g> + </pattern>} + \pgf@sys@svg@gs@color{fill="url(\#pgfupat\the\pgf@sys@svg@objectcount)"}% +} + +\def\pgfsys@setpatterncolored#1{% + \pgf@sys@svg@gs@color{fill="url(\#pgfpat#1)"}% +} + + \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def new file mode 100644 index 00000000000..164efe6a01e --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def @@ -0,0 +1,392 @@ +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvi.def,v 1.3 2006/10/11 15:22:26 tantau Exp $ + +% Driver commands for pure, ultra-portable dvi, in the tradition of +% old-style LaTeX pictures. +% +% Do not expect magic from this file + + +\newtoks\pgf@sys@dvi@path +\def\pgf@sys@dvi@addtopath#1{\pgf@sys@dvi@path\expandafter{\the\pgf@sys@dvi@path#1}} + +% Placing an object: +\def\pgf@sys@dvi@put#1#2#3{% + {% + \setbox\pgf@hbox=\hbox{\raise#2\hbox to0pt{\kern#1\relax#3\hss}}% + \wd\pgf@hbox=0pt% + \ht\pgf@hbox=0pt% + \dp\pgf@hbox=0pt% + \box\pgf@hbox% + }% +} + +\def\pgf@sys@dvi@drawrect#1#2#3#4{% + {% + \pgf@x=#1% + \pgf@y=#2% + \pgf@xa=#3% + \pgf@ya=#4% + \ifdim\pgf@xa<0pt% + \advance\pgf@x by\pgf@xa% + \pgf@xa=-\pgf@xa% + \fi% + \ifdim\pgf@ya<0pt% + \advance\pgf@y by\pgf@ya% + \pgf@ya=-\pgf@ya% + \fi% + \pgf@sys@dvi@put{\pgf@x}{\pgf@y}{\vrule width\pgf@xa height\pgf@ya}% + }% +} + +\def\pgf@sys@dvi@bezier{% + {% + % First iteration: + \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa% + \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya% + \pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb% + \pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb% + \pgf@xb=\pgf@time@t\pgf@xb\advance\pgf@xb by\pgf@time@s\pgf@xc% + \pgf@yb=\pgf@time@t\pgf@yb\advance\pgf@yb by\pgf@time@s\pgf@yc% + % Second iteration: + \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa% + \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya% + \pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb% + \pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb% + % Third iteration: + \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa% + \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya% + % + \advance\pgf@x by-.5\pgf@sys@dvi@linewidth% + \advance\pgf@y by-.5\pgf@sys@dvi@linewidth% + \pgf@sys@dvi@drawrect{\pgf@x}{\pgf@y}{\pgf@sys@dvi@linewidth}{\pgf@sys@dvi@linewidth}% + }% +} + +\def\pgf@sys@dvi@drawcurve#1#2#3#4#5#6#7#8{% + {% + \pgf@x=#1% + \pgf@y=#2% + \pgf@xa=#3% + \pgf@ya=#4% + \pgf@xb=#5% + \pgf@yb=#6% + \pgf@xc=#7% + \pgf@yc=#8% + % Compute number of steps: + \@tempdima=\pgf@x% + \advance\@tempdima by-\pgf@xa% + \ifdim\@tempdima<0pt% + \@tempdimb=-\@tempdima% + \else% + \@tempdimb=\@tempdima% + \fi% + \@tempdima=\pgf@y% + \advance\@tempdima by-\pgf@ya% + \ifdim\@tempdima<0pt% + \@tempdima=-\@tempdima% + \fi% + \ifdim\@tempdima>\@tempdimb% + \@tempdimb=\@tempdima% + \fi% + \@tempdima=\pgf@xb% + \advance\@tempdima by-\pgf@xc% + \ifdim\@tempdima<0pt% + \@tempdima=-\@tempdima% + \fi% + \ifdim\@tempdima>\@tempdimb% + \@tempdimb=\@tempdima% + \fi% + \@tempdima=\pgf@yb% + \advance\@tempdima by-\pgf@yc% + \ifdim\@tempdima<0pt% + \@tempdima=-\@tempdima% + \fi% + \ifdim\@tempdima>\@tempdimb% + \@tempdimb=\@tempdima% + \fi% + \@tempdima=\pgf@x% + \advance\@tempdima by-\pgf@xc% + \ifdim\@tempdima<0pt% + \@tempdima=-\@tempdima% + \fi% + \ifdim\@tempdima>\@tempdimb% + \@tempdimb=\@tempdima% + \fi% + \@tempdima=\pgf@y% + \advance\@tempdima by-\pgf@yc% + \ifdim\@tempdima<0pt% + \@tempdima=-\@tempdima% + \fi% + \ifdim\@tempdima>\@tempdimb% + \@tempdimb=\@tempdima% + \fi% + \@tempcnta=\@tempdimb% + \ifdim\pgf@sys@dvi@linewidth>0.3pt% + \@tempdimb=0.15pt% + \else% + \ifdim\pgf@sys@dvi@linewidth<0.05pt% + \@tempdimb=.025pt% + \else% + \@tempdimb=.5\pgf@sys@dvi@linewidth% + \fi% + \fi% + \@tempcntb=\@tempdimb% + \divide\@tempcnta by\@tempcntb\relax% + \ifnum\@tempcnta>0\relax% + \@tempcntb=0\relax% + \loop% + {% + \@tempdima=\the\@tempcntb pt% + \@tempdimb=\the\@tempcnta pt% + \advance\@tempdimb by-\@tempdima\relax% + \divide\@tempdima by\@tempcnta\relax% + \divide\@tempdimb by\@tempcnta\relax% + \edef\pgf@time@t{\pgf@sys@tonumber{\@tempdima}}% + \edef\pgf@time@s{\pgf@sys@tonumber{\@tempdimb}}% + \pgf@sys@dvi@bezier% + }% + \advance\@tempcntb by1\relax + \ifnum\@tempcntb<\@tempcnta% + {\def\pgf@time@t{1}\def\pgf@time@s{0}\pgf@sys@dvi@bezier}% + \repeat% + \fi% + }% +} + +% Text: +\def\pgfsys@hbox#1{% + \wd#1=0pt% + \ht#1=0pt% + \dp#1=0pt% + \pgf@sys@dvi@put{\pgf@sys@dvi@pt@x}{\pgf@sys@dvi@pt@y}{\box#1}% +} + + + +% Literals: + +\def\pgfsys@invoke#1{#1} + + +% Buffered path construction: + +\def\pgfsys@moveto#1#2{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@addtopath{\noexpand\pgf@sys@dvi@moveto{#1}{#2}}}} +\def\pgfsys@lineto#1#2{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@addtopath{\noexpand\pgf@sys@dvi@lineto{#1}{#2}}}} +\def\pgfsys@curveto#1#2#3#4#5#6{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@addtopath{\noexpand\pgf@sys@dvi@curveto{#1}{#2}{#3}{#4}{#5}{#6}}}} +\def\pgfsys@rect#1#2#3#4{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@addtopath{\noexpand\pgf@sys@dvi@rect{#1}{#2}{#3}{#4}}}} +\def\pgfsys@closepath{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@addtopath{\noexpand\pgf@sys@dvi@closepath}}} + + +% Scoping +\def\pgfsys@beginscope{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@beginscope}}% +\def\pgfsys@endscope{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@endscope}}% + +\def\pgf@sys@dvi@beginscope{% + % Save current stuff... + \edef\pgf@sys@dvi@return{% + \global\pgf@sys@dvi@linewidth=\the\pgf@sys@dvi@linewidth% + \global\pgf@sys@dvi@pt@x=\the\pgf@sys@dvi@pt@x% + \global\pgf@sys@dvi@pt@y=\the\pgf@sys@dvi@pt@y% + \gdef\noexpand\pgf@sys@dvi@pt@aa{\pgf@sys@dvi@pt@aa}% + \gdef\noexpand\pgf@sys@dvi@pt@ab{\pgf@sys@dvi@pt@ab}% + \gdef\noexpand\pgf@sys@dvi@pt@ba{\pgf@sys@dvi@pt@ba}% + \gdef\noexpand\pgf@sys@dvi@pt@bb{\pgf@sys@dvi@pt@bb}% + }% + \begingroup% + \ignorespaces% +} + +\def\pgf@sys@dvi@endscope{% + \endgroup% + \pgf@sys@dvi@return% +} + + + +% Line width + +\newdimen\pgf@sys@dvi@linewidth +\pgf@sys@dvi@linewidth=0.4pt + +\def\pgfsys@setlinewidth#1{\global\pgf@sys@dvi@linewidth=#1\relax} + + +% Transformation matrix + +\newdimen\pgf@sys@dvi@pt@x +\newdimen\pgf@sys@dvi@pt@y + +\def\pgf@sys@dvi@pt@aa{1.0} \def\pgf@sys@dvi@pt@ab{0.0} +\def\pgf@sys@dvi@pt@ba{0.0} \def\pgf@sys@dvi@pt@bb{1.0} + +\def\pgf@sys@dvi@pos@transform#1#2{% + \pgf@pt@temp=#1% + #1=\pgf@sys@dvi@pt@aa#1% + \advance#1 by\pgf@sys@dvi@pt@ba#2% + #2=\pgf@sys@dvi@pt@bb#2% + \advance#2 by\pgf@sys@dvi@pt@ab\pgf@pt@temp% + \advance#1 by\pgf@sys@dvi@pt@x% + \advance#2 by\pgf@sys@dvi@pt@y% +} + +\def\pgf@sys@dvi@transformcm#1#2#3#4#5#6{% + {% + \pgf@xc=#5% + \pgf@yc=#6% + % + \pgf@x=#1pt% + \pgf@y=#2pt% + % + \pgf@xa=\pgf@sys@dvi@pt@aa\pgf@x% + \advance\pgf@xa by \pgf@sys@dvi@pt@ba\pgf@y% + % + \pgf@ya=\pgf@sys@dvi@pt@ab\pgf@x% + \advance\pgf@ya by \pgf@sys@dvi@pt@bb\pgf@y% + % + \pgf@x=#3pt% + \pgf@y=#4pt% + % + \pgf@xb=\pgf@sys@dvi@pt@aa\pgf@x% + \advance\pgf@xb by \pgf@sys@dvi@pt@ba\pgf@y% + % + \pgf@yb=\pgf@sys@dvi@pt@ab\pgf@x% + \advance\pgf@yb by \pgf@sys@dvi@pt@bb\pgf@y% + % + \pgf@x=\pgf@sys@dvi@pt@aa\pgf@xc% + \advance\pgf@x by\pgf@sys@dvi@pt@ba\pgf@yc% + \advance\pgf@x by\pgf@sys@dvi@pt@x% + % + \pgf@y=\pgf@sys@dvi@pt@ab\pgf@xc% + \advance\pgf@y by\pgf@sys@dvi@pt@bb\pgf@yc% + \advance\pgf@y by\pgf@sys@dvi@pt@y% + % + \global\pgf@sys@dvi@pt@x=\pgf@x% + \global\pgf@sys@dvi@pt@y=\pgf@y% + \xdef\pgf@sys@dvi@pt@aa{\pgf@sys@tonumber{\pgf@xa}}% + \xdef\pgf@sys@dvi@pt@ab{\pgf@sys@tonumber{\pgf@ya}}% + \xdef\pgf@sys@dvi@pt@ba{\pgf@sys@tonumber{\pgf@xb}}% + \xdef\pgf@sys@dvi@pt@bb{\pgf@sys@tonumber{\pgf@yb}}% + }% +} + +\def\pgfsys@transformcm#1#2#3#4#5#6{% + {% + \pgf@x=#5\relax% + \pgf@y=#6\relax% + \pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@transformcm{#1}{#2}{#3}{#4}{\the\pgf@x}{\the\pgf@y}}% + }% +} + + +% Stroking + +\def\pgfsys@stroke{\pgfsysprotocol@literal{\noexpand\pgf@sys@dvi@stroke}}% + + +\def\pgf@sys@dvi@stroke{% + \let\pgf@sys@dvi@moveto=\pgf@sys@dvi@moveto@stroke% + \let\pgf@sys@dvi@lineto=\pgf@sys@dvi@lineto@stroke% + \let\pgf@sys@dvi@curveto=\pgf@sys@dvi@curveto@stroke% + \let\pgf@sys@dvi@rect=\pgf@sys@dvi@rect@stroke% + \let\pgf@sys@dvi@closepath=\pgf@sys@dvi@closepath@stroke% + {\the\pgf@sys@dvi@path}% + \pgf@sys@dvi@path{}% +} + +\def\pgf@sys@dvi@moveto@stroke#1#2{% + % These two store the current position: + \pgf@xc=#1\relax% + \pgf@yc=#2\relax% + % These two store the last moveto: + \pgf@xb=\pgf@xc% + \pgf@yb=\pgf@yc% +} + +\def\pgf@sys@dvi@lineto@stroke#1#2{% + {% + \pgf@xa=#1\relax% + \pgf@ya=#2\relax% + \pgf@x=\pgf@xc% + \pgf@y=\pgf@yc% + \pgf@sys@dvi@pos@transform{\pgf@xa}{\pgf@ya}% + \pgf@sys@dvi@pos@transform{\pgf@x}{\pgf@y}% + % Now, we need to draw a line from (x/y) to (xa/ya) + % + % Horizontal? + \ifdim\pgf@y=\pgf@ya% + % Ok, that should be easy... + \pgf@xb=\pgf@xa% + \advance\pgf@xb by-\pgf@x% + \advance\pgf@y by-0.5\pgf@sys@dvi@linewidth% + \pgf@sys@dvi@drawrect{\pgf@x}{\pgf@y}{\pgf@xb}{\pgf@sys@dvi@linewidth}% + \else% + \ifdim\pgf@x=\pgf@xa% + % Ok, also easy... + \pgf@yb=\pgf@ya% + \advance\pgf@yb by-\pgf@y% + \advance\pgf@x by-0.5\pgf@sys@dvi@linewidth% + \pgf@sys@dvi@drawrect{\pgf@x}{\pgf@y}{\pgf@sys@dvi@linewidth}{\pgf@yb}% + \else% + \edef\pgf@marshal{\noexpand\pgf@sys@dvi@drawcurve{\the\pgf@x}{\the\pgf@y}{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xa}{\the\pgf@ya}}% + \pgf@marshal% + \fi% + \fi% + }% + % Remember: + \pgf@xc=#1\relax% + \pgf@yc=#2\relax% +} + + +\def\pgf@sys@dvi@curveto@stroke#1#2#3#4#5#6{% + \pgf@x=\pgf@xc% + \pgf@y=\pgf@yc% + \pgf@xa=#1% + \pgf@ya=#2% + \pgf@xb=#3% + \pgf@yb=#4% + \pgf@xc=#5% + \pgf@yc=#6% + {% + \pgf@sys@dvi@pos@transform{\pgf@x}{\pgf@y}% + \pgf@sys@dvi@pos@transform{\pgf@xa}{\pgf@ya}% + \pgf@sys@dvi@pos@transform{\pgf@xb}{\pgf@yb}% + \pgf@sys@dvi@pos@transform{\pgf@xc}{\pgf@yc}% + \pgf@sys@dvi@drawcurve{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}{\pgf@xb}{\pgf@yb}{\pgf@xc}{\pgf@yc}% + }% +} + +\def\pgf@sys@dvi@closepath@stroke{% + \pgf@sys@dvi@lineto@stroke{\pgf@xc}{\pgf@yc}% +} + +\def\pgf@sys@dvi@rect@stroke#1#2#3#4{% + \pgf@x=#1\relax% + \pgf@y=#2\relax% + \pgf@xa=#3\relax% + \pgf@ya=#4\relax% + \advance\pgf@xa by\pgf@x% + \advance\pgf@ya by\pgf@y% + \pgf@sys@dvi@moveto@stroke{\pgf@x}{\pgf@y}% + \pgf@sys@dvi@lineto@stroke{\pgf@xa}{\pgf@y}% + \pgf@sys@dvi@lineto@stroke{\pgf@xa}{\pgf@ya}% + \pgf@sys@dvi@lineto@stroke{\pgf@x}{\pgf@ya}% + \pgf@sys@dvi@closepath@stroke% +} + + + +\endinput + +%%% Local Variables: +%%% mode: latex +%%% End: diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def index 224197f9b51..88cd20046e0 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def @@ -1,12 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfm.def,v 1.7 2005/09/30 07:14:03 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfm.def,v 1.10 2006/10/11 15:22:26 tantau Exp $ % Driver commands for dvipdfm @@ -43,7 +44,7 @@ \def\pgfsys@beginpurepicture{\special{pdf: content q}} -\def\pgf@sys@pdf@addtopageresources#1{% +\def\pgf@sys@pdf@addtopageresources@extgs#1{% \ifx\pgf@sys@pdf@obj\@undefined% \global\let\pgf@sys@pdf@obj=\relax% \special{pdf: obj @pgfopacities << >>}% @@ -51,7 +52,7 @@ \special{pdf: put @pgfopacities << #1 >>}% \special{pdf: put @resources << /ExtGState @pgfopacities >>}% } -\def\pgf@sys@pdf@readdtopageresources#1{% +\def\pgf@sys@pdf@readdtopageresources@extgs#1{% \special{pdf: put @resources << /ExtGState @pgfopacities >>}% } @@ -101,6 +102,10 @@ \pgf@process{\pgfpoint{\pgf@max}{\pgf@max}}% \advance\pgf@xa by \pgf@x\relax% \advance\pgf@ya by \pgf@y\relax% + \pgf@sys@bp@correct{\pgf@x}% + \pgf@sys@bp@correct{\pgf@y}% + \pgf@sys@bp@correct{\pgf@xa}% + \pgf@sys@bp@correct{\pgf@ya}% \@tempdima=2\pgf@max\relax% \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\@tempdima\space height \the\@tempdima}}}\@temp% \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources << diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def index 75e0a857445..a633f7cc4e9 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def @@ -1,18 +1,19 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.10 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.14 2006/10/11 15:22:26 tantau Exp $ % Driver commands for dvips \def\pgfsys@invoke#1{\special{ps:: #1}} \def\pgfsys@outerinvoke#1{\special{ps: #1}} -\def\pgf@sys@postscript@header#1{\special{! #1}} +\def\pgf@sys@postscript@header#1{\AtBeginDvi{\special{! #1}}} \def\pgf@sys@postscript@object#1{\special{! #1}} @@ -50,9 +51,11 @@ \def\pgfsys@color@unstacked#1{\special{ps: \XC@usecolor{#1}}} \def\pgfsys@imagesuffixlist{epsi:eps:ps} -\AtBeginDocument{ - % Always present specials. - \special{! +\def\pgfsys@papersize#1#2{% + \expandafter\gdef\expandafter\pgfsys@atbegindocument\expandafter{\pgfsys@atbegindocument\special{papersize=#1,#2}}} + +\expandafter\gdef\expandafter\pgfsys@atbegindocument\expandafter{\pgfsys@atbegindocument% + \pgf@sys@postscript@header{ /pgfsc{}B% stroke color is empty by default /pgffc{}B% fill color is empty by default /pgfstr{stroke}B% @@ -78,7 +81,12 @@ /pgffoa 1 def /pgfsoa 1 def end - } + }% +} + +\AtBeginDocument{ % needed for plain TeX + \pgfsys@atbegindocument + \let\pgfsys@atbegindocument=\relax } \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def index 79697fbb9f6..ce86689204c 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.4 2005/10/06 13:16:09 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.12 2006/10/11 15:22:26 tantau Exp $ % Driver commands for pdf @@ -40,23 +42,46 @@ }% } -\let\pgf@sys@pgf@resource@list=\@empty% -\def\pgf@sys@pdf@addtopageresources#1{% - \xdef\pgf@sys@pgf@resource@list{\pgf@sys@pgf@resource@list\space#1}% - \edef\pgf@temp{{<<\pgf@sys@pgf@resource@list>>}}% - \expandafter\immediate\expandafter\pdfobj\pgf@temp% - \edef\pgf@temp{{/ExtGState \the\pdflastobj\space 0 R}} - \expandafter\global\expandafter\pdfpageresources\pgf@temp% +\let\pgf@sys@pgf@resource@list@extgs=\pgf@empty% +\let\pgf@sys@pgf@resource@list@patterns=\pgf@empty% + +\def\pgf@sys@pdf@addtopageresources@extgs#1{% + \xdef\pgf@sys@pgf@resource@list@extgs{\pgf@sys@pgf@resource@list@extgs\space#1}% + \pgf@sys@pdf@updateresources% +} + +\def\pgf@sys@pdf@addtopageresources@patterns#1{% + \xdef\pgf@sys@pgf@resource@list@patterns{\pgf@sys@pgf@resource@list@patterns\space#1}% + \pgf@sys@pdf@updateresources% +} + +\def\pgf@sys@pdf@updateresources{% + \let\pgf@temp=\pgf@empty% + \ifx\pgf@sys@pgf@resource@list@extgs\pgf@empty% + \else% + \immediate\pdfobj{<<\pgf@sys@pgf@resource@list@extgs>>}% + \edef\pgf@temp{/ExtGState \the\pdflastobj\space 0 R\space}% + \fi% + \ifx\pgf@sys@pgf@resource@list@patterns=\pgf@empty% + \else% + \immediate\pdfobj{<<\pgf@sys@pgf@resource@list@patterns>>}% + \edef\pgf@temp{% + \pgf@temp% + /ColorSpace << /pgfprgb [/Pattern /DeviceRGB] >> + /Pattern \the\pdflastobj\space 0 R\space% + }% + \fi% + \expandafter\global\expandafter\pdfpageresources\expandafter{\pgf@temp}% } \def\pgfsys@imagesuffixlist{pdf:jpg:jpeg:png} \def\pgfsys@defineimage{% width, height, page number - \ifx\pgf@imagewidth\@empty\else\edef\pgf@imagewidth{ width \pgf@imagewidth }\fi% - \ifx\pgf@imageheight\@empty\else\edef\pgf@imageheight{ height \pgf@imageheight }\fi% - \ifx\pgf@imagepage\@empty\else\edef\pgf@imagepage{ page \pgf@imagepage }\fi% + \ifx\pgf@imagewidth\pgf@empty\else\edef\pgf@imagewidth{ width \pgf@imagewidth }\fi% + \ifx\pgf@imageheight\pgf@empty\else\edef\pgf@imageheight{ height \pgf@imageheight }\fi% + \ifx\pgf@imagepage\pgf@empty\else\edef\pgf@imagepage{ page \pgf@imagepage }\fi% \ifx\pdfximage\@undefined% old version of pdflatex - \ifx\pgf@imagepage\@empty\else% + \ifx\pgf@imagepage\pgf@empty\else% \PackageWarning{pgf}{Page selection not supported. Ignoring page selection}% \fi% @@ -72,7 +97,7 @@ \fi }% \def\pgfsys@definemask{% - \ifx\pgf@maskmatte\@empty% + \ifx\pgf@maskmatte\pgf@empty% \else% \edef\pgf@maskmatte{/Matte [\pgf@maskmatte]}% \fi% @@ -120,6 +145,10 @@ \pgf@process{\pgfpoint{\pgf@max}{\pgf@max}}% \advance\pgf@xa by \pgf@x% \advance\pgf@ya by \pgf@y% + \pgf@sys@bp@correct{\pgf@x}% + \pgf@sys@bp@correct{\pgf@y}% + \pgf@sys@bp@correct{\pgf@xa}% + \pgf@sys@bp@correct{\pgf@ya}% \pdfxform resources {% /Shading << /Sh << /ShadingType 3 /ColorSpace /DeviceRGB @@ -131,6 +160,55 @@ }% }% + + +% Patterns + +\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{% + % Start building the pattern dictionary: + \pgf@xa=#2\relax% + \pgf@ya=#3\relax% + \pgf@xb=#4\relax% + \pgf@yb=#5\relax% + \pgf@xc=#6\relax% + \pgf@yc=#7\relax% + \pgf@sys@bp@correct\pgf@xa% + \pgf@sys@bp@correct\pgf@ya% + \pgf@sys@bp@correct\pgf@xb% + \pgf@sys@bp@correct\pgf@yb% + \pgf@sys@bp@correct\pgf@xc% + \pgf@sys@bp@correct\pgf@yc% + % Now create the pattern object: + \immediate\pdfobj stream + attr + { + /Type /Pattern + /PatternType 1 + /PaintType \ifnum#9=0 2 \else 1 \fi + /TilingType 1 + /BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb] + /XStep \pgf@sys@tonumber\pgf@xc\space + /YStep \pgf@sys@tonumber\pgf@yc\space + /Resources << >> + } + {#8}% + \pgf@sys@pdf@addtopageresources@patterns{/pgfpat#1\space \the\pdflastobj\space 0 R}% +} + +\def\pgfsys@setpatternuncolored#1#2#3#4{% + \pgfsysprotocol@literal{/pgfprgb cs #2 #3 #4 /pgfpat#1\space scn}% +} + +\def\pgfsys@setpatterncolored#1{% + \pgfsysprotocol@literal{/Pattern cs /pgfpat#1\space scn}% +} + + +\def\pgfsys@papersize#1#2{% + \pdfpageheight#2% + \pdfpagewidth#1} + + % XForm version, crashes ghostview. %\def\pgfsys@defobject#1#2#3#4{% % \pgf@process{#2} @@ -161,6 +239,31 @@ % \box\pgfobjectbox% % \pgfsys@endscope} + + +% +% Position tracking +% +\def\pgfsys@markposition#1{% + \pdfsavepos% + \edef\pgf@temp{#1}% + \expandafter\write\expandafter\@auxout\expandafter{% + \expandafter\noexpand\expandafter\pgf@sys@pdf@mark\expandafter{\pgf@temp}{\the\pdflastxpos}{\the\pdflastypos}}% +} + +\def\pgf@sys@pdf@mark#1#2#3{% + \expandafter\gdef\csname pgf@sys@pdf@mark@pos@#1\endcsname{\pgfqpoint{#2sp}{#3sp}}% +} + +\def\pgfsys@getposition#1#2{% + \edef\pgf@marshal{\let\noexpand#2=\expandafter\noexpand\csname pgf@sys@pdf@mark@pos@#1\endcsname}% + \pgf@marshal% +} + +\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin} + + + \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def index 016f909d24f..5bab839a2db 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-tex4ht.def,v 1.9 2005/11/15 17:46:37 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-tex4ht.def,v 1.13 2006/10/11 15:22:26 tantau Exp $ \RequirePackage{xcolor} @@ -104,7 +108,7 @@ \pgf@x=.5\wd#1% \ifx\tikz@textcolor\relax% \else% - \ifx\tikz@textcolor\@empty% + \ifx\tikz@textcolor\pgf@empty% \pgfsetfillcolor{.}% \else% \pgfsetfillcolor{\tikz@textcolor}% @@ -115,7 +119,7 @@ transform="scale(1,-1) translate(\pgf@sys@tonumber{\pgf@x},0)" text-anchor="middle" }% - \ifx\f@size\@empty% + \ifx\f@size\pgf@empty% \else% \HCode{ font-size="\f@size"}% \fi% @@ -127,7 +131,7 @@ \HCode{</text>\Hnewline }% } -\def\pgfsys@outerinvoke{\ifpgfpicture\expandafter\pgfsys@invoke\else\expandafter\@gobble\fi} +\def\pgfsys@outerinvoke{\ifpgfpicture\expandafter\pgfsys@invoke\else\expandafter\pgf@gobble\fi} \def\pgfsys@shadingoutsidepgfpicture#1{% diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def index 34448c295a0..2239a0166ec 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-textures.def,v 1.2 2005/11/09 08:52:19 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-textures.def,v 1.4 2006/10/11 15:22:26 tantau Exp $ % Driver commands for textures driver @@ -29,7 +31,7 @@ \def\pgfsys@beginpicture{% \special{rawpostscript save}% \special{rawpostscript save pgfgetcoords}% - \special{postscript}% here come the coordiantes + \special{postscript}% here come the coordinates \special{rawpostscript restore}% \special{rawpostscript pgfbeginpicture}} \def\pgfsys@endpicture{\special{rawpostscript restore}} diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def index 197a3e14e0a..cac83871b86 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-vtex.def,v 1.4 2005/10/25 08:39:23 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-vtex.def,v 1.6 2006/10/11 15:22:26 tantau Exp $ % Driver commands for vtex @@ -39,7 +41,7 @@ } \def\pgf@sys@vtex@setcolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@sys@vtex@@setcolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@sys@vtex@@setcolor#1#2#3#4#5{% diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex index 22b257f7448..6057cbec149 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex @@ -1,11 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys.code.tex,v 1.9 2005/10/18 18:03:38 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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/systemlayer/pgfsys.code.tex,v 1.18 2006/10/11 15:22:26 tantau Exp $ % @@ -36,6 +38,51 @@ }% } + +% +% Useful commands that are used throughout pgf. The corresponding +% latex commands are not used because a) latex might not be in use and +% b) the latex commands are redefined by some *very vile and evil* +% packages. +% +\long\def\pgf@ifundefined#1{% + \expandafter\ifx\csname#1\endcsname\relax + \expandafter\pgf@firstoftwo + \else + \expandafter\pgf@secondoftwo + \fi} +\def\pgf@firstoftwo#1#2{#1} +\def\pgf@secondoftwo#1#2{#2} +\def\pgf@empty{} +\def\pgf@gobble#1{} +\def\pgf@gobbletwo#1#2{} +\long\def\pgf@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}% + \def\reserved@b{#3}% + \futurelet\pgf@let@token\pgf@ifnch} +\def\pgf@ifnch{% + \ifx\pgf@let@token\pgf@sptoken + \let\reserved@c\pgf@xifnch + \else + \ifx\pgf@let@token\reserved@d + \let\reserved@c\reserved@a + \else + \let\reserved@c\reserved@b + \fi + \fi + \reserved@c} +\def\:{\global\let\pgf@sptoken= } \: +\def\:{\pgf@xifnch} \expandafter\def\: {\futurelet\pgf@let@token\pgf@ifnch} +\def\pgf@namedef#1{\expandafter\def\csname #1\endcsname} +\long\def\pgf@g@addto@macro#1#2{% + \begingroup + \toks@\expandafter{#1#2}% + \xdef#1{\the\toks@}% + \endgroup} + + + % internal dimensions that are always present when pgsys is loaded. \newdimen\pgf@x \newdimen\pgf@y @@ -73,9 +120,9 @@ % given at the end. \def\pgf@sys@fail#1{% - \expandafter\ifx\csname pgf@sys@fail@#1\endcsname\@empty% + \expandafter\ifx\csname pgf@sys@fail@#1\endcsname\pgf@empty% \else% - \expandafter\global\expandafter\let\csname pgf@sys@fail@#1\endcsname=\@empty% + \expandafter\global\expandafter\let\csname pgf@sys@fail@#1\endcsname=\pgf@empty% \PackageWarning{pgf}{% Your graphic driver \pgfsysdriver\space does not supported #1. This warning is given only once}% \fi% @@ -543,6 +590,84 @@ % The parameter #2 is a pgf point specification if the starting point % of the shading. See the pgfuserguide for details. + + + + +% +% +% Pattern stuff +% +% + +\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{\pgf@sys@fail{patterns}} +% This command declares a new colored or uncolored pattern. Uncolored +% patterns have no inherent color, the color is provided when they are +% set. Colored patters have an inherent color. +% #1 = name of the pattern (must be a plain suffix for use in +% postscript/pdf/etc.) +% #2 to #5 = four coordinates describing the corners of a bounding box +% of pattern cells +% #6 = x-step +% #7 = y-step +% #8 = pattern code +% #9 = 0 if uncolored patter, 1 if colored pattern. + +\def\pgfsys@setpatternuncolored#1#2#3#4{\pgf@sys@fail{patterns}} +% Sets an uncolored pattern #1 as filling color. The numbers #2, #3, +% #4 must be an rgb-value to be used as the color of the pattern. + +\def\pgfsys@setpatterncolored#1{\pgf@sys@fail{patterns}} +% Sets an colored pattern #1 as filling color. + + +% +% +% Page size stuff +% +% +\def\pgfsys@papersize#1#2{\pgf@sys@fail{papersize}} +% This command sets the paper size in a portable way. +% #1 = width +% #2 = height + + + +% +% +% Position tracking commands +% +% + +% Marks the current position on the page. This position can later be +% referenced using \pgfsys@getposition +\def\pgfsys@markposition#1{\pgf@sys@fail{marking the current position}} + +% Sets #2 to a pgfpoint macro that returns the position #1 is +% returned in a coordinate system where the x-axis goes right and the +% y-axis goes up. The origin of this coordinate system may or may not +% lie in the lower left corner; you should shift the coordinate system +% to the position "pgfpageorigin" to make sure that the origin is at +% the lower left corner. Typically, getting this position +% requires two runs of TeX. On the first run, the macro will be set to +% \relax, indicating that the position is not available. +% +% If #1 is set to the special position "pgfpageorigin", the position +% of the the lower left page corner is returned. + +\def\pgfsys@getposition#1#2{\let#2=\relax} + + + +% +% +% Commands having a default implementation. These commands only need +% not be implemented by drivers if this results in a better +% preformance. +% +% + + \def\pgfsys@shadingoutsidepgfpicture#1{% #1% } @@ -568,15 +693,6 @@ -% -% -% Commands having a default implementation. These commands only need -% not be implemented by drivers if this results in a better -% preformance. -% -% - - \def\pgfsys@closestroke{\pgfsys@closepath\pgfsys@stroke} % This command should have the same effect as first closing the path % and then stroking it. @@ -608,7 +724,7 @@ {\pgfsys@beginscope\pgflowlevelsynccm\pgfsys@hbox#1\pgfsys@endscope}% } % Called to insert a TeX hbox into a pgfpicture, but with the current -% coordiante transformation matrix synced with the canvas +% coordinate transformation matrix synced with the canvas % transformation matrix. % % In essence, this command does the same as if you first said @@ -651,9 +767,9 @@ % Called at the end of a ``pure'' pgfpicture. \def\pgfsys@defineimage{% - \ifx\pgf@imagewidth\@empty\else\edef\pgf@imagewidth{width=\pgf@imagewidth,}\fi% - \ifx\pgf@imageheight\@empty\else\edef\pgf@imageheight{height=\pgf@imageheight,}\fi% - \ifx\pgf@imagepage\@empty\else\edef\pgf@imagepage{page=\pgf@imagepage,}\fi% + \ifx\pgf@imagewidth\pgf@empty\else\edef\pgf@imagewidth{width=\pgf@imagewidth,}\fi% + \ifx\pgf@imageheight\pgf@empty\else\edef\pgf@imageheight{height=\pgf@imageheight,}\fi% + \ifx\pgf@imagepage\pgf@empty\else\edef\pgf@imagepage{page=\pgf@imagepage,}\fi% \edef\pgf@image{\noexpand\includegraphics[\pgf@imageheight\pgf@imagewidth]{\pgf@filename}}% } % Called, when an image should be defined. @@ -706,7 +822,7 @@ \def\pgfsys@defobject#1#2#3#4{% \pgfsysprotocol@getcurrentprotocol\pgfsys@temp% {% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% \pgfsysprotocol@bufferedtrue% #4% \pgfsysprotocol@getcurrentprotocol\pgfsys@@temp% @@ -727,7 +843,7 @@ \def\pgfsys@useobject#1#2{% \pgfsysprotocol@getcurrentprotocol\pgfsys@temp% {% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% \pgfsysprotocol@bufferedfalse% #2% \expandafter\pgfsysprotocol@setcurrentprotocol\csname #1\endcsname% @@ -751,6 +867,20 @@ % nested. In this case, only the `last' one restores visibility. +\def\pgfsys@atbegindocument{} +% This command will be executed at the begin of the document. If for +% whatever reason this is not done, you may wish to execute this +% command yourself. It will setup certain specials that need to be +% inserted into the resulting .pdf/.ps/.xxx file. + + + +\AtBeginDocument{ + \pgfsys@atbegindocument + \let\pgfsys@atbegindocument=\relax +} + + % Discern the driver: diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex index 119fc5d7128..a241c6fbf75 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsysprotocol.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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 $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsysprotocol.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $ @@ -22,14 +24,14 @@ -\let\pgfsysprotocol@currentprotocol=\@empty +\let\pgfsysprotocol@currentprotocol=\pgf@empty \newif\ifpgfsysprotocol@buffered % Add to the protocol buffered \def\pgfsysprotocol@literalbuffered#1{% \edef\pgfsysprotocol@temp{{#1\space}}% - \expandafter\g@addto@macro\expandafter\pgfsysprotocol@currentprotocol\pgfsysprotocol@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsysprotocol@currentprotocol\pgfsysprotocol@temp% } % Add to the protocol @@ -53,7 +55,7 @@ % Invoking the current protocol \def\pgfsysprotocol@invokecurrentprotocol{% - \ifx\pgfsysprotocol@currentprotocol\@empty% + \ifx\pgfsysprotocol@currentprotocol\pgf@empty% \else% \expandafter\pgfsys@invoke\expandafter{\pgfsysprotocol@currentprotocol}% \fi% @@ -61,7 +63,7 @@ \def\pgfsysprotocol@flushcurrentprotocol{% \pgfsysprotocol@invokecurrentprotocol% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% } diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex index 1eecaf431e9..d92f0402782 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsyssoftpath.code.tex,v 1.1.1.1 2005/06/29 12:14:05 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsyssoftpath.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $ % This package provides the pgf system path abstraction layer. This @@ -34,7 +37,7 @@ -\let\pgfsyssoftpath@currentpath=\@empty +\let\pgfsyssoftpath@currentpath=\pgf@empty % The current path \def\pgfsyssoftpath@lastmoveto{{0pt}{0pt}} @@ -44,7 +47,7 @@ \edef\pgfsyssoftpath@temp{{% \noexpand\pgfsyssoftpath@movetotoken{#1}{#2}% }}% - \expandafter\g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% \xdef\pgfsyssoftpath@lastmoveto{{#1}{#2}}% } @@ -53,7 +56,7 @@ \edef\pgfsyssoftpath@temp{{% \noexpand\pgfsyssoftpath@linetotoken{#1}{#2}% }}% - \expandafter\g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% } % Add curveto elements to the current path @@ -63,7 +66,7 @@ \noexpand\pgfsyssoftpath@curvetosupportbtoken{#3}{#4}% \noexpand\pgfsyssoftpath@curvetotoken{#5}{#6}% }}% - \expandafter\g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% } % Add rectanlge elements to the current path @@ -72,7 +75,7 @@ \noexpand\pgfsyssoftpath@rectcornertoken{#1}{#2}% \noexpand\pgfsyssoftpath@rectsizetoken{#3}{#4}% }}% - \expandafter\g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% } % Add closepath element to the current path @@ -80,7 +83,7 @@ \edef\pgfsyssoftpath@temp{{% \noexpand\pgfsyssoftpath@closepathtoken\pgfsyssoftpath@lastmoveto% }}% - \expandafter\g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% } % Add special element to the current path @@ -88,7 +91,7 @@ \edef\pgfsyssoftpath@temp{{% \noexpand\pgfsyssoftpath@specialroundtoken{#1}{#2}% }}% - \expandafter\g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% + \expandafter\pgf@g@addto@macro\expandafter\pgfsyssoftpath@currentpath\pgfsyssoftpath@temp% } @@ -109,7 +112,7 @@ \def\pgfsyssoftpath@flushcurrentpath{% \pgfsyssoftpath@invokecurrentpath% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% } % Marshallers @@ -118,7 +121,7 @@ \def\pgfsyssoftpath@rectcornertoken#1#2#3#4#5{\pgfsys@rect{#1}{#2}{#4}{#5}} % #3 = \pgfsyssoftpath@rectsizetoken \def\pgfsyssoftpath@curvetosupportatoken#1#2#3#4#5#6#7#8{\pgfsys@curveto{#1}{#2}{#4}{#5}{#7}{#8}} \def\pgfsyssoftpath@closepathtoken#1#2{\pgfsys@closepath} -\let\pgfsyssoftpath@specialroundtoken=\@gobbletwo +\let\pgfsyssoftpath@specialroundtoken=\pgf@gobbletwo \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgf-latex-emulation.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgf-latex-emulation.tex index 139ac162264..257741a3c9a 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgf-latex-emulation.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgf-latex-emulation.tex @@ -1,10 +1,12 @@ -% This file is pgf-latex-emulation.tex - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the LaTeX Project Public License Distributed from CTAN -% archives in directory macros/latex/base/lppl.txt. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + \catcode`\@=11\relax @@ -14,7 +16,6 @@ \else% % Direct copy from latex.ltx: -\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname #1\endcsname\relax#2\else#3\fi} \def\typeout#1{\immediate\write\@unused{#1}} \alloc@7\write\chardef\sixt@@n\@unused \let\@@par=\par @@ -118,6 +119,10 @@ \gdef\Gin@driver{pdftex.def}% \fi% +% aux files +\newwrite\@auxout +\IfFileExists{\jobname.aux}{\input \jobname.aux\relax}{} +\openout\@auxout % Things that are not too clever, yet: \def\selectfont{\rm} @@ -144,6 +149,7 @@ \definecolor{purple}{rgb}{0.75,0,0.25} \definecolor{brown}{rgb}{0.75,0.5,0.25} +\ifx\color\@undefined \def\color#1{% \colorlet{.}{#1}% \pgfsysprotocol@getcurrentprotocol\pgf@emu@temp% @@ -156,6 +162,8 @@ \pgfsysprotocol@setcurrentprotocol\pgf@emu@temp% \aftergroup\reset@color% } +\fi + \def\reset@color{% \pgfsysprotocol@getcurrentprotocol\pgf@emu@temp% {% diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex index 6d381dcbdec..86b4106af18 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex @@ -1,11 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgffor.code.tex,v 1.2 2005/07/06 15:58:58 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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/utilities/pgffor.code.tex,v 1.4 2006/10/11 15:22:26 tantau Exp $ \newdimen\pgffor@iter \newdimen\pgffor@skip @@ -15,9 +17,14 @@ \let\pgffor@endhook=\@empty \let\pgffor@afterhook=\@empty +\def\pgffor@emptyvalues{, \pgffor@stop,}% + \def\foreach#1in#2{% \def\pgffor@var{#1}% \def\pgffor@values{#2, \pgffor@stop,}% + \ifx\pgffor@values\pgffor@emptyvalues + \def\pgffor@values{\pgffor@stop,}% + \fi% \let\pgffor@body\@empty% \global\pgffor@continuetrue% \pgffor@collectbody} diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex index b744514f544..68c5150641a 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex @@ -1,7 +1,13 @@ -% Copyright 2005 by Till Tantau <tantau@users.sourceforge.net>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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. + + % The purpose of this file is to define the command % \ProvidesPackageRCS, which should be followed by an RCS id @@ -9,7 +15,7 @@ % prints out a message to the log. -\def\pgfversion{1.01} +\def\pgfversion{1.09} \ifx\pgfrcsloaded\undefined @@ -35,12 +41,17 @@ \pgf@parsercsfile$#2$ \fi} -\def\ProvidesFileRCS $#1${ - \pgf@parseid $#1$ - \ProvidesFile{\pgf@rcsfile.\pgf@rcssuffix}[\pgf@rcsdate\space (rcs-revision \pgf@rcsrevision)] +\def\ProvidesFileRCS{% + \def\pgfrcs@marshal{\ProvidesFile{\pgf@rcsfile.\pgf@rcssuffix}}% + \pgfrcs@parserest% } \def\ProvidesPackageRCS{% + \def\pgfrcs@marshal{\ProvidesPackage{\pgf@rcsfile}}% + \pgfrcs@parserest% +} + +\def\pgfrcs@parserest{% \def\pgf@rcsadditional{}% \afterassignment\pgfrcs@checkforoptional\let\next=} @@ -59,7 +70,7 @@ \def\pgfrcs@package#1${ \pgf@parseid $#1$ - \ProvidesPackage{\pgf@rcsfile}[\pgf@rcsdate\space\pgf@rcsadditional\space(rcs-revision \pgf@rcsrevision)] + \pgfrcs@marshal[\pgf@rcsdate\space\pgf@rcsadditional\space(rcs-revision \pgf@rcsrevision)] } \def\ProvidesClassRCS $#1$ [#2]{% @@ -77,7 +88,7 @@ \def\ProvidesFile#1[#2]{\wlog{Loading file #1 version #2.}} \fi -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgfrcs.code.tex,v 1.8 2005/11/14 17:37:52 tantau Exp $ +\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgfrcs.code.tex,v 1.12 2006/10/11 15:22:26 tantau Exp $ \catcode`\@=\pgfrcsatcode |