diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities')
12 files changed, 1366 insertions, 1275 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 1e4960066ed..f7d08391757 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex @@ -45,18 +45,18 @@ % is executed. When the code is called, lots of information about the % current date (like its day of week) is available. The job of % #4 is to render the date. Typically, this is done by placing nodes -% somewhere, but the function could do other things as well. +% somewhere, but the function could do other things as well. % It is also the job of #4 to position the calendar correctly. % % The different calls of #4 are not surrounded by TeX groups (though % you can do so yourself, of course). This means that settings can % accumulate between different calls, which is often desirable and -% useful. +% useful. % % Inside #4 code, different macros can be access: % % \pgfcalendarprefix -% The parameter #1. This prefix is recomended for nodes inside the +% The parameter #1. This prefix is recommended for nodes inside the % calendar, but you have to use it yourself explicitly. % % \pgfcalendarbeginiso @@ -81,10 +81,10 @@ % Year of day to be checked % % \pgfcalendarcurrentmonth -% Month of day to be chjeck +% Month of day to be checked % % \pgfcalendarcurrentday -% Day of monath of day to be checked +% Day of month of day to be checked % % % Inside the \pgfcalendar macro the macro \ifdate is available, which @@ -105,7 +105,7 @@ \begingroup% % Setup local \ifdate \let\ifdate=\pgfcalendar@local@ifdate% - % Let's start with computing start and end dates... + % Let's start with computing start and end dates... \def\pgfcalendarprefix{#1}% \pgfcalendardatetojulian{#2}{\pgfcalendarcurrentjulian}% \edef\pgfcalendarbeginjulian{\the\pgfcalendarcurrentjulian}% @@ -163,7 +163,7 @@ % When the key-value code is executed, the following macros will have % been setup: % -% \pgfcalendarifdatejulian +% \pgfcalendarifdatejulian % Julian day number of day to be checked % % \pgfcalendarifdateweekday @@ -173,13 +173,13 @@ % Year of day to be checked % % \pgfcalendarifdatemonth -% Month of day to be chjeck +% Month of day to be checked % % \pgfcalendarifdateday % Day of month of day to be checked % % The setting of these macros will persist after the call, so a -% sideeffect of callling this macro is to setup these macros. +% side-effect of calling this macro is to setup these macros. % % By setting \ifpgfcalendar@do@not@recompute to false, the computation % of the year, month etc. is suppressed. @@ -212,7 +212,7 @@ % % Set match to false \pgfcalendarmatchesfalse% - \pgfqkeys{/pgf/calendar}{#1}% + \pgfqkeys{/pgf/calendar}{#1}% \ifpgfcalendarmatches% #2% \else% @@ -290,7 +290,7 @@ \def\pgfcalendar@special@datetojulian#1{% \edef\pgf@temp{#1}% - \expandafter\pgfcalendar@special@split@test\pgf@temp-\relax{#1}% + \expandafter\pgfcalendar@special@split@test\pgf@temp-\relax{#1}% } \def\pgfcalendar@special@split@test#1-#2-#3\relax#4{% @@ -342,7 +342,7 @@ % % Description: % -% The conversion is taken from the Wikipedia entry on Julian days. +% The conversion is taken from the Wikipedia entry on Julian days. % % The date specification works as follows: % @@ -370,7 +370,7 @@ {% % % Store year, month and days. - % + % \count1=#1\relax% \count2=#2\relax% % If #3=="last", then calculate first day of next month @@ -447,18 +447,18 @@ \ifx\pgf@temp\pgfcalendar@last@text% \advance\count7by-1\relax% \fi% - % Add offset + % Add offset \advance\count7by\count8\relax% \expandafter% }% - \expandafter#5\the\count7\relax% + \expandafter#5\the\count7\relax% } \def\pgfcalendar@last@text{last} \def\pgfcalendar@unpack#1+{% \count8=#1\relax% } -% Convert Julian day number date. +% Convert Julian day number date. % % #1 = the number of Julian days % #2 = a macro in which the year should be stored. @@ -492,23 +492,23 @@ {% % 1) J = Julian day number \count1=#1\relax% - % 2) j = J + 32044 + % 2) j = J + 32044 \count2=\count1\relax% \advance\count2 by 32044\relax% - % 3) g = j div 146097 + % 3) g = j div 146097 \count3=\count2\relax% \divide\count3 by 146097\relax% - % 4) dg = j mod 146097 + % 4) dg = j mod 146097 \count4=\count3\relax% \multiply\count4 by-146097\relax% \advance\count4 by\count2\relax% - % 5) c = (dg div 36524 + 1) * 3 div 4 + % 5) c = (dg div 36524 + 1) * 3 div 4 \count5=\count4\relax% \divide\count5 by36524\relax% \advance\count5 by1\relax% \multiply\count5 by3\relax% \divide\count5 by4\relax% - % 6) dc = dg - c * 36524 + % 6) dc = dg - c * 36524 \count6=\count4\relax% \count0=\count5\relax% \multiply\count0 by-36524\relax% @@ -571,15 +571,15 @@ \advance\count15 by1\relax% % 16)D = d + 1 \count16=\count13% - \advance\count16by 1\relax% + \advance\count16by 1\relax% % \xdef\pgf@temp@year{\the\count14}% \xdef\pgf@temp@month{\ifnum\count15<10 0\fi\the\count15}% \xdef\pgf@temp@day{\ifnum\count16<10 0\fi\the\count16}% }% \let#2=\pgf@temp@year% - \let#3=\pgf@temp@month% - \let#4=\pgf@temp@day% + \let#3=\pgf@temp@month% + \let#4=\pgf@temp@day% } @@ -620,11 +620,11 @@ % October 1st, 2006 was a \pgfcalendarweekdayname{\myweekday} \def\pgfcalendarweekdayname#1{% - \translate{\ifcase#1Monday\or Tuesday\or Wednesday\or Thursday\or Friday\or Saturday\or Sunday\fi}% + \pgfutil@translate{\ifcase#1Monday\or Tuesday\or Wednesday\or Thursday\or Friday\or Saturday\or Sunday\fi}% } \def\pgfcalendarweekdayshortname#1{% - \translate{\ifcase#1Mon\or Tue\or Wed\or Thu\or Fri\or Sat\or Sun\fi}% + \pgfutil@translate{\ifcase#1Mon\or Tue\or Wed\or Thu\or Fri\or Sat\or Sun\fi}% } @@ -637,13 +637,13 @@ % \pgfcalendarmonthname \def\pgfcalendarmonthname#1{% - \translate{\ifcase#1\or January\or February\or March\or April\or + \pgfutil@translate{\ifcase#1\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi}% } \def\pgfcalendarmonthshortname#1{% - \translate{\ifcase#1\or Jan\or Feb\or Mar\or Apr\or + \pgfutil@translate{\ifcase#1\or Jan\or Feb\or Mar\or Apr\or May\or Jun\or Jul\or Aug\or Sep\or Oct\or Nov\or Dec\fi}% } @@ -678,7 +678,7 @@ % t = textual representation (allowed only for d, m, w) % . = abbreviated textual representation (allowed only for d, m, w) % -% It is adivsed that you say, for example, +% It is advised that you say, for example, % \let\%=\pgfcalendarshorthand. % % With this setting, you can typeset an ISO-date by saying \%y0-\%m0-\%d0. diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex index ff53e5e182f..7be11f8f0e2 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternal.tex @@ -14,7 +14,7 @@ % % This file is intended to be distributed or even inlined into a file % when a document needs to be typeset on a system that does not have -% pgf/TikZ installed. +% pgf/TikZ installed. % "environment" for reading an external graphic. Note that there are % no (!) braces around the "name" of the environment diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex index 38eeb306855..f2b08b2a9e4 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex @@ -14,7 +14,7 @@ % % This file is intended to be distributed or even inlined into a file % when a document needs to be typeset on a system that does not have -% pgf/TikZ installed. +% pgf/TikZ installed. % "environment" for reading an external graphic. Note that there are % no (!) braces around the "name" of the environment @@ -30,14 +30,14 @@ % \endpgfgraphicnamed \long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{% - \begingroup - \setbox1=\hbox{\includegraphics{#1}}% - \openin1=#1.dpth - \ifeof1 \box1 - \else - \read1 to\pgfincludeexternalgraphicsdp \closein1 - \dimen0=\pgfincludeexternalgraphicsdp\relax - \hbox{\lower\dimen0 \box1 }% - \fi - \endgroup + \begingroup + \setbox1=\hbox{\includegraphics{#1}}% + \openin1=#1.dpth + \ifeof1 \box1 + \else + \read1 to\pgfincludeexternalgraphicsdp \closein1 + \dimen0=\pgfincludeexternalgraphicsdp\relax + \hbox{\lower\dimen0 \box1 }% + \fi + \endgroup } 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 47969aaba48..5ff18417bc6 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex @@ -31,10 +31,10 @@ \pgffor@stack={{}{}{}} \def\pgffor@stackpush#1{% - \def\pgffor@stacktemp{#1}% - \expandafter\expandafter\expandafter\pgffor@stack\expandafter\expandafter\expandafter=% - \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter% - {\expandafter\pgffor@stacktemp\expandafter}\the\pgffor@stack}% + \def\pgffor@stacktemp{#1}% + \expandafter\expandafter\expandafter\pgffor@stack\expandafter\expandafter\expandafter=% + \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter% + {\expandafter\pgffor@stacktemp\expandafter}\the\pgffor@stack}% } \def\pgffor@stackpop{\expandafter\pgffor@@stackpop\the\pgffor@stack\pgffor@stackstop} @@ -43,40 +43,40 @@ \def\pgffor@emptyvalues{, \pgffor@stop,}% \def\pgffor@foreach{% - \pgffor@atbeginforeach% - \let\pgffor@assign@before@code=\pgfutil@empty% - \let\pgffor@assign@after@code=\pgfutil@empty% - \let\pgffor@assign@once@code=\pgfutil@empty% - \let\pgffor@remember@code=\pgfutil@empty% - \let\pgffor@remember@once@code=\pgfutil@empty% - \pgffor@alphabeticsequencefalse% - \pgffor@contextfalse% - % - \let\pgffor@var=\pgfutil@empty - % - \pgffor@vars% -} - + \pgffor@atbeginforeach% + \let\pgffor@assign@before@code=\pgfutil@empty% + \let\pgffor@assign@after@code=\pgfutil@empty% + \let\pgffor@assign@once@code=\pgfutil@empty% + \let\pgffor@remember@code=\pgfutil@empty% + \let\pgffor@remember@once@code=\pgfutil@empty% + \pgffor@alphabeticsequencefalse% + \pgffor@contextfalse% + % + \let\pgffor@var=\pgfutil@empty + % + \pgffor@vars% +} + \let\foreach=\pgffor@foreach \def\pgffor@vars{% - \pgfutil@ifnextchar i{\pgffor@@vars@end}{% - \pgfutil@ifnextchar[{\pgffor@@vars@opt}{%] - \pgfutil@ifnextchar/{\pgffor@@vars@slash@gobble}{% - \pgffor@@vars}}}}% - + \pgfutil@ifnextchar i{\pgffor@@vars@end}{% + \pgfutil@ifnextchar[{\pgffor@@vars@opt}{%] + \pgfutil@ifnextchar/{\pgffor@@vars@slash@gobble}{% + \pgffor@@vars}}}}% + \def\pgffor@@vars@end in{\pgfutil@ifnextchar\bgroup{\pgffor@normal@list}{\pgffor@macro@list}} \def\pgffor@@vars@opt[#1]{\pgfkeys{/pgf/foreach/.cd,#1}\pgffor@vars} \def\pgffor@@vars#1{\pgffor@var@add#1\pgffor@stop\pgffor@vars} \def\pgffor@@vars@slash@gobble/{\pgffor@@vars} \def\pgffor@var@add#1#2\pgffor@stop{% - \ifx\pgffor@var\pgfutil@empty% - \def\pgffor@var{#1}% - \def\pgffor@mainvar{#1}% - \else% - \expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@var/#1}% - \fi% + \ifx\pgffor@var\pgfutil@empty% + \def\pgffor@var{#1}% + \def\pgffor@mainvar{#1}% + \else% + \expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@var/#1}% + \fi% } \def\pgffor@macro@list#1{% @@ -105,14 +105,14 @@ \pgffor@collectbody% } \long\def\pgffor@collectargument#1{% - \expandafter\pgfutil@in@\expandafter\foreach\expandafter{\pgffor@body}% - \ifpgfutil@in@% - \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter% - {\pgffor@body{#1}}% - \else% - \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter% - {\pgffor@body#1}% - \fi% + \expandafter\pgfutil@in@\expandafter\foreach\expandafter{\pgffor@body}% + \ifpgfutil@in@% + \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter% + {\pgffor@body{#1}}% + \else% + \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter% + {\pgffor@body#1}% + \fi% \pgffor@iterate% } @@ -131,12 +131,12 @@ { \catcode`\;=\active - + \gdef\pgffor@collectactivesemicolon#1;{% \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter{\pgffor@body#1;}% \pgffor@iterate% } -} +} \def\pgffor@iterate{% % Must do all of these in case the internal stack is used. @@ -145,7 +145,7 @@ \let\pgffor@dotsend=\pgfutil@empty% \let\pgffor@dots@pre=\pgfutil@empty% \let\pgffor@dots@post=\pgfutil@empty% - % + % \expandafter\pgffor@scan\pgffor@values} \def\pgffor@stop{\pgffor@stop}% @@ -159,11 +159,11 @@ % Check for dots. \newif\ifpgffor@dots@in@ \def\pgffor@dots@in@#1...#2#3\pgffor@stop{% - \ifx\pgffor@dots@@#2% - \pgffor@dots@in@false% - \else% - \pgffor@dots@in@true% - \fi% + \ifx\pgffor@dots@@#2% + \pgffor@dots@in@false% + \else% + \pgffor@dots@in@true% + \fi% } \def\pgffor@dots@@{\pgffor@dots@@} @@ -172,9 +172,9 @@ \ifx\pgffor@value\pgffor@stop% \let\pgffor@next=\pgffor@after% Done! \else% - % Check for dots. Quicker than \pgfutil@in@ and not suceptable - % to false-positives when a token sequence ends in a single full-stop. - \expandafter\pgffor@dots@in@\pgffor@value\pgffor@dots@...\pgffor@dots@@\pgffor@stop% + % Check for dots. Quicker than \pgfutil@in@ and not suceptable + % to false-positives when a token sequence ends in a single full-stop. + \expandafter\pgffor@dots@in@\pgffor@value\pgffor@dots@...\pgffor@dots@@\pgffor@stop% \ifpgffor@dots@in@% \let\pgffor@next=\pgffor@handledots% \else% @@ -192,17 +192,17 @@ \global\pgffor@continuetrue% \pgffor@atendforeach% \pgffor@afterhook} - + \def\pgffor@handlevalue{% - \let\pgffor@prevlast=\pgffor@last% + \let\pgffor@prevlast=\pgffor@last% \let\pgffor@last=\pgffor@value% \pgffor@invokebody% \pgffor@scan% } - + \def\pgffor@invokebody{% - \pgffor@begingroup% + \pgffor@begingroup% \expandafter\pgfutil@in@\expandafter/\expandafter{\pgffor@var}% \ifpgfutil@in@% \expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@value//\relax}% @@ -212,21 +212,21 @@ \fi% % Execute assign once code. \ifx\pgffor@assign@once@code\pgfutil@empty% - \else% - \pgffor@assign@once@code% - \fi% + \else% + \pgffor@assign@once@code% + \fi% % Execute assign before code. \ifx\pgffor@assign@before@code\pgfutil@empty% \else% - \pgffor@assign@before@code% - \fi% - % + \pgffor@assign@before@code% + \fi% + % \expandafter\expandafter\expandafter\pgffor@reset@hooks\expandafter\pgffor@beginhook\expandafter\pgffor@body\pgffor@endhook% % Execute assign after code. \ifx\pgffor@assign@after@code\pgfutil@empty% \else% - \pgffor@assign@after@code% - \fi% + \pgffor@assign@after@code% + \fi% % \pgffor@endgroup% } @@ -245,66 +245,68 @@ \def\pgffor@multiassignrest{\expandafter\pgffor@multiassignfinal\pgffor@valuerest} \def\pgffor@multiassignfinal#1/#2/\relax{% - \def\pgffor@temp{#1}% - \ifx\pgffor@currentvar\pgffor@mainvar% - \ifpgffor@alphabeticsequence% - \pgffor@makealphabetic\pgffor@temp% - \fi% + \def\pgffor@temp{#1}% + \ifx\pgffor@currentvar\pgffor@mainvar% + \ifpgffor@alphabeticsequence% + \pgffor@makealphabetic\pgffor@temp% + \fi% \fi% \def\pgffor@test{#2}% \ifx\pgffor@test\pgfutil@empty% - \expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@temp//\relax}% repeat + \expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@temp//\relax}% repeat \else% \def\pgffor@valuerest{#2/\relax}% \fi% \expandafter\expandafter\expandafter\def\expandafter\pgffor@currentvar\expandafter{\pgffor@temp}% - % + % \expandafter\pgffor@multiassign\pgffor@rest/\relax% -} +} \def\pgffor@gobblespaces#1{\pgfutil@ifnextchar x{#1}{#1}} \def\pgffor@handledots{% - \pgffor@gobblespaces{\expandafter\pgffor@@handledots\pgffor@value\pgffor@@stop}% + \pgffor@gobblespaces{\expandafter\pgffor@@handledots\pgffor@value\pgffor@@stop}% } \newif\ifpgffor@context \def\pgffor@@handledots#1...#2\pgffor@@stop{% - % Define the context if any. - \def\pgffor@dots@pre{#1}% - \def\pgffor@dots@post{#2}% - \def\pgffor@dots@stripcontext#1##1#2\pgffor@@stop{\def\pgffor@dotsvalue{##1}}% - \pgffor@contexttrue% - \ifx\pgffor@dots@pre\pgfutil@empty% - \ifx\pgffor@dots@post\pgfutil@empty% - \pgffor@contextfalse% - \def\pgffor@dots@stripcontext##1\pgffor@@stop{\def\pgffor@dotsvalue{##1}}% - \fi% - \fi% - \pgffor@gobblespaces{\pgffor@dotsscanend}% + % Define the context if any. + \def\pgffor@dots@pre{#1}% + \def\pgffor@dots@post{#2}% + \def\pgffor@dots@stripcontext#1##1#2\pgffor@@stop{\def\pgffor@dotsvalue{##1}}% + \pgffor@contexttrue% + \ifx\pgffor@dots@pre\pgfutil@empty% + \ifx\pgffor@dots@post\pgfutil@empty% + \pgffor@contextfalse% + \def\pgffor@dots@stripcontext##1\pgffor@@stop{\def\pgffor@dotsvalue{##1}}% + \fi% + \fi% + \pgffor@gobblespaces{\pgffor@dotsscanend}% } \def\pgffor@dots@value@process#1{% - \expandafter\pgffor@dots@stripcontext#1\pgffor@@stop% - \expandafter\pgffor@dots@charcheck\pgffor@dotsvalue\pgffor@@stop% + \expandafter\pgffor@dots@stripcontext#1\pgffor@@stop% + \expandafter\pgffor@dots@charcheck\pgffor@dotsvalue\pgffor@@stop% \ifpgffor@alphabeticsequence \else - \begingroup - \pgfkeys{/pgf/fpu/false/.try}% - \pgfmathparse{\pgffor@dotsvalue}% - \pgfmath@smuggleone\pgfmathresult - \endgroup - \let\pgffor@dotsvalue=\pgfmathresult + \ifpgffor@assign@parse + \begingroup + \pgfkeys{/pgf/fpu/false/.try}% + \pgfmathparse{\pgffor@dotsvalue}% + \pgfmath@smuggleone\pgfmathresult + \endgroup + \let\pgffor@dotsvalue=\pgfmathresult + \fi \fi - \let#1=\pgffor@dotsvalue% + \let#1=\pgffor@dotsvalue% } \def\pgffor@dotsscanend#1,{% - \pgffor@alphabeticsequencefalse% - % Strip context and check for a character sequence. - \def\pgffor@dotsend{#1}% - \pgffor@dots@value@process{\pgffor@dotsend}% + \pgffor@alphabeticsequencefalse% + % Strip context and check for a character sequence. + \def\pgffor@dotsend{#1}% + \pgffor@dots@value@process{\pgffor@dotsend}% % \pgffor@dots@value@process{\pgffor@last}% % @@ -316,7 +318,7 @@ \pgffor@skip=-1pt% \fi% \else% - \pgffor@dots@value@process{\pgffor@prevlast}% + \pgffor@dots@value@process{\pgffor@prevlast}% \pgffor@skip=\pgffor@last pt% \pgffor@iter=\pgffor@prevlast pt% \advance\pgffor@skip by-\pgffor@iter% @@ -346,8 +348,8 @@ } \def\pgffor@endloop{% - \pgffor@alphabeticsequencefalse% - \pgffor@scan% + \pgffor@alphabeticsequencefalse% + \pgffor@scan% } {\catcode`\p=12\catcode`\t=12\gdef\Pgffor@geT#1pt{#1}} @@ -365,168 +367,168 @@ \expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@temp//\relax}% \expandafter\pgffor@multiassign\pgffor@var/\pgffor@stop/\pgffor@stop/\relax% \else% - % Convert to alphabetic sequence, if necessary. - \ifpgffor@alphabeticsequence% - \pgffor@makealphabetic\pgffor@temp% - \expandafter\let\pgffor@var=\pgffor@temp% - \else% - \expandafter\expandafter\expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@temp}% + % Convert to alphabetic sequence, if necessary. + \ifpgffor@alphabeticsequence% + \pgffor@makealphabetic\pgffor@temp% + \expandafter\let\pgffor@var=\pgffor@temp% + \else% + \expandafter\expandafter\expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@temp}% \fi% \fi% % Insert any context, if any. \ifpgffor@context% \let\pgffor@temp=\pgffor@dots@pre% - \expandafter\pgfutil@append@macrotomacro\expandafter% - {\expandafter\pgffor@temp\expandafter}\expandafter{\pgffor@var}% - \expandafter\pgfutil@append@macrotomacro\expandafter% - {\expandafter\pgffor@temp\expandafter}\expandafter{\pgffor@dots@post}% - \expandafter\let\pgffor@var=\pgffor@temp% - \fi% - % Perform assignments before loop body. - \ifx\pgffor@assign@before@code\pgfutil@empty% + \expandafter\pgfutil@append@macrotomacro\expandafter% + {\expandafter\pgffor@temp\expandafter}\expandafter{\pgffor@var}% + \expandafter\pgfutil@append@macrotomacro\expandafter% + {\expandafter\pgffor@temp\expandafter}\expandafter{\pgffor@dots@post}% + \expandafter\let\pgffor@var=\pgffor@temp% + \fi% + % Perform assignments before loop body. + \ifx\pgffor@assign@before@code\pgfutil@empty% \else% - \pgffor@assign@before@code% - \fi% - % + \pgffor@assign@before@code% + \fi% + % \expandafter\expandafter\expandafter\pgffor@reset@hooks\expandafter\pgffor@beginhook\expandafter\pgffor@body\pgffor@endhook% % % Perform assignments after loop body. - \ifx\pgffor@assign@after@code\pgfutil@empty% + \ifx\pgffor@assign@after@code\pgfutil@empty% \else% - \pgffor@assign@after@code% - \fi% + \pgffor@assign@after@code% + \fi% \pgffor@endgroup% - \pgffor@loop% + \pgffor@loop% } \def\pgffor@strip#1.0{\def\pgffor@temp{#1}} \def\breakforeach{\global\pgffor@continuefalse} - + \def\pgffor@gobbletil@pgffor@@stop#1\pgffor@@stop{} \newif\ifpgffor@registeriscount \def\pgffor@ifcsregister#1{% - \expandafter\pgffor@@ifcsregister\meaning#1\pgffor@stop} + \expandafter\pgffor@@ifcsregister\meaning#1\pgffor@stop} \def\pgffor@@ifcsregister#1#2#3#4#5\pgffor@stop{% - \if#1m% It is an ordinary (m)acro. - \pgffor@registeriscountfalse% - \let\pgffor@csnext=\pgfutil@secondoftwo% - \else% - \if#1u% It is (u)ndefined. - \let\pgffor@csnext=\pgfutil@secondoftwo% - \pgffor@registeriscountfalse% - \else% - \let\pgffor@csnext=\pgfutil@firstoftwo% - \if#4u% It is a co(u)nt - \pgffor@registeriscounttrue% - \else% Assume it is a dimen or skip (bad assumption in the general case). - \pgffor@registeriscountfalse% - \let\pgffor@csnext=\pgfutil@firstoftwo% - \fi% - \fi% - \fi% - \pgffor@csnext} - + \if#1m% It is an ordinary (m)acro. + \pgffor@registeriscountfalse% + \let\pgffor@csnext=\pgfutil@secondoftwo% + \else% + \if#1u% It is (u)ndefined. + \let\pgffor@csnext=\pgfutil@secondoftwo% + \pgffor@registeriscountfalse% + \else% + \let\pgffor@csnext=\pgfutil@firstoftwo% + \if#4u% It is a co(u)nt + \pgffor@registeriscounttrue% + \else% Assume it is a dimen or skip (bad assumption in the general case). + \pgffor@registeriscountfalse% + \let\pgffor@csnext=\pgfutil@firstoftwo% + \fi% + \fi% + \fi% + \pgffor@csnext} + \newif\ifpgffor@alphabeticsequence -% +% \def\pgffor@dots@charcheck#1\pgffor@@stop{% \edef\pgffor@dots@charcheck@temp{#1}% \expandafter\expandafter\expandafter\pgffor@@dotscharcheck\expandafter\meaning\pgffor@dots@charcheck@temp\pgffor@@stop% } \def\pgffor@@dotscharcheck#1#2\pgffor@@stop{% - \if#1t% - \afterassignment\pgffor@gobbletil@pgffor@@stop% - \expandafter\chardef\expandafter\pgffor@char\expandafter=\expandafter`\pgffor@dots@charcheck@temp\relax\pgffor@@stop% - \edef\pgffor@char{\the\pgffor@char}% - \ifnum\pgffor@char>64\relax% From A-Z? - \ifnum\pgffor@char<91\relax% - \let\pgffor@dotsvalue=\pgffor@char% - \pgffor@alphabeticsequencetrue% - \else% - \ifnum\pgffor@char>96\relax% From a-z? - \ifnum\pgffor@char<123\relax% - \let\pgffor@dotsvalue=\pgffor@char% - \pgffor@alphabeticsequencetrue% - \fi% - \fi% - \fi% - \fi% - \fi% + \if#1t% + \afterassignment\pgffor@gobbletil@pgffor@@stop% + \expandafter\chardef\expandafter\pgffor@char\expandafter=\expandafter`\pgffor@dots@charcheck@temp\relax\pgffor@@stop% + \edef\pgffor@char{\the\pgffor@char}% + \ifnum\pgffor@char>64\relax% From A-Z? + \ifnum\pgffor@char<91\relax% + \let\pgffor@dotsvalue=\pgffor@char% + \pgffor@alphabeticsequencetrue% + \else% + \ifnum\pgffor@char>96\relax% From a-z? + \ifnum\pgffor@char<123\relax% + \let\pgffor@dotsvalue=\pgffor@char% + \pgffor@alphabeticsequencetrue% + \fi% + \fi% + \fi% + \fi% + \fi% } \def\pgffor@makealphabetic#1{% - % Convert the number in the macro passed as #1 to a-z or A-Z. - \pgfutil@tempcnta=#1\relax% - \ifnum\pgfutil@tempcnta>95\relax% - \advance\pgfutil@tempcnta by-96\relax% - \edef#1{\pgffor@alpha\pgfutil@tempcnta}% - \else% - \advance\pgfutil@tempcnta by-64 % - \edef#1{\pgffor@Alpha\pgfutil@tempcnta}% - \fi% + % Convert the number in the macro passed as #1 to a-z or A-Z. + \pgfutil@tempcnta=#1\relax% + \ifnum\pgfutil@tempcnta>95\relax% + \advance\pgfutil@tempcnta by-96\relax% + \edef#1{\pgffor@alpha\pgfutil@tempcnta}% + \else% + \advance\pgfutil@tempcnta by-64 % + \edef#1{\pgffor@Alpha\pgfutil@tempcnta}% + \fi% } \def\pgffor@Alpha#1{% - \ifcase#1\relax\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M% - \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else?\fi% + \ifcase#1\relax\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M% + \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else?\fi% } \def\pgffor@alpha#1{% - \ifcase#1\relax\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m% - \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else?\fi% + \ifcase#1\relax\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m% + \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else?\fi% } \newtoks\pgffor@toks \def\pgffor@addcstotoks#1{% - \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\expandafter\def\expandafter#1\expandafter{#1}}% - \pgffor@@addcstotoks} + \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\expandafter\def\expandafter#1\expandafter{#1}}% + \pgffor@@addcstotoks} \def\pgffor@addregtotoks#1{% - \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\expandafter#1\expandafter=\the#1}% - \pgffor@@addcstotoks} + \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\expandafter#1\expandafter=\the#1}% + \pgffor@@addcstotoks} \def\pgffor@addiftotoks#1{% - \begingroup% - \escapechar=-1\relax% - \expandafter\pgffor@@addiftotoks\string#1\pgffor@stop} + \begingroup% + \escapechar=-1\relax% + \expandafter\pgffor@@addiftotoks\string#1\pgffor@stop} \def\pgffor@@addiftotoks#1#2#3#4\pgffor@stop{% - \endgroup - \csname if#3#4\endcsname% - \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\csname#3#4true\endcsname}% - \else% - \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\csname#3#4false\endcsname}% - \fi% - \pgffor@@addcstotoks% + \endgroup + \csname if#3#4\endcsname% + \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\csname#3#4true\endcsname}% + \else% + \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\csname#3#4false\endcsname}% + \fi% + \pgffor@@addcstotoks% } \def\pgffor@@addcstotoks{% - \expandafter\expandafter\expandafter\pgffor@toks\expandafter\expandafter\expandafter=% - \expandafter\expandafter\expandafter{\expandafter\pgffor@tokstemp\the\pgffor@toks}% + \expandafter\expandafter\expandafter\pgffor@toks\expandafter\expandafter\expandafter=% + \expandafter\expandafter\expandafter{\expandafter\pgffor@tokstemp\the\pgffor@toks}% } % Set up the pgffor scopes. \def\pgffor@atbeginforeach{% - \begingroup% + \begingroup% } \def\pgffor@atendforeach{% - \global\edef\pgffor@remember@expanded{\pgffor@remember@code}% + \global\edef\pgffor@remember@expanded{\pgffor@remember@code}% \endgroup% \ifx\pgffor@remember@expanded\pgfutil@empty% \else% - \pgffor@remember@expanded% - \global\let\pgffor@remember@expanded=\pgfutil@empty% + \pgffor@remember@expanded% + \global\let\pgffor@remember@expanded=\pgfutil@empty% \fi% } \def\pgffor@default@begingroup{% - \begingroup% + \begingroup% } \let\pgffor@remember@once@expanded=\pgfutil@empty @@ -564,30 +566,30 @@ \let\pgffor@begingroup=\pgffor@default@begingroup \let\pgffor@endgroup=\pgffor@default@endgroup - + \def\pgffor@stack@begingroup{% - \pgffor@toks={}% - \pgffor@addcstotoks{\pgffor@mainvar}% - \pgffor@addcstotoks{\pgffor@var}% - \pgffor@addcstotoks{\pgffor@body}% - % - \pgffor@addcstotoks{\pgffor@last}% - \pgffor@addcstotoks{\pgffor@prevlast}% - \pgffor@addcstotoks{\pgffor@dotsend}% - % - \pgffor@addcstotoks{\pgffor@assign@before@code}% - \pgffor@addcstotoks{\pgffor@assign@after@code}% - \pgffor@addcstotoks{\pgffor@remember@code}% - \pgffor@addcstotoks{\pgffor@remember@once@code}% - \pgffor@addcstotoks{\pgffor@dots@pre}% - \pgffor@addcstotoks{\pgffor@dots@post}% - % - \pgffor@addregtotoks{\pgffor@iter}% - \pgffor@addregtotoks{\pgffor@skip}% - % - \pgffor@addiftotoks{\ifpgffor@alphabeticsequence}% - \pgffor@addiftotoks{\ifpgffor@context}% - \expandafter\pgffor@stackpush\expandafter{\the\pgffor@toks}% + \pgffor@toks={}% + \pgffor@addcstotoks{\pgffor@mainvar}% + \pgffor@addcstotoks{\pgffor@var}% + \pgffor@addcstotoks{\pgffor@body}% + % + \pgffor@addcstotoks{\pgffor@last}% + \pgffor@addcstotoks{\pgffor@prevlast}% + \pgffor@addcstotoks{\pgffor@dotsend}% + % + \pgffor@addcstotoks{\pgffor@assign@before@code}% + \pgffor@addcstotoks{\pgffor@assign@after@code}% + \pgffor@addcstotoks{\pgffor@remember@code}% + \pgffor@addcstotoks{\pgffor@remember@once@code}% + \pgffor@addcstotoks{\pgffor@dots@pre}% + \pgffor@addcstotoks{\pgffor@dots@post}% + % + \pgffor@addregtotoks{\pgffor@iter}% + \pgffor@addregtotoks{\pgffor@skip}% + % + \pgffor@addiftotoks{\ifpgffor@alphabeticsequence}% + \pgffor@addiftotoks{\ifpgffor@context}% + \expandafter\pgffor@stackpush\expandafter{\the\pgffor@toks}% } \def\pgffor@stack@endgroup{\pgffor@stackpop} @@ -596,163 +598,166 @@ \newif\ifpgffor@assign@evaluate \newif\ifpgffor@assign@once +\newif\ifpgffor@assign@parse \pgfkeys{/pgf/foreach/.cd, - var/.code=\pgffor@var@add#1\pgffor@stop, - scope iterations/.code={ - \csname if#1\endcsname% - \let\pgffor@begingroup=\pgffor@default@begingroup% - \let\pgffor@endgroup=\pgffor@default@endgroup% - \else% - \let\pgffor@begingroup=\pgffor@stack@begingroup% - \let\pgffor@endgroup=\pgffor@stack@endgroup% - \fi% - }, - evaluate/.code=\pgffor@assign@evaluatetrue\pgffor@assign@oncefalse\pgffor@assign@parse{#1},% - assign/.code=\pgffor@assign@evaluatefalse\pgffor@assign@oncefalse\pgffor@assign@parse{#1},% - evaluate once/.code=\pgffor@assign@evaluatetrue\pgffor@assign@oncetrue\pgffor@assign@parse{#1},% - assign once/.code=\pgffor@assign@evaluatefalse\pgffor@assign@oncetrue\pgffor@assign@parse{#1},% - remember/.code=\pgffor@remember@parse{#1},% - count/.code=\pgffor@count@parse#1\pgffor@stop + var/.code=\pgffor@var@add#1\pgffor@stop, + scope iterations/.code={ + \csname if#1\endcsname% + \let\pgffor@begingroup=\pgffor@default@begingroup% + \let\pgffor@endgroup=\pgffor@default@endgroup% + \else% + \let\pgffor@begingroup=\pgffor@stack@begingroup% + \let\pgffor@endgroup=\pgffor@stack@endgroup% + \fi% + }, + evaluate/.code=\pgffor@assign@evaluatetrue\pgffor@assign@oncefalse\pgffor@assign@parse{#1},% + assign/.code=\pgffor@assign@evaluatefalse\pgffor@assign@oncefalse\pgffor@assign@parse{#1},% + evaluate once/.code=\pgffor@assign@evaluatetrue\pgffor@assign@oncetrue\pgffor@assign@parse{#1},% + assign once/.code=\pgffor@assign@evaluatefalse\pgffor@assign@oncetrue\pgffor@assign@parse{#1},% + remember/.code=\pgffor@remember@parse{#1},% + count/.code=\pgffor@count@parse#1\pgffor@stop, + parse/.is if=pgffor@assign@parse, + parse/.default=false, } \def\pgffor@assign@parse#1{% - \pgfutil@in@;{#1}% - \ifpgfutil@in@% - \else% - \pgfutil@in@={#1}% - \fi% - \ifpgfutil@in@% - \pgffor@assign@@parse#1;\pgffor@stop;% - \else% - \pgffor@assign@parse@old#1\pgffor@stop%% - \fi% + \pgfutil@in@;{#1}% + \ifpgfutil@in@% + \else% + \pgfutil@in@={#1}% + \fi% + \ifpgfutil@in@% + \pgffor@assign@@parse#1;\pgffor@stop;% + \else% + \pgffor@assign@parse@old#1\pgffor@stop%% + \fi% } \def\pgffor@stop{\pgffor@stop} \def\pgffor@assign@@parse#1;{% - \def\pgffor@test{#1}% - \ifx\pgffor@test\pgffor@stop% - \let\pgffor@next=\relax% - \else% - \let\pgffor@next=\pgffor@assign@@parse% - \ifx\pgffor@test\pgfutil@empty% - \else% - \pgfutil@in@={#1}% - \ifpgfutil@in@% - \pgffor@assign@@@parse#1\pgffor@stop% - \else% - \pgffor@assign@@@parse#1=#1\pgffor@stop% - \fi% - \fi% - \fi% - \pgffor@next} - + \def\pgffor@test{#1}% + \ifx\pgffor@test\pgffor@stop% + \let\pgffor@next=\relax% + \else% + \let\pgffor@next=\pgffor@assign@@parse% + \ifx\pgffor@test\pgfutil@empty% + \else% + \pgfutil@in@={#1}% + \ifpgfutil@in@% + \pgffor@assign@@@parse#1\pgffor@stop% + \else% + \pgffor@assign@@@parse#1=#1\pgffor@stop% + \fi% + \fi% + \fi% + \pgffor@next} + \def\pgffor@assign@@@parse#1=#2\pgffor@stop{% - \ifpgffor@assign@evaluate% - \ifpgffor@assign@once% - \pgfutil@append@tomacro{\pgffor@assign@once@code}{\pgfmathparse{#2}\let#1=\pgfmathresult}% - \pgfutil@append@tomacro{\pgffor@remember@once@code}{\noexpand\def\noexpand#1{#2}}% - \else - \pgfutil@append@tomacro{\pgffor@assign@before@code}{\pgfmathparse{#2}\let#1=\pgfmathresult}% - \fi% - \else% - \ifpgffor@assign@once% - \pgfutil@append@tomacro{\pgffor@assign@once@code}{\def#1{#2}}% - \pgfutil@append@tomacro{\pgffor@remember@once@code}{\noexpand\def\noexpand#1{#2}}% - \else - \pgfutil@append@tomacro{\pgffor@assign@before@code}{\def#1{#2}}% - \fi% - \fi% + \ifpgffor@assign@evaluate% + \ifpgffor@assign@once% + \pgfutil@append@tomacro{\pgffor@assign@once@code}{\pgfmathparse{#2}\let#1=\pgfmathresult}% + \pgfutil@append@tomacro{\pgffor@remember@once@code}{\noexpand\def\noexpand#1{#2}}% + \else + \pgfutil@append@tomacro{\pgffor@assign@before@code}{\pgfmathparse{#2}\let#1=\pgfmathresult}% + \fi% + \else% + \ifpgffor@assign@once% + \pgfutil@append@tomacro{\pgffor@assign@once@code}{\def#1{#2}}% + \pgfutil@append@tomacro{\pgffor@remember@once@code}{\noexpand\def\noexpand#1{#2}}% + \else + \pgfutil@append@tomacro{\pgffor@assign@before@code}{\def#1{#2}}% + \fi% + \fi% } \def\pgffor@assign@parse@old#1#2\pgffor@stop{% - \pgffor@assign@@parse@old#2\pgffor@stop as#1using #1\pgffor@@stop} + \pgffor@assign@@parse@old#2\pgffor@stop as#1using #1\pgffor@@stop} \def\pgffor@assign@@parse@old#1as#2#3\pgffor@@stop{% - \pgffor@assign@@@parse@old{#2}#1#3\pgffor@stop\pgffor@@stop} + \pgffor@assign@@@parse@old{#2}#1#3\pgffor@stop\pgffor@@stop} \def\pgffor@assign@@@parse@old#1#2using #3\pgffor@stop#4\pgffor@@stop{% - \pgffor@assign@@@parse#1=#3\pgffor@stop} - + \pgffor@assign@@@parse#1=#3\pgffor@stop} + \def\pgffor@remember@parse#1{% - \pgfutil@in@ a{#1}% This matches the 'a' in 'as' or 'intially'. - \ifpgfutil@in@% - \pgffor@remember@parse@old#1\pgffor@stop% - \else% - \pgffor@remember@@parse#1;\pgffor@stop;% - \fi% + \pgfutil@in@ a{#1}% This matches the 'a' in 'as' or 'initially'. + \ifpgfutil@in@% + \pgffor@remember@parse@old#1\pgffor@stop% + \else% + \pgffor@remember@@parse#1;\pgffor@stop;% + \fi% } \def\pgffor@remember@@parse#1;{% - \def\pgffor@test{#1}% - \ifx\pgffor@test\pgffor@stop% - \let\pgffor@next=\relax% - \else% - \let\pgffor@next=\pgffor@remember@@parse% - \ifx\pgffor@test\pgfutil@empty% - \else% - \pgfutil@in@={#1}% - \ifpgfutil@in@% - \pgffor@remember@@@parse#1\pgffor@stop% - \else% - \pgffor@ifcsregister{#1}{% - \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand#1=\the#1\noexpand\relax}% - }% - {% - \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}% - }% - \fi% - \fi% - \fi% - \pgffor@next% + \def\pgffor@test{#1}% + \ifx\pgffor@test\pgffor@stop% + \let\pgffor@next=\relax% + \else% + \let\pgffor@next=\pgffor@remember@@parse% + \ifx\pgffor@test\pgfutil@empty% + \else% + \pgfutil@in@={#1}% + \ifpgfutil@in@% + \pgffor@remember@@@parse#1\pgffor@stop% + \else% + \pgffor@ifcsregister{#1}{% + \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand#1=\the#1\noexpand\relax}% + }% + {% + \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}% + }% + \fi% + \fi% + \fi% + \pgffor@next% } \def\pgffor@remember@@@parse#1=#2\pgffor@stop{% - \pgffor@ifcsregister{#2}{% - \pgfutil@append@tomacro{\pgffor@assign@after@code}{\expandafter\def\expandafter#1\expandafter{\the#2}}% - \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}% - }% - {% - \pgfutil@append@tomacro{\pgffor@assign@after@code}{\expandafter\def\expandafter#1\expandafter{#2}}% - \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}% - }% + \pgffor@ifcsregister{#2}{% + \pgfutil@append@tomacro{\pgffor@assign@after@code}{\expandafter\def\expandafter#1\expandafter{\the#2}}% + \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}% + }% + {% + \pgfutil@append@tomacro{\pgffor@assign@after@code}{\expandafter\def\expandafter#1\expandafter{#2}}% + \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}% + }% } \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 )\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} + \pgffor@remember@@@parse@old{#1}{#3}#2#4\pgffor@stop\pgffor@@stop} \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@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% } \def\pgffor@count@parse#1#2\pgffor@stop{% - \pgffor@count@@parse#1#2\pgffor@stop from 1\pgffor@stop\pgffor@@stop} + \pgffor@count@@parse#1#2\pgffor@stop from 1\pgffor@stop\pgffor@@stop} \def\pgffor@count@@parse#1#2from#3\pgffor@stop#4\pgffor@@stop{% - \pgfutil@append@tomacro\pgffor@remember@code{\noexpand\def\noexpand#1{#1}}% - \pgfutil@append@tomacro\pgffor@assign@before@code{\pgfmathparse{int(#1+1)}\let#1=\pgfmathresult}% - \pgfmathparse{int(#3-1)}\let#1=\pgfmathresult% + \pgfutil@append@tomacro\pgffor@remember@code{\noexpand\def\noexpand#1{#1}}% + \pgfutil@append@tomacro\pgffor@assign@before@code{\pgfmathparse{int(#1+1)}\let#1=\pgfmathresult}% + \pgfmathparse{int(#3-1)}\let#1=\pgfmathresult% } \def\pgfutil@append@macrotomacro#1#2{% - \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter% - #1\expandafter\expandafter\expandafter{\expandafter#1#2}} + \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter% + #1\expandafter\expandafter\expandafter{\expandafter#1#2}} \def\pgfutil@append@tomacro#1#2{% - \expandafter\def\expandafter#1\expandafter{#1#2}} - + \expandafter\def\expandafter#1\expandafter{#1#2}} + \endinput 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 6d9f08fdcba..f89e43639f4 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex @@ -9,8 +9,8 @@ % The files pgfkeys.code.tex and pgfkeysfiltered.code.tex are -% perfectly self-contained, except that the catcode of @ -% should be made a letter. +% perfectly self-contained, except that the catcode of @ +% should be made a letter. % Guard against reading twice @@ -19,8 +19,8 @@ \else \expandafter\endinput \fi - -% The purpose of this file is to provide a general settings engine that + +% The purpose of this file is to provide a general settings engine that % works with all TeX formats and has no save-stack impact @@ -56,7 +56,7 @@ % Description: % % This command sets the key to the given tokens. The tokens are stored as -% is and can even contain things like #9. +% is and can even contain things like #9. % % Keys are organized hierarchically using something similar to Unix % paths. Thus, a typically key might be called "/tikz/length" or @@ -78,7 +78,7 @@ \long\def\pgfkeyssetevalue#1#2{% \pgfkeys@temptoks={#2}% - \pgfkeys@temptoks=\scantokens\expandafter{\expandafter{\the\pgfkeys@temptoks}}% + \pgfkeys@temptoks=\pgfutil@scantokens\expandafter{\expandafter{\the\pgfkeys@temptoks}}% \expandafter\edef\csname pgfk@#1\expandafter\endcsname\expandafter{\the\pgfkeys@temptoks}% } @@ -156,7 +156,7 @@ % Description: % % This command will expand to the value stored in the key. The key -% should previously have been set using \pgfkeyasetkey or \pgfkeyslet. +% should previously have been set using \pgfkeyasetkey or \pgfkeyslet. % % Example: % @@ -213,7 +213,7 @@ % specified, the value of the token register "\pgfkeypath" is used. If % "=value" is missing, the value of the setting "/path/key/.@def" is used % instead. If this key is set to "\pgfvaluerequired", the key -% "/errors/value required/.@cmd" is executed. Theis error handler, +% "/errors/value required/.@cmd" is executed. This error handler, % like all other error handlers, will get the current key as its first % parameter (unexpanded) and the current value as its second value % (also unexpanded). @@ -247,7 +247,7 @@ % 3) Otherwise, if the key /handlers/key/.@cmd is present, it is executed % with the same parameters as in 1). Additionally, the % token register \pgfcurrentkeypath will be set to "/path/" and the -% macor \pgfcurrentkeywithoutpath to "key". So, in the above +% macro \pgfcurrentkeywithoutpath to "key". So, in the above % example if neither "/stuff/height/.@cmd" nor % "/stuff/height" is present, but "/handlers/height" is, % then "/handlers/height" is executed with the parameters: @@ -326,7 +326,7 @@ \def\pgfkeys@cleanup\pgfkeys@mainstop{} \def\pgfkeys@mainstop{\pgfkeys@mainstop} % equals only itself -\def\pgfkeys@novalue{} +\def\pgfkeys@novalue{} \def\pgfkeysnovalue{\pgfkeys@novalue} % equals only itself \def\pgfkeysnovalue@text{\pgfkeysnovalue} \def\pgfkeysvaluerequired{\pgfkeysvaluerequired} % equals only itself @@ -400,7 +400,7 @@ % '/my search path' % % Idea: - % set + % set % - path := '/my search path' % - name := 'key/.code' % - key = '/my search path/key/.code' @@ -417,7 +417,7 @@ }% } -% this macro is to implement the |handly only existing| key in key filtering: +% this macro is to implement the |handle only existing| key in key filtering: % #1: the code to invoke IF the key handler shall be executed % #2: the code to invoke if it shall not run. \def\pgfkeys@ifexecutehandler#1#2{#1}% @@ -533,7 +533,7 @@ % #1 = default path % #2 = key-value pairs % -% Desscription: +% Description: % % This command starts the execution with the default path set to % #1. This command should only be used when speed is important (like @@ -553,7 +553,7 @@ % % #1 = key-value pairs % -% Desscription: +% Description: % % This code may only be called inside the code that is executed for a % key. The #1 should be a list of settings pairs. They will be executed @@ -572,7 +572,7 @@ % #1 = default path % #2 = key-value pairs % -% Desscription: +% Description: % % This command executes #2 with the default path set to #1. This % command will cause chaos if used incorrectly. The only safe @@ -588,7 +588,7 @@ -% Now setup the default handelers and keys: +% Now setup the default handlers and keys: % Define a key macro with one argument (\def or \edef) % @@ -616,7 +616,7 @@ } -% Define a key macro with mutliple arguments (\def or \edef) +% Define a key macro with multiple arguments (\def or \edef) % % #1 = key % #2 = argument pattern @@ -664,7 +664,7 @@ % {2} % } % ->defnargs: 1=`1', 2=`2' -% +% % defargs: % \pgfkeysdefargs{/b}{#1#2}{1=`#1', 2=`#2'} % \pgfkeys{ @@ -678,7 +678,7 @@ % \pgfkeysdefargs{/b}{#1#2}{1=`#1', 2=`#2'} % \pgfkeys{ % /b= -% {1}% +% {1}% % {2} % } % ->defargs: 1=`1', 2=`2' @@ -863,7 +863,7 @@ \edef\pgf@keys@list@path{\pgfkeyscurrentpath}% \expandafter\expandafter\expandafter\pgf@keys@do@list% \expandafter\expandafter\expandafter{\expandafter\pgf@keys@list@path\expandafter}\pgf@keys@temp\pgf@stop% - }% + }% } \def\pgf@keys@do@list#1{\pgf@keys@utilifnextchar\bgroup{\pgf@keys@do@list@item{#1}}\pgf@keys@gobble} \def\pgf@keys@do@list@item#1#2{\pgfkeysalso{#1={#2}}\pgf@keys@do@list{#1}} @@ -878,7 +878,7 @@ % Inspection handlers -\pgfkeys{/handlers/.show value/.code=\pgfkeysgetvalue{\pgfkeyscurrentpath}{\pgfkeysshower}\show\pgfkeysshower} % inspect the value +\pgfkeys{/handlers/.show value/.code=\pgfkeysgetvalue{\pgfkeyscurrentpath}{\pgfkeysshower}\show\pgfkeysshower} % inspect the value \pgfkeys{/handlers/.show code/.code=\pgfkeysgetvalue{\pgfkeyscurrentpath/.@cmd}{\pgfkeysshower}\show\pgfkeysshower} % inspect the body of the command @@ -988,7 +988,7 @@ {% \pgfkeys@split@path% \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{% - % in the standard configuration, this check here is redundand + % in the standard configuration, this check here is redundant % because pgfkeys@ifexecutehandler === true. % It is only interesting for 'handle only existing'. \pgfkeys@ifexecutehandler{% @@ -1055,7 +1055,7 @@ \def\pgf@temp{#2}% \pgfkeys@error{% I do not know the key '\the\toks1'\ifx\pgf@temp\pgfkeysnovalue@text\space\else, to which you passed - '\the\toks2', \fi and I am going to ignore it. Perhaps you + '\the\toks2', \fi and I am going to ignore it. Perhaps you misspelled it% } } 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 1a413536783..7c6d6e49cef 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex @@ -6,13 +6,13 @@ % 2. under the GNU Public License. % % See the file doc/generic/pgf/licenses/LICENSE for more details. -% +% % This file contains additions to pgfkeys.code.tex (loaded % automatically at the end of pgfkeys.code.tex) % % Improvements: % -% - option filtering +% - option filtering % you provide % - a boolean predicate % - a "filter handler" which will be invoked for non-matching options, @@ -50,44 +50,44 @@ % Performs 'filtered' key settings. % -% For every option for which the path prefixing has already been done, +% For every option for which the path prefixing has already been done, % the current key filter predicate will be invoked. If the predicate % returns true, pgfkeys will process this key in the normal manner. % If not, a key filter handler will be invoked. % % The *predicate* and *handler* semantics are as follows: % PRECONDITION: -% 1. The variables -% \pgfkeyscurrentkey (full path including name) -% \pgfkeyscurrentkeyRAW (the current key as it has been -% found in the key=value list -% without path modification) -% \pgfkeyscurrentvalue -% are all set. If the current key is a handler variable, -% \pgfkeyscurrentname -% and -% \pgfkeyscurrentpath -% are also set. -% 2. The type of option has already been checked, that means -% case (1) whether '.@cmd' exists -% case (2) whether the key as such has its value -% case (3) it is a handler like '.code', '.cd' or whatever. -% case (0) it is unknown. -% The actual case number (0-3) will be provided as contents -% of the macro -% \pgfkeyscasenumber. -% It is always a one-character token, so it may be compared -% with both, \ifnum or \if. -% Please note that unknown options will be processed with -% the usual '.unknown' handlers unless the key filter takes -% control over unknown options as well. +% 1. The variables +% \pgfkeyscurrentkey (full path including name) +% \pgfkeyscurrentkeyRAW (the current key as it has been +% found in the key=value list +% without path modification) +% \pgfkeyscurrentvalue +% are all set. If the current key is a handler variable, +% \pgfkeyscurrentname +% and +% \pgfkeyscurrentpath +% are also set. +% 2. The type of option has already been checked, that means +% case (1) whether '.@cmd' exists +% case (2) whether the key as such has its value +% case (3) it is a handler like '.code', '.cd' or whatever. +% case (0) it is unknown. +% The actual case number (0-3) will be provided as contents +% of the macro +% \pgfkeyscasenumber. +% It is always a one-character token, so it may be compared +% with both, \ifnum or \if. +% Please note that unknown options will be processed with +% the usual '.unknown' handlers unless the key filter takes +% control over unknown options as well. % % POSTCONDITION: -% the predicate sets -% \pgfkeysfiltercontinuetrue -% or -% \pgfkeysfiltercontinuefalse -% (the boolean \ifpgfkeysfiltercontinue). +% the predicate sets +% \pgfkeysfiltercontinuetrue +% or +% \pgfkeysfiltercontinuefalse +% (the boolean \ifpgfkeysfiltercontinue). % Depending on this 'if', option processing will be continued or % skipped. % @@ -107,43 +107,43 @@ % invoke \pgfkeyssplitpath. In any other case, neither path nor name % are required for the options processing - if you need them for % predicates/handlers, you need to compute them by hand. -% +% % % Example: % \def\unmatched{} % \pgfkeys{/pgf/key filters/is descendant of/.install key filter=/my group} % \pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\unmatched} % \pgfkeysfiltered% -% {/my group/option 1=value 1,/tikz/option 2=value 2} +% {/my group/option 1=value 1,/tikz/option 2=value 2} % -> % will set '/my group/option 1' as usual, but '/tikz/option 2' will not -% be set. Instead, it will be appended to '\unmatched' such that +% be set. Instead, it will be appended to '\unmatched' such that % \unmatched = {/tikz/option 2=value2} % after the operation. % % Arguments: % #1: key-value list. \def\pgfkeysfiltered{% - % produce - % '{<default path>}' - % each expanded exactly one time into the register: - \expandafter\pgfkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}% + % produce + % '{<default path>}' + % each expanded exactly one time into the register: + \expandafter\pgfkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}% } % #1: old value of default path. % #2: key-value-list. \long\def\pgfkeysfiltered@@install#1#2{% - \pgfkeys@install@filter@and@invoke{% - \let\pgfkeysdefaultpath\pgfkeys@root% - \pgfkeys@parse#2,\pgfkeys@mainstop% - \def\pgfkeysdefaultpath{#1}% - }% + \pgfkeys@install@filter@and@invoke{% + \let\pgfkeysdefaultpath\pgfkeys@root% + \pgfkeys@parse#2,\pgfkeys@mainstop% + \def\pgfkeysdefaultpath{#1}% + }% } % Assuming that macro #1 contains a key=value list, this command % performs an \pgfkeysalso command for the content of macro #1. % -% It can be used in conjunction with +% It can be used in conjunction with % - \pgfkeysfiltered and % - \pgfkeysappendfilterednamestomacro: % the first pass fill only process options matching the filter, then, @@ -153,17 +153,17 @@ % Example: % \pgfkeys{/my group/.cd,/utils/exec=\pgfkeysalsofrom\filtered} \long\def\pgfkeysalsofrom#1{% - \expandafter\pgfkeysalso\expandafter{#1}% + \expandafter\pgfkeysalso\expandafter{#1}% } % The same as \pgfkeysalsofrom, but it invokes \pgfkeysalsofiltered. \long\def\pgfkeysalsofilteredfrom#1{% - \expandafter\pgfkeysalsofiltered\expandafter{#1}% + \expandafter\pgfkeysalsofiltered\expandafter{#1}% } % #1 = options \long\def\pgfkeysalsofiltered#1{% - \pgfkeys@install@filter@and@invoke{\pgfkeysalso{#1}}% + \pgfkeys@install@filter@and@invoke{\pgfkeysalso{#1}}% }% % The same like \pgfkeysfiltered, but with quick search path setting. @@ -171,28 +171,28 @@ % #1: default path % #2: key-value-pairs \long\def\pgfqkeysfiltered#1{% - \expandafter\pgfqkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}{#1}% + \expandafter\pgfqkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}{#1}% } % #1: old value of default path. % #2: default path % #3: key-value-list. \long\def\pgfqkeysfiltered@@install#1#2#3{% - \pgfkeys@install@filter@and@invoke{% - \def\pgfkeysdefaultpath{#2/}\pgfkeys@parse#3,\pgfkeys@mainstop\def\pgfkeysdefaultpath{#1}% - }% + \pgfkeys@install@filter@and@invoke{% + \def\pgfkeysdefaultpath{#2/}\pgfkeys@parse#3,\pgfkeys@mainstop\def\pgfkeysdefaultpath{#1}% + }% } % Family management % % The family code provides the following features: % 1. every key can be associated with 0 or 1 'family'. -% 2. Families are a loose association which are independend of the key +% 2. Families are a loose association which are independent of the key % hierarchy. % For example, /my tree/key1 can belong to family /tikz. % % 3. It is possible to "activate" or "deactivate" single families. -% Furthermore, it is possible to set only keys which belong to +% Furthermore, it is possible to set only keys which belong to % active families (using \pgfkeysfiltered). % 4. Runtime complexities: % If you have N options and you only want to process K active @@ -206,10 +206,10 @@ % % #1 maybe a macro. \def\pgfkeysactivatefamily#1{% - \pgfkeysiffamilydefined - {#1}% - {\csname pgfk@#1/familyactivetrue\endcsname}% - {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}% + \pgfkeysiffamilydefined + {#1}% + {\csname pgfk@#1/familyactivetrue\endcsname}% + {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}% %\message{[ACTIVATING FAMILY #1]}% } @@ -217,10 +217,10 @@ % % #1 maybe a macro. \def\pgfkeysdeactivatefamily#1{% - \pgfkeysiffamilydefined - {#1}% - {\csname pgfk@#1/familyactivefalse\endcsname}% - {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}% + \pgfkeysiffamilydefined + {#1}% + {\csname pgfk@#1/familyactivefalse\endcsname}% + {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}% %\message{[DEACTIVATING FAMILY #1]}% } @@ -232,26 +232,26 @@ % #1: a comma-separated list of fully qualified family names. % #2: a command which will be filled with a deactivate-all command. \def\pgfkeysactivatefamilies#1#2{% - \pgfkeyssavekeyfilterstateto\pgfkeys@cur@state - \expandafter\pgfkeysactivatefamilies@impl\expandafter{\pgfkeys@cur@state}{#1}{#2}% + \pgfkeyssavekeyfilterstateto\pgfkeys@cur@state + \expandafter\pgfkeysactivatefamilies@impl\expandafter{\pgfkeys@cur@state}{#1}{#2}% } % #1: commands needed to restore the old filtering state % #2: family name list % #3: macro name for de-activate command \def\pgfkeysactivatefamilies@impl#1#2#3{% - \pgfkeysinstallkeyfilter{/pgf/key filters/false}{}% - \let#3=\pgfkeys@empty% - \def\pgfkeys@filtered@handler{\pgfkeys@family@activate@handler{#3}}% - \pgfkeysalsofiltered{#2}% - #1% + \pgfkeysinstallkeyfilter{/pgf/key filters/false}{}% + \let#3=\pgfkeys@empty% + \def\pgfkeys@filtered@handler{\pgfkeys@family@activate@handler{#3}}% + \pgfkeysalsofiltered{#2}% + #1% } \def\pgfkeys@family@activate@handler#1{% - \pgfkeysactivatefamily{\pgfkeyscurrentkey}% - % produce - % <old list> '\pgfkeysdeactivatefamily{' <current key> '}' - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter\pgfkeysdeactivatefamily\expandafter{\pgfkeyscurrentkey}}% - \edef#1{\the\pgfkeys@tmptoks}% + \pgfkeysactivatefamily{\pgfkeyscurrentkey}% + % produce + % <old list> '\pgfkeysdeactivatefamily{' <current key> '}' + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter\pgfkeysdeactivatefamily\expandafter{\pgfkeyscurrentkey}}% + \edef#1{\the\pgfkeys@tmptoks}% } % If for testing whether a family exists. @@ -266,18 +266,18 @@ % called. \long\def\pgfkeysiffamilydefined#1#2#3{\pgfkeys@ifcsname ifpgfk@#1/familyactive\endcsname#2\else#3\fi} -% Sets the TeX boolean +% Sets the TeX boolean % \ifpgfkeysfiltercontinue := ( family #1 is active ) -% +% % Argument: % #1 the family name. Maybe a macro. \def\pgfkeysisfamilyactive#1{% - \pgfkeysiffamilydefined{#1}{% - \expandafter\let\expandafter\ifpgfkeysfiltercontinue\csname ifpgfk@#1/familyactive\endcsname - }{% - \pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov% - \expandafter\expandafter\expandafter\let\csname ifpgfkeysfiltercontinue\endcsname\csname iffalse\endcsname - }% + \pgfkeysiffamilydefined{#1}{% + \expandafter\let\expandafter\ifpgfkeysfiltercontinue\csname ifpgfk@#1/familyactive\endcsname + }{% + \pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov% + \expandafter\expandafter\expandafter\let\csname ifpgfkeysfiltercontinue\endcsname\csname iffalse\endcsname + }% }% % Retrieve the family of full key #1 into macro #2. @@ -292,33 +292,33 @@ % macro. % #2: a macro name which will be filled with the result. \def\pgfkeysgetfamily#1#2{% - \pgfkeysifdefined{#1/family}{\pgfkeysgetvalue{#1/family}{#2}\pgfkeyssuccesstrue}{\pgfkeyssuccessfalse}% + \pgfkeysifdefined{#1/family}{\pgfkeysgetvalue{#1/family}{#2}\pgfkeyssuccesstrue}{\pgfkeyssuccessfalse}% } % Equivalent to \pgfkeys{#1/.belongs to family=#2} \def\pgfkeyssetfamily#1#2{% - \pgfkeysiffamilydefined{#2}{% - \pgfkeyssetvalue{#1/family}{#2}% - }{% - \pgfkeysalso{/errors/family unknown=#2}% - }% + \pgfkeysiffamilydefined{#2}{% + \pgfkeyssetvalue{#1/family}{#2}% + }{% + \pgfkeysalso{/errors/family unknown=#2}% + }% }% % Sets \ifpgfkeysfiltercontinue to true iff the current key belongs to % the /errors tree. \long\def\pgfkeys@cur@is@descendant@of@errors{% - \expandafter\pgfkeys@cur@is@descendant@of@errors@impl\pgfkeyscurrentkey/errors\pgf@@eov + \expandafter\pgfkeys@cur@is@descendant@of@errors@impl\pgfkeyscurrentkey/errors\pgf@@eov }% \long\def\pgfkeys@cur@is@descendant@of@errors@impl#1/errors#2\pgf@@eov{% - \def\pgfkeyspred@TMP{#1}% - \ifx\pgfkeyspred@TMP\pgfkeys@empty + \def\pgfkeyspred@TMP{#1}% + \ifx\pgfkeyspred@TMP\pgfkeys@empty %\message{[SPECIAL CHECK] '\pgfkeyscurrentkey' is descendant of '/errors': TRUE.}% - \pgfkeysfiltercontinuetrue - \else + \pgfkeysfiltercontinuetrue + \else %\message{[SPECIAL CHECK] '\pgfkeyscurrentkey' is descendant of '/errors': FALSE.}% - \pgfkeysfiltercontinuefalse - \fi + \pgfkeysfiltercontinuefalse + \fi }% % \pgfkeysinterruptkeyfilter @@ -333,19 +333,19 @@ % \pgfkeysinterruptkeyfilter...\endpgfkeysinterruptkeyfilter does NOT % introduce a \TeX-group. \def\pgfkeysinterruptkeyfilter{% - \ifpgfkeysfilteringisactive - \let\pgfkeys@case@one=\pgfkeys@orig@case@one - \let\pgfkeys@try=\pgfkeys@orig@try - \let\pgfkeys@unknown=\pgfkeys@orig@unknown - \fi + \ifpgfkeysfilteringisactive + \let\pgfkeys@case@one=\pgfkeys@orig@case@one + \let\pgfkeys@try=\pgfkeys@orig@try + \let\pgfkeys@unknown=\pgfkeys@orig@unknown + \fi } \def\endpgfkeysinterruptkeyfilter{% - \ifpgfkeysfilteringisactive - \let\pgfkeys@case@one=\pgfkeys@case@one@filtered - \let\pgfkeys@try=\pgfkeys@try@filtered - \let\pgfkeys@unknown=\pgfkeys@unknown@filtered - \fi + \ifpgfkeysfilteringisactive + \let\pgfkeys@case@one=\pgfkeys@case@one@filtered + \let\pgfkeys@try=\pgfkeys@try@filtered + \let\pgfkeys@unknown=\pgfkeys@unknown@filtered + \fi } % Activates families #1, calls \pgfkeysfiltered and deactivates the @@ -359,9 +359,9 @@ % % @see \pgfkeysactivatefamiliesandfilteroptions \def\pgfkeysactivatefamiliesandfilteroptions#1#2{% - \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}% - \pgfkeysfiltered{#2}% - \pgfkeys@family@deactivation + \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}% + \pgfkeysfiltered{#2}% + \pgfkeys@family@deactivation } % The "quick" variant of \pgfkeysactivatefamiliesandfilteroptions: it @@ -371,9 +371,9 @@ % #2: default path % #3: key-value pairs \def\pgfqkeysactivatefamiliesandfilteroptions#1#2#3{% - \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}% - \pgfqkeysfiltered{#2}{#3}% - \pgfkeys@family@deactivation + \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}% + \pgfqkeysfiltered{#2}{#3}% + \pgfkeys@family@deactivation } % Public version of split path: @@ -386,9 +386,9 @@ % #1: family (maybe a macro) % #2: key-value pairs \def\pgfkeysactivatesinglefamilyandfilteroptions#1#2{% - \pgfkeysactivatefamily{#1}% - \pgfkeysfiltered{#2}% - \pgfkeysdeactivatefamily{#1}% + \pgfkeysactivatefamily{#1}% + \pgfkeysfiltered{#2}% + \pgfkeysdeactivatefamily{#1}% } % The "quick" variant of \pgfkeysactivatesinglefamilyandfilteroptions @@ -397,9 +397,9 @@ % #2: default path % #3: key-value pairs \def\pgfqkeysactivatesinglefamilyandfilteroptions#1#2#3{% - \pgfkeysactivatefamily{#1}% - \pgfqkeysfiltered{#2}{#3}% - \pgfkeysdeactivatefamily{#1}% + \pgfkeysactivatefamily{#1}% + \pgfqkeysfiltered{#2}{#3}% + \pgfkeysdeactivatefamily{#1}% } % Installs the key filter '#1' with argument '#2'. @@ -416,20 +416,20 @@ % #2: optional arguments for the key. If the key expects more than one % argument, supply '{{first}{second}}' \def\pgfkeysinstallkeyfilter#1#2{% - \pgfkeysifdefined{#1/.@cmd}{% - \edef\pgfkeyscurrentkeyfilter{#1}% - \def\pgfkeyscurrentkeyfilterargs{#2}% - \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@key@predicate@}% - \def\pgfkeys@key@predicate{\pgfkeys@key@predicate@#2\pgfeov}% - }{% - \pgfkeysvalueof{/errors/no such key filter/.@cmd}{#1}{#2}\pgfeov% - }% + \pgfkeysifdefined{#1/.@cmd}{% + \edef\pgfkeyscurrentkeyfilter{#1}% + \def\pgfkeyscurrentkeyfilterargs{#2}% + \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@key@predicate@}% + \def\pgfkeys@key@predicate{\pgfkeys@key@predicate@#2\pgfeov}% + }{% + \pgfkeysvalueof{/errors/no such key filter/.@cmd}{#1}{#2}\pgfeov% + }% } % Installs the key filter handler '#1' with argument '#2'. % This is equivalent to % \pgfkeys{#1/.install key filter handler=#2} -% +% % The current values of the key filter handler is stored into the public % macros % \pgfkeyscurrentkeyfilterhandler @@ -440,332 +440,333 @@ % #2: optional arguments for the handler. If the handler expects more than one % argument, supply '{{first}{second}}' \def\pgfkeysinstallkeyfilterhandler#1#2{% - \pgfkeysifdefined{#1/.@cmd}{% - \edef\pgfkeyscurrentkeyfilterhandler{#1}% - \def\pgfkeyscurrentkeyfilterhandlerargs{#2}% - \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@filtered@handler@}% - \def\pgfkeys@filtered@handler{\pgfkeys@filtered@handler@#2\pgfeov}% - }{% - \pgfkeysvalueof{/errors/no such key filter handler/.@cmd}{#1}{#2}\pgfeov% - }% + \pgfkeysifdefined{#1/.@cmd}{% + \edef\pgfkeyscurrentkeyfilterhandler{#1}% + \def\pgfkeyscurrentkeyfilterhandlerargs{#2}% + \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@filtered@handler@}% + \def\pgfkeys@filtered@handler{\pgfkeys@filtered@handler@#2\pgfeov}% + }{% + \pgfkeysvalueof{/errors/no such key filter handler/.@cmd}{#1}{#2}\pgfeov% + }% } % Creates a macro which contains commands to re-activate the current % key filter and key filter handler. It can be used to temporarily % switch the key filter. \def\pgfkeyssavekeyfilterstateto#1{% - % produce the string - % \pgfkeysinstallkeyfilter{...}{...} - % \pgfkeysinstallkeyfilterhandler{...}{...} - % where each argument is expanded once - % FIXME: Do the same with less overhead! - \pgfkeys@tmptoks={\pgfkeysinstallkeyfilter}% - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilter}}% - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterargs}\pgfkeysinstallkeyfilterhandler}% - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandler}}% - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandlerargs}}% - \edef#1{% - \the\pgfkeys@tmptoks - }% + % produce the string + % \pgfkeysinstallkeyfilter{...}{...} + % \pgfkeysinstallkeyfilterhandler{...}{...} + % where each argument is expanded once + % FIXME: Do the same with less overhead! + \pgfkeys@tmptoks={\pgfkeysinstallkeyfilter}% + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilter}}% + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterargs}\pgfkeysinstallkeyfilterhandler}% + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandler}}% + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandlerargs}}% + \edef#1{% + \the\pgfkeys@tmptoks + }% } \pgfkeys{% - /errors/family unknown/.code=\pgfkeys@error{% - Sorry, I do not know family '#1' and can't work with any assoicated family handling. Perhaps you misspelled it?}, - /errors/no such key filter/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter '#1'.}, - /errors/no such key filter handler/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter handler '#1'.}, - % HANDLERS: - % - % .is family should - % 1. '.cd' into the families' path, - % 2. define booleans to activate/deactive the family - % (see \pgfkeysisfamilyactive) - % 3. make sure that \pgfkeyshasactivefamily returns true for - % the family itsself. - /handlers/.is family/.append code={% - %\newif is an \outer macro in plain tex, so this here is not portable: - %\expandafter\newif\csname if\pgfkeyscurrentpath/familyactive\endcsname - \edef\pgfkeyspred@TMP{pgfk@\pgfkeyscurrentpath/familyactive}% - \expandafter\pgfkeys@non@outer@newif\expandafter{\pgfkeyspred@TMP}% - \edef\pgfkeyspred@TMP{\pgfkeyscurrentpath/.belongs to family=\pgfkeyscurrentpath}% - \expandafter\pgfkeysalso\expandafter{\pgfkeyspred@TMP}% - },% - /handlers/.activate family/.code=\pgfkeysactivatefamily{\pgfkeyscurrentpath}, - /handlers/.deactivate family/.code=\pgfkeysdeactivatefamily{\pgfkeyscurrentpath}, - /handlers/.belongs to family/.code={\pgfkeyssetfamily{\pgfkeyscurrentpath}{#1}},% - % - % - % An addition to the '.try' and '.retry' handlers: - % - % It is the same as '.retry', but if the option is still unknown, the - % usual handlers for unknown keys will be invoked. - /handlers/.lastretry/.code={% - \ifpgfkeyssuccess\else - \pgfkeys@try - \ifpgfkeyssuccess\else - % discard the '.lastretry' suffix: - \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% - \pgfkeys@split@path% - \pgfkeys@unknown - \fi - \fi - }, - % - % - /handlers/.install key filter/.code={% - \pgfkeysinstallkeyfilter{\pgfkeyscurrentpath}{#1}% - },% - /handlers/.install key filter handler/.code={% - \pgfkeysinstallkeyfilterhandler{\pgfkeyscurrentpath}{#1}% - },% - % - % - % KEY FILTER HANDLERS: - % - /pgf/key filter handlers/append filtered to/.code={% - % Produce - % <orig key> '={' <value> '}' - % where both, the key and the value are expanded just ONCE: - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentkeyRAW\expandafter=\expandafter{\pgfkeyscurrentvalue}}% - \ifx#1\pgfkeys@empty - \else - % Produce <old list> ',' <orig key> '={' <value> '}' - \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter,\the\pgfkeys@tmptoks}% - \fi - \edef#1{\the\pgfkeys@tmptoks}% - },% - /pgf/key filter handlers/ignore/.code={}, - /pgf/key filter handlers/ignore/.install key filter handler, - /pgf/key filter handlers/log/.code={% - \pgf@typeout{LOG: the option '\pgfkeyscurrentkey' (was originally '\pgfkeyscurrentkeyRAW') (case \pgfkeyscasenumber) has not been processed due to pgfkeysfiltered.}% - }, - % - % - % KEY FILTER PREDICATES: - % - % Returns true iff the currently processed key belongs to an active family. - % A family is active if it has been activated before. - /pgf/key filters/active families/.code={% - \if\pgfkeyscasenumber0% - % unknown options shall be processed with the - % unknown-handlers. - \pgfkeysfiltercontinuetrue - \else - \if\pgfkeyscasenumber3% - \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP - \else - \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP - \fi - \ifpgfkeyssuccess - \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% - \else% Ok, it does not belong to any family. - \pgfkeysfiltercontinuefalse - \fi - \fi - },% - % - % - % - % This filter works as follows: - % 1. if the current key belongs to a family: - % return whether its family is active, - % 2. if the current key does NOT belong to a family: - % return the result of criterion '#1', - % 3. the current key is unknown: - % return the result of criterion '#2'. - % - % Arguments: - % #1: the predicate which will be invoked in case 2. - % It will be invoked with the current case number as argument. - % #2: the predicate which will be invoked in case 3 with - % the current case number as argument. - /pgf/key filters/active families or no family/.code 2 args={% - \if\pgfkeyscasenumber0% - \pgfkeysevalkeyfilterwith{#2}% - \else - \if\pgfkeyscasenumber3% - \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP - \else - \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP - \fi - \ifpgfkeyssuccess - \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% - \else% Ok, it does not belong to any family. - \pgfkeysevalkeyfilterwith{#1}% - \fi - \fi - }, - /pgf/key filters/active families or no family DEBUG/.code 2 args={% - \if\pgfkeyscasenumber0% - \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking unknown handler '#2']}% - \pgfkeysevalkeyfilterwith{#2}% - \else - \if\pgfkeyscasenumber3% - \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP - \else - \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP - \fi - \ifpgfkeyssuccess - \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% - \ifpgfkeysfiltercontinue - \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is ACTIVE]}% - \else - \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is NOT active.]}% - \fi - \else% Ok, it does not belong to any family. - \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking has-no-family-handler '#1']}% - \pgfkeysevalkeyfilterwith{#1}% - \fi - \fi - }, - % - % A (faster) shortcut for - % /pgf/key filters/active families or no family= - % {/pgf/keys filters/false} - % {/pgf/keys filters/false} - /pgf/key filters/active families and known/.code={% - \if\pgfkeyscasenumber0% - \pgfkeysfiltercontinuefalse - \else - \if\pgfkeyscasenumber3% - \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP - \else - \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP - \fi - \ifpgfkeyssuccess - \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% - \else% Ok, it does not belong to any family. - \pgfkeysfiltercontinuefalse - \fi - \fi - }, - % A (faster) shortcut for - % /pgf/key filters/active families or no family= - % {/pgf/key filters/is descendant of=#1}% for keys without family - % {/pgf/keys filters/false} - /pgf/key filters/active families or descendants of/.code={% - \if\pgfkeyscasenumber0% - \pgfkeysfiltercontinuefalse - \else - \if\pgfkeyscasenumber3% - \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP - \else - \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP - \fi - \ifpgfkeyssuccess - \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% - \else% Ok, it does not belong to any family. - % the 'is descendendant of' implementation has been - % COPY PASTED here: - % - % string prefix comparison: - \def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{% - \def\pgfkeyspred@TMP{##1}% - \ifx\pgfkeyspred@TMP\pgfkeys@empty - \pgfkeysfiltercontinuetrue - \else - \pgfkeysfiltercontinuefalse - \fi - }% - \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov - \fi - \fi - }, - % - % Processes only options which are childs of #1. - % Example: - % is descendant of/.install key filter=/foo - % will be true for - % /foo/bar/x=y - % /foo/.cd - % /foo/bar/.style=... - % but not for - % /bar/foo/... - /pgf/key filters/is descendant of/.code={% - \if\pgfkeyscasenumber0% + /errors/family unknown/.code=\pgfkeys@error{% + Sorry, I do not know family '#1' and can't work with any assoicated family handling. Perhaps you misspelled it?}, + /errors/no such key filter/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter '#1'.}, + /errors/no such key filter handler/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter handler '#1'.}, + % HANDLERS: + % + % .is family should + % 1. '.cd' into the families' path, + % 2. define booleans to activate/deactive the family + % (see \pgfkeysisfamilyactive) + % 3. make sure that \pgfkeyshasactivefamily returns true for + % the family itself. + /handlers/.is family/.append code={% + %\newif is an \outer macro in plain tex, so this here is not portable: + %\expandafter\newif\csname if\pgfkeyscurrentpath/familyactive\endcsname + \edef\pgfkeyspred@TMP{pgfk@\pgfkeyscurrentpath/familyactive}% + \expandafter\pgfkeys@non@outer@newif\expandafter{\pgfkeyspred@TMP}% + \edef\pgfkeyspred@TMP{\pgfkeyscurrentpath/.belongs to family=\pgfkeyscurrentpath}% + \expandafter\pgfkeysalso\expandafter{\pgfkeyspred@TMP}% + },% + /handlers/.activate family/.code=\pgfkeysactivatefamily{\pgfkeyscurrentpath}, + /handlers/.deactivate family/.code=\pgfkeysdeactivatefamily{\pgfkeyscurrentpath}, + /handlers/.belongs to family/.code={\pgfkeyssetfamily{\pgfkeyscurrentpath}{#1}},% + % + % + % An addition to the '.try' and '.retry' handlers: + % + % It is the same as '.retry', but if the option is still unknown, the + % usual handlers for unknown keys will be invoked. + /handlers/.lastretry/.code={% + \ifpgfkeyssuccess\else + \pgfkeys@try + \ifpgfkeyssuccess\else + % discard the '.lastretry' suffix: + \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% + \pgfkeys@split@path% + \pgfkeys@unknown + \fi + \fi + }, + % + % + /handlers/.install key filter/.code={% + \pgfkeysinstallkeyfilter{\pgfkeyscurrentpath}{#1}% + },% + /handlers/.install key filter handler/.code={% + \pgfkeysinstallkeyfilterhandler{\pgfkeyscurrentpath}{#1}% + },% + % + % + % KEY FILTER HANDLERS: + % + /pgf/key filter handlers/append filtered to/.code={% + % Produce + % <orig key> '={' <value> '}' + % where both, the key and the value are expanded just ONCE: + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentkeyRAW\expandafter=\expandafter{\pgfkeyscurrentvalue}}% + \ifx#1\pgfkeys@empty + \else + % Produce <old list> ',' <orig key> '={' <value> '}' + \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter,\the\pgfkeys@tmptoks}% + \fi + \edef#1{\the\pgfkeys@tmptoks}% + },% + /pgf/key filter handlers/ignore/.code={}, + /pgf/key filter handlers/ignore/.install key filter handler, + /pgf/key filter handlers/log/.code={% + \pgf@typeout{LOG: the option '\pgfkeyscurrentkey' (was originally '\pgfkeyscurrentkeyRAW') (case \pgfkeyscasenumber) has not been processed due to pgfkeysfiltered.}% + }, + % + % + % KEY FILTER PREDICATES: + % + % Returns true if the currently processed key belongs to an active family. + % A family is active if it has been activated before. + /pgf/key filters/active families/.code={% + \if\pgfkeyscasenumber0% + % unknown options shall be processed with the + % unknown-handlers. + \pgfkeysfiltercontinuetrue + \else + \if\pgfkeyscasenumber3% + \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP + \else + \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP + \fi + \ifpgfkeyssuccess + \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% + \else% Ok, it does not belong to any family. + \pgfkeysfiltercontinuefalse + \fi + \fi + },% + % + % + % + % This filter works as follows: + % 1. if the current key belongs to a family: + % return whether its family is active, + % 2. if the current key does NOT belong to a family: + % return the result of criterion '#1', + % 3. the current key is unknown: + % return the result of criterion '#2'. + % + % Arguments: + % #1: the predicate which will be invoked in case 2. + % It will be invoked with the current case number as argument. + % #2: the predicate which will be invoked in case 3 with + % the current case number as argument. + /pgf/key filters/active families or no family/.code 2 args={% + \if\pgfkeyscasenumber0% + \pgfkeysevalkeyfilterwith{#2}% + \else + \if\pgfkeyscasenumber3% + \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP + \else + \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP + \fi + \ifpgfkeyssuccess + \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% + \else% Ok, it does not belong to any family. + \pgfkeysevalkeyfilterwith{#1}% + \fi + \fi + }, + /pgf/key filters/active families or no family DEBUG/.code 2 args={% + \if\pgfkeyscasenumber0% + \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking unknown handler '#2']}% + \pgfkeysevalkeyfilterwith{#2}% + \else + \if\pgfkeyscasenumber3% + \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP + \else + \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP + \fi + \ifpgfkeyssuccess + \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% + \ifpgfkeysfiltercontinue + \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is ACTIVE]}% + \else + \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is NOT active.]}% + \fi + \else% Ok, it does not belong to any family. + \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking has-no-family-handler '#1']}% + \pgfkeysevalkeyfilterwith{#1}% + \fi + \fi + }, + % + % A (faster) shortcut for + % /pgf/key filters/active families or no family= + % {/pgf/keys filters/false} + % {/pgf/keys filters/false} + /pgf/key filters/active families and known/.code={% + \if\pgfkeyscasenumber0% + \pgfkeysfiltercontinuefalse + \else + \if\pgfkeyscasenumber3% + \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP + \else + \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP + \fi + \ifpgfkeyssuccess + \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% + \else% Ok, it does not belong to any family. + \pgfkeysfiltercontinuefalse + \fi + \fi + }, + % A (faster) shortcut for + % /pgf/key filters/active families or no family= + % {/pgf/key filters/is descendant of=#1}% for keys without family + % {/pgf/keys filters/false} + /pgf/key filters/active families or descendants of/.code={% + \if\pgfkeyscasenumber0% + \pgfkeysfiltercontinuefalse + \else + \if\pgfkeyscasenumber3% + \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP + \else + \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP + \fi + \ifpgfkeyssuccess + \pgfkeysisfamilyactive{\pgfkeyspred@TMP}% + \else% Ok, it does not belong to any family. + % the 'is descendant of' implementation has been + % COPY PASTED here: + % + % string prefix comparison: + \def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{% + \def\pgfkeyspred@TMP{##1}% + \ifx\pgfkeyspred@TMP\pgfkeys@empty + \pgfkeysfiltercontinuetrue + \else + \pgfkeysfiltercontinuefalse + \fi + }% + \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov + \fi + \fi + }, + % + % Processes only options which are children of #1. + % Example: + % is descendant of/.install key filter=/foo + % will be true for + % /foo/bar/x=y + % /foo/.cd + % /foo/bar/.style=... + % but not for + % /bar/foo/... + /pgf/key filters/is descendant of/.code={% + \if\pgfkeyscasenumber0% %\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is UNKNOWN. Calling unknown handler.}% - % unknown options shall be processed with the - % unknown-handlers. - \pgfkeysfiltercontinuetrue - \else - % string prefix comparison: - % [ note : this has been COPY-PASTED to - % |active families or descendants of| ] - \def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{% - \def\pgfkeyspred@TMP{##1}% - \ifx\pgfkeyspred@TMP\pgfkeys@empty + % unknown options shall be processed with the + % unknown-handlers. + \pgfkeysfiltercontinuetrue + \else + % string prefix comparison: + % [ note : this has been COPY-PASTED to + % |active families or descendants of| ] + \def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{% + \def\pgfkeyspred@TMP{##1}% + \ifx\pgfkeyspred@TMP\pgfkeys@empty %\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is descendant of '#1': TRUE.}% - \pgfkeysfiltercontinuetrue - \else + \pgfkeysfiltercontinuetrue + \else %\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is descendant of '#1': FALSE.}% - \pgfkeysfiltercontinuefalse - \fi - }% - \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov - \fi - },% - % - % - % - % Returns true if the currently processed full key equals #2. - /pgf/key filters/equals/.code={% - \if\pgfkeyscasenumber0% - % Unknown option: - \pgfkeysfiltercontinuetrue - \else - \def\pgfkeyspred@TMP{#1}% - \ifx\pgfkeyscurrentkey\pgfkeyspred@TMP - \pgfkeysfiltercontinuetrue - \else - \pgfkeysfiltercontinuefalse - \fi - \fi - },% - % - % - % Argument #1 can be any other (evaluated) filter predicate, its logical return - % value will be inverted. - % Example: - % not/.install key filter={is descendend of=/tikz} - % will install a key filter which evaluates 'is descendant of' with argument '/tikz' and returns the logical negation of the result. - % - /pgf/key filters/not/.code={% - \pgfkeysevalkeyfilterwith{#1}% - \ifpgfkeysfiltercontinue - \pgfkeysfiltercontinuefalse - \else - \pgfkeysfiltercontinuetrue - \fi - },% - /pgf/key filters/and/.code 2 args={% - \pgfkeysevalkeyfilterwith{#1}% - \ifpgfkeysfiltercontinue - \pgfkeysevalkeyfilterwith{#2}% - \fi - },% - /pgf/key filters/or/.code 2 args={% - \pgfkeysevalkeyfilterwith{#1}% - \ifpgfkeysfiltercontinue - \else - \pgfkeysevalkeyfilterwith{#2}% - \fi - },% - /pgf/key filters/true/.code={\pgfkeysfiltercontinuetrue},% - /pgf/key filters/true/.install key filter, - /pgf/key filters/false/.code={% - \pgfkeysfiltercontinuefalse - },% - % - % Returns false if the current key is unknown, which avoids calling - % the unknown handlers. - /pgf/key filters/defined/.code={% - \if\pgfkeyscasenumber0% - \pgfkeysfiltercontinuefalse - \else - \pgfkeysfiltercontinuetrue - \fi - }, + \pgfkeysfiltercontinuefalse + \fi + }% + \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov + \fi + },% + % + % + % + % Returns true if the currently processed full key equals #2. + /pgf/key filters/equals/.code={% + \if\pgfkeyscasenumber0% + % Unknown option: + \pgfkeysfiltercontinuetrue + \else + \def\pgfkeyspred@TMP{#1}% + \ifx\pgfkeyscurrentkey\pgfkeyspred@TMP + \pgfkeysfiltercontinuetrue + \else + \pgfkeysfiltercontinuefalse + \fi + \fi + },% + % + % + % Argument #1 can be any other (evaluated) filter predicate, its logical return + % value will be inverted. + % Example: + % not/.install key filter={is descendant of=/tikz} + % will install a key filter which evaluates 'is descendant of' with argument + % '/tikz' and returns the logical negation of the result. + % + /pgf/key filters/not/.code={% + \pgfkeysevalkeyfilterwith{#1}% + \ifpgfkeysfiltercontinue + \pgfkeysfiltercontinuefalse + \else + \pgfkeysfiltercontinuetrue + \fi + },% + /pgf/key filters/and/.code 2 args={% + \pgfkeysevalkeyfilterwith{#1}% + \ifpgfkeysfiltercontinue + \pgfkeysevalkeyfilterwith{#2}% + \fi + },% + /pgf/key filters/or/.code 2 args={% + \pgfkeysevalkeyfilterwith{#1}% + \ifpgfkeysfiltercontinue + \else + \pgfkeysevalkeyfilterwith{#2}% + \fi + },% + /pgf/key filters/true/.code={\pgfkeysfiltercontinuetrue},% + /pgf/key filters/true/.install key filter, + /pgf/key filters/false/.code={% + \pgfkeysfiltercontinuefalse + },% + % + % Returns false if the current key is unknown, which avoids calling + % the unknown handlers. + /pgf/key filters/defined/.code={% + \if\pgfkeyscasenumber0% + \pgfkeysfiltercontinuefalse + \else + \pgfkeysfiltercontinuetrue + \fi + }, }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -779,192 +780,192 @@ % but it applies filtering whenever it identified the type of an % option. \def\pgfkeys@case@one@filtered{% - \pgfkeys@cur@is@descendant@of@errors - \ifpgfkeysfiltercontinue - \pgfkeys@orig@case@one - \else - \pgfkeysfiltercontinuetrue - \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{% - % CASE ONE: a command option - \def\pgfkeyscasenumber{1}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue + \pgfkeys@cur@is@descendant@of@errors + \ifpgfkeysfiltercontinue + \pgfkeys@orig@case@one + \else + \pgfkeysfiltercontinuetrue + \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{% + % CASE ONE: a command option + \def\pgfkeyscasenumber{1}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue %\message{PROCESSING KEY \pgfkeyscurrentkey!}% - \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}% - \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov - \else + \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}% + \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov + \else %\message{FILTERED OUT KEY \pgfkeyscurrentkey!}% - \pgfkeys@filtered@handler% - \fi - }{% - % CASE TWO: a normal value option - \pgfkeysifdefined{\pgfkeyscurrentkey}{% - \def\pgfkeyscasenumber{2}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue + \pgfkeys@filtered@handler% + \fi + }{% + % CASE TWO: a normal value option + \pgfkeysifdefined{\pgfkeyscurrentkey}{% + \def\pgfkeyscasenumber{2}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue %\message{PROCESSING KEY \pgfkeyscurrentkey!}% - \pgfkeys@case@two@extern - \else -%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}% - \pgfkeys@filtered@handler% - \fi - }{% - \pgfkeys@split@path - % CASE THREE: a handler - \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{% - \pgfkeys@ifexecutehandler{% - \def\pgfkeyscasenumber{3}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue + \pgfkeys@case@two@extern + \else +%\message{FILTERED OUT KEY \pgfkeyscurrentkey!}% + \pgfkeys@filtered@handler% + \fi + }{% + \pgfkeys@split@path + % CASE THREE: a handler + \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{% + \pgfkeys@ifexecutehandler{% + \def\pgfkeyscasenumber{3}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue %\message{PROCESSING KEY \pgfkeyscurrentkey!}% - \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}% - \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov - \else + \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}% + \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov + \else %\message{FILTERED OUT KEY \pgfkeyscurrentkey!}% - \pgfkeys@filtered@handler% - \fi - }{% - \pgfkeys@unknown - }% - }{% - \pgfkeys@unknown - }% - }% - }% - \fi + \pgfkeys@filtered@handler% + \fi + }{% + \pgfkeys@unknown + }% + }{% + \pgfkeys@unknown + }% + }% + }% + \fi }% \def\pgfkeys@unknown@filtered{% - % CASE ZERO: an unknown option. - \def\pgfkeyscasenumber{0}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue + % CASE ZERO: an unknown option. + \def\pgfkeyscasenumber{0}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue %\message{PROCESSING KEY \pgfkeyscurrentkey!}% - % start normal 'unknown' handlers: - \pgfkeys@orig@unknown - \else -%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}% - \pgfkeys@filtered@handler% - \fi + % start normal 'unknown' handlers: + \pgfkeys@orig@unknown + \else +%\message{FILTERED OUT KEY \pgfkeyscurrentkey!}% + \pgfkeys@filtered@handler% + \fi } % Does the same as \pgfkeys@try, but it also invokes the key filters. \def\pgfkeys@try@filtered{% - \ifpgfkeysfiltercontinue - \pgfkeys@orig@try - \else - \pgfkeysfiltercontinuetrue - \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% make sure that \pgfkeys@code doesn't know about 'try'. Important for .is choice - \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value - \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}% - {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}} - {}% no default, so leave it - \fi% - \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}% - {% - % CASE ONE: a command option - \def\pgfkeyscasenumber{1}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue - \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}% - \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov% - \else - \pgfkeys@filtered@handler% - \fi - \pgfkeyssuccesstrue% - }% - {% - \pgfkeysifdefined{\pgfkeyscurrentpath}% - {% CASE TWO: a normal value option - \def\pgfkeyscasenumber{2}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue - \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% - \pgfkeysvalueof{\pgfkeyscurrentpath}% - \else% - \pgfkeyslet{\pgfkeyscurrentpath}\pgfkeyscurrentvalue% - \fi% - \else - \pgfkeys@filtered@handler% - \fi - \pgfkeyssuccesstrue% - }% - {% - \pgfkeys@split@path% - \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{% - % CASE THREE: a handled key - % - % in the standard configuration, this check here is redundand - % because pgfkeys@ifexecutehandler === true. - % It is only interesting for 'handle only existing'. - \pgfkeys@ifexecutehandler{% - \def\pgfkeyscasenumber{3}% - \pgfkeys@key@predicate% - \ifpgfkeysfiltercontinue + \ifpgfkeysfiltercontinue + \pgfkeys@orig@try + \else + \pgfkeysfiltercontinuetrue + \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% make sure that \pgfkeys@code doesn't know about 'try'. Important for .is choice + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value + \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}% + {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}} + {}% no default, so leave it + \fi% + \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}% + {% + % CASE ONE: a command option + \def\pgfkeyscasenumber{1}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue + \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}% + \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov% + \else + \pgfkeys@filtered@handler% + \fi + \pgfkeyssuccesstrue% + }% + {% + \pgfkeysifdefined{\pgfkeyscurrentpath}% + {% CASE TWO: a normal value option + \def\pgfkeyscasenumber{2}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue + \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% + \pgfkeysvalueof{\pgfkeyscurrentpath}% + \else% + \pgfkeyslet{\pgfkeyscurrentpath}\pgfkeyscurrentvalue% + \fi% + \else + \pgfkeys@filtered@handler% + \fi + \pgfkeyssuccesstrue% + }% + {% + \pgfkeys@split@path% + \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{% + % CASE THREE: a handled key + % + % in the standard configuration, this check here is redundant + % because pgfkeys@ifexecutehandler === true. + % It is only interesting for 'handle only existing'. + \pgfkeys@ifexecutehandler{% + \def\pgfkeyscasenumber{3}% + \pgfkeys@key@predicate% + \ifpgfkeysfiltercontinue %\message{PROCESSING KEY \pgfkeyscurrentkey!}% - \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}% - \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov - \else + \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}% + \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov + \else %\message{FILTERED OUT KEY \pgfkeyscurrentkey!}% - \pgfkeys@filtered@handler% - \fi - \pgfkeyssuccesstrue% - }{% - \pgfkeyssuccessfalse - }% - }{% - \pgfkeyssuccessfalse - }% - }% - }% - \fi + \pgfkeys@filtered@handler% + \fi + \pgfkeyssuccesstrue% + }{% + \pgfkeyssuccessfalse + }% + }{% + \pgfkeyssuccessfalse + }% + }% + }% + \fi } % #1 the code to invoke after init and before cleanup \long\def\pgfkeys@install@filter@and@invoke#1{% - \ifpgfkeysfilteringisactive - \pgfkeys@error{Sorry, nested calls to key filtering routines are not allowed. (reason: It is not possible to properly restore the previous filtering state after returning from the nested call)}% - \fi - \pgfkeysfilteringisactivetrue - \let\pgfkeys@case@one=\pgfkeys@case@one@filtered - \let\pgfkeys@try=\pgfkeys@try@filtered - \let\pgfkeys@unknown=\pgfkeys@unknown@filtered - #1% - \let\pgfkeys@case@one=\pgfkeys@orig@case@one - \let\pgfkeys@try=\pgfkeys@orig@try - \let\pgfkeys@unknown=\pgfkeys@orig@unknown - \pgfkeysfilteringisactivefalse + \ifpgfkeysfilteringisactive + \pgfkeys@error{Sorry, nested calls to key filtering routines are not allowed. (reason: It is not possible to properly restore the previous filtering state after returning from the nested call)}% + \fi + \pgfkeysfilteringisactivetrue + \let\pgfkeys@case@one=\pgfkeys@case@one@filtered + \let\pgfkeys@try=\pgfkeys@try@filtered + \let\pgfkeys@unknown=\pgfkeys@unknown@filtered + #1% + \let\pgfkeys@case@one=\pgfkeys@orig@case@one + \let\pgfkeys@try=\pgfkeys@orig@try + \let\pgfkeys@unknown=\pgfkeys@orig@unknown + \pgfkeysfilteringisactivefalse } %-------------------------------------------------- % \def\pgfkeys@eval@key@filter@subroutine@case@one{% -% \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{% -% \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}% -% \let\pgfkeyspred@TMP=\pgfkeyscurrentvalue -% \pgfkeys@eval@key@filter@subroutine@restorestate -% \expandafter\pgfkeys@code\pgfkeyspred@TMP\pgfeov -% }{% -% \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyscurrentkey\pgfkeyscurrentvalue\pgfeov% -% }% +% \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{% +% \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}% +% \let\pgfkeyspred@TMP=\pgfkeyscurrentvalue +% \pgfkeys@eval@key@filter@subroutine@restorestate +% \expandafter\pgfkeys@code\pgfkeyspred@TMP\pgfeov +% }{% +% \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyscurrentkey\pgfkeyscurrentvalue\pgfeov% +% }% % } % % THIS VERSION IS TOO SLOW. See below. % \def\pgfkeysevalkeyfilterwith#1{% -% \edef\pgfkeys@eval@key@filter@subroutine@restorestate{% -% \noexpand\def\noexpand\pgfkeyscurrentkey{\pgfkeyscurrentkey}% -% \noexpand\def\noexpand\pgfkeyscurrentkeyRAW{\pgfkeyscurrentkeyRAW}% -% \noexpand\def\noexpand\pgfkeyscurrentname{\pgfkeyscurrentname}% -% \noexpand\def\noexpand\pgfkeyscurrentvalue{\pgfkeyscurrentvalue}% -% \noexpand\pgfkeys@pathtoks={\pgfkeyscurrentpath}% -% }% -% \pgfkeysinterruptkeyfilter -% \let\pgfkeys@case@one=\pgfkeys@eval@key@filter@subroutine@case@one -% \pgfkeysalso{#1}% -% \endpgfkeysinterruptkeyfilter% this here also restored \pgfkeys@case@one. -% \pgfkeys@eval@key@filter@subroutine@restorestate +% \edef\pgfkeys@eval@key@filter@subroutine@restorestate{% +% \noexpand\def\noexpand\pgfkeyscurrentkey{\pgfkeyscurrentkey}% +% \noexpand\def\noexpand\pgfkeyscurrentkeyRAW{\pgfkeyscurrentkeyRAW}% +% \noexpand\def\noexpand\pgfkeyscurrentname{\pgfkeyscurrentname}% +% \noexpand\def\noexpand\pgfkeyscurrentvalue{\pgfkeyscurrentvalue}% +% \noexpand\pgfkeys@pathtoks={\pgfkeyscurrentpath}% +% }% +% \pgfkeysinterruptkeyfilter +% \let\pgfkeys@case@one=\pgfkeys@eval@key@filter@subroutine@case@one +% \pgfkeysalso{#1}% +% \endpgfkeysinterruptkeyfilter% this here also restored \pgfkeys@case@one. +% \pgfkeys@eval@key@filter@subroutine@restorestate % }% -%-------------------------------------------------- +%-------------------------------------------------- % Evaluates a key filter '#1'. Example: @@ -977,40 +978,40 @@ % % The implementation employs a subset of the \pgfkeysalso code. \long\def\pgfkeysevalkeyfilterwith#1{% - \pgfkeys@eval@key@filter@subroutine@unpack#1=\pgfkeysnovalue=\pgfkeys@stop + \pgfkeys@eval@key@filter@subroutine@unpack#1=\pgfkeysnovalue=\pgfkeys@stop }% \long\def\pgfkeys@eval@key@filter@subroutine@unpack#1=#2=#3\pgfkeys@stop{% - \pgfkeys@spdef\pgfkeyspred@TMP{#1}% - \edef\pgfkeyspred@TMP{\pgfkeyspred@TMP}% - \pgfkeys@spdef\pgfkeyspred@TMPB{#2}% TMPB=value - \ifx\pgfkeyspred@TMPB\pgfkeysnovalue@text% Hmm... no value - \pgfkeysifdefined{\pgfkeyspred@TMP/.@def}% - {\pgfkeysgetvalue{\pgfkeyspred@TMP/.@def}{\pgfkeyspred@TMPB}} - {}% no default, so leave it - \fi% - \ifx\pgfkeyspred@TMPB\pgfkeysvaluerequired% - \pgfkeysvalueof{/errors/value required/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov% - \else% - \pgfkeysifdefined{\pgfkeyspred@TMP/.@cmd}{% - \pgfkeysgetvalue{\pgfkeyspred@TMP/.@cmd}{\pgfkeys@code}% - \expandafter\pgfkeys@code\pgfkeyspred@TMPB\pgfeov - }{% - \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov% - }% - \fi% + \pgfkeys@spdef\pgfkeyspred@TMP{#1}% + \edef\pgfkeyspred@TMP{\pgfkeyspred@TMP}% + \pgfkeys@spdef\pgfkeyspred@TMPB{#2}% TMPB=value + \ifx\pgfkeyspred@TMPB\pgfkeysnovalue@text% Hmm... no value + \pgfkeysifdefined{\pgfkeyspred@TMP/.@def}% + {\pgfkeysgetvalue{\pgfkeyspred@TMP/.@def}{\pgfkeyspred@TMPB}} + {}% no default, so leave it + \fi% + \ifx\pgfkeyspred@TMPB\pgfkeysvaluerequired% + \pgfkeysvalueof{/errors/value required/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov% + \else% + \pgfkeysifdefined{\pgfkeyspred@TMP/.@cmd}{% + \pgfkeysgetvalue{\pgfkeyspred@TMP/.@cmd}{\pgfkeys@code}% + \expandafter\pgfkeys@code\pgfkeyspred@TMPB\pgfeov + }{% + \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov% + }% + \fi% } \def\pgfkeys@non@outer@newif@#1#2{% - \expandafter\edef\csname #2true\endcsname{\noexpand\let\noexpand#1=\noexpand\iftrue}% - \expandafter\edef\csname #2false\endcsname{\noexpand\let\noexpand#1=\noexpand\iffalse}% - \csname #2false\endcsname + \expandafter\edef\csname #2true\endcsname{\noexpand\let\noexpand#1=\noexpand\iftrue}% + \expandafter\edef\csname #2false\endcsname{\noexpand\let\noexpand#1=\noexpand\iffalse}% + \csname #2false\endcsname }% % For latex and context, this here has the same effect as a \newif % applied to 'if#1'. For plain tex, it has also the same effect, but % it is not an \outer macro as the plain-tex \newif. \def\pgfkeys@non@outer@newif#1{% - \expandafter\pgfkeys@non@outer@newif@\csname if#1\endcsname{#1}% + \expandafter\pgfkeys@non@outer@newif@\csname if#1\endcsname{#1}% } \endinput 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 58fa5b0ef74..456e3b0c2db 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex @@ -44,9 +44,12 @@ \edef\pgfrcsatcode{\the\catcode`\@} \catcode`\@=11 - % not used in PGF, deprecated -\def\ProvidesFileRCS#1{% +\def\ProvidesFileRCS{% + \let\pgfrcs@final=\ProvidesFileRCS@ + \pgfrcs@parseinput +} +\def\ProvidesFileRCS@#1{% \ProvidesFile{#1}[\pgfversiondate\space v\pgfversion\space(\pgfrevision)]% } @@ -54,19 +57,74 @@ \def\pgfretval{#1}% }% -\def\ProvidesPackageRCS#1{% +\def\ProvidesPackageRCS{% + \let\pgfrcs@final=\ProvidesPackageRCS@ + \pgfrcs@parseinput +} +\def\ProvidesPackageRCS@#1{% \pgf@remove@ext#1.\relax \edef\pgfrcs@marshal{{\pgfretval}[\pgfversiondate\space v\pgfversion\space(\pgfrevision)]}% \expandafter\ProvidesPackage\pgfrcs@marshal } % not used in PGF, deprecated -\def\ProvidesClassRCS#1{% +\def\ProvidesClassRCS{% + \let\pgfrcs@final=\ProvidesClassRCS@ + \pgfrcs@parseinput +} +\def\ProvidesClassRCS@#1{% \pgf@remove@ext#1.\relax \edef\pgfrcs@marshal{{\pgfretval}[\pgfversiondate\space v\pgfversion\space(\pgfrevision)]}% \expandafter\ProvidesClass\pgfrcs@marshal } +\def\pgfrcs@parseinput@bracket{[}% +\def\pgfrcs@parseinput@dollarsign{$}% + +\def\pgfrcs@parseinput#1{% + \def\pgfrcs@parseinput@{#1}% + \ifx\pgfrcs@parseinput@\pgfrcs@parseinput@bracket% + % still accept it if someone has written his own pgfrcs files with headers of sorts + % \ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.7 2010/04/11 07:09:19 username Exp $ + \let\next=\pgfrcs@parseinput@opt + \else + \ifx\pgfrcs@parseinput@\pgfrcs@parseinput@dollarsign + % still accept it if someone has written his own pgfrcs files with headers of sorts + % \ProvidesPackageRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.7 2010/04/11 07:09:19 username Exp $ + \let\next\pgfrcs@parseinput@dollar + \else + % the new, normal pgf-way is \ProvidesPackageRCS{pgfcore.code.tex} + \def\next{\pgfrcs@final{#1}}% + \fi + \fi + \next +} +\def\pgfrcs@parseinput@opt#1] ${% + % just backwards compatibility -- ignore the information, but parse the input tokens: + \pgfrcs@parseinput@dollar +}% +\def\pgfrcs@parseinput@dollar#1${% + \pgf@parseid $#1$% + % we ignore pretty much everything except for the file name: + \edef\pgfrcs@parseinput@{\pgf@rcsfile.\pgf@rcssuffix}% + \expandafter\pgfrcs@final\expandafter{\pgfrcs@parseinput@}% +}% +% Get date and version from RCS Ids +\def\pgf@parseid $#1: #2.#3,v #4 #5/#6/#7 #8${% + \pgf@parsercsfile$#2/$ + \def\pgf@rcssuffix{#3} + \def\pgf@rcsrevision{#4} + \def\pgf@rcsdate{#5/#6/#7} +} +\def\pgf@parsercsfile$#1/#2${ + \def\pgf@temp{#2} + \ifx\pgf@temp\pgfutil@empty + \def\pgf@rcsfile{#1} + \else + \pgf@parsercsfile$#2$ + \fi} + + \ifx\ProvidesPackage\@undefined % plain tex \def\ProvidesPackage#1[#2]{\wlog{Loading package #1 version #2.}} 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 26529cd5e37..d3b817a00f1 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 @@ -13,147 +13,147 @@ % the PGF system layer. % It employs two collect-buffers to reduce the runtime. % -% - It has preasymptotical runtime O(N), but is O(N^2) asymptotically. +% - It has pre-asymptotical runtime O(N), but is O(N^2) asymptotically. % - It requires only 5 macros per list. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Usage: +% Usage: % \pgfapplistnewempty\macro \def\pgfapplistnewempty#1{% - \expandafter\let\csname pgfapp@#1\endcsname=\pgfutil@empty - \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% - \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% + \expandafter\let\csname pgfapp@#1\endcsname=\pgfutil@empty + \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% + \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% }% % #1: the item to append % #2: the list as macro name \long\def\pgfapplistpushback#1\to#2{% - \begingroup - \c@pgf@counta=\csname pgfapp@#2@smallbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfapp@#2@smallbuf@c\endcsname=\pgf@glob@TMPa - \ifnum\csname pgfapp@#2@smallbuf@c\endcsname<40 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% - \expandafter\edef\csname pgfapp@#2@smallbuf\endcsname{\the\t@pgf@toka}% - \else - \pgfapplistpushback@smallbufoverfl{#1}{#2}% - \fi + \begingroup + \c@pgf@counta=\csname pgfapp@#2@smallbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfapp@#2@smallbuf@c\endcsname=\pgf@glob@TMPa + \ifnum\csname pgfapp@#2@smallbuf@c\endcsname<40 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% + \expandafter\edef\csname pgfapp@#2@smallbuf\endcsname{\the\t@pgf@toka}% + \else + \pgfapplistpushback@smallbufoverfl{#1}{#2}% + \fi }% \long\def\pgfapplistpushback@smallbufoverfl#1#2{% - \begingroup - \c@pgf@counta=\csname pgfapp@#2@bigbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfapp@#2@bigbuf@c\endcsname=\pgf@glob@TMPa - % - \ifnum\csname pgfapp@#2@bigbuf@c\endcsname<30 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% - \expandafter\edef\csname pgfapp@#2@bigbuf\endcsname{\the\t@pgf@toka\the\t@pgf@tokb}% - \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% - \else% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% - \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% - \expandafter\edef\csname pgfapp@#2\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% - \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% - \expandafter\let\csname pgfapp@#2@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#2@bigbuf@c\endcsname{0}% - \fi% + \begingroup + \c@pgf@counta=\csname pgfapp@#2@bigbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfapp@#2@bigbuf@c\endcsname=\pgf@glob@TMPa + % + \ifnum\csname pgfapp@#2@bigbuf@c\endcsname<30 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% + \expandafter\edef\csname pgfapp@#2@bigbuf\endcsname{\the\t@pgf@toka\the\t@pgf@tokb}% + \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% + \else% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% + \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% + \expandafter\edef\csname pgfapp@#2\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% + \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% + \expandafter\let\csname pgfapp@#2@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#2@bigbuf@c\endcsname{0}% + \fi% }% \def\pgfapplist@flushbuffers#1{% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#1\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#1@bigbuf\endcsname}% - \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#1@smallbuf\endcsname}% - \expandafter\edef\csname pgfapp@#1\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% - \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% - \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#1\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#1@bigbuf\endcsname}% + \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#1@smallbuf\endcsname}% + \expandafter\edef\csname pgfapp@#1\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% + \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% + \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% }% \def\pgfapplistlet#1=#2{% - \pgfapplist@flushbuffers{#2}% - \expandafter\let\expandafter#1\csname pgfapp@#2\endcsname + \pgfapplist@flushbuffers{#2}% + \expandafter\let\expandafter#1\csname pgfapp@#2\endcsname }% - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% +% % A variant of applist which has the same runtime requirements, but % does PUSH FRONT only. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Usage: +% Usage: % \pgfprependlistnewempty{list} \def\pgfprependlistnewempty#1{% - \expandafter\let\csname pgfpPRP@#1\endcsname=\pgfutil@empty - \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% - \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% + \expandafter\let\csname pgfpPRP@#1\endcsname=\pgfutil@empty + \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% + \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% }% % #1: the item to append % #2: the list as macro name \long\def\pgfprependlistpushfront#1\to#2{% - \begingroup - \c@pgf@counta=\csname pgfpPRP@#2@smallbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfpPRP@#2@smallbuf@c\endcsname=\pgf@glob@TMPa - \ifnum\csname pgfpPRP@#2@smallbuf@c\endcsname<40 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% - \t@pgf@tokb={#1}% - \expandafter\edef\csname pgfpPRP@#2@smallbuf\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% - \else - \pgfprependlistpushfront@smallbufoverfl{#1}{#2}% - \fi + \begingroup + \c@pgf@counta=\csname pgfpPRP@#2@smallbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfpPRP@#2@smallbuf@c\endcsname=\pgf@glob@TMPa + \ifnum\csname pgfpPRP@#2@smallbuf@c\endcsname<40 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% + \t@pgf@tokb={#1}% + \expandafter\edef\csname pgfpPRP@#2@smallbuf\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% + \else + \pgfprependlistpushfront@smallbufoverfl{#1}{#2}% + \fi }% \long\def\pgfprependlistpushfront@smallbufoverfl#1#2{% - \begingroup - \c@pgf@counta=\csname pgfpPRP@#2@bigbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfpPRP@#2@bigbuf@c\endcsname=\pgf@glob@TMPa - % - \ifnum\csname pgfpPRP@#2@bigbuf@c\endcsname<30 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@bigbuf\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% - \t@pgf@tokc={#1}% - \expandafter\edef\csname pgfpPRP@#2@bigbuf\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% - \expandafter\let\csname pgfpPRP@#2@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#2@smallbuf@c\endcsname{0}% - \else% - \pgfprependlist@flushbuffers{#2}% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2\endcsname}% - \t@pgf@tokb={#1}% - \expandafter\edef\csname pgfpPRP@#2\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% - \fi% + \begingroup + \c@pgf@counta=\csname pgfpPRP@#2@bigbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfpPRP@#2@bigbuf@c\endcsname=\pgf@glob@TMPa + % + \ifnum\csname pgfpPRP@#2@bigbuf@c\endcsname<30 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@bigbuf\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% + \t@pgf@tokc={#1}% + \expandafter\edef\csname pgfpPRP@#2@bigbuf\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% + \expandafter\let\csname pgfpPRP@#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#2@smallbuf@c\endcsname{0}% + \else% + \pgfprependlist@flushbuffers{#2}% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2\endcsname}% + \t@pgf@tokb={#1}% + \expandafter\edef\csname pgfpPRP@#2\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% + \fi% }% \def\pgfprependlist@flushbuffers#1{% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@bigbuf\endcsname}% - \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@smallbuf\endcsname}% - \expandafter\edef\csname pgfpPRP@#1\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% - \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% - \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@bigbuf\endcsname}% + \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@smallbuf\endcsname}% + \expandafter\edef\csname pgfpPRP@#1\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% + \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% + \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% }% \def\pgfprependlistlet#1=#2{% - \pgfprependlist@flushbuffers{#2}% - \expandafter\let\expandafter#1\csname pgfpPRP@#2\endcsname + \pgfprependlist@flushbuffers{#2}% + \expandafter\let\expandafter#1\csname pgfpPRP@#2\endcsname }% 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 b2f55e82923..d3d8c59daa2 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex @@ -8,8 +8,8 @@ % See the file doc/generic/pgf/licenses/LICENSE for more details. -% -% This file provides utitiliy commands that are used throughout pgf. +% +% This file provides utility commands that are used throughout pgf. % % For most commands, the definition of these commands is just given % below. We cannot use the LaTeX definition of these commands since @@ -20,7 +20,7 @@ % context) is to be preferred over the generic definition below. In % this case, the definition of the format is installed when the file % pgfutil-XXXX.tex is read, where XXXX is the format name (latex, -% plain, or context). +% plain, or context). @@ -70,6 +70,9 @@ } \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{} \def\pgfutil@gobble@until@relax#1\relax{} @@ -238,12 +241,12 @@ % Include a library file. % % #1 = List of names of library file. -% +% % Description: % % This command includes a list of library files. For each file X in the % list, the file pgflibraryX.code.tex is included, provided this has -% not been done earlier. +% not been done earlier. % % For the convenience of Context users, both round and square brackets % are possible for the argument. @@ -273,7 +276,7 @@ \pgferror{I did not find the pgf library '\pgf@temp'. I looked for the file named pgflibrary\pgf@temp.code.tex, but could not find it in in - the current texmf trees.} + the current texmf trees.} }% \catcode`\@=\csname pgf@library@#1@atcode\endcsname \catcode`\|=\csname pgf@library@#1@barcode\endcsname @@ -287,12 +290,12 @@ % Include a module file. % % #1 = List of names of module files. -% +% % Description: % % This command includes a list of module files. For each file X in the % list, the file pgfmoduleX.code.tex is included, provided this has -% not been done earlier. +% not been done earlier. % % For the convenience of Context users, both round and square brackets % are possible for the argument. @@ -340,7 +343,7 @@ % If '#1' is a usual file name without anything fancy, \pgfretval % will simply contain it. However, if '#1' contains double colons % (introduces, for example, by pdftex because there are white - % spaces in '#1'), the routine + % spaces in '#1'), the routine % - removes the double colons, % - re-inserts them outside of the string. % @@ -434,7 +437,7 @@ \def\pgfretval{####1}% }% \pgfutil@tmp#2\pgf@EOI% - % + % % ... and execute the <true> code: #3\relax% \else @@ -475,7 +478,7 @@ % Solves a linear equation system of size 2x2 using gauss elimination. % % It employs TeX register arithmetics to do so. -% #1: should contain 4 sets of braces with matrix entries, +% #1: should contain 4 sets of braces with matrix entries, % {<a11>}{<a12>} % {<a21>}{<a22>} % where each entry should be a number without unit. @@ -538,7 +541,7 @@ {\csname m\Pa a\endcsname}% \let\pivot=\pgfmathresult % - % \factor := 1/aa * ba + % \factor := 1/aa * ba \csname \Pb a\endcsname=\pivot\csname \Pb a\endcsname \edef\factor{\expandafter\pgf@sys@tonumber\csname \Pb a\endcsname}% % @@ -658,7 +661,7 @@ \expandafter\pgfmathfloatreciprocal@\expandafter{\csname m\Pa a\endcsname}% \let\pivot=\pgfmathresult % - % \factor := 1/aa * ba + % \factor := 1/aa * ba \expandafter\pgfmathfloatmultiply@\expandafter{\csname m\Pb a\endcsname}{\pivot}% \let\factor=\pgfmathresult \expandafter\let\csname m\Pb a\endcsname=\factor @@ -746,7 +749,7 @@ % Used by latex for doing reruns % #1 = an internal label -% #2 = a to-be-tested text +% #2 = a to-be-tested text \def\pgfutil@check@rerun#1#2{} % new tempdims: @@ -797,9 +800,18 @@ % End of luatex stuff +% \pgfutil@scantokens +% +% This is either the \scantokens primitive or \relax +\pgfutil@IfUndefined{scantokens}{% + \long\def\pgfutil@scantokens#1{#1}% +}{% + \let\pgfutil@scantokens=\scantokens% +}% + % Advances a number stored in a macro and writes the result back into % the macro. -% #1 is a macro containing a number. +% #1 is a macro containing a number. \def\pgfutil@advancestringcounter#1{% \begingroup \c@pgf@counta=#1\relax 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 16ba0611783..e78655e9d09 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def @@ -292,48 +292,48 @@ \fi } - % The cmyk part is from Joseph Wright. - % See tex.stackexchange.com/questions/27952/cmyk-context-colors-in-tikz - \def\pgfutil@registercolor#1{% - \edef\pgf@temp{\PDFcolor{#1}}% - \edef\pgf@marshal{\noexpand\pgfutil@in@{rg}{\pgf@temp}}% - \pgf@marshal - \ifpgfutil@in@ - \expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}% - \else - \edef\pgf@marshal{\noexpand\pgfutil@in@{g}{\pgf@temp}}% - \pgf@marshal - \ifpgfutil@in@ - \expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}% - \else - \edef\pgf@marshal{\noexpand\pgfutil@in@{k}{\pgf@temp}}% - \pgf@marshal - \ifpgfutil@in@ - \expandafter\pgfutil@context@parse@cmyk\pgf@temp\pgf@stop{#1}% - \else - \pgferror{Color #1 has an unsupported color model.}% - \pgfutil@definecolor{#1}{gray}{0}% - \fi - \fi - \fi - } - - \def\pgfutil@context@parse@gray#1 g#2\pgf@stop#3{% - \pgfutil@definecolor{#3}{gray}{#1} - } - - \def\pgfutil@context@parse@rgb#1 #2 #3 rg#4\pgf@stop#5{% - \pgfutil@definecolor{#5}{rgb}{#1,#2,#3} - } - - \def\pgfutil@context@parse@cmyk#1 #2 #3 #4k#5\pgf@stop #6{% - \pgfutil@definecolor{#6}{cmyk}{#1,#2,#3,#4}% - } - - \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{% - \expandafter\def\csname\string\color@#1\endcsname - {\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}% - } + % The cmyk part is from Joseph Wright. + % See tex.stackexchange.com/questions/27952/cmyk-context-colors-in-tikz + \def\pgfutil@registercolor#1{% + \edef\pgf@temp{\PDFcolor{#1}}% + \edef\pgf@marshal{\noexpand\pgfutil@in@{rg}{\pgf@temp}}% + \pgf@marshal + \ifpgfutil@in@ + \expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}% + \else + \edef\pgf@marshal{\noexpand\pgfutil@in@{g}{\pgf@temp}}% + \pgf@marshal + \ifpgfutil@in@ + \expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}% + \else + \edef\pgf@marshal{\noexpand\pgfutil@in@{k}{\pgf@temp}}% + \pgf@marshal + \ifpgfutil@in@ + \expandafter\pgfutil@context@parse@cmyk\pgf@temp\pgf@stop{#1}% + \else + \pgferror{Color #1 has an unsupported color model.}% + \pgfutil@definecolor{#1}{gray}{0}% + \fi + \fi + \fi + } + + \def\pgfutil@context@parse@gray#1 g#2\pgf@stop#3{% + \pgfutil@definecolor{#3}{gray}{#1} + } + + \def\pgfutil@context@parse@rgb#1 #2 #3 rg#4\pgf@stop#5{% + \pgfutil@definecolor{#5}{rgb}{#1,#2,#3} + } + + \def\pgfutil@context@parse@cmyk#1 #2 #3 #4k#5\pgf@stop #6{% + \pgfutil@definecolor{#6}{cmyk}{#1,#2,#3,#4}% + } + + \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{% + \expandafter\def\csname\string\color@#1\endcsname + {\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}% + } \let\pgfutil@registerrgb \pgfutil@registercolor \let\pgfutil@registercmyk \pgfutil@registercolor @@ -355,4 +355,8 @@ \long\def\AtBeginDocument#1{#1}% +% pgfcalendar uses translations + +\def\pgfutil@translate#1{#1} % \translate works very different in ConTeXt + \endinput 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 aad781a60ef..f4c3ea92d3f 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def @@ -54,7 +54,7 @@ \else \let\pgf@next=\pgfutil@firstoftwo% \fi% - \pgf@next{#2}{#3}% + \pgf@next{#2}{#3}% } \let\pgfutil@raggedleft\raggedleft @@ -90,23 +90,23 @@ \def\pgfutil@check@rerun#1#2{\@newl@bel{pgf@lab}{#1}{#2}} -\AtBeginDocument{\AtEndDocument{\par\vfil\penalty-10000\relax\the\pgfutil@everybye}} +\AtBeginDocument{\AtEndDocument{\clearpage\the\pgfutil@everybye}} \def\pgfutil@insertatbegincurrentpagefrombox#1{% \edef\pgf@temp{\the\wd\pgfutil@abb}% \global\setbox\pgfutil@abb\hbox{% - \unhbox\pgfutil@abb% - % - % the order in which \pgfutil@insertatbegincurrentpagefrombox - % matters unless we make the following -shift! - % To see this, consider writing two such statements. The second - % one will (naturally) be placed more to the right, although there - % is no apparent reason why it should. - % - % CF observed problems when placing patterns in XObjects without - % this skip (dvipdfmx driver for pgfplots shader=interp) - \hskip-\pgf@temp\relax% - #1% + \unhbox\pgfutil@abb% + % + % the order in which \pgfutil@insertatbegincurrentpagefrombox + % matters unless we make the following -shift! + % To see this, consider writing two such statements. The second + % one will (naturally) be placed more to the right, although there + % is no apparent reason why it should. + % + % CF observed problems when placing patterns in XObjects without + % this skip (dvipdfmx driver for pgfplots shader=interp) + \hskip-\pgf@temp\relax% + #1% }% } \newbox\pgfutil@abb% @@ -124,40 +124,40 @@ % 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 - }% + % 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 + % ... 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: + \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. + %\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. }% } @@ -175,16 +175,23 @@ \fi }{}% } - + % Guess the driver: \def\pgfutil@guessdriver{ - \ifx\HCode\@undefined% + \ifx\HCode\@undefined% \edef\pgfsysdriver{pgfsys-\Gin@driver}% should be right \else% \def\pgfsysdriver{pgfsys-tex4ht.def}% should be right \fi% } +% pgfcalendar uses translations + +\ifx\translate\@undefined % check if \translate is available + \def\pgfutil@translate#1{\translate{#1}} +\else + \def\pgfutil@translate#1{#1} +\fi \endinput 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 3d7573f7071..f8e1e327991 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def @@ -51,7 +51,7 @@ \expandafter\pgfsys@outerinvoke\expandafter{\pgfsysprotocol@currentprotocol}% }% \pgfsysprotocol@setcurrentprotocol\pgfutil@emu@temp% - \aftergroup\pgfutil@reset@color% + \aftergroup\pgfutil@reset@color% } \def\pgfutil@extractcolorspec#1#2{% @@ -69,7 +69,7 @@ \else \let\pgf@next=\pgfutil@firstoftwo% \fi% - \pgf@next{#2}{#3}% + \pgf@next{#2}{#3}% } @@ -100,7 +100,7 @@ \edef\pgf@marshal{\noexpand\let\expandafter\noexpand\csname\string\color@#1\endcsname=% \expandafter\noexpand\csname\string\color@#2\endcsname}% \pgf@marshal% - \fi% + \fi% } \def\pgfutil@emu@mix#1!#2!#3!#4\@nil{% \expandafter\expandafter\expandafter\pgfutil@emu@unpack\csname\string\color@#1\endcsname% @@ -161,7 +161,7 @@ \def\pgfutil@guessdriver{ \ifx\directlua\@undefined - \ifx\HCode\@undefined% + \ifx\HCode\@undefined% \ifcase\pdfoutput% \ifx\XeTeXversion\@undefined \def\pgfsysdriver{pgfsys-dvips.def}% hopefully @@ -179,7 +179,7 @@ \fi } - + % Global colors @@ -247,18 +247,18 @@ \def\pgfutil@insertatbegincurrentpagefrombox#1{% \edef\pgf@temp{\the\wd\pgfutil@abb}% \global\setbox\pgfutil@abb\hbox{% - \unhbox\pgfutil@abb - % - % the order in which \pgfutil@insertatbegincurrentpagefrombox - % matters unless we make the following -shift! - % To see this, consider writing two such statements. The second - % one will (naturally) be placed more to the right, although there - % is no apparent reason why it should. - % - % CF observed problems when placing patterns in XObjects without - % this skip (dvipdfmx driver for pgfplots shader=interp) - \hskip-\pgf@temp\relax - #1% + \unhbox\pgfutil@abb + % + % the order in which \pgfutil@insertatbegincurrentpagefrombox + % matters unless we make the following -shift! + % To see this, consider writing two such statements. The second + % one will (naturally) be placed more to the right, although there + % is no apparent reason why it should. + % + % CF observed problems when placing patterns in XObjects without + % this skip (dvipdfmx driver for pgfplots shader=interp) + \hskip-\pgf@temp\relax + #1% }% } \newbox\pgfutil@abb% @@ -272,51 +272,55 @@ \let\pgfutil@abe\pgfutil@empty% % Code by Heiko Oberdiek on ctt -\input atbegshi.sty\relax -\AtBeginShipout{% - \setbox\AtBeginShipoutBox=\vbox{% - \setbox0=\hbox{% - \begingroup - % 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 - \endgroup - }% - \wd0=0pt\relax - \ht0=0pt\relax - \dp0=0pt\relax - % ... see remark above regarding \hoffset/\voffset: - \ifdim\voffset=0pt \else \vskip-\voffset\fi - \box0 % - \ifdim\voffset=0pt \else \vskip+\voffset\fi - \nointerlineskip - \box\AtBeginShipoutBox - }% -}% +\input atbegshi.sty\relax +\AtBeginShipout{% + \setbox\AtBeginShipoutBox=\vbox{% + \setbox0=\hbox{% + \begingroup + % 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 + \endgroup + }% + \wd0=0pt\relax + \ht0=0pt\relax + \dp0=0pt\relax + % ... see remark above regarding \hoffset/\voffset: + \ifdim\voffset=0pt \else \vskip-\voffset\fi + \box0 % + \ifdim\voffset=0pt \else \vskip+\voffset\fi + \nointerlineskip + \box\AtBeginShipoutBox + }% +}% % End of HO code % The following is still messy and needs to be cleanup up (everything -% prefixed by pgfutil@): +% prefixed by pgfutil@): %\def\PackageInfo#1#2{} %\def\PackageWarning#1#2{\immediate\write17{Package #1: Warning! #2.}}% %\def\PackageError#1#2#3{\immediate\write17{Package #1: Error! #2.}}% \long\def\AtBeginDocument#1{#1}% +% pgfcalendar uses translations + +\def\pgfutil@translate#1{#1} % is there a translator package for plain? + \endinput |