summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-08 00:02:17 +0000
committerKarl Berry <karl@freefriends.org>2016-01-08 00:02:17 +0000
commit4e668f51370a93cc9dc26b1a11a949b50493b353 (patch)
tree85ab6891036f9a348e68f83e31c56b069332a9ca /Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib
parentf2995718d3db02b5ff46d4552b9281b9761327ae (diff)
pgfplots (7jan16)
git-svn-id: svn://tug.org/texlive/trunk@39303 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex83
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex9
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex111
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex238
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex42
6 files changed, 355 insertions, 134 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
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex
index 733cb47a4db..dc36ce92770 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.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 9. Jul 15:41:39 CEST 2014 %%%
+%%% Date of this copy: Do 31. Dez 19:01:21 CET 2015 %%%
@@ -32,7 +32,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.20 2013/07/15 12:05:31 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.22 2015/08/29 10:15:21 cfeuersaenger Exp $
@@ -419,11 +419,16 @@
\begingroup
\def\n{\pgfexternal@hat\pgfexternal@hat J}%
\pgfexternalstorecommand{%
+ \pgf@external@grab@refundefinedtrue@code
\noexpand\immediate\noexpand\write16{\pgf@external@grab@refundefinedtrue@warning}%
\noexpand\G@refundefinedtrue
}%
\endgroup
}%
+
+% A hook. will be overwritten by \usetikzlibrary{external}
+\def\pgf@external@grab@refundefinedtrue@code{}
+
\def\pgf@external@grab@refundefinedtrue@warning{%
LaTeX Warning: External picture `\pgfactualjobname' contains undefined references\noexpand\on@line.\n
}%
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 8b5784c1172..1215300e328 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: So 11. Jan 18:03:19 CET 2015 %%%
+%%% Date of this copy: Do 31. Dez 19:01:21 CET 2015 %%%
@@ -230,6 +230,8 @@
\pgfmathfloat@install\pgfmathsign@=\pgfmathfloatsign@%
\pgfmathfloat@install\pgfmathround@=\pgfmathfloatround@%
\pgfmathfloat@install\pgfmathfloor@=\pgfmathfloatfloor@%
+ \pgfmathfloat@install\pgfmathceil@=\pgfmathfloatceil@
+ \pgfmathfloat@install\pgfmathint@=\pgfmathfloatint@
\pgfmathfloat@install\pgfmathmod@=\pgfmathfloatmod@%
\pgfmathfloat@install\pgfmathmax@=\pgfmathfloatmax@%
\pgfmathfloat@install\pgfmathmin@=\pgfmathfloatmin@%
@@ -284,11 +286,14 @@
\pgfmathfloat@install\pgfmathsinh@=\pgfmathfloatsinh@
\pgfmathfloat@install\pgfmathtanh@=\pgfmathfloattanh@
\expandafter\pgfmathfloat@install\csname pgfmathatan2@\endcsname=\pgfmathfloatatantwo@
- \pgfmathfloat@install@unimplemented{ceil}%
+ \pgfmathfloat@install@unimplemented{isprime}%
+ \pgfmathfloat@install@unimplemented{iseven}%
+ \pgfmathfloat@install@unimplemented{gcd}%
\pgfmathfloat@install@unimplemented{frac}%
\pgfmathfloat@install@unimplemented{random}%
\pgfmathfloat@install@unimplemented{setseed}%
\pgfmathfloat@install@unimplemented{Mod}%
+ \pgfmathfloat@install@unimplemented{div}%
\pgfmathfloat@install@unimplemented{real}%
% \pgfmathfloat@install@unimplemented{height}%
%
@@ -411,6 +416,8 @@
}%
\pgfmathdeclarepseudoconstant{inf}{\def\pgfmathresult{inf}}
+\pgfmathdeclarepseudoconstant{INF}{\def\pgfmathresult{inf}}
+\pgfmathdeclarepseudoconstant{Inf}{\def\pgfmathresult{inf}}
\pgfmathdeclarepseudoconstant{infty}{\def\pgfmathresult{inf}}
\pgfmathdeclarepseudoconstant{nan}{\def\pgfmathresult{nan}}
\pgfmathdeclarepseudoconstant{NaN}{\def\pgfmathresult{nan}}
@@ -1407,10 +1414,16 @@
% works symbolly)
%
% @see \pgfmathfloattoint
+% POSTCONDITION: \pgfmathresult contains the result and
+% \pgfmathfloatintwasnoop=1 if there was nothing to do
+% \pgfmathfloatintwasnoop=0 if there where non-zero digits after the period
+% \pgfmathfloatintwasnoop=2 if there where digits after the period. The digits will be stored in \pgfmathfloatintremainder in this case.
\def\pgfmathfloatint@#1{%
\begingroup
- \edef\pgfmathresult{#1}%
- \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \edef\pgfmathfloatint@input{#1}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathfloatint@input\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \gdef\pgfmathfloatintwasnoop{1}%
+ \gdef\pgfmathfloatintremainder{}%
\ifcase\pgfmathfloat@a@S
% 0: nothing to do.
\or% +
@@ -1422,6 +1435,7 @@
\else
% nothing to do
\fi
+ %\message{ XXXXX int(\pgfmathfloatint@input) = \pgfmathresult -> was no op = \pgfmathfloatintwasnoop\space (remainder \pgfmathfloatintremainder)^^J}%
\pgfmath@smuggleone\pgfmathresult
\endgroup
}%
@@ -1430,6 +1444,7 @@
\pgfmathfloat@a@S=0
\pgfmathfloat@a@Mtok={0.0}%
\pgfmathfloat@a@E=0
+ \gdef\pgfmathfloatintwasnoop{0}%
\expandafter\pgfmathfloatint@@loop@gobble
\else
\pgfmathfloat@a@Mtok={#1.}%
@@ -1440,10 +1455,11 @@
\def\pgfmathfloatint@@loop#1{%
\def\pgfmathfloatint@@loop@{#1}%
\ifx\pgfmathfloatint@@loop@\pgfmathfloat@EOI
+ \gdef\pgfmathfloatintwasnoop{1}%
\let\pgfmathfloatint@@loop@next=\relax
\else
\ifnum\pgfmathfloat@b@E=0
- \let\pgfmathfloatint@@loop@next=\pgfmathfloatint@@loop@gobble
+ \def\pgfmathfloatint@@loop@next{\pgfmathfloatint@@loop@gobble#1}%
\else
\pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
\advance\pgfmathfloat@b@E by-1
@@ -1452,13 +1468,73 @@
\fi
\pgfmathfloatint@@loop@next
}%
-\def\pgfmathfloatint@@loop@gobble#1\pgfmathfloat@EOI{}%
+\def\pgfmathfloatint@@loop@gobble#1\pgfmathfloat@EOI{%
+ \if0\pgfmathfloatintwasnoop
+ \else
+ \gdef\pgfmathfloatintwasnoop{2}%
+ \gdef\pgfmathfloatintremainder{#1}%
+ \fi
+}%
\let\pgfmathfloatint=\pgfmathfloatint@
-\let\pgfmathfloatfloor=\pgfmathfloatint
-\let\pgfmathfloatfloor@=\pgfmathfloatint@
+
+\def\pgfmathfloatfloor#1{%
+ \edef\pgfmath@orig{#1}%
+ \pgfmathfloatint@{#1}%
+ \pgfmathfloatifflags{\pgfmath@orig}{2}{%
+ \let\pgfmath@trunc=\pgfmathresult
+ \ifcase\pgfmathfloatintwasnoop\relax
+ % ah - we stripped something! Round DOWN
+ \pgfmathfloatcreate{2}{1.0}{0}% -1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ \or
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ \else
+ % ok, we have to inspect the remainder:
+ \pgfmathfloatparsenumber{0.\pgfmathfloatintremainder}%
+ \pgfmathfloatifflags{\pgfmathresult}{1}{%
+ % ah - we stripped a non-zero remainder! Round DOWN
+ \pgfmathfloatcreate{2}{1.0}{0}% -1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ }{%
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ }%
+ \fi
+ }{}%
+}
+\let\pgfmathfloatfloor@=\pgfmathfloatfloor
+
+\def\pgfmathfloatceil#1{%
+ \edef\pgfmath@orig{#1}%
+ \pgfmathfloatint@{#1}%
+ \pgfmathfloatifflags{\pgfmath@orig}{1}{%
+ \let\pgfmath@trunc=\pgfmathresult
+ \ifcase\pgfmathfloatintwasnoop\relax
+ % ah - we stripped something! Round UP
+ \pgfmathfloatcreate{1}{1.0}{0}% +1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ \or
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ \else
+ % ok, we have to inspect the remainder:
+ \pgfmathfloatparsenumber{0.\pgfmathfloatintremainder}%
+ \pgfmathfloatifflags{\pgfmathresult}{1}{%
+ % ah - we stripped a non-zero remainder! Round UP
+ \pgfmathfloatcreate{1}{1.0}{0}% +1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ }{%
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ }%
+ \fi
+ }{}%
+}
+\let\pgfmathfloatceil@=\pgfmathfloatceil
\def\pgfmathfloat@notimplemented#1{%
- \pgfmath@error{Sorry, the operation '#1' has not yet been implemented in the floating point unit :-(}{}%
+ \pgfmath@error{Sorry, the operation '#1' has not yet been implemented in the floating point unit}{}%
\pgfmathfloatcreate{0}{0.0}{0}%
}%
@@ -1721,6 +1797,7 @@
\expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
\expandafter\pgfmathfloat@decompose#2\relax\pgfmathfloat@b@S\pgfmathfloat@b@M\pgfmathfloat@b@E
\ifnum\pgfmathfloat@a@S=0
+ % ok, #1 = 0. Substitute by 1e-16 such that the next \ifnum catches it:
\pgfmathfloat@a@E=-16 %
\fi
%
@@ -1811,16 +1888,24 @@
\expandafter\def\csname pgfmathfloatlog10@\endcsname#1{%
\pgfmathfloatln@{#1}%
- \let\pgfmathfloat@log@ten=\pgfmathresult
+ \let\pgfmathfloat@log@e=\pgfmathresult
\pgfmathfloatcreate{1}{4.34294481903252}{-1}% 1/ln(10)
- \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@ten}%
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@e}%
}%
+\pgfutil@namelet{pgfmathfloatlog10}{pgfmathfloatlog10@}%
+
\expandafter\def\csname pgfmathfloatlog2@\endcsname#1{%
\pgfmathfloatln@{#1}%
- \let\pgfmathfloat@log@two=\pgfmathresult
+ \let\pgfmathfloat@log@e=\pgfmathresult
\pgfmathfloatcreate{1}{1.44269504088896}{0}% 1/ln(2)
- \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@two}%
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@e}%
}%
+\pgfutil@namelet{pgfmathfloatlog2}{pgfmathfloatlog2@}%
+
+\expandafter\let\expandafter\pgfmathfloatlogtwo\csname pgfmathfloatlog2\endcsname
+\expandafter\let\expandafter\pgfmathfloatlogtwo@\csname pgfmathfloatlog2@\endcsname
+\expandafter\let\expandafter\pgfmathfloatlogten\csname pgfmathfloatlog10\endcsname
+\expandafter\let\expandafter\pgfmathfloatlogten@\csname pgfmathfloatlog10@\endcsname
% Computes log(x) into \pgfmathresult.
%
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 28de0607b25..5e6a7bbc10e 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: Do 1. Jan 22:31:46 CET 2015 %%%
+%%% Date of this copy: Mi 6. Jan 09:15:30 CET 2016 %%%
@@ -33,9 +33,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
%
-% $Id: pgflibraryluamath.code.tex,v 1.19 2014/12/27 14:11:49 cfeuersaenger Exp $
-%
-% !!! Warning: this library does not work with fpu!!!
+% $Id: pgflibraryluamath.code.tex,v 1.20 2015/06/05 06:23:21 cfeuersaenger Exp $
%
%
% This is a library for a LUA math parser and LUA math operations.
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
index adf818bef7e..f4d348e9592 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.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: So 11. Jan 19:35:13 CET 2015 %%%
+%%% Date of this copy: Do 31. Dez 19:01:21 CET 2015 %%%
@@ -62,6 +62,9 @@
\newif\iftikzexternal@export@enabled
\tikzexternal@export@enabledtrue
+% must be numeric!
+\gdef\c@tikzexternal@version{2}
+
% This 'if' can be used as part of the public user interface.
%
% It is set by the 'remake next' key.
@@ -163,7 +166,7 @@
mode/list only/.code = {\def\tikzexternal@opmode{3}\tikzexternal@genfigurelisttrue},
mode/convert with system call/.code={%
\def\tikzexternal@opmode{4}%
- \pgfkeysalso{/tikz/external/figure list=false,/pgf/images/aux in dpth=true}% ATTENTION: this *can't* work if \label{} contains pictures!
+ \pgfkeysalso{/tikz/external/figure list=false,/pgf/images/aux in dpth=true}%
},
mode/list and make/.code = {%
\def\tikzexternal@opmode{5}%
@@ -172,6 +175,9 @@
mode=convert with system call,
force remake/.is if=tikzexternal@force@remake,
force remake/.default=true,
+ %
+ % DEPRECATED: this here will work out-of-the box (provided that
+ % 'aux in dpth' is active):
failed ref warnings for/.initial={\ref,\cite,\pageref},
export next/.is if=tikzexternalexportnext,
export/.is if=tikzexternal@export@enabled,
@@ -469,8 +475,7 @@
\tikzexternalauxlock@getlockvalue
\if1\tikzexternallocked
\pgfexternalreadmainauxfalse
- % the main .aux file won't be read. Handle \ref commands:
- \tikzexternalauxlock@handleref
+ % the main .aux file won't be read right now.
\else
\pgfexternalreadmainauxtrue
\fi
@@ -509,79 +514,10 @@
}
-% Installs a special \ref{} command such that externalized pictures
-% can use \ref and the user gets a warning if something fails.
-%
-% The special \ref handling is installed for every reference command
-% in the list '/tikz/external/failed ref warnings for' which contains
-% '\ref,\pageref,\cite'.
-%
-% For use in the aux lock handling only.
-%
-% ATTENTION: this is used if and only if *all* references are broken
-% (because the .aux file is NOT read at all)!
-\def\tikzexternalauxlock@handleref{%
- \let\pgf@external@grab@refundefinedtrue=\pgf@external@grab@refundefinedtrue@orig
- %
- \pgfkeysgetvalue{/tikz/external/failed ref warnings for}\tikzexternal@temp
- \expandafter\tikzexternalauxlock@handleref@loop\tikzexternal@temp,\@EOI,%
-}
-\def\tikzexternalauxlock@handleref@loop#1,{%
- \def\tikzexternal@temp{#1}%
- \ifx\tikzexternal@temp\pgfutil@empty
- \expandafter\tikzexternalauxlock@handleref@loop
- \else
- \ifx#1\@EOI
- \else
- {%
- % strip the leading '\'
- % this allows proper \protect ion when you write
- % \caption{...\cite{..}} and #1=\cite
- \escapechar=-1
- \xdef\pgf@temp{\string#1}%
- }%
- \expandafter\let\csname tikzexternalauxlock@handleref@orig@\pgf@temp\endcsname=#1%
- \edef#1{\noexpand\pgf@texdist@protect\noexpand\tikzexternalauxlock@handleref@repl{\pgf@temp}}%
- \expandafter\expandafter\expandafter\tikzexternalauxlock@handleref@loop
- \fi
- \fi
-}%
-\def\tikzexternalauxlock@handleref@repl#1{%
- \pgfutil@ifnextchar[{\tikzexternalauxlock@handleref@gobble@opt{#1}}{\tikzexternalauxlock@handleref@repl@{#1}}%
+% this is a hook into pgfcoreexternal.code.tex:
+\def\pgf@external@grab@refundefinedtrue@code{%
+ \gdef\noexpand\tikzexternal@systemcall@reschedule@to@end@document{1}%
}%
-% silently discard the options. We merely need to generate a warning.
-\def\tikzexternalauxlock@handleref@gobble@opt#1[#2]{%
- % there may be more than one set of options (biblatex's \cite):
- \pgfutil@ifnextchar[{\tikzexternalauxlock@handleref@gobble@opt{#1}}{\tikzexternalauxlock@handleref@repl@{#1}}%
-}%
-\def\tikzexternalauxlock@handleref@repl@#1#2{%
- \tikzifexternalizingcurrent{%
- % note that '#1' is NO control sequence! it is a protected string
- \csname tikzexternalauxlock@handleref@orig@#1\endcsname{#2}%
- \begingroup
- \def\n{\pgfexternal@hat\pgfexternal@hat J}%
- \tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}%
- \def\space{\noexpand\space}%
- \pgfexternalstorecommand{%
- \noexpand\begingroup
- \noexpand\toks0={\pgf@tempa}%
- \noexpand\immediate\noexpand\write16{\tikzexternalauxlock@handleref@warning{#2}{\noexpand\the\noexpand\toks0}}%
- \noexpand\G@refundefinedtrue
- \noexpand\endgroup
- }%
- \endgroup
- }{%
- % ok. We are not externalizing this part of the document.
- % Throw the citation away without further notice.
- }%
-}%
-\def\tikzexternalauxlock@handleref@warning#1#2{%
- \n
- LaTeX Warning: Reference `#1' in external picture `\pgfactualjobname' could not be resolved\noexpand\on@line.\n
- This is because the \tikzexternal@realjob.aux file is not accessable in this context, you will need to issue the externalize command\n
- \space\space\space#2\n
- manually.\n%
-}
% Expands to the default image extension (it is set by
% \tikzexternalize).
@@ -969,8 +905,8 @@
\def\tikzexternalmakefiledefaultdeprule{%
\immediate\write\tikzexternal@outmakefile{\tikzexternal@PERCENTchar.\tikzexternaldepext:}%
- \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar mkdir -p $(dir $@)}%
- \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar touch $@ \tikzexternal@HASHchar\space will be filled later.}%
+ \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar mkdir -p \tikzexternal@normal@dq $(dir $@)\tikzexternal@normal@dq}%
+ \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar touch \tikzexternal@normal@dq $@\tikzexternal@normal@dq\space \tikzexternal@HASHchar\space will be filled later.}%
}%
% Invokes '#1' if a makefile is to be written and '#2' if not.
@@ -1463,6 +1399,9 @@
}%
\long\def\tikzexternal@externalizefig@systemcall@@#1{%
\tikzexternal@externalizefig@systemcall@uptodatecheck{#1}%
+ \tikzexternal@assemble@systemcall{\tikzexternal@curfilename}{\pgf@tempa}%
+ \global\let\tikzexternal@cursyscall=\pgf@tempa
+ \gdef\tikzexternal@typeset@picture@on@failure{1}%
\iftikzexternal@file@isuptodate
\iftikzexternal@verboseio
\immediate\write16{===== Image '\tikzexternal@curfilename' is up-to-date. ======}%
@@ -1471,51 +1410,72 @@
\else
\begingroup
% no such image. Generate it!
- \tikzexternal@assemble@systemcall{\tikzexternal@curfilename}{\pgf@tempa}%
- \iftikzexternal@verboseio
- \immediate\write16{===== 'mode=convert with system call': Invoking '\pgf@tempa' ========}%
- \fi
%
\tikzexternalauxlock@setlock1%
- \immediate\write18{\pgf@tempa}%
+ \tikzexternal@externalizefig@systemcall@call{\tikzexternal@cursyscall}%
\tikzexternalauxlock@setlock0%
- \expandafter\tikzexternal@externalizefig@systemcall@assertsuccess\expandafter{\pgf@tempa}%
+ \expandafter\tikzexternal@externalizefig@systemcall@assertsuccess\expandafter{\tikzexternal@cursyscall}%
\pgfmath@smuggleone\pgf@filename
\endgroup
\fi
\ifx\pgf@filename\pgfutil@empty
- % error recovery: something did not work! Try to load it
- % anyway. Perhaps it was just that shell-escape wasn't
- % enabled.
- \begingroup
- \toks0={%
- \tikzexternaldisable
- \pgfutil@ifundefined{scantokens}{\long\def\scantokens##1{##1}}{}%
- }%
- % FIXME : THIS WILL FAIL IF THERE IS '##' INSIDE OF '#1'!
- % for example something like /.style={#1} in the picture environment *will* fail.
- \toks1={%
- \tikzpicture#1%
- }%
- \toks2={%
- \tikzexternal@TEXDIALECT@endpicture
- \tikzexternalenable
- }%
- \xdef\tikzexternal@externalizefig@systemcall@next{%
- \the\toks0
- % try reading them again as if they were in the input file.
- \noexpand\scantokens{\the\toks1 }%
- \the\toks2
- }%
- \endgroup
+ \if1\tikzexternal@typeset@picture@on@failure
+ % error recovery: something did not work! Try to load it
+ % anyway. Perhaps it was just that shell-escape wasn't
+ % enabled.
+ \begingroup
+ \toks0={%
+ \tikzexternaldisable
+ \pgfutil@ifundefined{scantokens}{\long\def\scantokens##1{##1}}{}%
+ }%
+ % FIXME : THIS WILL FAIL IF THERE IS '##' INSIDE OF '#1'!
+ % for example something like /.style={#1} in the picture environment *will* fail.
+ \toks1={%
+ \tikzpicture
+ #1%
+ }%
+ \toks2={%
+ \tikzexternal@TEXDIALECT@endpicture
+ \tikzexternalenable
+ }%
+ \xdef\tikzexternal@externalizefig@systemcall@next{%
+ \the\toks0
+ % try reading them again as if they were in the input file.
+ \noexpand\scantokens{\the\toks1 }%
+ \the\toks2
+ }%
+ \endgroup
+ \else
+ % Ah -- this picture failed, but the failure has already
+ % been handled somehow. Do not typeset it again!
+ %
+ % A use-case is that the picture has been rescheduled for
+ % \end{document}.
+ \gdef\tikzexternal@externalizefig@systemcall@next{\tikzexternal@closeenvironments}%
+ \fi
\else
% ok, take the image!
+ \gdef\tikzexternal@systemcall@reschedule@to@end@document{0}%
\expandafter\pgfincludeexternalgraphics\expandafter{\tikzexternal@curfilename}%
+ \if1\tikzexternal@systemcall@reschedule@to@end@document
+ \pgfutil@IfUndefined{AtVeryEndDocument}{%
+ }{%
+ \immediate\write16{===== The previous system call resulted in undefined references inside of the output file. Rescheduling it for \string\end{document}. ========}%
+ \expandafter\tikzexternal@externalizefig@systemcall@reschedule\expandafter{\tikzexternal@cursyscall}%
+ }%
+ \fi
\gdef\tikzexternal@externalizefig@systemcall@next{\tikzexternal@closeenvironments}%
\fi
\tikzexternal@externalizefig@systemcall@next
}%
+\def\tikzexternal@externalizefig@systemcall@call#1{%
+ \iftikzexternal@verboseio
+ \immediate\write16{===== 'mode=convert with system call': Invoking '#1' ========}%
+ \fi
+ \immediate\write18{#1}%
+}%
+
% Sets \iftikzexternal@file@isuptodate to false if one of the "force
% remake" things is active.
\def\tikzexternal@checkforceremake{%
@@ -1656,11 +1616,9 @@
% It returns \iftikzexternal@file@isuptodate accordingly.
% #1: the picture-content
\long\def\tikzexternal@externalizefig@systemcall@uptodatecheck#1{%
+ \tikzexternal@check@uptodate@mode{#1}%
\tikzexternal@checkforceremake
\iftikzexternal@file@isuptodate
- \tikzexternal@check@uptodate@mode{#1}%
- \fi
- \iftikzexternal@file@isuptodate
% check if there is already a file.
% In that case, use it. If that is not the case, generate it and include it afterwards.
\gdef\pgf@filename{}%
@@ -1679,14 +1637,70 @@
\xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
\pgf@tempa
\ifx\pgf@filename\pgfutil@empty%
- \tikzerror{Sorry, the system call '#1' did NOT result in a usable output file '\tikzexternal@curfilename' (expected one of \pgfsys@imagesuffixlist). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in '\tikzexternal@curfilename.log'. If you continue now, I'll try to typeset the picture}{}%
+ \tikzexternal@externalizefig@systemcall@handleexception{#1}%
\fi
}%
+\def\tikzexternal@externalizefig@systemcall@handleexception@msg#1{%
+ \tikzerror{Sorry, the system call '#1' did NOT result in a usable output file '\tikzexternal@curfilename' (expected one of \pgfsys@imagesuffixlist). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in '\tikzexternal@curfilename.log'. If you continue now, I'll try to typeset the picture}{}%
+}
+\def\tikzexternal@externalizefig@systemcall@handleexception@retry@later#1{%
+ \gdef\tikzexternal@systemcall@reschedule@to@end@document{0}%
+ \expandafter\pgfexternalreaddpth\expandafter{\tikzexternal@curfilename}%
+ \if1\tikzexternal@systemcall@reschedule@to@end@document
+ \pgfutil@IfUndefined{AtVeryEndDocument}{%
+ \tikzexternal@externalizefig@systemcall@handleexception@msg{#1}%
+ }{%
+ \immediate\write16{===== The last system call resulted in an EMPTY output file. Maybe it is part of \string\ref. Rescheduling it for \string\end{document}. ========}%
+ \gdef\tikzexternal@typeset@picture@on@failure{0}%
+ \tikzexternal@externalizefig@systemcall@reschedule{#1}%
+ }%
+ \else
+ \tikzexternal@externalizefig@systemcall@handleexception@msg{#1}%
+ \fi
+}
+
+% reschedules the externalization of the current file to
+% \AtVeryEndDocument.
+%
+% This hook allows to execute code AFTER the main .aux file is
+% finished; it will even re-read the main aux file.
+\def\tikzexternal@externalizefig@systemcall@reschedule#1{%
+ \t@tikzexternal@tmpb={%
+ \global\let\tikzexternal@externalizefig@systemcall@handleexception=\tikzexternal@externalizefig@systemcall@handleexception@msg%
+ % ... no auxlocks!
+ \tikzexternal@externalizefig@systemcall@call{#1}%
+ \tikzexternal@externalizefig@systemcall@assertsuccess{#1}%
+ }%
+ \xdef\pgfutil@tempa{%
+ \noexpand\def\noexpand\tikzexternal@curfilename{\tikzexternal@curfilename}%
+ \the\t@tikzexternal@tmpb
+ }%
+ \expandafter\AtVeryEndDocument\expandafter{\pgfutil@tempa}%
+ \gdef\tikzexternal@has@rescheduled@something{1}%
+}%
+\let\tikzexternal@externalizefig@systemcall@handleexception=\tikzexternal@externalizefig@systemcall@handleexception@retry@later%
+
+\def\tikzexternal@has@rescheduled@something{0}%
+\pgfutil@IfUndefined{AtVeryEndDocument}{}{%
+ \AtVeryEndDocument{%
+ \if1\tikzexternal@has@rescheduled@something
+ \immediate\write16{===== tikzexternal: \string\end{document} reached. Working on rescheduled images to resolve references... ========}%
+ \fi
+ }%
+}
% Overwrite error message of pgf.
% This happens if the generated image was empty, i.e. if there was no \shipout.
\def\pgfexternal@error@no@shipout{%
\begingroup
+ \begingroup
+ % overwrite .dpth file in order to flag the file as "need to be scheduled
+ % for \AtVeryEndDocument" :
+ \immediate\openout\pgf@plotwrite=\pgfactualjobname.dpth
+ \let\w@pgfexternal@auxout=\pgf@plotwrite
+ \pgfexternalstorecommand@isexporting{\gdef\noexpand\tikzexternal@systemcall@reschedule@to@end@document{1}}%
+ \immediate\closeout\pgf@plotwrite
+ \endgroup
\tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}%
\toks0=\expandafter{\pgf@tempa}%
\tikzerror{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname', but it seems there is no such image in the document!?
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex
index 7e41bce2e56..e4ef015455f 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.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: Di 25. Dez 18:14:20 CET 2012 %%%
+%%% Date of this copy: Do 31. Dez 19:01:21 CET 2015 %%%
@@ -47,9 +47,26 @@
% It replaces \tikzpicture/ \endtikzpicture and \tikz and invokes \beginpgfgraphicnamed ... \endpgfgraphicnamed
% commands if necessary.
+% load this package in order to get \pdf@mdfivesum .
+% \pdf@mdfivesum is available for pdftex and lualatex and computes the
+% md5 sum. Note that pdftex has \pdfmdfivesum, but lualatex does not
+% have it.
+%
+% ... also used for \pdf@shellescape.
+\usepackage{pdftexcmds}
+\pgfutil@IfFileExists{atveryend.sty}{%
+ \usepackage{atveryend}%
+}{%
+ \message{! Package tikz Warning: \string\usepackage{atveryend} impossible. Automatic resolving of references within external files impossible.}%
+}%
+
% source generic implementation:
\input pgfplotsoldpgfsupp_tikzexternalshared.code.tex
+\pgfutil@IfUndefined{pdf@mdfivesum}{}{%
+ \let\tikzexternal@mdfivesum=\pdf@mdfivesum
+}%
+
\def\tikzexternal@TEXDIALECT@begpicture{\begin{tikzpicture}}
\def\tikzexternal@TEXDIALECT@endpicture{\end{tikzpicture}}%
@@ -77,6 +94,7 @@
\noexpand\endgroup
\noexpand#1{\the\t@tikzexternal@tmpa}%
}%
+ \t@tikzexternal@tmpa={}% release memory.
\else
\t@tikzexternal@tmpa=\expandafter{\the\t@tikzexternal@tmpa #2\end{#3}}%
\def\tikzexternal@TEXDIALECT@collectpicture@next{%
@@ -86,8 +104,30 @@
}%
\def\tikzexternal@laTeX@collect@until@end@tikzpicturetikzpicturestring{tikzpicture}%
+\def\tikzexternal@handle@landscape{%
+ \ltx@ifpackageloaded{pdflscape}{%
+ % Work around a bug in conjunction with pdflscape and
+ % external: without this optimize-away-instruction, the
+ % externalized image would be rotated - and it will be rotated
+ % once more again when it is included.
+ %
+ % if we "optimize it away", the landscape stuff will be
+ % omitted. I hope this is enough... might not be entirely
+ % fool-proof; perhaps we need to set it to \relax. For now, it
+ % will probably do the job
+ \tikzset{
+ external/.cd,
+ optimize command away=\landscape,
+ optimize command away=\endlandscape
+ }%
+ }{%
+ }%
+}%
+
\AtBeginDocument{%
\pgfutil@ifundefined{tikzexternalrealjob}{%
\global\let\tikzexternalrealjob=\jobname
}{}%
+ \tikzexternal@handle@landscape
}%
+