diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-28 20:57:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-28 20:57:36 +0000 |
commit | e752903a9ad1c74190305384230882402822846a (patch) | |
tree | 8d60a64b66091d1c8e34e5af76d413268603b25d /Master/texmf-dist/tex/generic/pgf/math | |
parent | c452dea4584e1a0650f1ba1f87262a85b511057c (diff) |
pgf (28sep20)
git-svn-id: svn://tug.org/texlive/trunk@56462 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math')
14 files changed, 70 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex index fb629421d54..7bfdf58a6c9 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Till Tantau +% Copyright 2019 by Till Tantau % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex index 58c51558c8a..bb4d1022e54 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -339,7 +339,7 @@ % \pgfmathpointreflectalongaxis % -% Reflects point #2 around an axis centered on #2 at an angle #3. +% Reflects point #1 around an axis centered on #2 at an angle #3. % \def\pgfmathreflectpointalongaxis#1#2#3{% \pgf@process{% diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex index bda29cb51b7..a3a36d82541 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex @@ -1,4 +1,4 @@ -% Copyright 2008 by Christian Feuersaenger +% Copyright 2019 by Christian Feuersaenger % % This file may be distributed and/or modified % @@ -1214,7 +1214,7 @@ fixed zerofill=false,% useless here! sci zerofill=false}% \ifx\pgfmathprintnumber@issci\pgfmathprintnumber@RELATIVE@issci - \pgfmath@error{The '/pgf/number format/every relative' style should set a valid display style}% + \pgfmath@error{The '/pgf/number format/every relative' style should set a valid display style}{}% \fi \let\pgfmathfloat@round@precision@orig=\pgfmathfloat@round@precision \def\pgfmathfloat@round@precision{9999}% @@ -1312,7 +1312,7 @@ % The numerator and denominator is always a number (not empty) \def\pgfmathfloatgetfrac#1{% \pgfutil@ifundefined{pgfmathfloatmultiply@}{% - \pgfmath@PackageError{Sorry, the number format 'frac' requires '\string\usetikzlibrary{fpu}' (and, optionally, \string\usepackage{fp}) in order to work correctly}% + \pgfmath@error{Sorry, the number format 'frac' requires '\string\usetikzlibrary{fpu}' (and, optionally, \string\usepackage{fp}) in order to work correctly}{}% \edef\pgfmathresult{{#1}{0}{1}}% }{% \pgfmathfloatgetfrac@{#1}% @@ -1435,7 +1435,7 @@ \pgfmathfloattofixed\pgfmathresult \pgf@xa=\pgfmathresult pt \multiply\pgf@xa by\pgfmathresultdenom - \edef\pgfmathfloat@scaled@numerator{\pgf@sys@tonumber\pgf@xa}% + \edef\pgfmathfloat@scaled@numerator{\pgfmath@tonumber\pgf@xa}% \expandafter\pgfmathfloat@loc@@to@int\pgfmathfloat@scaled@numerator\relax{\pgfmathresultnumerator}% \fi \ifpgfmathprintnumber@frac@whole diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex index 9370a219fe3..fcf5503b36b 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -109,7 +109,7 @@ \divide\c@pgfmath@counta by\pgfmath@base\relax% \let\pgfmath@next\pgfmathbasetodec@@@% \else - \pgfmath@error{Digit `#1' invalid for base \pgfmath@base}% + \pgfmath@error{Digit `#1' invalid for base \pgfmath@base}{}% \let\pgfmath@next=\relax% \fi% \fi% @@ -245,10 +245,10 @@ \def\pgfmath@checkbase#1{% \ifnum#1<2\relax% - \pgfmath@error{Cannot process numbers in base `#1'.}% + \pgfmath@error{Cannot process numbers in base `#1'.}{}% \else% \ifnum#1>36\relax% - \pgfmath@error{Cannot process numbers in base `#1'.}% + \pgfmath@error{Cannot process numbers in base `#1'.}{}% \fi% \fi} @@ -256,7 +256,7 @@ \expandafter\pgfmath@checknumber@#1\pgfmath@} \def\pgfmath@checknumber@#1#2\pgfmath@{% \ifx#1-% - \pgfmath@error{Cannot process negative numbers.}% + \pgfmath@error{Cannot process negative numbers.}{}% \fi} % \pgfmath@ensurenumberlength diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex index 64dbe2b09a7..1607c386e85 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -70,7 +70,7 @@ \let\pgfmath@sign=\pgfmath@empty% \ifdim0pt=\pgfmath@y% \pgfmath@error{You've asked me to divide `#1' by `#2', % - but I cannot divide any number by `#2'}% + but I cannot divide any number by `#2'}{}% \fi% \afterassignment\pgfmath@xa% \c@pgfmath@counta\the\pgfmath@y\relax% diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex index fc08640e4f3..417ede069dd 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -52,6 +52,7 @@ {\expandafter\noexpand\csname pgfmath#1@\endcsname}% {\csname pgfmath@operation@#1@arity\endcsname}% }% + \pgfkeysvalueof{/pgf/declare function/execute at begin function}% \pgfmath@marshal% } @@ -61,6 +62,7 @@ % #4 - code for function <name>. % \def\pgfmath@@declarefunction#1#2#3#4{% Function of arity 0 - 9. + \pgfkeysvalueof{/pgf/declare function/execute at end function}% \ifcase#3\relax% \def#1{#2}% \def\pgfmath@@head{\def#2}% @@ -109,7 +111,27 @@ \pgfkeys{% /pgf/declare function/.code={% \pgfmath@local@functions#1@=@;% - } + }, + /pgf/declare function/execute at begin function/.initial={}, + /pgf/declare function/execute at end function/.initial={}, + /pgf/declare function/ignore spaces/.is choice, + /pgf/declare function/ignore spaces/.default=true, + /pgf/declare function/ignore spaces/true/.style={% + /pgf/declare function/execute at begin function={% + \begingroup + \catcode`\^^I=9\relax + \catcode`\ =9\relax + \catcode`\~=10\relax + \endlinechar=`\ \relax + }, + /pgf/declare function/execute at end function={% + \endgroup + }, + }, + /pgf/declare function/ignore spaces/false/.style={% + /pgf/declare function/execute at begin function={}, + /pgf/declare function/execute at end function={}, + }, } \def\pgfmath@local@gobbleone#1{} diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex index f6e69993e8c..a0632670d8c 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex index bab8fefd4eb..6d1ec5b6ab8 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex index 03be2abfd33..66bdd72b71e 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -239,7 +239,7 @@ % #2 - the name of the list. % \def\pgfmathrandomitem#1#2{% - \pgfmath@ifundefined{pgfmath@randomlist@#2}{\pgfmath@error{Unknown random list `#2'}}{% + \pgfmath@ifundefined{pgfmath@randomlist@#2}{\pgfmath@error{Unknown random list `#2'}{}}{% \edef\pgfmath@randomlistlength{\csname pgfmath@randomlist@#2\endcsname}% \pgfmathrandominteger{\pgfmath@randomtemp}{1}{\pgfmath@randomlistlength}% \def#1{\csname pgfmath@randomlist@#2@\pgfmath@randomtemp\endcsname}}} diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex index 4bd05c18c41..120e971c8c8 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex index 76b58bc0f16..b76c5b440ce 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -249,7 +249,7 @@ \begingroup% \pgfmath@x=#1pt % \pgfmath@xa\pgfmath@x% - \edef\pgf@temp{\pgf@sys@tonumber\pgfmath@x}% + \edef\pgf@temp{\pgfmath@tonumber\pgfmath@x}% % compute lossless '*1000' operation: \expandafter\pgfmath@multiply@thousand\pgf@temp 000\relax \pgfmath@x=\pgfmathresult pt % @@ -306,7 +306,7 @@ \begingroup% \pgfmath@x#1pt\relax% \pgfmath@xa\pgfmath@x% - \edef\pgf@temp{\pgf@sys@tonumber\pgfmath@x}% + \edef\pgf@temp{\pgfmath@tonumber\pgfmath@x}% % compute lossless '*1000' operation: \expandafter\pgfmath@multiply@thousand\pgf@temp 000\relax \pgfmath@x=\pgfmathresult pt % @@ -340,7 +340,7 @@ \pgfmath@x\pgfmathresult pt\relax% \fi% % compute lossless '*1000' operation: - \edef\pgf@temp{\pgf@sys@tonumber\pgfmath@x}% + \edef\pgf@temp{\pgfmath@tonumber\pgfmath@x}% \expandafter\pgfmath@multiply@thousand\pgf@temp 000\relax \pgfmath@x=\pgfmathresult pt % \pgfmath@table@lookup{\pgfmath@x}{pgfmath@atan@}{1001}%xxx diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathode.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathode.code.tex index cb3d0d26ca8..f072c2361ef 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathode.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathode.code.tex @@ -1,4 +1,4 @@ -% Copyright 2011 by Christophe Jorssen +% Copyright 2019 by Christophe Jorssen % % This file may be distributed and/or modified % diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex index e50dfd615e3..439e62e4370 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex @@ -235,6 +235,16 @@ \pgfmath@tokens@make{dimexpr}{\dimexpr\glueexpr} \fi \pgfmath@tokens@make{unit}{{bp}{cc}{cm}{dd}{em}{ex}{in}{mm}{pc}{pt}{sp}} +\ifx\pdftexversion\@undefined\else % for pdfTeX + \pgfmath@tokens@make{unit}{{nc}{nd}{px}} +\fi +\ifx\directlua\@undefined\else % for LuaTeX + \pgfmath@tokens@make{unit}{{nc}{nd}{px}} +\fi +\ifx\kanjiskip\@undefined\else % for pTeX, upTeX + \pgfmath@tokens@make{unit}{{H}{Q}{zh}{zw}} +\fi +% \pgfmath@tokens@make{mathunit}{{mu}} \pgfmath@tokens@make{numeric}{.0123456789} \pgfmath@tokens@make{number}{0123456789} @@ -460,7 +470,10 @@ \else% \expandafter\ifx\csname pgfmath@token@numeric@\expandafter\string\pgfmath@token\endcsname\relax% % It isn't numeric (i.e., 012345679.), so it might be units... + % first double-character units... \expandafter\ifx\csname pgfmath@token@unit@\pgfmath@token\expandafter\string\pgfmath@token@next\endcsname\relax% + % then single-character units... + \expandafter\ifx\csname pgfmath@token@unit@\pgfmath@token\endcsname\relax% % ...or the exponent characters... \expandafter\ifx\csname pgfmath@token@exponent@\pgfmath@token\endcsname\relax% % ...or a base prefix... @@ -498,7 +511,14 @@ \else% ... and here, it is the exponent characters. \let\pgfmath@parse@next=\pgfmath@parse@exponent% \fi% - \else% ...but here it is units. + \else% ...but here it is single-character units. + \global\pgfmathunitsdeclaredtrue% + \pgfmath@dimen=\pgfmath@number\pgfmath@token\relax% + \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@dimen}}% + \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}% + \let\pgfmath@parse@next=\pgfmath@parse@@operator% + \fi% + \else% ...but here it is double-character units. \global\pgfmathunitsdeclaredtrue% \pgfmath@dimen=\pgfmath@number\pgfmath@token\pgfmath@token@next\relax% \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@dimen}}% diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex index 49313e88491..d8d67dd8419 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex @@ -1,4 +1,4 @@ -% Copyright 2007 Mark Wibrow +% Copyright 2019 Mark Wibrow % % but subject to the LaTeX Project Public License % (http://www.latex-project.org/lppl.txt) |