diff options
author | Karl Berry <karl@freefriends.org> | 2007-06-17 23:22:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-06-17 23:22:38 +0000 |
commit | 5c5c7843fbd37c6960799b6e1a32d5948966316c (patch) | |
tree | ea73f6b5ba799656992ebe2f34beccd2555f1342 /Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex | |
parent | f0c1f4cdb9fad83f293fd91d194538425f9f7633 (diff) |
pgf 1.18 (15jun07)
git-svn-id: svn://tug.org/texlive/trunk@4459 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex | 379 |
1 files changed, 299 insertions, 80 deletions
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 740dacf6794..805f27bcad6 100644 --- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz.code.tex @@ -7,7 +7,7 @@ % % 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.68 2006/10/17 08:16:28 tantau Exp $ +\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz.code.tex,v 1.87 2007/06/07 07:41:10 tantau Exp $ % Always-present libraries: @@ -65,7 +65,7 @@ % Draw options \tikzoption{line width}{\tikz@semiaddlinewidth{#1}}% -\def\tikz@semiaddlinewidth#1{\tikz@addoption{\pgfsetlinewidth{#1}}\setlength\pgflinewidth{#1}} +\def\tikz@semiaddlinewidth#1{\tikz@addoption{\pgfsetlinewidth{#1}}\pgfmathsetlength\pgflinewidth{#1}} \tikzoption{cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}} \tikzoption{join}{\tikz@addoption{\csname pgfset#1join\endcsname}} @@ -111,7 +111,7 @@ \tikz@addmode{\tikz@mode@doubletrue}% \fi} \tikzoption{double distance}{% - \setlength{\pgf@x}{#1}% + \pgfmathsetlength{\pgf@x}{#1}% \edef\tikz@double@width@distance{\the\pgf@x}% \tikz@addmode{\tikz@mode@doubletrue}} @@ -203,7 +203,8 @@ \tikzoption{xshift}{\tikz@addtransform{\pgftransformxshift{#1}}} \tikzoption{yshift}{\tikz@addtransform{\pgftransformyshift{#1}}} \tikzoption{cm}{\tikz@addtransform{\tikz@parse@cm#1\relax}} -\tikzoption{reset cm}{\tikz@addtransform{\pgftransformreset}} +\tikzoption{reset cm}[]{\tikz@addtransform{\pgftransformreset}} +\tikzoption{shift only}[]{\tikz@addtransform{\pgftransformresetnontranslations}} \def\tikz@parse@cm#1,#2,#3,#4,{% \def\tikz@p@cm{{#1}{#2}{#3}{#4}}% @@ -453,6 +454,8 @@ \tikzoption{shape}{\edef\tikz@shape{#1}} +\tikzoption{nodes}{\tikzstyle{every node}+=[#1]} + \tikzoption{inner sep}{\def\pgfshapeinnerxsep{#1}\def\pgfshapeinnerysep{#1}} \tikzoption{inner xsep}{\def\pgfshapeinnerxsep{#1}} \tikzoption{inner ysep}{\def\pgfshapeinnerysep{#1}} @@ -533,7 +536,7 @@ \def\tikz@test{#3}% \ifx\tikz@test\pgfutil@empty% \else% - \setlength{\pgf@x}{#3}% + \pgfmathsetlength{\pgf@x}{#3}% \pgf@x=#2\pgf@x\relax% \edef\tikz@marshal{\noexpand\tikz@addtransform{% \expandafter\noexpand\csname pgftransform#1shift\endcsname{\the\pgf@x}}}% @@ -690,7 +693,7 @@ \def\tikz@set@parabola@bend#1{\def\tikz@parabola@bend{#1}} % Axis options -\tikzoption{domain}{\def\tikz@plot@domain{#1}} +\tikzoption{domain}{\def\tikz@plot@domain{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax} \tikzoption{range}{\def\tikz@plot@range{#1}} % Plot options @@ -708,9 +711,12 @@ \tikzoption{prefix}{\def\tikz@plot@prefix{#1}} \tikzoption{id}{\def\tikz@plot@id{#1}} -\tikzoption{samples}{\def\tikz@plot@sampels{#1}} +\tikzoption{samples}{\def\tikz@plot@samples{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax} +\tikzoption{samples at}{\def\tikz@plot@samplesat{#1}} \tikzoption{parametric}[true]{\csname tikz@plot@parametric#1\endcsname} +\tikzoption{variable}{\def\tikz@plot@var{#1}} + \tikzoption{only marks}[]{\let\tikz@plot@handler\pgfplothandlerdiscard} \tikzoption{mark}{\def\tikz@plot@mark{#1}} @@ -728,8 +734,19 @@ \let\tikz@plot@handler=\pgfplothandlerlineto \let\tikz@plot@mark=\pgfutil@empty -\def\tikz@plot@sampels{25} +\def\tikz@plot@samples{25} \def\tikz@plot@domain{-5:5} +\def\tikz@plot@var{\x} +\def\tikz@plot@samplesat{-5,-4.6,...,5} +\def\tikz@plot@samples@recalc#1:#2\relax{% + \pgfmathparse{#1}% + \let\tikz@temp@start=\pgfmathresult% + \pgfmathparse{#2}% + \let\tikz@temp@end=\pgfmathresult% + \pgfmathparse{\tikz@temp@start+(\tikz@temp@end-\tikz@temp@start)/\tikz@plot@samples}% + \edef\tikz@plot@samplesat{\tikz@temp@start,\pgfmathresult,...,\tikz@temp@end}% +} + \def\tikz@plot@prefix{\jobname.} \def\tikz@plot@id{pgf-plot} @@ -751,13 +768,15 @@ \tikzoption{parent anchor}{\def\tikzparentanchor{.#1}\ifx\tikzparentanchor\tikz@border@text\let\tikzparentanchor\pgfutil@empty\fi} \tikzoption{child anchor}{\def\tikzchildanchor{.#1}\ifx\tikzchildanchor\tikz@border@text\let\tikzchildanchor\pgfutil@empty\fi} -\tikzoption{level distance}{\setlength\tikzleveldistance{#1}} -\tikzoption{sibling distance}{\setlength\tikzsiblingdistance{#1}} +\tikzoption{level distance}{\pgfmathsetlength\tikzleveldistance{#1}} +\tikzoption{sibling distance}{\pgfmathsetlength\tikzsiblingdistance{#1}} \tikzoption{growth function}{\let\tikz@grow=#1} +\tikzoption{growth parent anchor}{\def\tikz@growth@anchor{#1}} \tikzoption{grow}{\tikz@set@growth{#1}\edef\tikz@special@level{\the\tikztreelevel}}% \tikzoption{grow'}{\tikz@set@growth{#1}\tikz@swap@growth\edef\tikz@special@level{\the\tikztreelevel}}% +\def\tikz@growth@anchor{center} \def\tikz@special@level{-1}% never @@ -812,8 +831,8 @@ \pgf@xc=.5\tikzsiblingdistance% \c@pgf@counta=\tikznumberofchildren% \advance\c@pgf@counta by1\relax% - \@tempdima=\c@pgf@counta\pgf@xc% - \pgftransformshift{\pgfpointpolar{\tikz@angle@grow@left}{\@tempdima}}% + \pgfutil@tempdima=\c@pgf@counta\pgf@xc% + \pgftransformshift{\pgfpointpolar{\tikz@angle@grow@left}{\pgfutil@tempdima}}% \pgftransformshift{\pgfpointpolar{\tikz@angle@grow@right}{\tikznumberofcurrentchild\tikzsiblingdistance}}% \fi% } @@ -837,12 +856,12 @@ \fi% \fi} -\tikzoption{segment amplitude}{\setlength{\pgfsnakesegmentamplitude}{#1}} -\tikzoption{segment length}{\setlength{\pgfsnakesegmentlength}{#1}} -\tikzoption{segment angle}{\def\pgfsnakesegmentangle{#1}} -\tikzoption{segment aspect}{\def\pgfsnakesegmentaspect{#1}} +\tikzoption{segment amplitude}{\pgfmathsetlength{\pgfsnakesegmentamplitude}{#1}} +\tikzoption{segment length}{\pgfmathsetlength{\pgfsnakesegmentlength}{#1}} +\tikzoption{segment angle}{\pgfmathparse{#1}\let\pgfsnakesegmentangle=\pgfmathresult} +\tikzoption{segment aspect}{\pgfmathparse{#1}\let\pgfsnakesegmentaspect=\pgfmathresult} -\tikzoption{segment object length}{\def\pgfsnakesegmentobjectlength{#1}} +\tikzoption{segment object length}{\pgfmathparse{#1}\edef\pgfsnakesegmentobjectlength{\pgfmathresult pt}} \tikzoption{raise snake}{\def\pgf@snake@raise{\pgftransformyshift{#1}}} \tikzoption{mirror snake}[true]{% @@ -881,6 +900,21 @@ \def\tikz@mainsnakelength{\pgfsnakeremainingdistance} +% Matrix options +\tikzoption{matrix}[true]{\csname tikz@is@matrix#1\endcsname} + +\tikzoption{matrix anchor}{\def\tikz@matrix@anchor{#1}} + +\tikzoption{column sep}{\def\pgfmatrixcolumnsep{#1}} +\tikzoption{row sep}{\def\pgfmatrixrowsep{#1}} + +\tikzoption{cells}{\tikzstyle{every cell}+=[#1]} + +\tikzoption{ampersand replacement}{\def\tikz@ampersand@replacement{#1}} + +\newif\iftikz@is@matrix +\let\tikz@matrix@anchor=\pgfutil@empty +\let\tikz@ampersand@replacement=\pgfutil@empty % Execute option @@ -892,6 +926,9 @@ \tikzoption{execute at end to}{\expandafter\def\expandafter\tikz@atend@to\expandafter{\tikz@atend@to#1}} \tikzoption{execute at begin node}{\expandafter\def\expandafter\tikz@atbegin@node\expandafter{\tikz@atbegin@node#1}} \tikzoption{execute at end node}{\expandafter\def\expandafter\tikz@atend@node\expandafter{\tikz@atend@node#1}} +\tikzoption{execute at begin cell}{\expandafter\def\expandafter\tikz@atbegin@cell\expandafter{\tikz@atbegin@cell#1}} +\tikzoption{execute at end cell}{\expandafter\def\expandafter\tikz@atend@cell\expandafter{\tikz@atend@cell#1}} +\tikzoption{execute at empty cell}{\expandafter\def\expandafter\tikz@at@emptycell\expandafter{\tikz@at@emptycell#1}} \let\tikz@atbegin@picture=\pgfutil@empty \let\tikz@atend@picture=\pgfutil@empty @@ -901,6 +938,9 @@ \let\tikz@atend@to=\pgfutil@empty \let\tikz@atbegin@node=\pgfutil@empty \let\tikz@atend@node=\pgfutil@empty +\let\tikz@atbegin@cell=\pgfutil@empty +\let\tikz@atend@cell=\pgfutil@empty +\let\tikz@at@emptycell=\pgfutil@empty @@ -957,6 +997,8 @@ \tikzstyle{every child}= [] \tikzstyle{every child node}= [] \tikzstyle{every to}= [] +\tikzstyle{every cell}= [] +\tikzstyle{every matrix}= [] \tikzstyle{every edge}= [draw] \tikzstyle{every label}= [draw=none,fill=none] \tikzstyle{every pin}= [draw=none,fill=none] @@ -1206,6 +1248,8 @@ \let\tikz@origuseasboundingbox=\useasboundingbox% \let\tikz@orignode=\node% \let\tikz@origcoordinate=\coordinate% + \let\tikz@origmatrix=\matrix% + \let\tikz@origcalendar=\calendar% % \tikz@deactivatthings% % @@ -1226,7 +1270,12 @@ \def\useasboundingbox{\path[use as bounding box]} \def\node{\path node} \def\coordinate{\path coordinate} + \def\matrix{\path node[matrix]} + \def\calendar{\tikz@lib@cal@calendar}% } +\ifx\tikz@lib@cal@calendar\@undefined +\def\tikz@lib@cal@calendar{\PackageError{tikz}{You need to load the calendar library}{}} +\fi \def\tikz@uninstallcommands{% \ifnum\the\catcode`\;=\active\relax\expandafter\let\tikz@activesemicolon=\tikz@origsemi\fi% @@ -1248,6 +1297,8 @@ \let\useasboundingbox=\tikz@origuseasboundingbox% \let\node=\tikz@orignode% \let\coordinate=\tikz@origcoordinate% + \let\matrix=\tikz@origmatrix% + \let\calendar=\tikz@origcalendar% } @@ -1281,8 +1332,10 @@ % settings. \def\tikz@command@path{% + \let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell \pgfutil@ifnextchar[{\tikz@check@earg}%] {\pgfutil@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}} +\def\tikz@signal@path{\tikz@signal@path}% \def\tikz@check@earg[#1]{% \pgfutil@ifnextchar<{\tikz@swap@args[#1]}{\tikz@@command@path[#1]}} \def\tikz@swap@args[#1]<#2>{\tikz@command@path<#2>[#1]} @@ -1546,7 +1599,7 @@ \def\tikz@expand{% \advance\tikz@expandcount by -1% \ifnum\tikz@expandcount<0\relax% - \PackageError{tikz}{Giving up on this path}{}% + \PackageError{tikz}{Giving up on this path. Did you forget a semicolon?}{}% \let\@next=\tikz@finish% \else% \let\@next=\tikz@@expand @@ -1589,11 +1642,22 @@ \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\pgfutil@gobble}}% - \def\pgffor@afterhook{\setbox\tikz@figbox=\box\tikz@tempbox\tikz@scan@next@command}% + \def\pgffor@endhook{\pgfextra{% + \xdef\tikz@foreach@save@lastx{\the\tikz@lastx}% + \xdef\tikz@foreach@save@lasty{\the\tikz@lasty}% + \xdef\tikz@foreach@save@lastxsaved{\the\tikz@lastxsaved}% + \xdef\tikz@foreach@save@lastysaved{\the\tikz@lastysaved}% + \global\setbox\tikz@tempbox=\copy\tikz@figbox\pgfutil@gobble}}% + \def\pgffor@afterhook{% + \tikz@lastx=\tikz@foreach@save@lastx% + \tikz@lasty=\tikz@foreach@save@lasty% + \tikz@lastxsaved=\tikz@foreach@save@lastxsaved% + \tikz@lastysaved=\tikz@foreach@save@lastysaved% + \setbox\tikz@figbox=\box\tikz@tempbox\tikz@scan@next@command}% \global\setbox\tikz@tempbox=\copy\tikz@figbox% \foreach} + % Syntax for againpath: % \againpath \somepathname @@ -1753,7 +1817,10 @@ % snake or lineto? \def\tikz@path@lineto#1{% \iftikz@snaked% - \pgfpathsnakesto{\tikz@presnake,{\tikz@snake}{\tikz@mainsnakelength},\tikz@postsnake}{#1}% + { + \pgfsyssoftpathmovetorelevantfalse% + \pgfpathsnakesto{\tikz@presnake,{\tikz@snake}{\tikz@mainsnakelength},\tikz@postsnake}{#1}% + } \else% \pgfpathlineto{#1}% \fi% @@ -2074,7 +2141,10 @@ \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}}% + \iftikz@snaked% + \tikz@path@lineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}% + \fi% + \pgfpathclose% \pgfpathmoveto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}% \def\pgfstrokehook{}% \tikz@scan@next@command% @@ -2133,8 +2203,9 @@ \tikz@setkeys{#1}% \pgfutil@ifnextchar f{\tikz@plot@f}% {\pgfutil@ifnextchar c{\tikz@plot@scan@points}% - {\PackageError{tikz}{Cannot parse this plotting data}{}% - \endgroup}}} + {\pgfutil@ifnextchar ({\tikz@plot@expression}{% + \PackageError{tikz}{Cannot parse this plotting data}{}% + \endgroup}}}} \def\tikz@plot@f f{\pgfutil@ifnextchar i{\tikz@plot@file}{\tikz@plot@function}} \def\tikz@plot@file ile#1{\def\tikz@plot@data{\pgfplotxyfile{#1}}\tikz@@@plot}% @@ -2157,12 +2228,12 @@ \else% \iftikz@plot@parametric% \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{% - set samples \tikz@plot@sampels; + set samples \tikz@plot@samples; set parametric; plot [t=\tikz@plot@domain] #1}}% \else% \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{% - set samples \tikz@plot@sampels; + set samples \tikz@plot@samples; plot [x=\tikz@plot@domain] #1}}% \fi% \fi% @@ -2175,6 +2246,11 @@ {}% } +\def\tikz@plot@expression(#1){% + \edef\tikz@plot@data{\noexpand\pgfplotfunction{\expandafter\noexpand\tikz@plot@var}{\tikz@plot@samplesat}}% + \expandafter\def\expandafter\tikz@plot@data\expandafter{\tikz@plot@data{\tikz@scan@one@point\pgfutil@firstofone(#1)}}% + \tikz@@@plot% +} \def\tikz@@@plot{% \def\pgfplotlastpoint{\pgfpointorigin}% @@ -2359,30 +2435,23 @@ } \def\tikz@@@arcto@check@slashand(#1:#2:#3){% - \pgfutil@in@{/}{#3}% + \pgfutil@in@{ and }{#3}% \ifpgfutil@in@% - \tikz@parse@arc@replace@slash@and(#1:#2:#3)% + \tikz@parse@arc@and(#1:#2:#3)% \else% - \pgfutil@in@{ and }{#3}% - \ifpgfutil@in@% - \tikz@parse@arc@and(#1:#2:#3)% - \else% - \tikz@parse@arc@and(#1:#2:#3 and #3)% - \fi% + \tikz@parse@arc@and(#1:#2:#3 and #3)% \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@checkunit{#3}% \iftikz@isdimension% - \tikz@@@arcfinal{\pgfpatharc{#1}{#2}{#3/#4}} - {\pgfpointpolar{#1}{#3/#4}} - {\pgfpointpolar{#2}{#3/#4}}% + \tikz@@@arcfinal{\pgfpatharc{#1}{#2}{#3 and #4}} + {\pgfpointpolar{#1}{#3 and #4}} + {\pgfpointpolar{#2}{#3 and #4}}% \else% \tikz@@@arcfinal{\pgfpatharcaxes{#1}{#2}{\pgfpointxy{#3}{0}}{\pgfpointxy{0}{#4}}} - {\pgfpointpolarxy{#1}{#3/#4}}{\pgfpointpolarxy{#2}{#3/#4}}% + {\pgfpointpolarxy{#1}{#3 and #4}}{\pgfpointpolarxy{#2}{#3 and #4}}% \fi% } @@ -2429,6 +2498,7 @@ \begingroup% \let\tikz@fig@name=\pgfutil@empty% \begingroup% + \tikz@is@matrixfalse% \let\nodepart=\tikz@nodepart% \let\tikz@options=\pgfutil@empty% \let\tikz@after@node=\pgfutil@empty% @@ -2463,6 +2533,14 @@ \def\tikz@shape{rectangle}}% {}% \tikz@every@style{every \tikz@shape\space node}% + \iftikz@is@matrix% + \let\tikz@next=\tikz@do@matrix% + \else% + \let\tikz@next=\tikz@do@fig% + \fi% + \tikz@next% +} +\def\tikz@do@fig{% \setbox\pgfnodeparttextbox=\hbox% \bgroup% \tikz@every@style{every text node part}% @@ -2506,66 +2584,179 @@ \fi% \endpgfinterruptpicture% \egroup% - \pgfutil@ifnextchar c{\tikz@fig@mustbenamed}% - {\pgfutil@ifnextchar[{\tikz@fig@mustbenamed}% - {\pgfutil@ifnextchar t{\tikz@fig@mustbenamed} - {\pgfutil@ifnextchar e{\tikz@fig@mustbenamed} - {\ifx\tikz@after@node\pgfutil@empty\expandafter\tikz@fig@continue\else\expandafter\tikz@fig@mustbenamed\fi}}}}}%} -\def\tikz@fig@mustbenamed{% - \ifx\tikz@fig@name\pgfutil@empty% - % Assign a dummy name - \global\advance\tikz@fig@count by1\relax - \edef\tikz@fig@name{tikz@f@\the\tikz@fig@count}% - \fi% - \tikz@fig@continue% + \pgfutil@ifnextchar c{\tikz@fig@mustbenamed\tikz@fig@continue}% + {\pgfutil@ifnextchar[{\tikz@fig@mustbenamed\tikz@fig@continue}% + {\pgfutil@ifnextchar t{\tikz@fig@mustbenamed\tikz@fig@continue} + {\pgfutil@ifnextchar e{\tikz@fig@mustbenamed\tikz@fig@continue} + {\ifx\tikz@after@node\pgfutil@empty\expandafter\tikz@fig@continue\else\expandafter\tikz@fig@mustbenamed\expandafter\tikz@fig@continue\fi}}}}}%} + +\def\tikz@do@matrix{% + \tikz@every@style{every matrix}% + \tikz@node@transformations% + \tikz@fig@mustbenamed% + \setbox\tikz@figbox=\hbox\bgroup% + \setbox\pgfutil@tempboxa=\copy\tikz@figbox% + \unhbox\pgfutil@tempboxa% + \hbox\bgroup\bgroup% + \pgfinterruptpath% + \pgfscope% + \tikz@options% + \setbox\tikz@figbox=\box\voidb@x% + \let\tikzmatrixname=\tikz@fig@name% + \edef\tikz@m@anchor{\ifx\tikz@matrix@anchor\pgfutil@empty\tikz@anchor\else\tikz@matrix@anchor\fi}% + \expandafter\pgfutil@in@\expandafter{\expandafter.\expandafter}\expandafter{\tikz@m@anchor}% + \ifpgfutil@in@% + \expandafter\tikz@matrix@split\tikz@m@anchor\relax% + \else% + \def\tikz@matrix@shift{\pgfpointorigin}% + \fi% + \let\tikz@transform=\relax% + \pgfmatrix% + {\tikz@shape}% + {\tikz@m@anchor}% + {\tikz@fig@name}% + {% + \pgfutil@tempdima=\pgflinewidth% + {\begingroup\tikz@finish}% + \global\pgflinewidth=\pgfutil@tempdima% + }% + {\tikz@matrix@shift}% + {% + \tikz@matrix@make@active@ampersand% + \def\pgfmatrixbegincode{% + \pgfsys@beginscope% + \tikz@common@matrix@code% + \tikz@atbegin@cell% + }% + \def\tikz@common@matrix@code{% + \let\tikz@options=\pgfutil@empty% + \let\tikz@mode=\pgfutil@empty% + \tikz@every@style{every cell}% + \tikz@every@style{column \the\pgfmatrixcurrentcolumn}% + \ifodd\pgfmatrixcurrentcolumn% + \tikz@every@style{every odd column}% + \else% + \tikz@every@style{every even column}% + \fi% + \tikz@every@style{row \the\pgfmatrixcurrentrow}% + \ifodd\pgfmatrixcurrentrow% + \tikz@every@style{every odd row}% + \else% + \tikz@every@style{every even row}% + \fi% + \tikz@every@style{row \the\pgfmatrixcurrentrow\space column \the\pgfmatrixcurrentcolumn}% + \tikz@options% + }% + \def\pgfmatrixendcode{% + \tikz@atend@cell% + \pgfsys@endscope% + }% + \def\pgfmatrixemptycode{% + \pgfsys@beginscope% + \tikz@common@matrix@code% + \tikz@at@emptycell% + \pgfsys@endscope% + }% + \aftergroup\tikz@do@matrix@cont}% + \bgroup% +} +\def\tikz@do@matrix@cont{% + \endpgfscope + \endpgfinterruptpath% + \egroup\egroup% + \egroup% + % + \tikz@node@finish% +} + +{% + \catcode`\&=13 + \gdef\tikz@matrix@make@active@ampersand{% + \ifx\tikz@ampersand@replacement\pgfutil@empty% + \catcode`\&=13% + \let&=\pgfmatrixnextcell% + \else% + \expandafter\let\tikz@ampersand@replacement=\pgfmatrixnextcell% + \fi% + }% +}% + + +\def\tikz@matrix@split#1.#2\relax{% + \def\tikz@m@anchor{text}% + \def\tikz@matrix@shift{\pgfpointanchor{#1}{#2}}% } + \def\tikz@fig@continue{% \ifx\tikz@text@width\pgfutil@empty% \else% - \setlength{\pgf@x}{\tikz@text@width}% + \pgfmathsetlength{\pgf@x}{\tikz@text@width}% \wd\pgfnodeparttextbox=\pgf@x% \fi% \ifx\tikz@text@height\pgfutil@empty% \else% - \setlength{\pgf@x}{\tikz@text@height}% + \pgfmathsetlength{\pgf@x}{\tikz@text@height}% \ht\pgfnodeparttextbox=\pgf@x% \fi% \ifx\tikz@text@depth\pgfutil@empty% \else% - \setlength{\pgf@x}{\tikz@text@depth}% + \pgfmathsetlength{\pgf@x}{\tikz@text@depth}% \dp\pgfnodeparttextbox=\pgf@x% \fi% - % Possibly, we are ``online'' - \ifx\tikz@time\pgfutil@empty% - \pgftransformshift{\tikz@node@at}% - \iftikz@fullytransformed% - \else% - \pgftransformresetnontranslations - \fi% - \else% - \tikz@do@auto@anchor% - \tikz@timer% - \fi% - % Invoke local transformations - \tikz@transform% + % + % Node transformation + % + \tikz@node@transformations + % \setbox\tikz@figbox=\hbox{% - \setbox\@tempboxa=\copy\tikz@figbox% - \unhbox\@tempboxa% + \setbox\pgfutil@tempboxa=\copy\tikz@figbox% + \unhbox\pgfutil@tempboxa% \hbox{{% \pgfinterruptpath% \pgfscope% \tikz@options% \setbox\tikz@figbox=\box\voidb@x% \pgfmultipartnode{\tikz@shape}{\tikz@anchor}{\tikz@fig@name}{% - \@tempdima=\pgflinewidth% + \pgfutil@tempdima=\pgflinewidth% {\begingroup\tikz@finish}% - \global\pgflinewidth=\@tempdima% + \global\pgflinewidth=\pgfutil@tempdima% }% \endpgfscope \endpgfinterruptpath% }}% }% - % + % + \tikz@node@finish% +} + + +\def\tikz@fig@mustbenamed{% + \ifx\tikz@fig@name\pgfutil@empty% + % Assign a dummy name + \global\advance\tikz@fig@count by1\relax + \edef\tikz@fig@name{tikz@f@\the\tikz@fig@count}% + \fi% +} + +\def\tikz@node@transformations{ + % + % Possibly, we are ``online'' + % + \ifx\tikz@time\pgfutil@empty% + \pgftransformshift{\tikz@node@at}% + \iftikz@fullytransformed% + \else% + \pgftransformresetnontranslations% + \fi% + \else% + \tikz@do@auto@anchor% + \tikz@timer% + \fi% + % Invoke local transformations + \tikz@transform% +} + +\def\tikz@node@finish{% \global\let\tikz@last@fig@name=\tikz@fig@name% \global\let\tikz@after@node@smuggle=\tikz@after@node% \global\let\tikz@afternodepathoptions@smuggle=\tikz@afternodepathoptions% @@ -2585,6 +2776,8 @@ } \let\tikz@fig@continue@orig=\tikz@fig@continue + + % Syntax for parts of nodes: % node ... {... \nodepart{name} ... \nodepart{name} ...} @@ -2742,7 +2935,7 @@ \tikz@transform% \let\tikzparentnode=\tikz@last@fig@name% % Transform to center of node - \pgftransformshift{\pgfpointanchor{\tikzparentnode}{center}}% + \pgftransformshift{\pgfpointanchor{\tikzparentnode}{\tikz@growth@anchor}}% \tikznumberofcurrentchild=0\relax% \tikz@children@list% \global\setbox\tikz@tempbox=\copy\tikz@figbox% @@ -2973,7 +3166,7 @@ \tikzdeclarecoordinatesystem{xyz polar} {% \tikz@orig@setkeys{tikzcskeys}{angle=0,radius=0,#1}% - \pgfpointpolarxy{\tikz@cs@angle}{\tikz@cs@xradius/\tikz@cs@yradius}% + \pgfpointpolarxy{\tikz@cs@angle}{\tikz@cs@xradius and \tikz@cs@yradius}% } \tikzaliascoordinatesystem{xy polar}{xyz polar} @@ -3021,6 +3214,33 @@ \pgfqpoint{\the\pgf@xb}{\the\pgf@ya} } +\tikzdeclarecoordinatesystem{barycentric} +{% + {% + \pgf@xa=0pt% point + \pgf@ya=0pt% + \pgf@xb=0pt% sum + \tikz@bary@dolist#1,=,% + \pgfmathparse{1/\the\pgf@xb}% + \global\pgf@x=\pgfmathresult\pgf@xa% + \global\pgf@y=\pgfmathresult\pgf@ya% + }% +} + +\def\tikz@bary@dolist#1=#2,{% + \def\tikz@temp{#1}% + \ifx\tikz@temp\pgfutil@empty% + \else + \pgf@process{\pgfpointanchor{#1}{center}}% + \pgfmathparse{#2}% + \advance\pgf@xa by\pgfmathresult\pgf@x% + \advance\pgf@ya by\pgfmathresult\pgf@y% + \advance\pgf@xb by\pgfmathresult pt% + \expandafter\tikz@bary@dolist% + \fi% +} + + \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}} @@ -3168,9 +3388,8 @@ \newif\iftikz@isdimension \def\tikz@checkunit#1{% - \@tempdima\z@% - \afterassignment\tikz@@checkunit% - \@tempdima#1\@tempdima\tikz@unique% + \pgfmathparse{#1}% + \let\iftikz@isdimension=\ifpgfmathunitsdeclared% } \def\tikz@@checkunit{\pgfutil@ifnextchar\tikz@unique{\tikz@checkunit@number}{\tikz@checkunit@dimension}} \def\tikz@checkunit@number\tikz@unique{\tikz@isdimensionfalse} @@ -3193,9 +3412,9 @@ \def\tikz@@@parse@polar#1(#2:#3 and #4){% \tikz@checkunit{#3}% \iftikz@isdimension% - \def\tikz@next{#1{\pgfpointpolar{#2}{#3/#4}}}% + \def\tikz@next{#1{\pgfpointpolar{#2}{#3 and #4}}}% \else% - \def\tikz@next{#1{\pgfpointpolarxy{#2}{#3/#4}}}% + \def\tikz@next{#1{\pgfpointpolarxy{#2}{#3 and #4}}}% \fi% \tikz@next% } |