diff options
Diffstat (limited to 'graphics/pgf/base/tex')
32 files changed, 614 insertions, 171 deletions
diff --git a/graphics/pgf/base/tex/pgf.revision.tex b/graphics/pgf/base/tex/pgf.revision.tex index 714fd17d5d..fd2ec0044b 100644 --- a/graphics/pgf/base/tex/pgf.revision.tex +++ b/graphics/pgf/base/tex/pgf.revision.tex @@ -5,10 +5,10 @@ \catcode`\:=12 \catcode`\+=12 \catcode`\-=12 -\gdef\pgfrevision{3.1.4b} -\gdef\pgfversion{3.1.4b} -\gdef\pgfversiondatetime{2019-08-03 20:21:02 +1200} -\gdef\pgfrevisiondatetime{2019-08-03 20:21:02 +1200} +\gdef\pgfrevision{3.1.5} +\gdef\pgfversion{3.1.5} +\gdef\pgfversiondatetime{2019-12-19 19:56:10 +1300} +\gdef\pgfrevisiondatetime{2019-12-19 19:56:10 +1300} \gdef\pgf@glob@TMPa#1-#2-#3 #4\relax{#1/#2/#3} \xdef\pgfversiondate{\expandafter\pgf@glob@TMPa\pgfversiondatetime\relax} \xdef\pgfrevisiondate{\expandafter\pgf@glob@TMPa\pgfrevisiondatetime\relax} diff --git a/graphics/pgf/base/tex/pgfcorepathconstruct.code.tex b/graphics/pgf/base/tex/pgfcorepathconstruct.code.tex index c5b9ee1e99..e7b8f98dd3 100644 --- a/graphics/pgf/base/tex/pgfcorepathconstruct.code.tex +++ b/graphics/pgf/base/tex/pgfcorepathconstruct.code.tex @@ -130,9 +130,9 @@ \ifdim#1>\pgf@picmaxx\global\pgf@picmaxx#1\fi% \ifdim#2<\pgf@picminy\global\pgf@picminy#2\fi% \ifdim#2>\pgf@picmaxy\global\pgf@picmaxy#2\fi% - \ifpgf@size@hooked% - \let\pgf@size@hook@x#1\let\pgf@size@hook@y#2\pgf@path@size@hook% - \fi% + \fi% + \ifpgf@size@hooked% + \let\pgf@size@hook@x#1\let\pgf@size@hook@y#2\pgf@path@size@hook% \fi% \ifdim#1<\pgf@pathminx\global\pgf@pathminx#1\fi% \ifdim#1>\pgf@pathmaxx\global\pgf@pathmaxx#1\fi% diff --git a/graphics/pgf/base/tex/pgfcorepoints.code.tex b/graphics/pgf/base/tex/pgfcorepoints.code.tex index 028546dde8..15dfbbf160 100644 --- a/graphics/pgf/base/tex/pgfcorepoints.code.tex +++ b/graphics/pgf/base/tex/pgfcorepoints.code.tex @@ -851,11 +851,11 @@ \def\pgfpointxyz#1#2#3{% \pgfmathparse{#1}% - \global\let\pgftemp@x=\pgfmathresult% + \let\pgftemp@x=\pgfmathresult% \pgfmathparse{#2}% - \global\let\pgftemp@y=\pgfmathresult% + \let\pgftemp@y=\pgfmathresult% \pgfmathparse{#3}% - \global\let\pgftemp@z=\pgfmathresult% + \let\pgftemp@z=\pgfmathresult% \global\pgf@x=\pgftemp@x\pgf@xx% \global\advance\pgf@x by \pgftemp@y\pgf@yx% \global\advance\pgf@x by \pgftemp@z\pgf@zx% diff --git a/graphics/pgf/base/tex/pgfcorescopes.code.tex b/graphics/pgf/base/tex/pgfcorescopes.code.tex index 3e292aa038..27b9da97bb 100644 --- a/graphics/pgf/base/tex/pgfcorescopes.code.tex +++ b/graphics/pgf/base/tex/pgfcorescopes.code.tex @@ -456,14 +456,12 @@ \pgf@getpathsizes\pgf@interrupt@pathsizes% \pgfsyssoftpath@getcurrentpath\pgf@interrupt@path% \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \edef\pgfscope@linewidth{\the\pgflinewidth}% \let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto% \begingroup% } \def\endpgfinterruptpath {% \endgroup% - \global\pgflinewidth=\pgfscope@linewidth% \pgfsyssoftpath@setcurrentpath\pgf@interrupt@path% \pgf@setpathsizes\pgf@interrupt@pathsizes% \global\pgf@path@lastx\pgf@interrupt@savex% diff --git a/graphics/pgf/base/tex/pgfkeys.code.tex b/graphics/pgf/base/tex/pgfkeys.code.tex index 2f17652628..73922a0f09 100644 --- a/graphics/pgf/base/tex/pgfkeys.code.tex +++ b/graphics/pgf/base/tex/pgfkeys.code.tex @@ -74,9 +74,9 @@ } \long\def\pgfkeyssetevalue#1#2{% - \pgfkeys@temptoks={#2}% - \pgfkeys@temptoks=\scantokens\expandafter{\expandafter{\the\pgfkeys@temptoks}}% - \expandafter\edef\csname pgfk@#1\expandafter\endcsname\expandafter{\the\pgfkeys@temptoks}% + \edef\pgfkeys@temp##1##2##3##4##5##6##7##8##9{#2}% + \pgfkeys@temptoks=\expandafter{\pgfkeys@temp{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}% + \expandafter\edef\csname pgfk@#1\endcsname{\the\pgfkeys@temptoks}% } % Add text to a key at the end @@ -401,11 +401,11 @@ % - path := '/my search path' % - name := 'key/.code' % - key = '/my search path/key/.code' - \let\pgfkeys@temp=\pgfkeyscurrentkey + \let\pgfkeys@tempa=\pgfkeyscurrentkey \let\pgfkeys@tempb=\pgfkeyscurrentname \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% \pgfkeys@split@path% - \let\pgfkeyscurrentkey=\pgfkeys@temp + \let\pgfkeyscurrentkey=\pgfkeys@tempa \edef\pgfkeyscurrentname{\pgfkeyscurrentname/\pgfkeys@tempb}% \pgfkeys@unknown }% @@ -958,6 +958,16 @@ \long\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}} +\def\pgfkeys@mathparse{% + \ifcsname pgfmathparse\endcsname + \expandafter\pgfmathparse + \else + \pgfkeys@error{You have to load `pgfmath' to use \string\pgfmathparse}% + \expandafter\def\expandafter\pgfmathresult + \fi +} +\pgfkeys{/handlers/.evaluated/.code=\pgfkeys@mathparse{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}} + % Try to set a key and do nothing if not define \newif\ifpgfkeyssuccess diff --git a/graphics/pgf/base/tex/pgflibrarybbox.code.tex b/graphics/pgf/base/tex/pgflibrarybbox.code.tex new file mode 100644 index 0000000000..38690faed1 --- /dev/null +++ b/graphics/pgf/base/tex/pgflibrarybbox.code.tex @@ -0,0 +1,94 @@ +% Copyright 2019 by an anonymous contributor +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU General Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\global\let\pgf@bbox@lt@curveto@normal\pgf@lt@curveto +\global\let\pgf@bbox@nlt@curveto@normal\pgf@nlt@curveto + +\pgfqkeys{/pgf}{bezier bounding box/.is if=pgf@bbox@switch@} + +\def\pgf@bbox@switch@false{% + \let\pgf@lt@curveto \pgf@bbox@lt@curveto@normal + \let\pgf@nlt@curveto\pgf@bbox@nlt@curveto@normal +} + +\def\pgf@bbox@switch@true{% + \let\pgf@lt@curveto \pgf@bbox@curveto + \let\pgf@nlt@curveto\pgf@bbox@curveto +} + +\def\pgf@bbox@curveto#1#2#3#4#5#6{% + % extrema in x + \pgfmathsetmacro{\pgf@temp@b}{abs(\pgf@path@lastx-#5-3*#1+3*#3)}% + % ^^^ this is used for the denominator below, cannot become too small + \pgfmathsetmacro{\pgf@temp@c}{max(1+\pgf@path@lastx,max(#1,max(#3,#5)))}% + % ^^^ in order to avoid dimension too large errors from squaring lengths in pt + \pgfmathparse{((#1/\pgf@temp@c)*(#1/\pgf@temp@c)-1*((#1/\pgf@temp@c)*(#3/\pgf@temp@c))+(#3/\pgf@temp@c)*(#3/\pgf@temp@c)-1*((#1/\pgf@temp@c)*(#5/\pgf@temp@c))+(-(#3/\pgf@temp@c)+(#5/\pgf@temp@c))*(\pgf@path@lastx/\pgf@temp@c))}% + \pgfutil@tempdima=\pgfmathresult pt\relax% + % ^^^ discriminant + \ifdim\pgf@temp@b pt<0.01pt\relax% + % approximately linear + \pgfmathparse{abs(2*(#1)-2*(#3)+(#5))}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \ifdim\pgfutil@tempdimb<0.1pt\relax% + % if the denominator is very small, t is *likely* large but could be 0/0 + \else + \pgfmathsetmacro{\pgf@temp@a}{(2*(#1)-3*(#3)+(#5))/(2*(#1)-2*(#3)+(#5))}% + \pgfmathparse{\pgf@path@lastx*pow(1-\pgf@temp@a,3)+3*#1*pow(1-\pgf@temp@a,2)*\pgf@temp@a+3*#3*(1-\pgf@temp@a)*\pgf@temp@a*\pgf@temp@a+#5*pow(\pgf@temp@a,3)}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \pgf@protocolsizes{\pgfutil@tempdimb}{#6}% + \fi% + \else + \ifdim\pgfutil@tempdima<0pt\relax% negative discriminant -> no turning point + \else + \pgfmathsetmacro{\pgf@temp@a}{min(1,max(0,(\pgf@path@lastx-2*#1+#3-\pgf@temp@c*sqrt(\pgfutil@tempdima))/(\pgf@path@lastx-#5-3*#1+3*#3)))}% + \pgfmathparse{\pgf@path@lastx*pow(1-\pgf@temp@a,3)+3*#1*pow(1-\pgf@temp@a,2)*\pgf@temp@a+3*#3*(1-\pgf@temp@a)*\pgf@temp@a*\pgf@temp@a+#5*pow(\pgf@temp@a,3)}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \pgf@protocolsizes{\pgfutil@tempdimb}{#6}% + \pgfmathsetmacro{\pgf@temp@a}{min(1,max(0,(\pgf@path@lastx-2*#1+#3+\pgf@temp@c*sqrt(\pgfutil@tempdima))/(\pgf@path@lastx-#5-3*#1+3*#3)))}% + \pgfmathparse{\pgf@path@lastx*pow(1-\pgf@temp@a,3)+3*#1*pow(1-\pgf@temp@a,2)*\pgf@temp@a+3*#3*(1-\pgf@temp@a)*\pgf@temp@a*\pgf@temp@a+#5*pow(\pgf@temp@a,3)}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \pgf@protocolsizes{\pgfutil@tempdimb}{#6}% + \fi% + \fi + %%%%%%%%%%%%%%%%%%%%%%%%%%% + % extrema in y (completely analogous to the above) + \pgfmathsetmacro{\pgf@temp@b}{abs(\pgf@path@lasty-#6-3*#2+3*#4)}% + \pgfmathsetmacro{\pgf@temp@c}{max(1+\pgf@path@lasty,max(#2,max(#4,#6)))}% + \pgfmathparse{((#2/\pgf@temp@c)*(#2/\pgf@temp@c)-1*((#2/\pgf@temp@c)*(#4/\pgf@temp@c))+(#4/\pgf@temp@c)*(#4/\pgf@temp@c)-1*((#2/\pgf@temp@c)*(#6/\pgf@temp@c))+(-(#4/\pgf@temp@c)+(#6/\pgf@temp@c))*(\pgf@path@lasty/\pgf@temp@c))}% + \pgfutil@tempdima=\pgfmathresult pt\relax% + % ^^^ discriminant + \ifdim\pgf@temp@b pt<0.01pt\relax% + % approximately linear + \pgfmathparse{abs(2*(#2)-2*(#4)+(#6))}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \ifdim\pgfutil@tempdimb<0.1pt\relax% + % if the denominator is very small, t is *likely* large but could be 0/0 + \else + \pgfmathsetmacro{\pgf@temp@a}{(2*(#2)-3*(#4)+(#6))/(2*(#2)-2*(#4)+(#6))}% + \pgfmathparse{\pgf@path@lasty*pow(1-\pgf@temp@a,3)+3*#2*pow(1-\pgf@temp@a,2)*\pgf@temp@a+3*#4*(1-\pgf@temp@a)*\pgf@temp@a*\pgf@temp@a+#6*pow(\pgf@temp@a,3)}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \pgf@protocolsizes{#5}{\pgfutil@tempdimb}% + \fi% + \else + \ifdim\pgfutil@tempdima<0pt\relax% negative discriminant -> no turning point + \else + \pgfmathsetmacro{\pgf@temp@a}{min(1,max(0,(\pgf@path@lasty-2*#2+#4-\pgf@temp@c*sqrt(\pgfutil@tempdima))/(\pgf@path@lasty-#6-3*#2+3*#4)))}% + \pgfmathparse{\pgf@path@lasty*pow(1-\pgf@temp@a,3)+3*#2*pow(1-\pgf@temp@a,2)*\pgf@temp@a+3*#4*(1-\pgf@temp@a)*\pgf@temp@a*\pgf@temp@a+#6*pow(\pgf@temp@a,3)}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \pgf@protocolsizes{#5}{\pgfutil@tempdimb}% + \pgfmathsetmacro{\pgf@temp@a}{min(1,max(0,(\pgf@path@lasty-2*#2+#4+\pgf@temp@c*sqrt(\pgfutil@tempdima))/(\pgf@path@lasty-#6-3*#2+3*#4)))}% + \pgfmathparse{\pgf@path@lasty*pow(1-\pgf@temp@a,3)+3*#2*pow(1-\pgf@temp@a,2)*\pgf@temp@a+3*#4*(1-\pgf@temp@a)*\pgf@temp@a*\pgf@temp@a+#6*pow(\pgf@temp@a,3)}% + \pgfutil@tempdimb=\pgfmathresult pt\relax% + \pgf@protocolsizes{#5}{\pgfutil@tempdimb}% + \fi% + \fi + \pgf@protocolsizes{\pgf@path@lastx}{\pgf@path@lasty}% + \pgf@protocolsizes{#5}{#6}% + \pgfsyssoftpath@curveto{\the#1}{\the#2}{\the#3}{\the#4}{\the#5}{\the#6}% +} diff --git a/graphics/pgf/base/tex/pgflibraryfpu.code.tex b/graphics/pgf/base/tex/pgflibraryfpu.code.tex index cb20507fa0..270d9af8b5 100644 --- a/graphics/pgf/base/tex/pgflibraryfpu.code.tex +++ b/graphics/pgf/base/tex/pgflibraryfpu.code.tex @@ -104,6 +104,9 @@ \let\pgfmathpostparse=\relax% \pgfmath@catcodes% \pgfmath@quickparsefalse% + \ifpgfmathfloatparseactive\else + \pgfmathfloat@parser@install + \fi \pgfmathfloatparse@}% % for pgf 2.00 : diff --git a/graphics/pgf/base/tex/pgflibraryintersections.code.tex b/graphics/pgf/base/tex/pgflibraryintersections.code.tex index 6bed3e4721..81b7d29c37 100644 --- a/graphics/pgf/base/tex/pgflibraryintersections.code.tex +++ b/graphics/pgf/base/tex/pgflibraryintersections.code.tex @@ -361,23 +361,30 @@ \global\advance\pgf@intersect@solutions by1\relax% \expandafter\global\expandafter\let\csname pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions\endcsname=\pgf@intersect@solution@candidate \ifpgf@intersect@sort% + % save coordinates of the intersection + \pgf@process{\pgf@intersect@solution@candidate}% \pgf@xc=\pgf@x% \pgf@yc=\pgf@y% + % determine length of path \pgf@process{\pgfpointdiff{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}}% \edef\pgf@marshal{% - \noexpand\pgfmathveclen@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@ya}}% + \noexpand\pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}% }% \pgf@marshal% \let\pgf@intersect@length@a=\pgfmathresult% + % determine distance of intersection from start \pgf@process{\pgfpointdiff{\pgfpoint@intersect@start@a}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}% \edef\pgf@marshal{% \noexpand\pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}% }% \pgf@marshal% + % scale the distance to the path length (path time) \pgfmathdivide@{\pgfmathresult}{\pgf@intersect@length@a}% \pgf@x=\pgfmathresult pt\relax% + % advance by the path segment (see definition of \pgf@intersection@store@properties) \advance\pgf@x by\pgf@intersect@time@offset pt\relax% \edef\pgf@intersect@time@a{\pgfmath@tonumber{\pgf@x}}% + % save numbered \expandafter\global\expandafter\let\csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname= \pgf@intersect@time@a \else diff --git a/graphics/pgf/base/tex/pgflibrarypatterns.meta.code.tex b/graphics/pgf/base/tex/pgflibrarypatterns.meta.code.tex index 479992ad37..d04e75ab23 100644 --- a/graphics/pgf/base/tex/pgflibrarypatterns.meta.code.tex +++ b/graphics/pgf/base/tex/pgflibrarypatterns.meta.code.tex @@ -85,7 +85,7 @@ \def\pgfdeclarepattern#1{% \begingroup% \nullfont% - \def\pgf@pat@options{#1}% + \def\pgf@pat@options{,#1}% \pgfkeys{/pgf/patterns/.cd,#1}% \ifx\pgf@pat@name\pgfutil@empty \pgferror{Declaring unnamed pattern}% @@ -274,6 +274,183 @@ \pgfsys@setpatternuncolored{#4}{#1}{#2}{#3}% }% +% Predefined patterns + +\pgfdeclarepattern{ + name=Lines, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/line width}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3pt, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + line width/.initial=\the\pgflinewidth, + }, + code={% + \pgfsetlinewidth{\pgfkeysvalueof{/pgf/pattern keys/line width}}% + \pgfpathmoveto{\pgfpoint{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfpathlineto{\pgfpoint{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfusepath{stroke}% + }, +} + +\pgfdeclarepattern{ + name=Hatch, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/line width}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3pt, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + line width/.initial=\the\pgflinewidth, + }, + code={% + \pgfsetlinewidth{\pgfkeysvalueof{/pgf/pattern keys/line width}}% + \pgfpathmoveto{\pgfpoint{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfpathlineto{\pgfpoint{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfpathmoveto{\pgfpoint{0pt}{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}% + \pgfpathlineto{\pgfpoint{0pt}{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}% + \pgfusepath{stroke}% + }, +} + +\pgfdeclarepattern{ + name=Dots, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/radius}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3pt, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + radius/.initial=.5pt, + }, + code={% + \pgfpathcircle% + {\pgfpointorigin}% + {\pgfkeysvalueof{/pgf/pattern keys/radius}} + \pgfusepath{fill}% + }, +} + +\pgfdeclarepattern{ + name=Stars, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/radius}, + \pgfkeysvalueof{/pgf/pattern keys/points}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3mm, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + radius/.initial=1mm, + points/.initial=5, + }, + code={% + \pgfmathsetmacro\a{180/(\pgfkeysvalueof{/pgf/pattern keys/points})}% + \pgfpathmoveto{\pgfpointpolar{90}{\pgfkeysvalueof{/pgf/pattern keys/radius}}}% + \foreach \i in {1,...,\pgfkeysvalueof{/pgf/pattern keys/points}}{% + \pgfpathlineto{\pgfpointpolar{90+2*\i*\a-\a}{.5*(\pgfkeysvalueof{/pgf/pattern keys/radius})}}% + \pgfpathlineto{\pgfpointpolar{90+2*\i*\a}{\pgfkeysvalueof{/pgf/pattern keys/radius}}}% + }% + \pgfpathclose% + \pgfusepath{fill}% + }, +} %%% Local Variables: %%% mode: latex diff --git a/graphics/pgf/base/tex/pgfmanual.pdflinks.code.tex b/graphics/pgf/base/tex/pgfmanual.pdflinks.code.tex index a23b9ad686..370c5ad071 100644 --- a/graphics/pgf/base/tex/pgfmanual.pdflinks.code.tex +++ b/graphics/pgf/base/tex/pgfmanual.pdflinks.code.tex @@ -53,13 +53,6 @@ \newif\ifpgfmanualshowlabels -% FIXME : \cleanedhypertarget/\cleanedhyperlink have been introduced -% in http://pgf.cvs.sourceforge.net/viewvc/pgf/pgf/latex/pgf/doc/pgfmanual.pdflinks.code.tex?r1=1.15&r2=1.16 -% but they are not present on my (CFR) system... what problem did they -% address/how can we satisfy this dependency? -\pgfutil@IfUndefined{cleanedhypertarget}{\let\cleanedhypertarget=\hypertarget}{} -\pgfutil@IfUndefined{cleanedhyperlink}{\let\cleanedhyperlink=\hyperlink}{} - \pgfkeys{% /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1, /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualprettyprintpgfkeys{#2}\pgfmanualclosebrace}, @@ -238,9 +231,9 @@ \expandafter\gdef\csname pgfd@lbl@\pgfmanualpdflabel@@\endcsname{w}% 1. remember the label AND remember that we "w"rote it into the pdf. \edef\pgfmanualpdflabel@@{\pgfkeysvalueof{/pdflinks/internal link prefix}.\pgfmanualpdflabel@@}% \ifvmode% - \expandafter\cleanedhypertarget\expandafter{\pgfmanualpdflabel@@}{#2}% + \expandafter\hypertarget\expandafter{\pgfmanualpdflabel@@}{#2}% \else% - {\setbox0=\hbox{\raise1em\hbox{\expandafter\cleanedhypertarget\expandafter{\pgfmanualpdflabel@@}{}}}\ht0=0pt\box0}#2% + {\setbox0=\hbox{\raise1em\hbox{\expandafter\hypertarget\expandafter{\pgfmanualpdflabel@@}{}}}\ht0=0pt\box0}#2% \fi% \else #2% @@ -287,7 +280,7 @@ }% \def\pgfmanualpdfref@#1#2{% \pgfkeysgetvalue{/pdflinks/internal link prefix}\pgfmanual@temp - \expandafter\cleanedhyperlink\expandafter{\pgfmanual@temp.#1}{\pgfkeysvalueof{/pdflinks/render hyperlink/.@cmd}{#2}\pgfeov}% + \expandafter\hyperlink\expandafter{\pgfmanual@temp.#1}{\pgfkeysvalueof{/pdflinks/render hyperlink/.@cmd}{#2}\pgfeov}% \ifpgfmanualshowlabels \pgfkeysvalueof{/pdflinks/show labels code/.@cmd}{#1}\pgfeov \fi diff --git a/graphics/pgf/base/tex/pgfmanual.prettyprinter.code.tex b/graphics/pgf/base/tex/pgfmanual.prettyprinter.code.tex index e8aa334224..3a230cac23 100644 --- a/graphics/pgf/base/tex/pgfmanual.prettyprinter.code.tex +++ b/graphics/pgf/base/tex/pgfmanual.prettyprinter.code.tex @@ -720,7 +720,7 @@ % Collects tokens inside of a token list up to a single delimiting token, dealing with nested % catcode-12-braces. % -% #1: is the end token, the delimiter. It won't be collected. +% #1: list of tokens, each of which is marking the end. It won't be collected. % #2: is code to invoke after % \pgfmanualprettyprinterhandlecollectedargsVtwo has been invoked. % @@ -742,8 +742,9 @@ % \def\pgfmanualprettyprintercollectupto#1#2{% \pgfmanualprettyprinterarghasunmatchedbracesfalse + \def\pgfmanualprettyprinterterminator{}% \begingroup - \def\pgfmanual@loc@delimittoken{#1}% + \def\pgfmanual@loc@delimittokens{#1}% \toksdef\t@afterpgfmanualprettyprinterhandlecollected=10 \t@afterpgfmanualprettyprinterhandlecollected={#2}% % @@ -758,6 +759,12 @@ \pgfmanual@pretty@collectupto@loop }% +% Stores the token that marks the end in the first argument of +% \pgfmanualprettyprintercollectupto. For example if the token list was {,]} +% and ] was encountered first, then \pgfmanualprettyprinterterminator will +% be ]. +\def\pgfmanualprettyprinterterminator{} + % loops through all tokens, collecting the required number of % arguments. This involves to track nested braces manually. % #1 is a single token. @@ -794,11 +801,13 @@ \advance\c@pgfmanual@pretty@openbracecount by-1 \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}% \else - \ifx\pgfmanual@loc@TMPc\pgfmanual@loc@delimittoken + \expandafter\expandafter\expandafter\pgfutil@in@\expandafter\pgfmanual@loc@TMPc\expandafter{\pgfmanual@loc@delimittokens}% + \ifpgfutil@in@ \ifnum\c@pgfmanual@pretty@openbracecount=0 % do NOT include the delimit token. \edef\pgfmanual@pretty@collectupto@loop@NEXT{% \noexpand\endgroup + \noexpand\def\noexpand\pgfmanualprettyprinterterminator{\pgfmanual@loc@TMPc}% \noexpand\pgfmanualprettyprinterhandlecollectedargsVtwo{\the\t@pgfmanual@currentarg}{1}% \noexpand\pgfmanualprettyprintercollectupto@restore@callback \the\t@afterpgfmanualprettyprinterhandlecollected @@ -1053,7 +1062,7 @@ \if\pgfmanual@pretty@isconsumed0% \def\pgfmanualprettyprinterhandlecollectedargsVtwo##1##2{\pgfmanual@pretty@pgfkeys@processvalue{##1}}% the braces will be handled separately. \def\pgfmanual@pretty@pgfkeys@collectvalue@next{% - \pgfmanualprettyprintercollectupto,{\afterpgfmanual@pretty@collectargs@finish@value}#1% + \pgfmanualprettyprintercollectupto{,]}{\afterpgfmanual@pretty@collectargs@finish@value}#1% }% \fi \fi @@ -1063,7 +1072,7 @@ \pgfutil@ifnextchar\pgfmanual@EOI{% \pgfmanual@pretty@pgfkeys@loop }{% - \pgfmanual@pretty@pgfkeys@loop,% re-insert the gobbled comma here! + \expandafter\pgfmanual@pretty@pgfkeys@loop\pgfmanualprettyprinterterminator% re-insert the gobbled comma here! }% }% diff --git a/graphics/pgf/base/tex/pgfmathfunctions.basic.code.tex b/graphics/pgf/base/tex/pgfmathfunctions.basic.code.tex index 2dbf154d8b..64dbe2b09a 100644 --- a/graphics/pgf/base/tex/pgfmathfunctions.basic.code.tex +++ b/graphics/pgf/base/tex/pgfmathfunctions.basic.code.tex @@ -434,7 +434,7 @@ \fi% \fi% \else% - \ifdim\pgfmath@x>0.000244140625pt\relax% 2^-11 + \ifdim\pgfmath@x>0.00048828125pt\relax% 2^-11 \ifdim\pgfmath@x>0.001953125pt\relax% 2^-9 \ifdim\pgfmath@x>0.00390625pt\relax% 2^-8 \multiply\pgfmath@x by128\relax% diff --git a/graphics/pgf/base/tex/pgfmathparser.code.tex b/graphics/pgf/base/tex/pgfmathparser.code.tex index c16d07005d..e50dfd615e 100644 --- a/graphics/pgf/base/tex/pgfmathparser.code.tex +++ b/graphics/pgf/base/tex/pgfmathparser.code.tex @@ -238,7 +238,7 @@ \pgfmath@tokens@make{mathunit}{{mu}} \pgfmath@tokens@make{numeric}{.0123456789} \pgfmath@tokens@make{number}{0123456789} -\pgfmath@tokens@make{functional}{_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ} +\pgfmath@tokens@make{functional}{_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} \pgfmath@tokens@make{exponent}{eE} \pgfmath@tokens@make{group}{{()}{[]}{\pgfmath@bgroup\pgfmath@egroup}} \pgfmath@tokens@make{specials}{@)]\pgfmath@egroup} diff --git a/graphics/pgf/base/tex/pgfmathutil.code.tex b/graphics/pgf/base/tex/pgfmathutil.code.tex index d98ecb25d5..49313e8849 100644 --- a/graphics/pgf/base/tex/pgfmathutil.code.tex +++ b/graphics/pgf/base/tex/pgfmathutil.code.tex @@ -13,6 +13,48 @@ \def\pgfmathincluded{} +% Helper macros for \pgfmath@ifregister +% +\def\pgfmath@grabv#1#2#3#4#5#6#7\pgfmath@grabv{#2#3#4#5\ifx#6!!\fi} +\def\pgfmath@ifskip@extract#1{\expandafter\pgfmath@grabv\meaning#1!!!!!!\pgfmath@grabv} +\def\pgfmath@iftoks@extract#1{\expandafter\pgfmath@grabv\meaning#1!!!!!!\pgfmath@grabv} + +\def\pgfmath@grabvi#1#2#3#4#5#6#7#8\pgfmath@grabvi{#2#3#4#5#6\ifx#7!!\fi} +\def\pgfmath@ifdimen@extract#1{\expandafter\pgfmath@grabvi\meaning#1!!!!!!\pgfmath@grabvi} +\def\pgfmath@ifcount@extract#1{\expandafter\pgfmath@grabvi\meaning#1!!!!!!\pgfmath@grabvi} + +\def\pgfmath@grabvii#1#2#3#4#5#6#7#8#9\pgfmath@grabvii{#2#3#4#5#6#7\ifx#8!!\fi} +\def\pgfmath@ifmuskip@extract#1{\expandafter\pgfmath@grabvii\meaning#1!!!!!!\pgfmath@grabvii} + +% \pgfmath@ifdimen@unguarded +% +% Check if #2 is a register of type #1. +% Credits to Frank: https://tex.stackexchange.com/a/56905 +% +% #1 register type (count, dimen, skip, muskip, toks) +% #2 single token +% +\def\pgfmath@ifregister@unguarded#1#2{% + \expandafter\ifx\csname\csname pgfmath@if#1@extract\endcsname{#2}\expandafter\endcsname\csname #1\endcsname + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi} + +% \pgfmath@ifregister +% +% Checks if a token is a a certain type of register +% +% #1 register type (count, dimen, skip, muskip, toks) +% #2 single token +% +\def\pgfmath@ifregister#1#2{% + \pgfutil@IfUndefined{pgfmath@if#1@extract}% + {\errmessage{Package PGF Math Error: Cannot test for #1 register}}% + {\pgfutil@IfUndefined{\csname pgfmath@if#1@extract\endcsname{#2}}% + {\pgfutil@secondoftwo}}% + {\pgfmath@ifregister@unguarded{#1}{#2}}} + % \pgfmath@ensureregister % % Ensure a control sequence exists as a TeX count/dimen register. @@ -21,27 +63,9 @@ % #2 - a control sequence. % \def\pgfmath@ensureregister#1#2{% - \begingroup% - \setbox0=\hbox\bgroup\begingroup% In case #2 is a defined macro. Unlikely, but you never know... - \afterassignment\pgfmath@@ensureregister% - \noexpand#20.0pt\let\pgfmath@temp\relax\relax\pgfmath@#2#1\pgfmath@} - -\def\pgfmath@@ensureregister#1#2\pgfmath@#3#4#5\pgfmath@{% - \endgroup\egroup% - \endgroup% - \ifx#4c% - \ifx#1.% Already a count register. - \else% - \csname newcount\endcsname#3% This gets round \outer in plain TeX. - \fi% - \else% - \ifx#4d% - \ifx\let#1% Already a dimen register. - \else% - \csname newdimen\endcsname#3% - \fi% - \fi% - \fi% + \pgfmath@ifregister{#1}{#2}% + {}% + {\csname new#1\endcsname#2}% } % Check registers exist. If not, create them. diff --git a/graphics/pgf/base/tex/pgfmodulematrix.code.tex b/graphics/pgf/base/tex/pgfmodulematrix.code.tex index 50c0e1e52f..4f676aeea4 100644 --- a/graphics/pgf/base/tex/pgfmodulematrix.code.tex +++ b/graphics/pgf/base/tex/pgfmodulematrix.code.tex @@ -24,6 +24,9 @@ \let\pgf@matrix@cell=\pgfnodeparttextbox % alias \let\pgf@matrix@box=\pgf@matrix@cell % alias +\long\def\pgfmatrixbeforeassemblenode#1{% + \long\def\pgf@matrix@before@assemnble@node{#1}} +\pgfmatrixbeforeassemblenode{} % Sets the default row or column sep % @@ -211,6 +214,11 @@ \egroup\egroup% \egroup% % + % Inject custom tokens before assembling the node holding the matrix. Can + % be used to apply additional settings. + % + \pgf@matrix@before@assemnble@node + % % If there are named nodes, we must adjust their coordinates. % \ifx\pgf@matrix@node@list\pgfutil@empty% diff --git a/graphics/pgf/base/tex/pgfmoduleparser.code.tex b/graphics/pgf/base/tex/pgfmoduleparser.code.tex index 3528771b1a..3ac1aba9fc 100644 --- a/graphics/pgf/base/tex/pgfmoduleparser.code.tex +++ b/graphics/pgf/base/tex/pgfmoduleparser.code.tex @@ -410,7 +410,7 @@ \def\pgfparserlet@g {% \ifx\pgfparserlet@argb\pgfutil@sptoken - % will also gobble the \pgfparserlet@c after \fi + % will also gobble the \pgfparserlet@h after \fi \pgfparserlet@gobble@space\pgfparserlet@f \fi \pgfparserlet@h @@ -496,24 +496,40 @@ {} {\csname \pgfparser@current\space final action\endcsname}% } - {% - \futurelet\pgfparsertoken\pgfparser@getnexttoken@a - }% + {\futurelet\pgfparsertoken\pgfparser@getnexttoken@a}% } \pgfutil@protected\def\pgfparser@getnexttoken@a {% - \pgfparser@getnexttoken@iftokengobble\bgroup\bgroup + % check the problematic categories based on the meaning of the token + \edef\pgfparser@tokencategory{\pgfparser@extractmeaning\pgfparsertoken}% + \pgfparser@getnexttoken@ifcategory\pgfparser@category@i\bgroup {% - \pgfparser@getnexttoken@iftokengobble\egroup\egroup + \pgfparser@getnexttoken@ifcategory\pgfparser@category@ii\egroup {% - \pgfparser@getnexttoken@iftokengobble\pgfutil@sptoken{ }% - {\pgfparser@getnexttoken@defchar}% + \pgfparser@getnexttoken@ifcategory\pgfparser@category@x{ }% + {% + \pgfparser@getnexttoken@ifcategory\pgfparser@category@vi{####}% + {\pgfparser@getnexttoken@defchar}% + }% }% }% } -\pgfutil@protected\def\pgfparser@getnexttoken@iftokengobble#1#2% +\begingroup +\def\pgfparser@extractmeaning#1% {% - \ifx\pgfparsertoken#1% + \endgroup + \def\pgfparser@extractmeaning##1% + {\expandafter\pgfparser@extractmeaning@\meaning##1#1#1\pgfparser@mark}% + \def\pgfparser@extractmeaning@##1#1##2#1##3\pgfparser@mark{##1#1##2}% + } +\catcode`\ =12\pgfparser@extractmeaning{ } % ends the group +\edef\pgfparser@category@i{\pgfparser@extractmeaning\bgroup} +\edef\pgfparser@category@ii{\pgfparser@extractmeaning\egroup} +\edef\pgfparser@category@vi{\pgfparser@extractmeaning#} +\edef\pgfparser@category@x{\pgfparser@extractmeaning\pgfutil@sptoken} +\pgfutil@protected\def\pgfparser@getnexttoken@ifcategory#1#2% + {% + \ifx\pgfparser@tokencategory#1% \def\pgfparserletter{#2}% \pgfparser@getnexttoken@gobble \fi diff --git a/graphics/pgf/base/tex/pgfmoduleshapes.code.tex b/graphics/pgf/base/tex/pgfmoduleshapes.code.tex index 78edf01c62..166a5d5640 100644 --- a/graphics/pgf/base/tex/pgfmoduleshapes.code.tex +++ b/graphics/pgf/base/tex/pgfmoduleshapes.code.tex @@ -532,7 +532,7 @@ % Ok, check whether #1 is known! \pgfutil@ifundefined{pgf@sh@ns@#1} {\pgfutil@ifundefined{pgf@sh@ns@not yet positionedPGFINTERNAL#1}{% - \pgferror{No shape named #1 is known}}{ + \pgferror{No shape named `#1' is known}}{ % else, fail silently }% \pgfpointorigin}% @@ -597,7 +597,7 @@ \def\pgfpointshapeborder#1#2{% % Ok, check whether #1 is known! \pgfutil@ifundefined{pgf@sh@ns@#1} - {\pgferror{No shape named #1 is known}% + {\pgferror{No shape named `#1' is known}% \pgfpointorigin}% {% \pgf@process{% @@ -823,7 +823,6 @@ \anchor{north}{\centerpoint}% \anchor{north west}{\centerpoint}% \anchor{north east}{\centerpoint}% - \anchor{center}{\centerpoint}% \anchor{west}{\centerpoint}% \anchor{east}{\centerpoint}% \anchor{mid}{\centerpoint}% diff --git a/graphics/pgf/base/tex/pgfsys-dvipdfmx.def b/graphics/pgf/base/tex/pgfsys-dvipdfmx.def index 67b6cd87b3..b2be0c9110 100644 --- a/graphics/pgf/base/tex/pgfsys-dvipdfmx.def +++ b/graphics/pgf/base/tex/pgfsys-dvipdfmx.def @@ -307,21 +307,12 @@ % Image Mask came from pgfsys-pdftex.def % generic/pgf/basiclayer/pgfcoreimage.code.tex must be modified! \def\pgfsys@defineimage{% width, height, page number - \ifx\includegraphics\undefined - \ifx\pgf@imagewidth\pgfutil@empty\edef\pgf@imagewidth{1bp}\fi% width? - \ifx\pgf@imageheight\pgfutil@empty\edef\pgf@imageheight{1bp}\fi% height? - \ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepage{ page \pgf@imagepage}\fi% - \ifx\pgf@imageinterpolate\pgfutil@empty\else\edef\pgf@imageinterpolate{ /Interpolate\space\pgf@imageinterpolate}\fi% - \ifx\pgf@imagemask\pgfutil@empty\else\xdef\pgf@imagemask{ /SMask @\pgf@imagemask}\fi% - \edef\pgf@image{\noexpand\hbox to \pgf@imagewidth{\vbox to \pgf@imageheight{\vfil\special{pdf:image width \pgf@imagewidth\space height \pgf@imageheight\space\pgf@imagepage\space(\pgf@filename) <<\pgf@imageinterpolate\pgf@imagemask\space>>}}\hfil}}% - \else - \ifx\pgf@imagewidth\pgfutil@empty\else\edef\pgf@imagewidth{width=\pgf@imagewidth,}\fi% - \ifx\pgf@imageheight\pgfutil@empty\else\edef\pgf@imageheight{height=\pgf@imageheight,}\fi% - \ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepage{page=\pgf@imagepage,}\fi% - \ifx\pgf@imageinterpolate\pgfutil@empty\else\edef\pgf@imageinterpolate{interpolate=\pgf@imageinterpolate,}\fi% - \ifx\pgf@imagemask\pgfutil@empty\else\xdef\pgf@imagemask{mask=\pgf@imagemask,}\fi% - \edef\pgf@image{\noexpand\includegraphics[\pgf@imageheight\pgf@imagewidth\pgf@imagepage\pgf@imageinterpolate\pgf@imagemask]{\pgf@filename}}% - \fi% + \ifx\pgf@imagewidth\pgfutil@empty\edef\pgf@imagewidth{1bp}\fi% width? + \ifx\pgf@imageheight\pgfutil@empty\edef\pgf@imageheight{1bp}\fi% height? + \ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepage{ page \pgf@imagepage}\fi% + \ifx\pgf@imageinterpolate\pgfutil@empty\else\edef\pgf@imageinterpolate{ /Interpolate\space\pgf@imageinterpolate}\fi% + \ifx\pgf@imagemask\pgfutil@empty\else\xdef\pgf@imagemask{ /SMask @\pgf@imagemask}\fi% + \edef\pgf@image{\noexpand\hbox to \pgf@imagewidth{\vbox to \pgf@imageheight{\vfil\special{pdf:image width \pgf@imagewidth\space height \pgf@imageheight\space\pgf@imagepage\space(\pgf@filename) <<\pgf@imageinterpolate\pgf@imagemask\space>>}}\hfil}}% } \def\pgfsys@definemask#1{% \ifx\pgf@maskmatte\pgfutil@empty% @@ -377,7 +368,7 @@ % hook for xdvipdfmx: \def\pgfsys@dvipdfmx@patternobj#1{% - #1% + \pgfutil@insertatbegincurrentpagefrombox{#1}% }% % hook for xdvipdfmx: diff --git a/graphics/pgf/base/tex/pgfutil-common.tex b/graphics/pgf/base/tex/pgfutil-common.tex index 6fbaf2687b..b1c0546c17 100644 --- a/graphics/pgf/base/tex/pgfutil-common.tex +++ b/graphics/pgf/base/tex/pgfutil-common.tex @@ -59,20 +59,16 @@ \fi} % A variant of \pgfutil@ifundefined which will NOT let #1 to \relax it -% is undefined. However, this macro is not expandable. +% is undefined. \def\pgfutil@IfUndefined#1{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname#1\endcsname\relax - \expandafter\pgfutil@firstoftwo - \else + \ifcsname#1\endcsname \expandafter\pgfutil@secondoftwo + \else + \expandafter\pgfutil@firstoftwo \fi } \long\def\pgfutil@firstofone#1{#1} \long\def\pgfutil@firstoftwo#1#2{#1} -\long\def\pgfutil@letfirst#1#2{\pgfutil@letfirst@#1#2\pgfutil@letfirst@end} -\long\def\pgfutil@letfirst@#1#2#3\pgfutil@letfirst@end{\let#1=#2} -\def\pgfutil@letfirst@end{} \long\def\pgfutil@secondoftwo#1#2{#2} \def\pgfutil@empty{} \long\def\pgfutil@gobble@until@relax#1\relax{} @@ -215,6 +211,45 @@ \let\pgfutil@repeat=\fi % this makes \loop...\if...\repeat skippable +% \pgfutil@switch +% +% #1: string to switch on +% #2: sequence of label-value pairs +% +% Example: +% +% \pgfutil@switch{foo}{% +% {foo}{1}% +% {bar}{2}% +% {default}{X}% +% } +% +% If a statement with the label `default' exists it will be executed +% if no other label matches. + +\long\def\pgfutil@switch#1#2{% + \begingroup + \def\pgfutil@switch@selected{}% + \pgfutil@switch@collect@statements#2{}{}% + \ifcsname pgfutil@switch@choice@\detokenize{#1}\endcsname + \expandafter\let\expandafter\pgfutil@switch@selected\csname pgfutil@switch@choice@\detokenize{#1}\endcsname + \else + \ifdefined\pgfutil@switch@choice@default + \let\pgfutil@switch@selected\pgfutil@switch@choice@default + \fi + \fi + \expandafter\endgroup\pgfutil@switch@selected +} + +\long\def\pgfutil@switch@collect@statements#1{% + \if\relax\detokenize{#1}\relax + \else + \afterassignment\pgfutil@switch@collect@statements + \expandafter\def\csname pgfutil@switch@choice@\detokenize{#1}\expandafter\endcsname + \fi +} + + % aux-read-hook \let\pgfutil@aux@read@hook=\relax @@ -709,7 +744,7 @@ \let\pgfmathresult=\pgfutil@empty \else % xb := rb / bb (the modified rb and modified bb!) - \edef\pgf@marshal{ + \edef\pgf@marshal{% \noexpand\pgfmathfloatdivide@ {\csname r\Pb\endcsname} {\csname m\Pb b\endcsname}% diff --git a/graphics/pgf/base/tex/pgfutil-context.def b/graphics/pgf/base/tex/pgfutil-context.def index bf7e43a298..7d244efc5f 100644 --- a/graphics/pgf/base/tex/pgfutil-context.def +++ b/graphics/pgf/base/tex/pgfutil-context.def @@ -167,11 +167,12 @@ \def\pgfutil@minipage[#1]#2{% \hbox to#2\bgroup \hsize=#2\relax - \vbox\bgroup\leavevmode + \vbox\bgroup + \noindentation } \def\pgfutil@endminipage{% - \egroup + \egroup \egroup } @@ -225,7 +226,7 @@ \doifmodeelse {mkiv} { - \def\pgfsysdriver{pgfsys-pdftex.def} + \def\pgfutil@guessdriver{\def\pgfsysdriver{pgfsys-luatex.def}} \def\pgfutil@driver@if@in#1#2{% \edef\pgf@marshal{\noexpand\pgfutil@in@{#1}{\preloadedspecials}}% @@ -358,7 +359,7 @@ \appendtoks \the\pgfutil@everybye \to \everybye -\long\def\AtBeginDocument#1{#1}% +\long\def\AtBeginDocument#1{\appendtoks#1\to\everystarttext}% % pgfcalendar uses translations diff --git a/graphics/pgf/base/tex/pgfutil-plain.def b/graphics/pgf/base/tex/pgfutil-plain.def index 090fcaeb5a..95dacd18a4 100644 --- a/graphics/pgf/base/tex/pgfutil-plain.def +++ b/graphics/pgf/base/tex/pgfutil-plain.def @@ -26,6 +26,15 @@ \def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}} \def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}} +\def\pgfutil@emu@RGB#1#2,#3,#4\@nil{% + \begingroup + \pgfmathdivide@{#2}{255}\let\pgfutil@emu@RGB@r\pgfmathresult + \pgfmathdivide@{#3}{255}\let\pgfutil@emu@RGB@g\pgfmathresult + \pgfmathdivide@{#4}{255}\let\pgfutil@emu@RGB@b\pgfmathresult + \edef\pgf@marshal{\def\expandafter\noexpand\csname\string\color@#1\endcsname{% + \noexpand\xcolor@{}{}{rgb}{\pgfutil@emu@RGB@r,\pgfutil@emu@RGB@g,\pgfutil@emu@RGB@b}}}% + \expandafter\endgroup\pgf@marshal +} \pgfutil@definecolor{white}{gray}{1} \pgfutil@definecolor{black}{gray}{0} diff --git a/graphics/pgf/base/tex/tikz.code.tex b/graphics/pgf/base/tex/tikz.code.tex index 5f67167ad3..2d428f666f 100644 --- a/graphics/pgf/base/tex/tikz.code.tex +++ b/graphics/pgf/base/tex/tikz.code.tex @@ -283,7 +283,18 @@ % Radii and arc options \tikzset{x radius/.initial=0pt}% \tikzset{y radius/.initial=0pt}% -\tikzset{radius/.style={/tikz/x radius=#1,/tikz/y radius=#1}}% +\tikzset{% + radius/.code={% + \pgfmathparse{#1}% + \ifpgfmathunitsdeclared + \pgfkeyssetevalue{/tikz/x radius}{\pgfmathresult pt}% + \pgfkeyssetevalue{/tikz/y radius}{\pgfmathresult pt}% + \else + \pgfkeyssetevalue{/tikz/x radius}{\pgfmathresult}% + \pgfkeyssetevalue{/tikz/y radius}{\pgfmathresult}% + \fi + }% +}% \tikzset{start angle/.initial=}% \tikzset{end angle/.initial=}% \tikzset{delta angle/.initial=}% @@ -696,9 +707,9 @@ \bgroup [current point is local = true] \pgfextra{\let\tikz@save@last@node=\tikzlastnode\tikz@node@is@a@labelfalse}% - node [every pin, - tikz@label@angle = #2, + node [tikz@label@angle = #2, anchor=@auto, + every pin, #1, append after command = {% (\tikz@save@last@node) @@ -726,9 +737,9 @@ \bgroup [current point is local = true] \pgfextra{\let\tikz@save@last@node=\tikzlastnode\tikz@node@is@a@labelfalse}% - node [every pin, - tikz@label@angle = #2, + node [tikz@label@angle = #2, anchor=@auto, + every pin, #1, append after command = {% (\tikz@save@last@node) @@ -857,9 +868,9 @@ \bgroup [current point is local=true] \pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name\tikz@node@is@a@labelfalse} - node [every label, - tikz@label@angle = #2, + node [tikz@label@angle = #2, anchor=@auto, + every label, #1, tikz@label@post = \tikz@label@distance] {\iftikz@handle@active@nodes\expandafter\scantokens\else\expandafter\pgfutil@firstofone\fi{#3\noexpand}} \pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name} @@ -887,9 +898,9 @@ \bgroup [current point is local=true] \pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name\tikz@node@is@a@labelfalse} - node [every label, - tikz@label@angle = #2, + node [tikz@label@angle = #2, anchor=@auto, + every label, #1, tikz@label@post = \tikz@label@distance] {\iftikz@handle@active@nodes\expandafter\scantokens\else\expandafter\pgfutil@firstofone\fi{#3\noexpand}} \pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name} @@ -1030,7 +1041,7 @@ \tikz@addtransform{% \expandafter\tikz@extract@node@dist\tikz@node@distance and\pgf@stop% \pgftransformshift{\pgfpointpolar{#2}{\tikz@extracted@node@distance}}}% - \def\tikz@node@at{\pgfpointanchor{#1}{center}}}% + \def\tikz@node@at{\pgfpointanchor{\tikz@pp@name{#1}}{center}}}% \def\tikz@extract@node@dist#1and#2\pgf@stop{% \def\tikz@extracted@node@distance{#1}}% @@ -1147,15 +1158,17 @@ \tikzset{badness warnings for centered text/.is if=tikz@warn@for@narrow@centered}% \newif\iftikz@warn@for@narrow@centered -\let\tikz@text@width=\pgfutil@empty -\let\tikz@text@height=\pgfutil@empty -\let\tikz@text@depth=\pgfutil@empty -\let\tikz@textcolor=\pgfutil@empty -\let\tikz@textfont=\pgfutil@empty -\let\tikz@textopacity=\pgfutil@empty -\let\tikz@node@textfont=\pgfutil@empty - -\def\tikz@text@action{\pgfutil@raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}% +\def\tikz@text@reset{% + \let\tikz@text@width=\pgfutil@empty + \let\tikz@text@height=\pgfutil@empty + \let\tikz@text@depth=\pgfutil@empty + \let\tikz@textcolor=\pgfutil@empty + \let\tikz@textfont=\pgfutil@empty + \let\tikz@textopacity=\pgfutil@empty + \let\tikz@node@textfont=\pgfutil@empty + \def\tikz@text@action{\pgfutil@raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}% +} +\tikz@text@reset % Alignment @@ -2058,7 +2071,6 @@ % settings. \def\tikz@command@path{% - \global\let\tikz@intersect@namedpaths=\pgfutil@empty% clear intersections \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}}}% @@ -3615,7 +3627,7 @@ \tikzset{every circle/.try,#1}% \pgftransformshift{\tikz@node@at}% \tikz@transform% - \tikz@do@circle{\pgfkeysvalueof{/tikz/x radius}}{\pgfkeysvalueof{/tikz/y radius}} + \tikz@do@ellipse{\pgfkeysvalueof{/tikz/x radius}}{\pgfkeysvalueof{/tikz/y radius}} }% \tikz@scan@next@command% }% @@ -3627,15 +3639,28 @@ \ifpgfutil@in@% \tikz@@ellipseB(#1)% \else% - \tikz@do@circle{#1}{#1}% + \tikz@do@circle{#1}% \fi% }% \tikz@scan@next@command% }% \def\tikz@@ellipseB(#1 and #2){% - \tikz@do@circle{#1}{#2} + \tikz@do@ellipse{#1}{#2}% }% -\def\tikz@do@circle#1#2{ +\def\tikz@do@circle#1{% + \pgfmathparse{#1}% + \let\tikz@ellipse@x=\pgfmathresult + \ifpgfmathunitsdeclared + \pgfpathellipse{\pgfpointorigin}% + {\pgfqpoint{\tikz@ellipse@x pt}{0pt}}% + {\pgfpoint{0pt}{\tikz@ellipse@x pt}}% + \else + \pgfpathellipse{\pgfpointorigin}% + {\pgfpointxy{\tikz@ellipse@x}{0}}% + {\pgfpointxy{0}{\tikz@ellipse@x}}% + \fi +} +\def\tikz@do@ellipse#1#2{ \pgfmathparse{#1}% \let\tikz@ellipse@x=\pgfmathresult% \ifpgfmathunitsdeclared% @@ -3801,9 +3826,11 @@ \tikz@scan@one@point\tikz@@coordinate@at@math(% }% \def\tikz@@coordinate@at@math#1{% - \pgf@process{#1}% - \edef\tikz@temp{(\the\pgf@x,\the\pgf@y)}% - \expandafter\tikz@coordinate@caller\tikz@temp{}% + \pgfutil@ifundefined{tikz@scan@point@coordinate}% + {\pgf@process{#1}% + \edef\tikz@temp{(\the\pgf@x,\the\pgf@y)}% + \expandafter\tikz@coordinate@caller\tikz@temp{}} + {\expandafter\tikz@coordinate@caller\tikz@scan@point@coordinate{}}% }% @@ -3935,10 +3962,8 @@ \ifx\tikz@textcolor\pgfutil@empty% \else% \pgfutil@colorlet{.}{\tikz@textcolor}% + \pgfutil@color{\tikz@textcolor}% \fi% - % FIXME : this here is the proposed solution for <https://sourceforge.net/p/pgf/bugs/362/> - % but it caused <https://sourceforge.net/p/pgf/bugs/503/>. - % \pgfutil@color{.}% \setbox\tikz@figbox=\box\pgfutil@voidb@x% \setbox\tikz@figbox@bg=\box\pgfutil@voidb@x% \tikz@uninstallcommands% @@ -3950,6 +3975,8 @@ \ifnum\the\catcode`\:=\active\relax\expandafter\let\tikz@activecolon=\tikz@origcolon\fi% \ifnum\the\catcode`\|=\active\relax\expandafter\let\tikz@activebar=\tikz@origbar\fi% \aftergroup\tikz@fig@collectresetcolor% + \tikz@signal@halign@check% + \tikz@text@reset% \tikz@halign@check% \ignorespaces% }% @@ -4004,6 +4031,7 @@ \def\tikz@matrix@shift{\pgfpointorigin}% \fi% \let\tikz@transform=\relax% + \pgfmatrixbeforeassemblenode{\tikzset{every outer matrix/.try}}% \pgfmatrix% {\tikz@shape}% {\tikz@m@anchor}% @@ -4214,7 +4242,7 @@ \newif\iftikz@do@align % Alignment handling -\def\tikz@halign@check{% +\def\tikz@signal@halign@check{% \tikz@do@alignfalse \ifx\tikz@text@width\pgfutil@empty% \pgfkeysgetvalue{/tikz/node halign header}\tikz@align@header% @@ -4223,6 +4251,8 @@ \tikz@do@aligntrue% \fi% \fi% +} +\def\tikz@halign@check{% \iftikz@do@align% % Bingo \setbox\tikz@align@aligned@box=\box\pgfutil@voidb@x% void @@ -4341,6 +4371,8 @@ \ifnum\the\catcode`\|=\active\relax\expandafter\let\tikz@activebar=\tikz@origbar\fi% \tikz@atbegin@node% \aftergroup\tikz@fig@collectresetcolor% + \tikz@signal@halign@check% + \tikz@text@reset% \tikz@halign@check% \ignorespaces% }% @@ -4379,9 +4411,17 @@ {\pgfutil@ifnextchar\bgroup{\tikz@nodes@main}% {\tikzerror{Nodes must have a (possibly empty) label text}% \tikz@fig@main{}}}}}}%}}% -\def\tikz@nodes@at at#1){% + +% Look ahead whether the next character is a (. If that is the case, we scan +% until ), otherwise we grab a single token and append. +\def\tikz@nodes@at at{\pgfutil@ifnextchar({\tikz@nodes@at@}{\tikz@nodes@at@@}}% +\def\tikz@nodes@at@#1){% \expandafter\def\expandafter\tikz@nodes@collect\expandafter{\tikz@nodes@collect at#1)}% \tikz@nodes@scan}% +\def\tikz@nodes@at@@#1{% + \expandafter\def\expandafter\tikz@nodes@collect\expandafter{\tikz@nodes@collect at#1}% + \tikz@nodes@scan}% + \def\tikz@nodes@name#1){% \expandafter\def\expandafter\tikz@nodes@collect\expandafter{\tikz@nodes@collect#1)}% \tikz@nodes@scan}% @@ -4786,7 +4826,7 @@ \let\tikz@picmode\tikz@mode% \tikzset{name prefix ../.style/.expanded={/tikz/name prefix=\pgfkeysvalueof{/tikz/name prefix}}}% \ifx\tikz@fig@name\pgfutil@empty\else% - \tikzset{name prefix/.prefix/.expanded=\tikz@fig@name}% + \tikzset{name prefix/.expanded=\tikz@fig@name}% \fi% \pgfkeysvalueof{/tikz/pics/setup code}% \pgfkeysgetvalue{/tikz/pics/code}{\tikz@pic@code} @@ -5387,19 +5427,26 @@ \else% \tikz@calc@anchor#2.center\tikz@stop% to be on the save side, in % case iftikz@shapeborder is ignored... - \expandafter\ifx\csname pgf@sh@ns@\tikz@pp@name{#2}\endcsname\tikz@coordinate@text% - \else - \tikz@shapebordertrue% - \def\tikz@shapeborder@name{\tikz@pp@name{#2}}% - \fi% + \ifcsname pgf@sh@ns@\tikz@pp@name{#2}\endcsname + \expandafter\ifx\csname pgf@sh@ns@\tikz@pp@name{#2}\endcsname\tikz@coordinate@text% + \else + \tikz@shapebordertrue% + \def\tikz@shapeborder@name{\tikz@pp@name{#2}}% + \fi% + \fi \fi% - \expandafter\let\expandafter\tikz@declared@coordinate\csname tikz@dcl@coord@\tikz@pp@name{#2}\endcsname \edef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}% \tikz@marshal% }% \def\tikz@calc@anchor#1.#2\tikz@stop{% - \pgfpointanchor{\tikz@pp@name{#1}}{#2}% + % Check if a shape with name prefix exists, otherwise try the global name + % without prefix. + \ifcsname pgf@sh@ns@\tikz@pp@name{#1}\endcsname% + \pgfpointanchor{\tikz@pp@name{#1}}{#2}% + \else + \pgfpointanchor{#1}{#2}% + \fi }% diff --git a/graphics/pgf/base/tex/tikzexternal.sty b/graphics/pgf/base/tex/tikzexternal.sty index 4f9d31572f..75cb9aedb5 100644 --- a/graphics/pgf/base/tex/tikzexternal.sty +++ b/graphics/pgf/base/tex/tikzexternal.sty @@ -69,6 +69,10 @@ \def\tikz@opt@process#1#2{\tikzexternal@image} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\pgf@marshal{\let\ifmeasuring@\iffalse} +\ifdefined\ifmeasuring@\else + \expandafter\pgf@marshal +\fi \def\tikzexternal@image{% \leavevmode \begingroup @@ -80,14 +84,18 @@ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@figurename}% \count0=\csname c@tikzext@no@\tikzexternal@figurename\endcsname \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb\the\count0 }% - \advance\count0 by1\relax + \ifmeasuring@\else + \advance\count0 by1\relax + \fi \expandafter\xdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{\the\count0 }% \else \t@tikzexternal@tmpb=\expandafter{\tikzexternal@nextfile}% \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb}% \fi \endgroup - \global\let\tikzexternal@nextfile=\empty + \ifmeasuring@\else + \global\let\tikzexternal@nextfile=\empty + \fi \pgfincludeexternalgraphics\tikzexternal@curfilename }% \def\tikzset#1{}\def\pgfkeys#1{}\def\pgfqkeys#1#2{} diff --git a/graphics/pgf/base/tex/tikzexternalshared.code.tex b/graphics/pgf/base/tex/tikzexternalshared.code.tex index 55b387f13c..08fd794319 100644 --- a/graphics/pgf/base/tex/tikzexternalshared.code.tex +++ b/graphics/pgf/base/tex/tikzexternalshared.code.tex @@ -749,6 +749,13 @@ \fi } +% amsmath signals the first pass of aligned environments with measuring@true. +% This is just \measuring@false in case \ifmeasuring@ is not defined +\def\pgf@marshal{\let\ifmeasuring@\iffalse} +\ifdefined\ifmeasuring@\else + \expandafter\pgf@marshal +\fi + % Fills #1 with a filename for the current picture. % % The filename will be generated automatically by appending '-figure<number>' to the real jobname. @@ -779,8 +786,10 @@ }{}% \t@tikzexternal@tmpb=\expandafter{\tikzexternal@figurename}% \xdef\pgf@tempa{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb\csname c@tikzext@no@\tikzexternal@figurename\endcsname}% - % advance the counter for 'figure name': - \tikzexternal@getnextfilename@advancecount + \ifmeasuring@\else + % advance the counter for 'figure name': + \tikzexternal@getnextfilename@advancecount + \fi \fi \else \t@tikzexternal@tmpb=\expandafter{\tikzexternal@nextfile}% @@ -798,7 +807,9 @@ \def\tikzexternal@getnextfilename@resetglobals{% % Reset global flags: - \global\let\tikzexternal@nextfile=\pgfutil@empty + \ifmeasuring@\else + \global\let\tikzexternal@nextfile=\pgfutil@empty + \fi \global\tikzexternalexportnexttrue }% diff --git a/graphics/pgf/base/tex/tikzlibrarycalc.code.tex b/graphics/pgf/base/tex/tikzlibrarycalc.code.tex index 594ccc6c49..b6fc75aeef 100644 --- a/graphics/pgf/base/tex/tikzlibrarycalc.code.tex +++ b/graphics/pgf/base/tex/tikzlibrarycalc.code.tex @@ -39,10 +39,6 @@ \let\x=\tikz@cc@dox% \let\y=\tikz@cc@doy% \let\n=\tikz@cc@don% - \let\rawx=\tikz@cc@dotempx% - \let\rawy=\tikz@cc@dotempy% - \let\rawz=\tikz@cc@dotempz% - \let\coord=\tikz@cc@docoord% \pgfutil@ifnextchar i{\tikz@cc@stop@let}{\tikz@cc@handle@line}% }% \def\tikz@cc@handle@line{% @@ -74,17 +70,6 @@ \expandafter\edef\csname tikz@cc@p@\tikz@cc@coord@name\endcsname{\the\pgf@x,\the\pgf@y}% \expandafter\edef\csname tikz@cc@x@\tikz@cc@coord@name\endcsname{\the\pgf@x}% \expandafter\edef\csname tikz@cc@y@\tikz@cc@coord@name\endcsname{\the\pgf@y}% - \pgfutil@letfirst\pgfutil@next{#1}% - \ifx\pgfutil@next\pgfpointxyz - \expandafter\edef\csname tikz@cc@tempx@\tikz@cc@coord@name\endcsname{\pgftemp@x}% - \expandafter\edef\csname tikz@cc@tempy@\tikz@cc@coord@name\endcsname{\pgftemp@y}% - \expandafter\edef\csname tikz@cc@tempz@\tikz@cc@coord@name\endcsname{\pgftemp@z}% - \else - \expandafter\edef\csname tikz@cc@tempx@\tikz@cc@coord@name\endcsname{}% - \expandafter\edef\csname tikz@cc@tempy@\tikz@cc@coord@name\endcsname{}% - \expandafter\edef\csname tikz@cc@tempz@\tikz@cc@coord@name\endcsname{}% - \fi - \expandafter\edef\csname tikz@cc@coord@\tikz@cc@coord@name\endcsname{\csname tikz@declared@coordinate\endcsname}% \pgfutil@ifnextchar,{\tikz@cc@handle@nextline}{\tikz@cc@stop@let}% }% \def\tikz@cc@handle@nextline,{% @@ -98,10 +83,6 @@ \def\tikz@cc@dox#1{\csname tikz@cc@x@#1\endcsname}% \def\tikz@cc@doy#1{\csname tikz@cc@y@#1\endcsname}% \def\tikz@cc@don#1{\csname tikz@cc@n@#1\endcsname}% -\def\tikz@cc@dotempx#1{\csname tikz@cc@tempx@#1\endcsname}% -\def\tikz@cc@dotempy#1{\csname tikz@cc@tempy@#1\endcsname}% -\def\tikz@cc@dotempz#1{\csname tikz@cc@tempz@#1\endcsname}% -\def\tikz@cc@docoord#1{\csname tikz@cc@coord@#1\endcsname}% diff --git a/graphics/pgf/base/tex/tikzlibrarydatavisualization.code.tex b/graphics/pgf/base/tex/tikzlibrarydatavisualization.code.tex index 7f26cc0017..c56b29baae 100644 --- a/graphics/pgf/base/tex/tikzlibrarydatavisualization.code.tex +++ b/graphics/pgf/base/tex/tikzlibrarydatavisualization.code.tex @@ -887,9 +887,9 @@ \let\tikz@dv@at@list\pgfutil@empty% \let\tikz@dv@style@at@list\pgfutil@empty% \pgfkeysgetvalue{#2/scaling mapper}\tikz@lib@dv@mapper - \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@settings}% \scope[/tikz/data visualization/.cd,every ticks/.try,every #1 ticks/.try,#3]% % Setup options + \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@settings}% \pgfkeysgetvalue{/tikz/data visualization/common}\tikz@temp \expandafter\tikzdatavisualizationset\expandafter{\tikz@temp} \pgfkeysgetvalue{/tikz/data visualization/#1}\tikz@temp @@ -1080,7 +1080,7 @@ \let\tikz@dv@style@at@list\pgfutil@empty \pgfkeysgetvalue{#2/scaling mapper}\tikz@lib@dv@mapper \let\tikz@lib@dv@ticks@default@at\pgfutil@empty% - \scope[data visualization/grid layer,/tikz/data visualization/.cd,every grid,every #1 grid/.try,#3] + \scope[data visualization/grid layer,/tikz/data visualization/.cd,every #1 grid/.try,every grid,#3] % Setup options \pgfkeysgetvalue{#2/ticks at}\tikz@lib@dv@ticks@at% \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@settings}% diff --git a/graphics/pgf/base/tex/tikzlibrarygraphs.standard.code.tex b/graphics/pgf/base/tex/tikzlibrarygraphs.standard.code.tex index bfceb3769a..c7f2daf744 100644 --- a/graphics/pgf/base/tex/tikzlibrarygraphs.standard.code.tex +++ b/graphics/pgf/base/tex/tikzlibrarygraphs.standard.code.tex @@ -10,6 +10,7 @@ \ProvidesFileRCS{tikzlibrarygraphs.standard.code.tex} +\usetikzlibrary{graphs}% % % Basic graphs diff --git a/graphics/pgf/base/tex/tikzlibraryintersections.code.tex b/graphics/pgf/base/tex/tikzlibraryintersections.code.tex index 5b0e83d5ee..f7ff81b7e2 100644 --- a/graphics/pgf/base/tex/tikzlibraryintersections.code.tex +++ b/graphics/pgf/base/tex/tikzlibraryintersections.code.tex @@ -72,6 +72,10 @@ \let\tikz@intersect@total=\pgfutil@empty \tikzset{ + every scope/.append style={ + execute at begin scope={\let\tikz@intersect@namedpaths@outside\tikz@intersect@namedpaths}, + execute at end scope={\global\let\tikz@intersect@namedpaths\tikz@intersect@namedpaths@outside}, + }, name intersections/.code={% \tikzset{/tikz/intersection/.cd, by=, diff --git a/graphics/pgf/base/tex/tikzlibraryspy.code.tex b/graphics/pgf/base/tex/tikzlibraryspy.code.tex index b23cf08caf..c9ac86f17e 100644 --- a/graphics/pgf/base/tex/tikzlibraryspy.code.tex +++ b/graphics/pgf/base/tex/tikzlibraryspy.code.tex @@ -97,8 +97,20 @@ \pgftransformcm{\pgf@lib@svg@a}{\pgf@lib@svg@b}{\pgf@lib@svg@c}{\pgf@lib@svg@d}{\pgfpointorigin}% } }]{}; + \expandafter\pgfutil@switch\expandafter{\tikz@anchor}{% + {north} {\def\tikz@spy@anchor{south}}% + {north east}{\def\tikz@spy@anchor{south west}}% + {east} {\def\tikz@spy@anchor{west}}% + {south east}{\def\tikz@spy@anchor{north west}}% + {south} {\def\tikz@spy@anchor{north}}% + {south west}{\def\tikz@spy@anchor{north east}}% + {west} {\def\tikz@spy@anchor{east}}% + {north west}{\def\tikz@spy@anchor{south east}}% + % default to center + {default} {\def\tikz@spy@anchor{center}}% + } \node [alias=tikzspyinnode,inner sep=0pt,outer sep=0pt,at={#2},every spy in node/.try, - path picture={\node[anchor=center,tikz@lib@reset@gs]{\nullfont% + path picture={\node[anchor=\tikz@spy@anchor,tikz@lib@reset@gs]{\nullfont% \pgfpicture\relax\pgfsetbaseline{default}\pgfsettrimleft{default}\pgfsettrimright{default}% \pgftransformreset% \let\tikz@transform=\relax% diff --git a/graphics/pgf/base/tex/tikzlibrarytopaths.code.tex b/graphics/pgf/base/tex/tikzlibrarytopaths.code.tex index 2051fce8fd..121a570f4b 100644 --- a/graphics/pgf/base/tex/tikzlibrarytopaths.code.tex +++ b/graphics/pgf/base/tex/tikzlibrarytopaths.code.tex @@ -163,7 +163,7 @@ \fi% \tikz@to@start@compute% \tikz@to@end@compute% - \edef\tikz@computed@path{.. controls \tikz@computed@start and \tikz@computed@end .. (\tikz@toto)} + \edef\tikz@computed@path{.. controls \tikz@computed@start and \tikz@computed@end .. (\tikztotarget)} } \def\tikz@to@compute@distance{\tikz@scan@one@point\tikz@@to@compute@distance(\tikz@tofrom)} diff --git a/graphics/pgf/base/tex/tikzlibrarytrees.code.tex b/graphics/pgf/base/tex/tikzlibrarytrees.code.tex index 830435a029..8ff54a0312 100644 --- a/graphics/pgf/base/tex/tikzlibrarytrees.code.tex +++ b/graphics/pgf/base/tex/tikzlibrarytrees.code.tex @@ -59,7 +59,12 @@ % Circle grow % -\tikzset{grow cyclic/.style={growth function=\tikz@grow@circle}}% +\tikzset{ + grow cyclic/.style={ + edge from parent/.append style={reset cm}, + growth function=\tikz@grow@circle, + } +}% \tikzset{sibling angle/.initial=20}% diff --git a/graphics/pgf/base/tex/tikzlibraryturtle.code.tex b/graphics/pgf/base/tex/tikzlibraryturtle.code.tex index 009a309e31..76272f1a6c 100644 --- a/graphics/pgf/base/tex/tikzlibraryturtle.code.tex +++ b/graphics/pgf/base/tex/tikzlibraryturtle.code.tex @@ -28,7 +28,7 @@ % given, by turtle distance \tikzset{ turtle/forward/.default=\pgfkeysvalueof{/tikz/turtle/distance}, - turtle/forward/.style={/tikz/insert path={to[/tikz/turtle/how]++(\tikz@lib@turtle@dir:#1)}} + turtle/forward/.style={/tikz/insert path={to[/tikz/turtle/how]++({\tikz@lib@turtle@dir}:{#1})}} }% @@ -46,7 +46,7 @@ \tikzset{ turtle/left/.default=90, turtle/left/.code={% - \pgfmathparse{#1+\tikz@lib@turtle@dir}% + \pgfmathparse{(#1)+(\tikz@lib@turtle@dir)}% \ifdim\pgfmathresult pt>360pt\relax% \pgfmathparse{\pgfmathresult-360}% \fi% @@ -60,7 +60,7 @@ turtle/right/.default=90, turtle/right/.code={% \pgfmathparse{#1} - \pgfmathparse{\tikz@lib@turtle@dir-\pgfmathresult}% + \pgfmathparse{(\tikz@lib@turtle@dir)-\pgfmathresult}% \ifdim\pgfmathresult pt<0pt\relax% \pgfmathparse{\pgfmathresult+360}% \fi% |