summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex83
1 files changed, 81 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
index ced1ab3c95b..1fefd8f12cd 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
@@ -61,12 +61,70 @@
}%
}%
+\gdef\pgfplots@glob@TMPa{0}%
+
+\def\pgfmathfloatfloor@broken#1{%
+ \edef\pgfmathfloat@loc@TMPa{#1}%
+ \pgfmathfloatcreate{2}{5.0}{-1}% -0.5
+ \let\pgfmathfloat@loc@TMPb=\pgfmathresult
+ \pgfmathfloatadd@{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@loc@TMPb}%
+ \expandafter\pgfmathfloatround@\expandafter{\pgfmathresult}%
+}
+\ifx\pgfmathfloatfloor\pgfmathfloatfloor@broken
+ \gdef\pgfplots@glob@TMPa{1}%
+\fi
+
+\def\pgfmathfloor@broken#1{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \advance\c@pgfmath@counta by -1\relax%
+ \fi%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+\ifx\pgfmathfloor@\pgfmathfloor@broken
+ \def\pgfmathfloor@#1{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmathfloor@collect@remainder%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\pgfmath@%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \ifdim\pgfmathfloor@remainder>0pt
+ \advance\c@pgfmath@counta by -1\relax%
+ \else
+ % ok, we stripped only '0'.
+ \fi
+ \fi%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+ }%
+ \def\pgfmathfloor@collect@remainder#1\pgfmath@{%
+ \def\pgfmathfloor@remainder{#1}%
+ \ifx\pgfmathfloor@remainder\pgfutil@empty
+ \def\pgfmathfloor@remainder{0}%
+ \fi
+ }%
+\fi
+
+
+
\pgfutil@ifundefined{pgfmathfloatatan2}{
+ \gdef\pgfplots@glob@TMPa{1}%
+}
+{}%
+
+\if1\pgfplots@glob@TMPa
\immediate\write16{Package pgfplots: loading complementary arithmetics for your pgf version...}
\input pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
\input pgfplotsoldpgfsupp_pgfmathfloat.code.tex
-}
-{}%
+\fi
\pgfutil@IfUndefined{pgfmathdeclarefunction}{
\pgfplots@warning{Parts of pgfplots require PGF 2.10; you have PGF 2.00 . Consider upgrading if you experience problems.}%
@@ -128,6 +186,8 @@
\let\pgfmath@local@function@body=\PATCH@pgfmath@local@function@body
\pgfplotsusecompatibilityfile{pgflibraryluamath.code.tex}
\else
+ \let\PATCH@pgfmathnotifynewdeclarefunction@orig=\pgfmathnotifynewdeclarefunction
+ \let\PATCH@pgfmathsetseed@pgfbasic = \pgfmathsetseed
\pgfutil@IfFileExists{pgflibraryluamath.code.tex}{%
% ah - we have a very recent version of PGF.
% Well, it will hopefully come with a suitable version of the
@@ -139,6 +199,25 @@
% FIXME
%\pgfplots@LUA@supportedfalse
}%
+ %
+ \def\pgfplots@glob@TMPa{3.0.1}%
+ \ifx\pgfversion\pgfplots@glob@TMPa
+ % 3.0.1 does not have the (correct) luamath library.
+ \pgfutil@directlua{%
+ package.loaded["pgf.luamath.functions"]=nil;
+ package.loaded["pgf.luamath.parser"]=nil;
+ pgfluamathfunctions = nil;
+ pgfluamathparser = nil}
+ \pgfplotsusecompatibilityfile{pgflibraryluamath.code.tex}
+ % ATTENTION: see 'pgfplots.lua' which ALSO loads these items
+ \pgfutil@directlua{%
+ pgfplots.pgfluamathfunctions = pgfluamathfunctions;
+ pgfplots.pgfluamathparser = pgfluamathparser}
+ \let\pgfmathnotifynewdeclarefunction@orig=\PATCH@pgfmathnotifynewdeclarefunction@orig
+ \let\pgfmathsetseed@pgfbasic=\PATCH@pgfmathsetseed@pgfbasic
+ \else
+ \pgfplots@log4{luamath library shipped with pgf \pgfversion\space is up-to-date}%
+ \fi
\fi
\fi