diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-02 03:02:44 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-02 03:02:44 +0000 |
commit | 6276231aa1cc25fe33679b149fdbaca5471ca8a4 (patch) | |
tree | f5282bc8055c4145a733bae60f53e93986d005a6 /graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex | |
parent | ad1928316d819ffb337fc4a926dbef47607dfb95 (diff) |
CTAN sync 202003020302
Diffstat (limited to 'graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex')
-rw-r--r-- | graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex b/graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex index fe86ba6f4a..8b2bf234be 100644 --- a/graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex +++ b/graphics/pgf/contrib/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex @@ -19,7 +19,7 @@ % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything: % This file comes without any warranty as the rest of pgfplots; there is no obligation for help. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Mi 8. Feb 20:49:06 CET 2017 %%% +%%% Date of this copy: Mo 30. Apr 17:24:35 CEST 2018 %%% @@ -33,7 +33,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. % -% $Id: pgflibraryluamath.code.tex,v 1.20 2015/06/05 06:23:21 cfeuersaenger Exp $ +% $Id$ % % % This is a library for a LUA math parser and LUA math operations. @@ -223,12 +223,16 @@ \else \let\pgfluamath@pgfmathparse\pgfmathparse \let\pgfmathparse\pgfluamathparse + \let\pgfmath@iftrue=\pgfmathluamath@iftrue \pgfluamathparseractivetrue \fi} +\let\pgfmath@iftrue@basic=\pgfmath@iftrue + \def\pgfluamath@makeparserinactive{% \ifpgfluamathparseractive \let\pgfmathparse\pgfluamath@pgfmathparse + \let\pgfmath@iftrue=\pgfmath@iftrue@basic \pgfluamathparseractivefalse \fi} @@ -320,6 +324,7 @@ \pgfluamath@install@function\pgfmathsubtract@=\pgfluamathsubtract@% \pgfluamath@install@function\pgfmathneg@=\pgfluamathneg@% \pgfluamath@install@function\pgfmathmultiply@=\pgfluamathmultiply@% + \pgfmathfloat@install\pgfmath@iftrue=\pgfmathluamath@iftrue \pgfluamath@install@function\pgfmathdivide@=\pgfluamathdivide@% % \pgfluamath@install@function\pgfmathdiv@=\pgfluamathdiv@% \pgfluamath@install@function\pgfmathfactorial@=\pgfluamathfactorial@% @@ -400,6 +405,25 @@ \def\pgfluamathgetresult#1{% \edef\pgfmathresult{\pgfutil@directlua{tex.print(-1,#1)}}} +\def\pgfmathluamath@iftrue{% + \if 0\pgfluamath@outputformat@choice + \let\pgfmathluamath@@iftrue@v=\pgfluamathone + \else + \let\pgfmathluamath@@iftrue@v=\pgfluamathfloatone + \fi + \pgfmathluamath@iftrue@ +}% +\def\pgfluamathone{1.0}% +\def\pgfluamathfloatone{1Y1.0e+00]}% +\def\pgfmathluamath@iftrue@#1#2{% + \ifx\pgfmathresult\pgfmathluamath@@iftrue@v + \def\pgfmath@next{#1}% + \else + \def\pgfmath@next{#2}% + \fi + \pgfmath@next +}% + \def\pgfluamathpi@{% \pgfluamathgetresult{pgfluamathfunctions.pi()}} \def\pgfluamathe@{% @@ -543,15 +567,15 @@ \def\pgfluamathparse#1{% \pgfluamathusedTeXfallbackfalse \pgfutil@directlua{pgfluamathparser.texCallParser( - "\pgfutil@luaescapestring{#1}", - \pgfluamath@outputformat@choice, - \ifpgfluamathshowerrormessage true\else false\fi)% + "\pgfutil@luaescapestring{#1}", + \pgfluamath@outputformat@choice, + \ifpgfluamathshowerrormessage true\else false\fi)% }% \ifx\pgfmathresult\pgfutil@empty - \ifpgfluamathenableTeXfallback - \pgfluamathusedTeXfallbacktrue - \pgfluamath@pgfmathparse{#1}% - \fi + \ifpgfluamathenableTeXfallback + \pgfluamathusedTeXfallbacktrue + \pgfluamath@pgfmathparse{#1}% + \fi \fi } |