From 2fc276d60abc3ce08fc60890eede3a70aa5ac031 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 3 Mar 2020 22:58:29 +0000 Subject: pgfplots (2mar20) git-svn-id: svn://tug.org/texlive/trunk@54041 c570f23f-e606-0410-a88d-b1316a301751 --- .../pgfplotsoldpgfsupp_loader.code.tex | 21 ++++++++- .../pgfplotsoldpgfsupp_misc.code.tex | 20 --------- .../pgfplotsoldpgfsupp_pgflibraryfpu.code.tex | 52 ++++++++++++++++++++-- .../pgfplotsoldpgfsupp_pgflibraryluamath.code.tex | 42 +++++++++++++---- .../pgfplotsoldpgfsupp_pgfmathfloat.code.tex | 36 +++++++-------- 5 files changed, 119 insertions(+), 52 deletions(-) (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib') 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 b68c50eac2c..b8df1292a33 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 @@ -113,8 +113,23 @@ }% \fi +\pgfutil@IfUndefined{pgfmathifexpression}{% + \def\pgfmathifexpression#1#2#3{% + \pgfmathparse{#1}% + \pgfmath@iftrue{#2}{#3}% + } + \def\pgfmath@iftrue{% + \ifdim\pgfmathresult pt=1.0pt % + \let\pgfmath@next=\pgfutil@firstoftwo + \else + \let\pgfmath@next=\pgfutil@secondoftwo + \fi + \pgfmath@next + }% + \gdef\pgfplots@glob@TMPa{1}% +}{}% -\pgfutil@ifundefined{pgfmathfloat@stack@push@operand@single@str}{ +\pgfutil@ifundefined{pgfmathfloat@iftrue@}{ \gdef\pgfplots@glob@TMPa{1}% } {}% @@ -358,4 +373,8 @@ \input pgfplotsoldpgfsupp_leq.code.tex }{}% +\pgfutil@IfUndefined{pgfutilifstartswith}{% + \let\pgfutilifstartswith=\pgfplotsutilifstartswith +}{} + \endinput diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex index 5d1188e8562..c1558cde9f9 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex @@ -87,26 +87,6 @@ \let\pgfutil@insertatbegincurrentpagefrombox=\pgfutil@insertatbegincurrentpagefrombox@FIXED \fi -% check if \endtikzpicture deals with layerlist: -\expandafter\pgfutil@in@\expandafter\pgf@remember@layerlist@globally\expandafter{\endtikzpicture}% -\ifpgfutil@in@ -\else - \def\endtikzpicture{% - \tikz@atend@picture% - \global\let\pgf@shift@baseline@smuggle=\pgf@baseline% - \global\let\pgf@trimleft@final@smuggle=\pgf@trimleft% - \global\let\pgf@trimright@final@smuggle=\pgf@trimright% - \global\let\pgf@remember@smuggle=\ifpgfrememberpicturepositiononpage% - \pgf@remember@layerlist@globally - \endscope% - \let\pgf@baseline=\pgf@shift@baseline@smuggle% - \let\pgf@trimleft=\pgf@trimleft@final@smuggle% - \let\pgf@trimright=\pgf@trimright@final@smuggle% - \let\ifpgfrememberpicturepositiononpage=\pgf@remember@smuggle% - \pgf@restore@layerlist@from@global - \endpgfpicture} -\fi - % ====================================================== % compatibility with PGF 2.0 % ====================================================== diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex index 1c9cfe742dd..e1f349129d7 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.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: Fr 10. Nov 17:18:26 CET 2017 %%% +%%% Date of this copy: Mo 30. Apr 17:24:35 CEST 2018 %%% @@ -95,9 +95,18 @@ % process. If 'scale results' is active, 'fixed' is assumed % automatically. fpu/output format/.is choice, - fpu/output format/float/.code= {\let\pgfmathfloatparse@output=\relax}, - fpu/output format/sci/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattosci@{\pgfmathresult}}}, - fpu/output format/fixed/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattofixed@{\pgfmathresult}}}, + fpu/output format/float/.code= {% + \def\pgfmathfloatparse@output@choice{Y}% + \let\pgfmathfloatparse@output=\relax + }, + fpu/output format/sci/.code= {% + \def\pgfmathfloatparse@output@choice{S}% + \def\pgfmathfloatparse@output{\pgfmathfloattosci@{\pgfmathresult}}% + }, + fpu/output format/fixed/.code= {% + \def\pgfmathfloatparse@output@choice{F}% + \def\pgfmathfloatparse@output{\pgfmathfloattofixed@{\pgfmathresult}}% + }, fpu/output format/float, fpu/rel thresh/.code={% \pgfmathfloatparsenumber{#1}% @@ -108,6 +117,8 @@ \pgfmathfloatcreate{1}{1.0}{0}\let\pgfmathfloatscale=\pgfmathresult +\let\pgfmathfloatone=\pgfmathresult + % This is the replacement parser invocation. % It does two things which are different to \pgfmathparse: % 1. it disables any dimension dependand scalings, @@ -285,6 +296,7 @@ \pgfmathfloat@install\pgfmathcosh@=\pgfmathfloatcosh@ \pgfmathfloat@install\pgfmathsinh@=\pgfmathfloatsinh@ \pgfmathfloat@install\pgfmathtanh@=\pgfmathfloattanh@ + \pgfmathfloat@install\pgfmath@iftrue=\pgfmathfloat@iftrue \expandafter\pgfmathfloat@install\csname pgfmathatan2@\endcsname=\pgfmathfloatatantwo@ \pgfmathfloat@install@unimplemented{isprime}% \pgfmathfloat@install@unimplemented{iseven}% @@ -302,6 +314,38 @@ \pgfmathfloat@install\pgfmathscientific=\pgfmathfloatscientific% } +\def\pgfmathfloat@iftrue{% + \if Y\pgfmathfloatparse@output@choice + \let\pgfmathfloat@@iftrue@v=\pgfmathfloatone + \let\pgfmathfloat@@iftrue@next=\pgfmathfloat@iftrue@ + \else + \if S\pgfmathfloatparse@output@choice + \def\pgfmathfloat@@iftrue@v{1.0e0}% + \let\pgfmathfloat@@iftrue@next=\pgfmathfloat@iftrue@ + \else + \def\pgfmath@next{\pgfutilifstartswith{1.0}}% + \expandafter\pgfmath@next\expandafter{\pgfmathresult}{% + \ifdim\pgfmathresult pt=1.0pt % + \let\pgfmathfloat@@iftrue@next=\pgfutil@firstoftwo + \else + \let\pgfmathfloat@@iftrue@next=\pgfutil@secondoftwo + \fi + }{% + \let\pgfmathfloat@@iftrue@next=\pgfutil@secondoftwo + }% + \fi + \fi + \pgfmathfloat@@iftrue@next +}% +\def\pgfmathfloat@iftrue@{% + \ifx\pgfmathresult\pgfmathfloat@@iftrue@v + \let\pgfmath@next=\pgfutil@firstoftwo + \else + \let\pgfmath@next=\pgfutil@secondoftwo + \fi + \pgfmath@next +}% + \def\pgfmathfloat@parser@install{% \pgfmathfloat@plots@checkuninstallcmd \pgfmathfloat@plots@install% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex index fe86ba6f4a7..8b2bf234be7 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/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 } diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex index 5ba17bc2d0e..e2c0f91a51f 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.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: Fr 10. Nov 17:18:26 CET 2017 %%% +%%% Date of this copy: Mo 30. Apr 17:24:35 CEST 2018 %%% @@ -95,7 +95,7 @@ % [FLAGS] MANTISSE EXPONENT % meaning % [+-]X.XXXXXXX*10^C -% where +% where % X.XXXXXX is a mantissa with first number != 0, C is an integer and % FLAGS contains the sign and some other special cases. % @@ -103,7 +103,7 @@ % computation is COMPLETELY STRING BASED. % This allows numbers such at 10000000 or 5.23e-10 to be represented % properly, although TeX-registers would produce overflow/underflow -% errors in these cases. +% errors in these cases. % % It is to be used to compute logs, because log(X*10^Y) = log(X) + log(10)*Y % @@ -124,7 +124,7 @@ % where % FLAGS is a number in [0-5] where % 0 == '0' (the number is +- 0.0), -% 1 == '+', +% 1 == '+', % 2 == '-', % 3 == 'not a number' % 4 == '+ infinity' @@ -419,7 +419,7 @@ % Converts a float to an integer (in integer format). % -% @see \pgfmathfloatint +% @see \pgfmathfloatint \def\pgfmathfloattoint#1{% \pgfmathfloattofixed{#1}% \expandafter\pgfmathfloattoint@@\pgfmathresult\relax @@ -521,7 +521,7 @@ } -% Overloaded method. +% Overloaded method. % % This variant always uses a FIXED number behind the period and fills % in zeros if necessary. @@ -707,7 +707,7 @@ % \else % \pgfmath@error{INTERNAL ERROR in fixed style - The input sequence did not terminate as expected; which indicates a wrong exponent argument provided to \string\pgfmathprintnumber@fixed@style}{}% % \fi - %-------------------------------------------------- + %-------------------------------------------------- \let\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT=\relax \fi \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT @@ -782,7 +782,7 @@ % Arguments: % #1#2#3e#4\relax -% Input: +% Input: % #1 the fixed point number to be displayed (maybe a macro). % #2#3e#4: the (possibly unformatted) floating point representation % which belongs to #1. This format is returned (only!) by @@ -791,7 +791,7 @@ \let\pgfmathprintnumber@fixed@style=\pgfmathprintnumber@fixed@styleDEFAULT -% Rounds a normalized floating point number to \pgfmathfloat@round@precision +% Rounds a normalized floating point number to \pgfmathfloat@round@precision % digits precision and writes the result to \pgfmathresult. % % This method uses \pgfmathroundto for the mantissa. @@ -836,7 +836,7 @@ % #2: mantissa % #3: exponent % #4: CODE to display if the mantissa is drawn. -% This code will be shown just before the exponent. +% This code will be shown just before the exponent. % Example: #4=\cdot % #5: CODE to display if the mantissa is NOT draw. (unused currently) % Might be used to display '10^1' instead of '1*10^1'. @@ -1160,7 +1160,7 @@ \if0\pgfmathprintnumber@RELATIVE@choice@roundtofixed % relative round mode=mantissa \def\b@round@fixed{0}% - \else + \else \if1\pgfmathprintnumber@RELATIVE@choice@roundtofixed % relative round mode=fixed \def\b@round@fixed{1}% @@ -1196,7 +1196,7 @@ \fi \edef\pgfmathresultX{% \the\pgfmathfloat@a@S - \the\pgfmathfloat@a@Mtok + \the\pgfmathfloat@a@Mtok \ifpgfmathfloatroundhasperiod\else.0\fi e\the\pgfmathfloat@a@E}% % call another formatter for the result (but avoid rounding inside of it): @@ -1235,7 +1235,7 @@ \fi \edef\pgfmathresultX{% \the\pgfmathfloat@a@S - \the\pgfmathfloat@a@Mtok + \the\pgfmathfloat@a@Mtok \ifpgfmathfloatroundhasperiod\else.0\fi e\the\pgfmathfloat@a@E}% \let\pgfmathfloat@round@precision@orig=\pgfmathfloat@round@precision @@ -1705,7 +1705,7 @@ \pgfkeys{/pgf/number format/std} %%%%%%%%%%%%%%%%%%%%%%%%%% -% +% % IMPL % %%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1747,7 +1747,7 @@ % \pgfmathroundto implementation in WORDS: % -% coarse idea: +% coarse idea: % 1. collect all digits/sign BEFORE the first period in REVERSE order % 2. then, collect UP TO \prec digits after the period in REVERSE order % Steps 1. and 2. lead to the digit [sign] sequence @@ -1781,7 +1781,7 @@ % fi % ++q % if q=0 -% discard the period +% discard the period % fi % end while % if q = r+1 @@ -1991,7 +1991,7 @@ \fi } -% PRECONDITION: +% PRECONDITION: % \c@pgfmathroundto@lastzeros > 0 \def\pgfmathroundto@impl@discard@suffix@zeros@ITERATE#1{% \advance\c@pgfmathroundto@lastzeros by-1 @@ -2183,7 +2183,7 @@ % \pgfmathfloattofixed@impl@collectmantissa#2\count\pgfmathfloat@a@E % \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok}% % \fi - %-------------------------------------------------- + %-------------------------------------------------- \pgfmathfloat@a@Mtok{#1}% \pgfmathfloattofixed@impl@pos#2000000000\pgfmathfloat@EOI \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok}% -- cgit v1.2.3