summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
diff options
context:
space:
mode:
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.tex35
1 files changed, 22 insertions, 13 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 db2c38fa350..5e353007618 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
@@ -20,14 +20,15 @@
% #1 - count or dimen.
% #2 - a control sequence.
%
-\newbox\pgfmath@box%
\def\pgfmath@ensureregister#1#2{%
- \setbox\pgfmath@box\hbox\bgroup% In case #2 is a defined macro. Unlikely, but you never know...
+ \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@{%
- \egroup%
+ \endgroup\egroup%
+ \endgroup%
\ifx#4c%
\ifx#1.% Already a count register.
\else%
@@ -181,8 +182,18 @@
\let\pgfmath@PackageError\PackageError%
\fi%
-\def\pgfmath@error#1#2{\pgfmath@PackageError{PGF Math}{#1}{#2}}
-\def\pgfmath@warning#1{\pgfmath@PackageWarning{PGF Math}{#1}}
+\def\pgfmath@error#1#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@pt
%
@@ -208,6 +219,9 @@
\def\pgfmath@gobbleone#1{}%
+\def\pgfmath@namedef#1{\expandafter\def\csname#1\endcsname}
+\def\pgfmath@nameedef#1{\expandafter\edef\csname#1\endcsname}
+
% \pgfmathloop
%
% A version of the standard TeX and LaTeX
@@ -233,9 +247,6 @@
% \pgfmath@returnone
%
-% \edef \pfgmathresult to the value of #1 after the end
-% of a group, which *must directly follow*.
-%
% #1 - a dimension representing a number or dimension.
%
% Changed by TT: made faster and simpler since it is used
@@ -248,11 +259,7 @@
\expandafter\endgroup\expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmath@temp}%
}
-
-% \pgfmath@returntwo
-%
-% Removed by TT: not used.
-
+\let\pgfmathreturn=\pgfmath@returnone
% \pgfmath@smuggleone
%
@@ -263,3 +270,5 @@
%
\def\pgfmath@smuggleone#1\endgroup{%
\expandafter\endgroup\expandafter\def\expandafter#1\expandafter{#1}}
+
+\let\pgfmathsmuggle=\pgfmath@smuggleone