diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-28 20:57:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-28 20:57:36 +0000 |
commit | e752903a9ad1c74190305384230882402822846a (patch) | |
tree | 8d60a64b66091d1c8e34e5af76d413268603b25d /Master/texmf-dist/tex/generic/pgf/utilities | |
parent | c452dea4584e1a0650f1ba1f87262a85b511057c (diff) |
pgf (28sep20)
git-svn-id: svn://tug.org/texlive/trunk@56462 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities')
12 files changed, 116 insertions, 87 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex index 89ee8963e92..579b6dccea3 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex index 7be11f8f0e2..7f9c4a0293a 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex index f2b08b2a9e4..907083ef3be 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % 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 4e351c902be..cdb77b31377 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex @@ -1,4 +1,4 @@ -% Copyright 2008 by Till Tantau and Mark Wibrow +% Copyright 2019 by Till Tantau and Mark Wibrow % % This file may be distributed and/or modified % @@ -727,7 +727,7 @@ } \def\pgffor@remember@parse@old#1#2\pgffor@stop{% - \pgffor@remember@@parse@old#1#2\pgffor@stop as#1(initially )\pgffor@@stop} + \pgffor@remember@@parse@old#1#2\pgffor@stop as#1(initially 0)\pgffor@@stop} \def\pgffor@remember@@parse@old#1#2as#3#4\pgffor@@stop{% \pgffor@remember@@@parse@old{#1}{#3}#2#4\pgffor@stop\pgffor@@stop} @@ -735,11 +735,7 @@ \def\pgffor@remember@@@parse@old#1#2#3(initially #4)#5\pgffor@stop#6\pgffor@@stop{% \pgfutil@append@tomacro{\pgffor@assign@after@code}{\edef#2{#1}}% \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#2{#2}}% - \def\pgffor@test{#4}% - \ifx\pgffor@test\pgfutil@empty% - \else% - \pgfutil@append@tomacro{\pgffor@assign@once@code}{\def#2{#4}}% - \fi% + \pgfutil@append@tomacro{\pgffor@assign@once@code}{\def#2{#4}}% } \def\pgffor@count@parse#1#2\pgffor@stop{% diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex index 73922a0f097..e32745317c5 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % @@ -24,6 +24,8 @@ % works with all TeX formats and has no save-stack impact \def\pgfkeys@empty{} +\long\def\pgfkeys@firstoftwo#1#2{#1} +\long\def\pgfkeys@secondoftwo#1#2{#2} % This is useful: @@ -43,8 +45,6 @@ \csname @@end\expandafter\endcsname\expandafter\end% \fi -\expandafter\let\expandafter\pgfkeys@ifcsname\csname ifcsname\endcsname% - % Set a key to a value % % #1 = key @@ -178,7 +178,7 @@ % % \pgfkeysifdefined{/tikz/length}{key exists}{does not exist} -\long\def\pgfkeysifdefined#1#2#3{\pgfkeys@ifcsname pgfk@#1\endcsname#2\else#3\fi} +\long\def\pgfkeysifdefined#1#2#3{\ifcsname pgfk@#1\endcsname#2\else#3\fi} % Tests whether a key is assignable. For standard keys which just % store their value, this is identical to \pgfkeysifdefined. @@ -420,7 +420,7 @@ \def\pgfkeys@ifexecutehandler#1#2{#1}% \let\pgfkeys@ifexecutehandler@handleall=\pgfkeys@ifexecutehandler \def\pgfkeys@ifexecutehandler@handleonlyexisting#1#2{% - \pgfkeys@ifcsname pgfk@excpt@\pgfkeyscurrentname\endcsname% + \ifcsname pgfk@excpt@\pgfkeyscurrentname\endcsname% #1% ok, this particular key handler is known and should be processed in any case (for example .try) \else % implement the 'only existing' feature here: @@ -431,7 +431,7 @@ }% \def\pgfkeys@ifexecutehandler@handlefullorexisting#1#2{% \ifpgfkeysaddeddefaultpath - \pgfkeys@ifcsname pgfk@excpt@\pgfkeyscurrentname\endcsname% + \ifcsname pgfk@excpt@\pgfkeyscurrentname\endcsname% #1% ok, this particular key handler is known and be processed in any case (for example .try) \else % implement the 'only existing' feature here: @@ -719,7 +719,11 @@ % (with expansion of '#1'): \edef\pgfkeys@tempargs{\noexpand\pgfkeysvalueof{#1/.@@body}}% \def\pgfkeys@temp{\pgfkeysdef{#1}}% - \expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs##1}% + \ifnum#2=1\relax + \expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs{##1}}% + \else + \expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs##1}% + \fi #5{#1/.@body}{#3}% } @@ -795,7 +799,11 @@ % Defining a value -\pgfkeys{/handlers/.initial/.code=\pgfkeyssetvalue{\pgfkeyscurrentpath}{#1}} +\pgfkeys{/handlers/.initial/.code=% + \pgfkeyslet{\pgfkeyscurrentpath/.@cmd}\undefined + \pgfkeyslet{\pgfkeyscurrentpath/.@args}\undefined + \pgfkeyssetvalue{\pgfkeyscurrentpath}{#1}% +} \pgfkeys{/handlers/.add/.code 2 args=\pgfkeysaddvalue{\pgfkeyscurrentpath}{#1}{#2}} \pgfkeys{/handlers/.prefix/.code=\pgfkeysaddvalue{\pgfkeyscurrentpath}{#1}{}} \pgfkeys{/handlers/.append/.code=\pgfkeysaddvalue{\pgfkeyscurrentpath}{}{#1}} @@ -828,7 +836,7 @@ }% } \def\pgfkeys@handle@boolean#1#2{% - \pgfkeys@ifcsname#1#2\endcsname% + \ifcsname#1#2\endcsname% \csname#1#2\endcsname% \else% \def\pgf@marshal{\pgfkeysvalueof{/errors/boolean expected/.@cmd}}% @@ -895,10 +903,17 @@ \pgfkeys@searchalso@parse#1,\pgfkeys@mainstop {% \toks0=\expandafter{\pgfkeys@global@temp##1\pgfeov}% - \toks1={\pgfkeysalso{/handlers/.unknown/.@cmd/.expand once=\pgfkeys@searchalso@temp@value}}% + \toks1={% + \pgfkeysgetvalue{/handlers/.unknown/.@cmd}{\pgfkeys@code}% + \expandafter\pgfkeys@code\pgfkeys@searchalso@temp@value\pgfeov + }% \xdef\pgfkeys@global@temp{% \noexpand\def\noexpand\pgfkeys@searchalso@temp@value{####1}% \noexpand\ifpgfkeysaddeddefaultpath + \noexpand\expandafter\noexpand\pgfkeys@firstoftwo + \noexpand\else + \noexpand\expandafter\noexpand\pgfkeys@secondoftwo + \noexpand\fi{% \noexpand\pgfkeyssuccessfalse \noexpand\let\noexpand\pgfkeys@searchalso@name=\noexpand\pgfkeyscurrentkeyRAW \the\toks0 % one or more /.try things; one for each path. The last element won't have a /.try @@ -906,9 +921,9 @@ %\noexpand\else % \the\toks1 % invoke /handlers/.unknown handler %\noexpand\fi - \noexpand\else + }{% \the\toks1 % invoke /handlers/.unknown handler - \noexpand\fi + }% }% \expandafter\gdef\expandafter\pgfkeys@global@temp\expandafter##\expandafter1\expandafter\pgfeov\expandafter{\pgfkeys@global@temp}% }% @@ -952,7 +967,6 @@ % Value expansion \pgfkeys{/handlers/.expand once/.code=\expandafter\pgfkeys@exp@call\expandafter{#1}} -\pgfkeys{/handlers/.expand two once/.code 2 args=\expandafter\expandafter\expandafter\pgfkeys@exp@call\expandafter\expandafter\expandafter{\expandafter#1\expandafter}\expandafter{#2}} \pgfkeys{/handlers/.expand twice/.code=\expandafter\expandafter\expandafter\pgfkeys@exp@call\expandafter\expandafter\expandafter{#1}} \pgfkeys{/handlers/.expanded/.code=\edef\pgfkeys@temp{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@temp}} @@ -1101,7 +1115,6 @@ \pgfkeysaddhandleonlyexistingexception{.lastretry}% \pgfkeysaddhandleonlyexistingexception{.unknown}% \pgfkeysaddhandleonlyexistingexception{.expand once}% -\pgfkeysaddhandleonlyexistingexception{.expand two once}% \pgfkeysaddhandleonlyexistingexception{.expand twice}% \pgfkeysaddhandleonlyexistingexception{.expanded}% diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex index ef70baf021f..5772bcadca7 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex @@ -1,4 +1,4 @@ -% Copyright 2008 by Christian Feuersaenger +% Copyright 2019 by Christian Feuersaenger % % This file may be distributed and/or modified % @@ -264,7 +264,7 @@ % % If the family exists, #2 will be executed. Otherwise, #3 will be % called. -\long\def\pgfkeysiffamilydefined#1#2#3{\pgfkeys@ifcsname ifpgfk@#1/familyactive\endcsname#2\else#3\fi} +\long\def\pgfkeysiffamilydefined#1#2#3{\ifcsname ifpgfk@#1/familyactive\endcsname#2\else#3\fi} % Sets the TeX boolean % \ifpgfkeysfiltercontinue := ( family #1 is active ) 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 f83674c7528..8f53c1d7ba5 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex index d3b817a00f1..5e807b2e4f4 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex @@ -1,4 +1,4 @@ -% Copyright 2013 by Christian Feuersaenger +% Copyright 2019 by Christian Feuersaenger % % This file may be distributed and/or modified % @@ -104,7 +104,7 @@ \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% }% -% #1: the item to append +% #1: the item to prepend % #2: the list as macro name \long\def\pgfprependlistpushfront#1\to#2{% \begingroup diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex index b1c0546c17e..37210d48703 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % @@ -45,6 +45,18 @@ \def\pgfutil@trimspaces@@#1Q#2{#1} \catcode`\Q=11 +% \pgfutil@ifempty{<cs>}{<true code>}{<false code>} +% +% Check if <cs> is equal to \pgfutil@empty +% +% This macro is expandable. +\def\pgfutil@ifempty#1{% + \ifx#1\pgfutil@empty + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi} + % \pgfutil@ifundefined{<macro name with backslash>} % {<is undefined code>}{<is defined code>} % @@ -99,7 +111,7 @@ \csname newcount\expandafter\endcsname\csname pgfutil@pushedmacro@\pgfutil@pushmacro@string\endcsname \fi \global\advance\csname pgfutil@pushedmacro@\pgfutil@pushmacro@string\endcsname 1\relax - \expandafter\glet\csname\the\csname pgfutil@pushedmacro@\pgfutil@pushmacro@string\endcsname\pgfutil@pushmacro@string\endcsname#1% + \global\expandafter\let\csname\the\csname pgfutil@pushedmacro@\pgfutil@pushmacro@string\endcsname\pgfutil@pushmacro@string\endcsname#1% } \def\pgfutil@popmacro#1{% diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def index 7d244efc5fa..651b1cd169c 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def index 2ac8ec42120..e2ed750368f 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % @@ -119,61 +119,69 @@ } \let\pgfutil@abe\pgfutil@empty% -\RequirePackage{everyshi} -\EveryShipout{% - % Add at begin page stuff - \setbox\@cclv=\vbox{% - \setbox\z@=\hbox{% - % the boxes \pgfutil@abe ("every page") and \pgfutil@abb ("current page") - % are used to generate pdf objects / dictionaries which are - % required for the graphics which are somewhere in the "real" - % page content. - % BUT: these pdf objects MUST NOT be affected by text layout - % shifts! Consequently, we have to undo \hoffset and \voffset - % (which are h/v shifts to the page layout). - % - % Note that this of importance for shadings. To be more - % specific: try out shadings with standalone (which uses - % \hoffset) and with xdvipdfmx (which appears to be more - % fragile than pdflatex) - they break unless we undo \hoffset - % and \voffset. - \ifdim\hoffset=0pt \else \hskip-\hoffset\fi - \pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty - \ifdim\hoffset=0pt \else \hskip+\hoffset\fi +\@ifl@t@r\fmtversion{2020/10/01}{% + \AddToHook{shipout/background}{% + \put(\hoffset-1in,\voffset-1in){% + \pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty }% - \wd\z@=\z@% - \ht\z@=\z@% - \dp\z@=\z@% - % ... see remark above regarding \hoffset/\voffset: - \ifdim\voffset=0pt \else \vskip-\voffset\fi - \box\z@% - \ifdim\voffset=0pt \else \vskip+\voffset\fi - % - % if TeX changes into vertical mode, it inserts \parskip and - % \lineskip. Disable it here: - \nointerlineskip% - \ifvbox\@cclv \unvbox\@cclv \else\hsize=\wd\@cclv \noindent\unhbox\@cclv \fi% - %\box\@cclv - % using \box instead of \unhbox or \unvbox - % has the advantage that glue settings won't be - % altered (as for \unhbox/\unvbox). But \box breaks compatibility - % with the 'remember picture' feature. }% -} - -% Preview hack: preview.sty hacks into \shipout (which is ok), but -% does not honour everyshi.sty (which is not ok). This causes everyshi -% material to get lost. -\AtBeginDocument{ - \@ifpackageloaded{preview}{% - % Ok, package loaded. Swap definitions of everyshi.sty's shipout - % and preview.sty's shipout: - \ifPreview - \let\shipout\@EveryShipout@Org@Shipout%This is the null version of \shipout, created by preview and saved by everyshi - \let\@EveryShipout@Org@Shipout\pr@shipout% This is the original shipout - \let\pr@shipout\@EveryShipout@Shipout% - \fi - }{}% +}{% + \RequirePackage{everyshi} + \EveryShipout{% + % Add at begin page stuff + \setbox\@cclv=\vbox{% + \setbox\z@=\hbox{% + % the boxes \pgfutil@abe ("every page") and \pgfutil@abb ("current page") + % are used to generate pdf objects / dictionaries which are + % required for the graphics which are somewhere in the "real" + % page content. + % BUT: these pdf objects MUST NOT be affected by text layout + % shifts! Consequently, we have to undo \hoffset and \voffset + % (which are h/v shifts to the page layout). + % + % Note that this of importance for shadings. To be more + % specific: try out shadings with standalone (which uses + % \hoffset) and with xdvipdfmx (which appears to be more + % fragile than pdflatex) - they break unless we undo \hoffset + % and \voffset. + \ifdim\hoffset=0pt \else \hskip-\hoffset\fi + \pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty + \ifdim\hoffset=0pt \else \hskip+\hoffset\fi + }% + \wd\z@=\z@% + \ht\z@=\z@% + \dp\z@=\z@% + % ... see remark above regarding \hoffset/\voffset: + \ifdim\voffset=0pt \else \vskip-\voffset\fi + \box\z@% + \ifdim\voffset=0pt \else \vskip+\voffset\fi + % + % if TeX changes into vertical mode, it inserts \parskip and + % \lineskip. Disable it here: + \nointerlineskip% + \ifvbox\@cclv \unvbox\@cclv \else\hsize=\wd\@cclv \noindent\unhbox\@cclv \fi% + %\box\@cclv + % using \box instead of \unhbox or \unvbox + % has the advantage that glue settings won't be + % altered (as for \unhbox/\unvbox). But \box breaks compatibility + % with the 'remember picture' feature. + }% + } + + % Preview hack: preview.sty hacks into \shipout (which is ok), but + % does not honour everyshi.sty (which is not ok). This causes everyshi + % material to get lost. + \AtBeginDocument{ + \@ifpackageloaded{preview}{% + % Ok, package loaded. Swap definitions of everyshi.sty's shipout + % and preview.sty's shipout: + \ifPreview + \let\shipout\@EveryShipout@Org@Shipout%This is the null version of \shipout, created by preview and saved by everyshi + \let\@EveryShipout@Org@Shipout\pr@shipout% This is the original shipout + \let\pr@shipout\@EveryShipout@Shipout% + \fi + }{}% + } } % Guess the driver: diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def index 95dacd18a46..58fa3eac5f8 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def @@ -1,4 +1,4 @@ -% Copyright 2006 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % |