diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-12 20:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-12 20:23:02 +0000 |
commit | 22cbaf8cd711b82b3fe4b387a7e72b58409ecdbd (patch) | |
tree | 0b785b59273566c030b567add8671b7f06167054 /Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex | |
parent | 692a797099b0acfd35d4bbd6a322acdc87c2c3a8 (diff) |
pgf
git-svn-id: svn://tug.org/texlive/trunk@51107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex | 172 |
1 files changed, 86 insertions, 86 deletions
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 44d39c75b6a..d98ecb25d59 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex @@ -1,9 +1,9 @@ % Copyright 2007 Mark Wibrow % -% but subject to the LaTeX Project Public License +% but subject to the LaTeX Project Public License % (http://www.latex-project.org/lppl.txt) % -% and the GNU Public License +% and the GNU Public License % (http://www.gnu.org/licenses/gpl.txt) % @@ -21,30 +21,30 @@ % #2 - a control sequence. % \def\pgfmath@ensureregister#1#2{% - \begingroup% - \setbox0=\hbox\bgroup\begingroup% In case #2 is a defined macro. Unlikely, but you never know... - \afterassignment\pgfmath@@ensureregister% - \noexpand#20.0pt\let\pgfmath@temp\relax\relax\pgfmath@#2#1\pgfmath@} + \begingroup% + \setbox0=\hbox\bgroup\begingroup% In case #2 is a defined macro. Unlikely, but you never know... + \afterassignment\pgfmath@@ensureregister% + \noexpand#20.0pt\let\pgfmath@temp\relax\relax\pgfmath@#2#1\pgfmath@} \def\pgfmath@@ensureregister#1#2\pgfmath@#3#4#5\pgfmath@{% - \endgroup\egroup% - \endgroup% - \ifx#4c% - \ifx#1.% Already a count register. - \else% - \csname newcount\endcsname#3% This gets round \outer in plain TeX. - \fi% - \else% - \ifx#4d% - \ifx\let#1% Already a dimen register. - \else% - \csname newdimen\endcsname#3% - \fi% - \fi% - \fi% + \endgroup\egroup% + \endgroup% + \ifx#4c% + \ifx#1.% Already a count register. + \else% + \csname newcount\endcsname#3% This gets round \outer in plain TeX. + \fi% + \else% + \ifx#4d% + \ifx\let#1% Already a dimen register. + \else% + \csname newdimen\endcsname#3% + \fi% + \fi% + \fi% } -% Check registers exist. If not, create them. +% Check registers exist. If not, create them. % \pgfmath@ensureregister{dimen}{\pgf@x} \pgfmath@ensureregister{dimen}{\pgf@xa} @@ -91,63 +91,63 @@ \let\pgfmath@tempcntb\pgfutil@tempcntb % Now check if pgfutil and pgf@sys stuff exists. If it does, fine. -% Just \let pgfmath versions. If not, define pgfmath versions (Arghhh). +% Just \let pgfmath versions. If not, define pgfmath versions (Arghhh). % % \...ifnextchar % \ifx\pgfutil@ifnextchar\pgfmath@undefined% - \long\def\pgfmath@ifnextchar#1#2#3{% + \long\def\pgfmath@ifnextchar#1#2#3{% \let\pgfmath@reserved@d#1% \def\pgfmath@reserved@a{#2}% \def\pgfmath@reserved@b{#3}% \futurelet\pgfmath@let@token\pgfmath@ifnch} - \def\pgfmath@ifnch{% - \ifx\pgfmath@let@token\pgfmath@sptoken% - \let\pgfmath@reserved@c\pgfmath@xifnch% - \else% - \ifx\pgfmath@let@token\pgfmath@reserved@d% - \let\pgfmath@reserved@c\pgfmath@reserved@a% - \else% - \let\pgfmath@reserved@c\pgfmath@reserved@b% - \fi% - \fi% - \pgfmath@reserved@c} - {% - \def\:{\global\let\pgfmath@sptoken= } \: - \def\:{\pgfmath@xifnch} \expandafter\gdef\: {\futurelet\pgfmath@let@token\pgfmath@ifnch} - }% + \def\pgfmath@ifnch{% + \ifx\pgfmath@let@token\pgfmath@sptoken% + \let\pgfmath@reserved@c\pgfmath@xifnch% + \else% + \ifx\pgfmath@let@token\pgfmath@reserved@d% + \let\pgfmath@reserved@c\pgfmath@reserved@a% + \else% + \let\pgfmath@reserved@c\pgfmath@reserved@b% + \fi% + \fi% + \pgfmath@reserved@c} + {% + \def\:{\global\let\pgfmath@sptoken= } \: + \def\:{\pgfmath@xifnch} \expandafter\gdef\: {\futurelet\pgfmath@let@token\pgfmath@ifnch} + }% \else% - \let\pgfmath@ifnextchar\pgfutil@ifnextchar% - % Still need to define \pgfmath@sptoken (cannot \let). - {% - \def\:{\global\let\pgfmath@sptoken= } \: - }% + \let\pgfmath@ifnextchar\pgfutil@ifnextchar% + % Still need to define \pgfmath@sptoken (cannot \let). + {% + \def\:{\global\let\pgfmath@sptoken= } \: + }% \fi% % \...ifundefined % \ifx\pgfutil@ifundefined\pgfmath@undefined% - \long\def\pgfmath@ifundefined#1{% - \expandafter\ifx\csname#1\endcsname\relax% - \expandafter\pgfmath@firstoftwo% - \else% - \expandafter\pgfmath@secondoftwo% - \fi}% + \long\def\pgfmath@ifundefined#1{% + \expandafter\ifx\csname#1\endcsname\relax% + \expandafter\pgfmath@firstoftwo% + \else% + \expandafter\pgfmath@secondoftwo% + \fi}% \else% - \let\pgfmath@ifundefined\pgfutil@ifundefined% + \let\pgfmath@ifundefined\pgfutil@ifundefined% \fi% % \...selectfont % \ifx\pgfutil@selectfont\pgfmath@undefined% - \ifx\selectfont\pgfmath@undefined% - \let\pgfmath@selectfont\rm% Plain TeX and ConTeXt. - \else% - \let\pgfmath@selectfont\selectfont% LaTeX. - \fi% + \ifx\selectfont\pgfmath@undefined% + \let\pgfmath@selectfont\rm% Plain TeX and ConTeXt. + \else% + \let\pgfmath@selectfont\selectfont% LaTeX. + \fi% \else% - \let\pgfmath@selectfont\pgfutil@selectfont% + \let\pgfmath@selectfont\pgfutil@selectfont% \fi% % New definition easier than fussing around with let. @@ -163,43 +163,43 @@ % \ifx\pgf@sys@tonumber\pgfmath@undefined% {\catcode`\p=12\catcode`\t=12\gdef\Pgf@geT#1pt{#1}} - \def\pgfmath@tonumber#1{\expandafter\Pgf@geT\the#1} + \def\pgfmath@tonumber#1{\expandafter\Pgf@geT\the#1} \else% - \let\pgfmath@tonumber\pgf@sys@tonumber% + \let\pgfmath@tonumber\pgf@sys@tonumber% \fi% % \PackageWarning and \PackageError % \ifx\PackageWarning\pgfmath@undefined - \def\pgfmath@PackageWarning#1#2{\immediate\write-1{Package #1: Warning! #2.}}% + \def\pgfmath@PackageWarning#1#2{\immediate\write-1{Package #1: Warning! #2.}}% \else% - \let\pgfmath@PackageWarning\PackageWarning% + \let\pgfmath@PackageWarning\PackageWarning% \fi% \ifx\PackageError\pgfmath@undefined - \def\pgfmath@PackageError#1#2#3{\errmessage{Package #1 Error: #2.}}% + \def\pgfmath@PackageError#1#2#3{\errmessage{Package #1 Error: #2.}}% \else% - \let\pgfmath@PackageError\PackageError% + \let\pgfmath@PackageError\PackageError% \fi% \def\pgfmath@error#1#2{% - \pgfmath@PackageError{PGF Math}{% - #1% - \pgfutil@ifundefined{pgfmath@expression}{}{ (in '\pgfmath@expression')}% - }{#2}% + \pgfmath@PackageError{PGF Math}{% + #1% + \pgfutil@ifundefined{pgfmath@expression}{}{ (in '\pgfmath@expression')}% + }{#2}% } \def\pgfmath@warning#1{% - \pgfmath@PackageWarning{PGF Math}{% - #1% - \pgfutil@ifundefined{pgfmath@expression}{}{ (in '\pgfmath@expression')}% - }% + \pgfmath@PackageWarning{PGF Math}{% + #1% + \pgfutil@ifundefined{pgfmath@expression}{}{ (in '\pgfmath@expression')}% + }% } % \pgfmath@pt % % Needed to test for 'pt' resulting from expansion using \the. % -{\catcode`\p=12\catcode`\t=12\gdef\PgfmaTh@PT{pt}} +{\catcode`\p=12\catcode`\t=12\gdef\PgfmaTh@PT{pt}} \edef\pgfmath@pt{\PgfmaTh@PT}% % \pgfmath@empty @@ -214,7 +214,7 @@ % \pgfmath@gobbletilpgfmath@ % % Gobble stream until \pgfmath@ {which is undefined}. -% +% \def\pgfmath@gobbletilpgfmath@#1\pgfmath@{} \def\pgfmath@gobbleone#1{}% @@ -231,17 +231,17 @@ % \newif\ifpgfmathcontinueloop \def\pgfmathloop#1\repeatpgfmathloop{% - \def\pgfmathcounter{1}% - \def\pgfmath@iterate{% - #1\relax% - {% Do this inside a group, just in case... - \c@pgfmath@counta\pgfmathcounter% - \advance\c@pgfmath@counta1\relax% - \xdef\pgfmathloop@temp{\the\c@pgfmath@counta}% - }% - \edef\pgfmathcounter{\pgfmathloop@temp}% - \expandafter\pgfmath@iterate\fi}% - \pgfmath@iterate\let\pgfmath@iterate\relax} + \def\pgfmathcounter{1}% + \def\pgfmath@iterate{% + #1\relax% + {% Do this inside a group, just in case... + \c@pgfmath@counta\pgfmathcounter% + \advance\c@pgfmath@counta1\relax% + \xdef\pgfmathloop@temp{\the\c@pgfmath@counta}% + }% + \edef\pgfmathcounter{\pgfmathloop@temp}% + \expandafter\pgfmath@iterate\fi}% + \pgfmath@iterate\let\pgfmath@iterate\relax} \let\repeatpgfmathloop\fi \def\pgfmathbreakloop{\let\pgfmath@iterate\relax}% @@ -251,7 +251,7 @@ % % Changed by TT: made faster and simpler since it is used % *heavily*. #1 must be something that can be assigned to a -% dimension. +% dimension. % \def\pgfmath@returnone#1\endgroup{% \pgfmath@x#1% @@ -269,6 +269,6 @@ % followed by \endgroup % \def\pgfmath@smuggleone#1\endgroup{% - \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{#1}} + \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{#1}} \let\pgfmathsmuggle=\pgfmath@smuggleone |