From 6b8752dc2acdb37bf3868adf0bdb0549f726ec6c Mon Sep 17 00:00:00 2001 From: Till Tantau Date: Fri, 30 Mar 2012 09:39:45 +0000 Subject: [PATCH] fixed math loading order problem --- doc/generic/pgf/ChangeLog | 6 ++++++ generic/pgf/math/pgfmathutil.code.tex | 2 +- .../pgf/modules/pgfmoduledecorations.code.tex | 3 +-- generic/pgf/systemlayer/pgfsys.code.tex | 19 +++++++++++++++++++ generic/pgf/utilities/pgfutil-context.def | 5 +++++ generic/pgf/utilities/pgfutil-latex.def | 6 ++++++ generic/pgf/utilities/pgfutil-plain.def | 5 +++++ 7 files changed, 43 insertions(+), 3 deletions(-) diff --git a/doc/generic/pgf/ChangeLog b/doc/generic/pgf/ChangeLog index eaba9d711..e3996b8c5 100644 --- a/doc/generic/pgf/ChangeLog +++ b/doc/generic/pgf/ChangeLog @@ -1,3 +1,9 @@ +2012-03-30 Till Tantau + + - Fixed problem that in case math library is loaded before pgf + some math functions were broken (because \pgfmath@xa and + \pgf@xa were different registers, which they should not be). + 2012-03-29 Till Tantau - Added anchoring and orientation to graph drawing library. diff --git a/generic/pgf/math/pgfmathutil.code.tex b/generic/pgf/math/pgfmathutil.code.tex index 5e3530076..aac1357a4 100755 --- a/generic/pgf/math/pgfmathutil.code.tex +++ b/generic/pgf/math/pgfmathutil.code.tex @@ -80,7 +80,7 @@ \let\pgfmath@yc\pgf@yc \let\pgfmath@tempdima\pgfutil@tempdima -\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempdimb\pgfutil@tempdimb \let\c@pgfmath@counta\c@pgf@counta \let\c@pgfmath@countb\c@pgf@countb diff --git a/generic/pgf/modules/pgfmoduledecorations.code.tex b/generic/pgf/modules/pgfmoduledecorations.code.tex index 9834e91f0..7f52429a6 100644 --- a/generic/pgf/modules/pgfmoduledecorations.code.tex +++ b/generic/pgf/modules/pgfmoduledecorations.code.tex @@ -1347,7 +1347,6 @@ \advance\pgf@x0.666666\pgf@xa% \advance\pgf@y0.666666\pgf@ya% }% - % \let\pgf@decorate@movealonginputsegment\pgf@decorate@movealonginputsegment@line% \let\pgf@decorate@transformtoinputsegment\pgf@decorate@transformtoinputsegment@line% \let\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentlineto% @@ -1419,7 +1418,7 @@ \pgfpointcurveattime{\pgf@decorate@inputsegmenttime}% {\pgf@decorate@inputsegment@first}{\pgf@decorate@inputsegment@supporta}% {\pgf@decorate@inputsegment@supportb}{\pgf@decorate@inputsegment@last}% - \pgf@xa\pgf@x% +\show1 \pgf@xa\pgf@x% \pgf@ya\pgf@y% \pgf@xb\pgf@decorate@inputsegmenttime pt\relax% % diff --git a/generic/pgf/systemlayer/pgfsys.code.tex b/generic/pgf/systemlayer/pgfsys.code.tex index effdb7ed6..3516a4382 100644 --- a/generic/pgf/systemlayer/pgfsys.code.tex +++ b/generic/pgf/systemlayer/pgfsys.code.tex @@ -67,6 +67,25 @@ \newcount\c@pgf@countd +% Ensure that math registers are the same (math is broken in case it +% is loaded first) +\let\pgfmath@x\pgf@x +\let\pgfmath@xa\pgf@xa +\let\pgfmath@xb\pgf@xb +\let\pgfmath@xc\pgf@xc + +\let\pgfmath@y\pgf@y +\let\pgfmath@ya\pgf@ya +\let\pgfmath@yb\pgf@yb +\let\pgfmath@yc\pgf@yc + +\let\c@pgfmath@counta\c@pgf@counta +\let\c@pgfmath@countb\c@pgf@countb +\let\c@pgfmath@countc\c@pgf@countc +\let\c@pgfmath@countd\c@pgf@countd + + + % The following \if decides, whether even-odd filling and clipping is % to be used or normal the non-zero winding number rule. See the % pdf-documentation for details on what these rules are. diff --git a/generic/pgf/utilities/pgfutil-context.def b/generic/pgf/utilities/pgfutil-context.def index 73c4b70e8..de934f6af 100644 --- a/generic/pgf/utilities/pgfutil-context.def +++ b/generic/pgf/utilities/pgfutil-context.def @@ -275,6 +275,11 @@ \newbox \pgfutil@voidb@x \newtoks \pgfutil@toks@ +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempcnta\pgfutil@tempcnta +\let\pgfmath@tempcntb\pgfutil@tempcntb + % From LaTeX \newskip\pgfutil@flushglue \pgfutil@flushglue=0pt plus 1fil diff --git a/generic/pgf/utilities/pgfutil-latex.def b/generic/pgf/utilities/pgfutil-latex.def index f6c30ae56..02e5e94b1 100644 --- a/generic/pgf/utilities/pgfutil-latex.def +++ b/generic/pgf/utilities/pgfutil-latex.def @@ -67,6 +67,12 @@ \let\pgfutil@tempdima=\@tempdima \let\pgfutil@tempdimb=\@tempdimb +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempcnta\pgfutil@tempcnta +\let\pgfmath@tempcntb\pgfutil@tempcntb + + \AtEndDocument{\par\vfil\penalty-10000\relax\the\pgfutil@everybye} \def\pgfutil@insertatbegincurrentpagefrombox#1{% diff --git a/generic/pgf/utilities/pgfutil-plain.def b/generic/pgf/utilities/pgfutil-plain.def index e5c1dde13..cfb75ac0b 100644 --- a/generic/pgf/utilities/pgfutil-plain.def +++ b/generic/pgf/utilities/pgfutil-plain.def @@ -209,6 +209,11 @@ \newdimen\pgfutil@tempdima \newdimen\pgfutil@tempdimb +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempcnta\pgfutil@tempcnta +\let\pgfmath@tempcntb\pgfutil@tempcntb + % From LaTeX \newskip\pgfutil@flushglue \pgfutil@flushglue=0pt plus 1fil