diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-03 23:06:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-03 23:06:54 +0000 |
commit | 36080b5cf06fe9bdde3b1edb30fd795a58e6bf10 (patch) | |
tree | 172e727ca5a42cbd0c2440855dbb81f3a5c2148e /Master/texmf-dist/tex/generic/pgfplots | |
parent | e27b3d0aaf815fdab1497a0a827998ac044e245d (diff) |
pgfplots update (1apr10)
git-svn-id: svn://tug.org/texlive/trunk@17670 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots')
19 files changed, 1598 insertions, 388 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex index 2df18861a1e..227f5c1a5a4 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex @@ -31,68 +31,16 @@ % % -\def\pgfplots@orig@pgfincludeexternalgraphics#1{% - \begingroup - \openin\r@pgfplots@reada=#1.dpth - \setbox1=\hbox{\pgfkeysvalueof{/pgf/images/include external/.@cmd}{#1}\pgfeov}% - \ifeof\r@pgfplots@reada - \box1 - \else - \read\r@pgfplots@reada to\pgfincludeexternalgraphics@dp - \closein\r@pgfplots@reada - \dimen0=\pgfincludeexternalgraphics@dp\relax - \hbox{\lower\dimen0 \box1 }% - \fi - \endgroup -} -\def\pgfplots@orig@pgf@external@grab#1{% - \def\pgf@filename{#1}% - \setbox\pgfpic=\hbox\bgroup\bgroup% - \let\endpgfgraphicnamed=\pgf@externalend% -} -\def\pgfplots@orig@pgf@externalend{% - \unskip\egroup\egroup% - {% - \parindent0pt% -% \leftmargin0pt% -% \rightmargin0pt% - \dimen0\ht\pgfpic% - \advance\dimen0\dp\pgfpic% - \ifdim\dp\pgfpic=0pt\relax - \else% store the picture's depth. Otherwise, it would be lost. - \immediate\openout\pgf@plotwrite=\pgf@filename.dpth - \immediate\write\pgf@plotwrite{\the\dp\pgfpic}% - \immediate\closeout\pgf@plotwrite - \fi - \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}% - \setbox0=\vbox{% - \kern -1truein% - \hbox{% - \kern -1truein% - \hbox to0pt{% - \wd\pgfexternal@startupbox=0pt% - \ht\pgfexternal@startupbox=0pt% - \dp\pgfexternal@startupbox=0pt% - \box\pgfexternal@startupbox% - \pgfsys@atbegindocument\hss}% - \box\pgfpic% - \kern 1truein}% - \kern1truein}% - \pgfexternal@originalshipout\box0% - }% -} - \pgfplotsiffileexists{tikzlibraryexternal.code.tex}{% \usetikzlibrary{external}% }{% % Backwards compatibility: + \let\pgfplots@backw@compat@AtBeginDocument=\AtBeginDocument + \def\AtBeginDocument#1{}% + \input pgfplotsoldpgfsupp_pgfcoreexternal.code.tex + \let\AtBeginDocument=\pgfplots@backw@compat@AtBeginDocument + % \input pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex - \pgfkeys{ - /pgf/images/include external/.code={\pgfimage{#1}}, - }% - \let\pgfincludeexternalgraphics=\pgfplots@orig@pgfincludeexternalgraphics - \let\pgf@external@grab=\pgfplots@orig@pgf@external@grab - \let\pgf@externalend=\pgfplots@orig@pgf@externalend }% \endinput diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex index ac81e8f5491..bb5ea8de194 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex @@ -296,7 +296,15 @@ \edef\pgfplots@loc@TMPa{% \noexpand\pgfkeys{/pgfplots/group/.cd,\pgfplots@group@style} }\pgfplots@loc@TMPa + % + \let\pgfplots@set@options@sanitizemode@old=\pgfplots@set@options@sanitizemode + \let\pgfplots@set@options@sanitize@old=\pgfplots@set@options@sanitize + \let\pgfplots@set@options@sanitize=\relax + \let\pgfplots@set@options@sanitizemode=\relax \expandafter\pgfplots@set@options\expandafter{\pgfplots@group@rmopts} + \let\pgfplots@set@options@sanitize=\pgfplots@set@options@sanitize@old + \let\pgfplots@set@options@sanitizemode=\pgfplots@set@options@sanitizemode@old + % \pgfplots@group@individual@setup \pgfplots@group@determine@ticklabels \pgfplots@group@current@plot=0% diff --git a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex index ef27a7a2728..157f8874691 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex @@ -448,7 +448,7 @@ \pgfkeyslet{/pgfplots/table/@cell content}\pgfplots@glob@TMPa% }% },% - /pgfplots/table/date type/.default={\year/\month/\day}% + /pgfplots/table/date type/.default={\year/\month/\day},% /pgfplots/table/set content/.style={% /pgfplots/table/postproc cell content/.style={% /pgfplots/table/@cell content={#1}% @@ -916,6 +916,8 @@ /pgfplots/table/every even row/.code=, /pgfplots/table/every first row/.code=, /pgfplots/table/every last row/.code=, + /pgfplots/table/postproc cell content/.code=, + /pgfplots/table/preproc cell content/.code=, }, /pgfplots/table/colnames from/.initial=,% for \pgfplotstabletranspose /pgfplots/table/input colnames to/.initial=colnames,% for \pgfplotstabletranspose @@ -1080,7 +1082,7 @@ \pgfplotsutil@ifdefinedui@withsuffix{#1}{@@table@name}{#2}{#3}% }% -% Defines \pgfmathresult to be the number of rows in table #1. +% Defines \pgfmathresult (and now also \pgfplotsretval) to be the number of rows in table #1. % % #1 may be either a loaded table structure (a macro name) or a table % file name. In the latter case, the file will be loaded temporarily. @@ -1101,6 +1103,7 @@ \pgfmath@smuggleone\pgfmathresult \endgroup }% + \let\pgfplotsretval=\pgfmathresult }% % \pgfplotstablesave[<options>]{<\tablename>}{file name} @@ -1176,7 +1179,8 @@ /pgfplots/table/in col sep=space,% % WARNING: you NEED a '%' before '#1': #1,% - outfile={#3}% + /pgfplots/table/include outfiles=false, + /pgfplots/table/outfile={#3}% ]{#2}% }% @@ -1856,7 +1860,7 @@ \def\thepgfplotstableread@curcol{\the\pgfplotstableread@curcol}% \def\thepgfplotstableread@numcols{\the\pgfplotstableread@numcols}% \def\pgfplotstableread@countreset##1{##1=0 }% - \def\pgfplotstableread@countset##1##2{##1=##2 }% + \def\pgfplotstableread@countset##1##2{##1=##2\relax}% \def\pgfplotstableread@countadvance##1{\advance##1 by1 }% \else % don't re-use integers! We have no protecting scopes! @@ -1906,7 +1910,7 @@ % #1: the <\macro> name of the table which is to be copied to global buffers. % #2: the table file name. \def\pgfplotstable@copy@to@globalbuffers#1#2{% - \global\let\pgfplotstable@colnames@glob=#1 + \global\let\pgfplotstable@colnames@glob=#1\relax \c@pgfplotstable@counta=0\relax% \pgfplotslistforeachungrouped\pgfplotstable@colnames@glob\as\pgfplotstable@loc@TMPa{% \def\pgfplotstable@loc@TMPb{% @@ -3199,7 +3203,7 @@ \global\let\pgfplots@glob@TMPb=\pgfplotstable@newcolname \endgroup \ifpgfplotstablecreatecol@isreallynew - \expandafter\pgfplotslistpushback\expandafter{\pgfplots@glob@TMPb}\to#3 + \expandafter\pgfplotslistpushback\expandafter{\pgfplots@glob@TMPb}\to#3% \fi \expandafter\let\csname\string#3@\pgfplots@glob@TMPb\endcsname=\pgfplots@glob@TMPc }% 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 c63985e38c4..6d1cb8a2ee1 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 @@ -14,7 +14,7 @@ % #2: for normal processing. \def\pgfplots@ifneedspgfcompabitibilitycode#1#2{% %\pgfkeysifdefined{/handlers/.search also/.@cmd}{#2}{#1}% - \pgfutil@ifundefined{pgfutilsolvetwotwoleq}{#1}{#2}% + \pgfutil@ifundefined{pgfkeysdefnargs}{#1}{#2}% }% \pgfplots@ifneedspgfcompabitibilitycode @@ -22,9 +22,7 @@ \immediate\write16{Package pgfplots: loading complementary code for your PGF version...} \input pgfplotsoldpgfsupp_misc.code.tex \let\pgfkeysloaded=\undefined - % FIXME: this does also load pgfkeysfiltered.code.tex again: \input pgfplotsoldpgfsupp_pgfkeys.code.tex - \input pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex \input pgfplotsoldpgfsupp_pgfmathfloat.code.tex \input pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex \input pgfplotsoldpgfsupp_pgflibraryfpu.code.tex 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 132240e77c7..178da4c3510 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 @@ -3,6 +3,16 @@ % compatibility with PGF 2.0 % ====================================================== +\expandafter\ifx\csname w@pgf@writea\endcsname\relax +\newwrite\w@pgf@writea +\fi + +\expandafter\ifx\csname r@pgf@reada\endcsname\relax +\newread\r@pgf@reada +\fi +\let\pgfutil@inputcheck=\r@pgf@reada + + % from pgfutil-common.tex: % Usage: 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 new file mode 100644 index 00000000000..d9e6476398f --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex @@ -0,0 +1,351 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% This file is a copy of some part of PGF/Tikz. +%%% It has been copied here to provide : +%%% - compatibility with older PGF versions +%%% - availability of PGF contributions by Christian Feuersaenger +%%% which are necessary or helpful for pgfplots. +%%% +%%% For reasons of simplicity, I have copied the whole file, including own contributions AND +%%% PGF parts. The copyrights are as they appear in PGF. +%%% +%%% Note that pgfplots has compatible licenses. +%%% +%%% This copy has been modified in the following ways: +%%% - nested \input commands have been updated +%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% + + + +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.1 2010/03/25 20:57:13 ludewich Exp $ + + + +\newif\ifpgfexternal@allow@aux + +\pgfkeys{ + /pgf/images/include external/.code={\pgfimage{#1}}, + /pgf/images/aux in dpth/.is if=pgfexternal@allow@aux, + /pgf/images/aux in dpth/.default=true +} + +% The external read/write mechanism is used as follows: +% +% In your document, you put a number or all of your pgfpicture (or +% tikzpicture) environments inside a pair of \beginpgfexternal and +% \endpgfexternal. The \beginpgfexternal gets one parameter called the +% graphics name. +% +% Once this is done, the next step is to declare the names of your +% graphics in the document at the beginning using the +% \pgfdeclaregraphicname command. +% +% Now, when you typeset your document, each time a \beginpgfexternal +% command is encountered, it will be checked whether the corresponding +% graphics file exists. If this is the case, it will be included and +% the code between \beginpgfexternal and \endpgfexternal is +% ignored. Otherwise, the code is executed normally. +% +% Things change when you run tex on your file with the \jobname set to +% the name of a decalred graphics name. In this case, only your +% graphic will be typeset, the rest of the document will be "thrown away". +% To be more precise, everything is gobbled up to the beginning +% of the first \beginpgfexternal with the given graphics name. Then, +% the content of the "environment" is put in a box (this "environment" +% need not contain a graphics, it may contain anything that can be put +% in a box). Then a single page is output whose size is exactly the +% size of the picture. +% +% So, once you have run tex repeatedly, each time with the jobname set +% to each of the graphics, you can then run tex on the whole document +% and this will cause all graphics to be included rather than begin +% typeset. +% +% Finally, once all the graphics have been created, you can also say +% \input pgfexternal.tex instead of including pgf/TikZ. + + +\newif\ifpgfexternalreadmainaux +\pgfexternalreadmainauxtrue + +% Tells pgf which jobname is the name of the real file +% +% #1 = name +% +% Description: +% +% This command is used to tell pgf that the file named #1 should be +% typeset normally. If \jobname is not equal to #1, only +% the graphic called \jobname will be typeset. +% +% Example: +% +% \pgfrealjobname{survey} +% +% Note that afterwards, \jobname will be set to the argument. In our +% example, \jobname will be 'survey'. This is to accomplish +% compatibility with aux-file generation. + +\def\pgfrealjobname#1{% + \global\let\pgfactualjobname=\jobname + \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}% + \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% + \ifx\pgf@tempa\pgf@tempb% + \else% + \pgf@external@grabshipouttrue% + \pgfexternal@nofiles + \ifpgfexternalreadmainaux + % and reset the jobname. This should allow to handle any + % \label/\ref constructions which are stored in \jobname.aux (and + % which won't be found otherwise) + \gdef\jobname{#1}% + \fi + \ifpgfexternal@allow@aux + \csname newwrite\endcsname\w@pgfexternal@auxout + \fi + \fi% + \gdef\pgfrealjobname##1{}% avoid multiple calls. +} + +\def\pgfexternal@nofiles{% + % replace \relax. The \nofiles macros does + % \let\makeglossary=\relax + % but the glossary.sty calls \renewcommand\makeglossary (which + % will fail if \makeglossary=\relax). Stupid, but it works. + \let\pgfexternal@nofiles@=\relax + \def\relax{\relax}% + % + % suppress generation of LaTeX .aux, .toc etc files. + % generation of these files is not thread-safe. + % the \csname \endcsname yields \relax if \nofiles doesn't exist. + \csname nofiles\endcsname + % + \let\relax=\pgfexternal@nofiles@ +}% + +\newif\ifpgf@external@grabshipout +\newbox\pgfexternal@startupbox + +\AtBeginDocument{% + \ifpgf@external@grabshipout% + \global\let\pgfexternal@originalshipout=\shipout% + \global\def\shipout{\setbox\pgfpic=}% + \maxdeadcycles=10000% + % Ok, gather everything we have seen up to now in a box. This box + % will contain any specials that have been used. + {% + \output{\global\setbox\pgfexternal@startupbox=\vbox{\csname @begindvi\endcsname\unvbox255}}% + \hbox{}\eject% + }% + \fi% +} + + +% "Environment" for an external graphic. +% +% #1 = graphic name +% +% Example: +% +% \beginpgfgraphicnamed{main-graphic2} +% \begin{tikzpicture} +% ... +% \end{tikzpicture} +% \endpgfgraphicnamed + +\def\pgf@externalbegin#1{% + % First, check whether we wish to grab this graphic: + \let\pgf@next=\pgf@external@normal% + \ifpgf@external@grabshipout% + \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}% + \edef\pgf@tempb{\expandafter\string\csname\pgfactualjobname\endcsname}% + \ifx\pgf@tempa\pgf@tempb% + \let\pgf@next=\pgf@external@grab% + \fi% + \fi% + \pgf@next{#1}% +} + + +\AtBeginDocument{ + \let\beginpgfgraphicnamed=\pgf@externalbegin% overwrite definition of pgfexternal.tex if necessary + \let\endpgfgraphicnamed=\unskip +} + + +% Normal operation: Include an external graphic instead of the +% picture, if such an external picture exists. +\def\pgf@external@normal#1{% + \let\pgf@filename=\pgfutil@empty% + \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#1}% + \ifx\pgf@filename\pgfutil@empty% + % Ok, no such image... Just typeset the picture normally. + \let\pgf@next=\relax% + \else% + \let\pgf@next=\pgf@replacepicturebygraphic% + \fi% + \pgf@next% +} + +\long\def\pgf@replacepicturebygraphic#1\endpgfgraphicnamed{% + \expandafter\pgfincludeexternalgraphics\expandafter{\pgf@filename}\unskip +} + +% This is almost the same as \includegraphics{#1}, but it checks +% whether '#1.dpth' exists. In such case, it restores the boxes depth +% stored in #1.dpth. +% +% Furthermore, the .dpth file may contain .aux related information +% collected for the external graphics (references). They start after +% the first line (if any). +\def\pgfincludeexternalgraphics#1{% + \begingroup + \setbox1=\hbox{\pgfkeysvalueof{/pgf/images/include external/.@cmd}{#1}\pgfeov}% + % + \let\pgfincludeexternalgraphics@dp=\pgfutil@empty + \endlinechar=-1 % suppress white space at end + \catcode`\@=11 + \openin\r@pgf@reada=#1.dpth + \pgfincludeexternalgraphics@read@dpth + \ifx\pgfincludeexternalgraphics@dp\pgfutil@empty + \box1 + \else + \dimen0=\pgfincludeexternalgraphics@dp\relax + \hbox{\lower\dimen0 \box1 }% + \fi + \endgroup +} +% +% The .dpth consists of 0-N lines, where each is either a single +% dimension (the box' depth) or something which belongs to the .aux +% file (such lines will always start with a macro). +\def\pgfincludeexternalgraphics@read@dpth{% + \ifeof\r@pgf@reada + \closein\r@pgf@reada + \else + \read\r@pgf@reada to\pgfincludeexternalgraphics@auxline + \ifx\pgfincludeexternalgraphics@auxline\pgfutil@empty + \else + \expandafter\pgfincludeexternalgraphics@read@dpth@line\pgfincludeexternalgraphics@auxline\pgfincludeexternalgraphics@read@dpth@line@EOI + \fi + \expandafter\pgfincludeexternalgraphics@read@dpth + \fi +}% +\long\def\pgfincludeexternalgraphics@read@dpth@line#1#2\pgfincludeexternalgraphics@read@dpth@line@EOI{% + \ifcat\noexpand#1\relax + % Ah -- the first token is a control sequence. It belongs to + % the .aux file. + % + % #1#2\relax% do NOT set the information! many LaTeX commands don't support it (\label for example) + \pgfutil@ifundefined{if@filesw}{% + % sorry, .aux file support only for latex + }{% + % append to main .aux file (for forward references) + \if@filesw + {% + \toks0={#1#2}% + % believe it or not, but the + % \def\dpthimport{...}\dpthimport *makes* a + % difference! In ensures any occuring `##' characters + % are properly expanded to `#'. + \immediate\write\@auxout{\noexpand\def\noexpand\dpthimport{\the\toks0 }\noexpand\dpthimport }% + }% + \fi + }% + \else + \def\pgfincludeexternalgraphics@dp{#1#2}% + \fi +}% + + + +% Grab operation: If jobname matches the graphic name, typeset this +% picture normall. +% REMARK: +% this method is also invoked from within the tikz external library. +\def\pgf@external@grab#1{% + \def\pgf@filename{#1}% + \ifpgfexternal@allow@aux + \begingroup + \pgf@external@init@aux@in@dpth + \fi + \setbox\pgfpic=\hbox\bgroup\bgroup% + \let\endpgfgraphicnamed=\pgf@externalend% +} + +\let\pgf@external@@protected@write@orig=\protected@write +\long\def\pgf@external@@protected@write@immediate#1#2#3{% + \begingroup + \let\pgf@write@=\write + \def\write{\noexpand\immediate\pgf@write@}% + \pgf@external@@protected@write@orig{#1}{#2}{#3}% + \endgroup +}% + +\def\pgf@external@init@aux@in@dpth{% + % tell LaTeX to write aux files... + \csname @fileswtrue\endcsname + % ... but redirect output to the .dpth file! + \immediate\openout\w@pgfexternal@auxout=\pgf@filename.dpth + \let\@auxout=\w@pgfexternal@auxout + % ... and disable the correct page numbers. I can't get that + % (because the correct page number is only available in the + % shipout routine). Use immediate output: + \let\protected@write=\pgf@external@@protected@write@immediate +}% + +% REMARK: +% this method is also invoked from within the tikz external library. +\def\pgf@externalend{% + \unskip\egroup\egroup% + {% + \parindent0pt % leave the space +% \leftmargin0pt% +% \rightmargin0pt% + \dimen0\ht\pgfpic% + \advance\dimen0\dp\pgfpic% + \ifdim\dp\pgfpic=0pt\relax + \else% store the picture's depth. Otherwise, it would be lost. + \ifpgfexternal@allow@aux + \immediate\write\@auxout{\the\dp\pgfpic}% + \immediate\closeout\@auxout + \else + \immediate\openout\pgf@plotwrite=\pgf@filename.dpth + \immediate\write\pgf@plotwrite{\the\dp\pgfpic}% + \immediate\closeout\pgf@plotwrite + \fi + \fi + \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}% + \setbox0=\vbox{% + \kern -1truein % + \hbox{% + \kern -1truein % + \hbox to0pt{% + \wd\pgfexternal@startupbox=0pt % + \ht\pgfexternal@startupbox=0pt % + \dp\pgfexternal@startupbox=0pt % + \box\pgfexternal@startupbox% + \pgfsys@atbegindocument\hss}% + \box\pgfpic% + \kern 1truein }% + \kern1truein }% + \pgfexternal@originalshipout\box0 % + }% + \ifpgfexternal@allow@aux + \endgroup + \fi +} + + +\endinput + diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex index 6ae79bec9bf..24203d3b330 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% @@ -634,6 +634,85 @@ \pgfkeyssetvalue{#1/.@body}{#3}% } +% Like \pgfkeysdefargs, but `#2' is an integer denoting the expected +% *number* of arguments. +% +% There is a subtle difference between the 'args' command, when it +% comes to spaces: +% a key defined with defargs{#1#2} must not have spaces between the +% arguments when it is used. +% +% See this: +% +%-------------------------------------------------- +% % defnargs: +% \pgfkeysdefnargs{/a}{2}{1=`#1', 2=`#2'} +% \pgfkeys{ +% /a= +% {1} +% {2} +% } +% ->defnargs: 1=`1', 2=`2' +% +% defargs: +% \pgfkeysdefargs{/b}{#1#2}{1=`#1', 2=`#2'} +% \pgfkeys{ +% /b= +% {1} +% {2} +% } +% ->defargs: 1=`1', 2=` 2' (note the space!) +% +% defargs: +% \pgfkeysdefargs{/b}{#1#2}{1=`#1', 2=`#2'} +% \pgfkeys{ +% /b= +% {1}% +% {2} +% } +% ->defargs: 1=`1', 2=`2' +%-------------------------------------------------- +\long\def\pgfkeysdefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\def}}% +\long\def\pgfkeysedefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\edef}}% +\long\def\pgfkeysdefnargs@#1#2#3#4{% + \ifcase#2\relax + \pgfkeyssetvalue{#1/.@args}{}% + \or + \pgfkeyssetvalue{#1/.@args}{##1}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6##7}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6##7##8}% + \or + \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6##7##8##9}% + \else + \pgfkeys@error{\string\pgfkeysdefnargs: expected <= 9 arguments, got #2}% + \fi + \pgfkeysgetvalue{#1/.@args}\pgfkeys@tempargs + \def\pgfkeys@temp{\expandafter#4\csname pgfk@#1/.@@body\endcsname}% + \expandafter\pgfkeys@temp\pgfkeys@tempargs{#3}% + % eliminate the \pgfeov at the end such that TeX gobbles spaces + % by using + % \pgfkeysdef{#1}{\pgfkeysvalueof{#1/.@@body}##1} + % (with expansion of '#1'): + \edef\pgfkeys@tempargs{\noexpand\pgfkeysvalueof{#1/.@@body}}% + \def\pgfkeys@temp{\pgfkeysdef{#1}}% + \expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs##1}% + \pgfkeyssetvalue{#1/.@body}{#3}% +} + % Defining a key command @@ -642,8 +721,10 @@ \pgfkeysdef{/handlers/.code 2 args}{\pgfkeysdefargs{\pgfkeyscurrentpath}{##1##2}{#1}} \pgfkeysdef{/handlers/.ecode}{\pgfkeysedef{\pgfkeyscurrentpath}{#1}} \pgfkeysdef{/handlers/.ecode 2 args}{\pgfkeysedefargs{\pgfkeyscurrentpath}{##1##2}{#1}} -\pgfkeysdefargs{/handlers/.code args}{#1#2}{\pgfkeysdefargs{\pgfkeyscurrentpath}{#1}{#2}} -\pgfkeysdefargs{/handlers/.ecode args}{#1#2}{\pgfkeysedefargs{\pgfkeyscurrentpath}{#1}{#2}} +\pgfkeysdefnargs{/handlers/.code args}{2}{\pgfkeysdefargs{\pgfkeyscurrentpath}{#1}{#2}} +\pgfkeysdefnargs{/handlers/.ecode args}{2}{\pgfkeysedefargs{\pgfkeyscurrentpath}{#1}{#2}} +\pgfkeysdefnargs{/handlers/.code n args}{2}{\pgfkeysdefnargs{\pgfkeyscurrentpath}{#1}{#2}} +\pgfkeysdefnargs{/handlers/.ecode n args}{2}{\pgfkeysedefnargs{\pgfkeyscurrentpath}{#1}{#2}} % Adding to a key command @@ -651,15 +732,24 @@ % Find out, whether with args or not. \pgfkeysifdefined{\pgfkeyscurrentpath/.@args}% {% Yes, so add to body and reuse args - \pgfkeysaddvalue{\pgfkeyscurrentpath/.@body}{#1}{#2}% - % Redefine code - \pgfkeysgetvalue{\pgfkeyscurrentpath/.@args}{\pgfkeys@tempargs}% - \pgfkeysgetvalue{\pgfkeyscurrentpath/.@body}{\pgfkeys@tempbody}% - \expandafter\expandafter\expandafter\def\expandafter\pgfkeys@temp\expandafter\pgfkeys@tempargs\expandafter{\pgfkeys@tempbody}% - \pgfkeyslet{\pgfkeyscurrentpath/.@cmd}{\pgfkeys@temp}% + \pgfkeysaddvalue{\pgfkeyscurrentpath/.@body}{#1}{#2}% + % Redefine code + {% + \pgfkeysgetvalue{\pgfkeyscurrentpath/.@args}{\pgfkeys@tempargs}% + \pgfkeysgetvalue{\pgfkeyscurrentpath/.@body}{\pgfkeys@tempbody}% + \def\pgfkeys@marshal{\expandafter\gdef\expandafter\pgfkeys@global@temp\pgfkeys@tempargs}% + \expandafter\pgfkeys@marshal\expandafter{\pgfkeys@tempbody}% + }% + \pgfkeysifdefined{\pgfkeyscurrentpath/.@@body}{% + % support for \pgfkeysndefargs: + \pgfkeyslet{\pgfkeyscurrentpath/.@@body}{\pgfkeys@global@temp}% + }{% + % support for \pgfkeysdefargs: + \pgfkeyslet{\pgfkeyscurrentpath/.@cmd}{\pgfkeys@global@temp}% + }% }% {% - % No, so single argument. Redefine accordingly. + % No, so single argument (simple \pgfkeysdef). Redefine accordingly. {% \toks0{#1}% \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex index 5d7a731334d..c795bc45ffb 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% 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 3bb41804bdb..0af3c3887c5 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 @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% @@ -94,6 +94,11 @@ fpu/output format/sci/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattosci@{\pgfmathresult}}}, fpu/output format/fixed/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattofixed@{\pgfmathresult}}}, fpu/output format/float, + fpu/rel thresh/.code={% + \pgfmathfloatparsenumber{#1}% + \let\pgfmathfloat@relthresh=\pgfmathresult + }, + fpu/rel thresh=1e-4, } \pgfmathfloatcreate{1}{1.0}{0}\let\pgfmathfloatscale=\pgfmathresult @@ -897,6 +902,28 @@ \ifnum\pgfmathfloatiffinite@>2 #3\else #2\fi }% + +% Computes the relative error between #1 and #2 (assuming #2 != 0) and +% invokes #3 if the relative error is below `/pgf/fpu/rel thresh' and +% #4 if that is not the case. +\long\def\pgfmathfloatifapproxequalrel#1#2#3#4{% + \begingroup + \pgfmathfloatparsenumber{#1}% + \let\pgfmathfloatarga=\pgfmathresult + \pgfmathfloatparsenumber{#2}% + \let\pgfmathfloatargb=\pgfmathresult + \pgfmathfloatrelerror@\pgfmathfloatarga\pgfmathfloatargb + \let\pgfmathfloatarga=\pgfmathresult + \pgfmathfloatlessthan@\pgfmathfloatarga\pgfmathfloat@relthresh + \ifpgfmathfloatcomparison + \def\pgfmathfloat@loc@TMPa{#3}% + \else + \def\pgfmathfloat@loc@TMPa{#4}% + \fi + \expandafter\endgroup + \pgfmathfloat@loc@TMPa +}% + % Invokes code '#3' if the flags of the floating point number '#1' % match the flag provided in '#2'. % @@ -1420,6 +1447,7 @@ } \let\pgfmathfloatmod=\pgfmathfloatmod@ + % A modification of \pgfmathfloatmod@ where #3 = 1/#2 is already % known. This may be faster. \def\pgfmathfloatmodknowsinverse@#1#2#3{% @@ -1472,7 +1500,7 @@ % % #1 is a one-argument macro which assigns \pgfmathresult. \def\pgfmathfloatTRIG@#1#2{% - \expandafter\ifx\csname pgfmathfloatTRIG@NUM\endcsname\relax% why not directly!??? Did not work!?? + \expandafter\ifx\csname pgfmathfloatTRIG@NUM\endcsname\relax% % Lazy evaluation: \pgfmathfloatcreate{1}{3.6}{2}% \global\let\pgfmathfloatTRIG@NUM=\pgfmathresult @@ -1515,7 +1543,7 @@ \def\pgfmathfloatatan@#1{% \begingroup - \expandafter\ifx\csname pgfmathfloatatan@TMP\endcsname\relax% why not directly!??? Did not work!?? + \expandafter\ifx\csname pgfmathfloatatan@TMP\endcsname\relax% \pgfmathfloatcreate{1}{1.6}{4}% \global\let\pgfmathfloatatan@TMP=\pgfmathresult \pgfmathfloatcreate{2}{1.6}{4}% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex index d2089a6fd67..f93028724a3 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex index 93a7a0c59e2..a03ef94d6a5 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex index edfc48d5a4e..0c20db997a3 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% @@ -216,6 +216,7 @@ \pgfkeysvalueof{/pdflinks/show labels code/.@cmd}{\pgfmanualpdflabel@@}\pgfeov \fi % + \if@filesw \ifx\pgfmanualpdf@catcode\pgfutil@empty \else \toks0=\expandafter{\pgfmanualpdf@catcode}% @@ -232,6 +233,7 @@ \else \immediate\write\@auxout{\noexpand\endgroup}% \fi + \fi \expandafter\gdef\csname pgfd@lbl@\pgfmanualpdflabel@@\endcsname{w}% 1. remember the label AND remember that we "w"rote it into the pdf. \edef\pgfmanualpdflabel@@{\pgfkeysvalueof{/pdflinks/internal link prefix}.\pgfmanualpdflabel@@}% \expandafter\hypertarget\expandafter{\pgfmanualpdflabel@@}{#2}% @@ -252,8 +254,10 @@ \def\pgfmanual@tempa{\foreach \prefix in }% \pgfkeysgetvalue{/pdflinks/search key prefixes in}\pgfmanual@tempb \expandafter\pgfmanual@tempa\expandafter{\pgfmanual@tempb}{% - \ifcsname pgfd@lbl@\prefix\pgfmanualpdflabel@@\endcsname - \xdef\pgfmanual@glob{\prefix\pgfmanualpdflabel@@}% + \edef\pgfmanualpdflabel@@{\prefix\pgfmanualpdflabel@@}% + \expandafter\pgfmanual@handlespeciallabeltokens@in\expandafter{\pgfmanualpdflabel@@}% + \ifcsname pgfd@lbl@\pgfmanualpdflabel@@\endcsname + \xdef\pgfmanual@glob{\pgfmanualpdflabel@@}% \breakforeach \fi }% @@ -314,6 +318,7 @@ \pgfmath@smuggleone\pgfmanualpdflabel@@ \endgroup }% + \expandafter\def\expandafter\pgfmanualpdfref@substitute@backslash\expandafter#\expandafter1\pgfmanual@pretty@backslash#2\relax{% \edef\pgfmanualpdflabel@@{#1\textbackslash #2}% }% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex index 04fed087887..20e0bf1b4d2 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% 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 67d2be8c72b..62a33269d8b 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 @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% @@ -643,11 +643,13 @@ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}% }% +% @deprecated. It has been replaced by \pgfmathprintnumber@fixed@styleDEFAULT % #1 maybe a macro \def\pgfmathprintnumber@fixed@stylePERIOD#1#2#3e#4\relax{% \def\pgfmathresult{#1}% } +% @deprecated. It has been replaced by \pgfmathprintnumber@fixed@styleDEFAULT % #1 maybe a macro \def\pgfmathprintnumber@fixed@styleCOMMA#1#2#3e#4\relax{% \ifpgfmathfloatroundhasperiod @@ -721,7 +723,10 @@ % #2: mantisse % #3: exponent % #4: CODE to display if the mantisse is drawn. -% #5: CODE to display if the mantisse is NOT draw. (unused) +% This code will be shown just before the exponent. +% Example: #4=\cdot +% #5: CODE to display if the mantisse is NOT draw. (unused currently) +% Might be used to display '10^1' instead of '1*10^1'. % #6: CODE to display the exponent. \def\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax#4#5#6{% \pgfkeysgetvalue{/pgf/number format/@sci exponent mark}\pgfmathfloatrounddisplaystyle@e@mark @@ -733,7 +738,7 @@ \or\pgfmathprintnumber@fixed@style{-#2}#1#2e0\relax% \expandafter\pgfmathfloatrounddisplaystyle@shared@impl@\expandafter{\pgfmathresult}{#4#6}% \or - \pgfmathfloatrounddisplaystyle@shared@impl@@{NaN}{}% + \pgfmathfloatrounddisplaystyle@shared@impl@@{\hbox{NaN}}{}% \or \ifpgfmathprintnumber@showpositive \pgfmathfloatrounddisplaystyle@shared@impl@@{+\infty}{}% @@ -802,6 +807,20 @@ \expandafter\pgfmathfloat@loc@TMPb\expandafter{\pgfmathresult}% } +\def\pgfmathfloatrounddisplaystyle@generic#1#2e#3\relax{% + \begingroup + \pgfkeysvalueof {/pgf/number format/sci generic/@/.@cmd}{#3}{#1}{#2}\pgfeov + \pgfkeysgetvalue{/pgf/number format/sci generic/mantisse sep}\pgfmathdisplay@aftermantisse + \pgfkeysgetvalue{/pgf/number format/sci generic/empty mantisse sep}\pgfmathdisplay@nomantisse + \pgfkeysgetvalue{/pgf/number format/sci generic/exponent}\pgfmathdisplay@e + \toks0=\expandafter{\pgfmathdisplay@aftermantisse}% + \toks1=\expandafter{\pgfmathdisplay@nomantisse}% + \toks2=\expandafter{\pgfmathdisplay@e}% + \xdef\pgfmathfloat@glob@TMP{\noexpand\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\noexpand\relax{\the\toks0}{\the\toks1}{\the\toks2}}% + \endgroup + \pgfmathfloat@glob@TMP +} + % A macro which takes the argument '<SIGN><MANTISSE>e<EXPONENT>' and % expands to the final TeX-representation for that floating point % number. @@ -817,15 +836,22 @@ \newif\ifpgfmathfloat@usezerofill@fixed \newif\ifpgfmathprintnumber@assumemathmode \newif\ifpgfmathprintnumber@showpositive +\newif\ifpgfmathprintnumber@frac@warn \pgfkeys{% /pgf/number format/.is family, /pgf/number format, fixed/.code= \pgfmath@set@number@printer{pgfmathprintnumber@FIXED}, sci/.code= \pgfmath@set@number@printer{pgfmathprintnumber@SCI}, - std/.code= \pgfmath@set@number@printer{pgfmathprintnumber@STD}, + std/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@STD}\pgfmathprintnumber@STD@setparam{#1}}, + std/.default=,% int detect/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@DETECT}, int trunc/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@TRUNC}, + frac/.code= \pgfmath@set@number@printer{pgfmathprintnumber@frac},% + frac TeX/.initial=\frac, + frac shift/.initial=4, + frac warning/.is if=pgfmathprintnumber@frac@warn, + frac warning=true, assume math mode/.is if=pgfmathprintnumber@assumemathmode, assume math mode/.default=true, fixed zerofill/.is if= pgfmathfloat@usezerofill@fixed, @@ -835,6 +861,16 @@ zerofill/.style= {/pgf/number format/fixed zerofill=#1,/pgf/number format/sci zerofill=#1}, zerofill/.default= true, precision/.store in= \pgfmathfloat@round@precision, + sci precision/.code={% + \edef\pgfmathfloat@loc@TMPa{#1}% + \ifx\pgfmathfloat@loc@TMPa\pgfutil@empty + \def\pgfmathprintnumber@sci@precision{\pgfmathfloat@round@precision}% + \else + \let\pgfmathprintnumber@sci@precision=\pgfmathfloat@loc@TMPa + \fi + },% + sci precision/.default=, + sci precision=, fixed default/.code= {\let\pgfmathprintnumber@fixed@style=\pgfmathprintnumber@fixed@styleDEFAULT}, set decimal separator/.initial=, dec sep/.style={/pgf/number format/set decimal separator=#1}, @@ -859,6 +895,26 @@ sci E/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@E}, sci subscript/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@subscript}, sci superscript/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@superscript}, + sci generic/.code= {% + \let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@generic + \pgfkeysdefargs{/pgf/number format/sci generic/@}% + {##1##2##3}% + {\pgfqkeys{/pgf/number format/sci generic}{#1}}% + }, + sci generic/mantisse sep/.initial=,% + sci generic/empty mantisse sep/.initial=,% + sci generic/exponent/.initial=,% + sci generic/.value required, + verbatim/.style={% + sci generic={mantisse sep=,exponent={e##1}}, + 1000 sep=, + skip 0.=false, + print sign=false, + dec sep=., + assume math mode, + @dec sep mark=, + @sci exponent mark=, + }, % sci may skip mantisse/.is if=pgfmathfloatround@allow@empty@mantisse, % sci may skip mantisse/.default=true, } @@ -872,14 +928,44 @@ \expandafter\pgfmathprintnumber@STD@issci\pgfmathresult\relax } +\def\pgfmathprintnumber@STD@setparam#1{% + \edef\pgfmathfloat@loc@TMPb{#1}% + \ifx\pgfmathfloat@loc@TMPb\pgfutil@empty + % DEFAULT for lower and upper bound. + \def\pgfmathprintnumber@STD@getlowerbound{% + \c@pgf@counta=\pgfmathfloat@round@precision\relax + \divide\c@pgf@counta by-2\relax + }% + \def\pgfmathprintnumber@STD@upperbound{4}% + \else + \expandafter\pgfutil@in@\expandafter:\expandafter{\pgfmathfloat@loc@TMPb}% + \ifpgfutil@in@ + % we have -4:5 or something like that. + % parse both values: + \def\pgfmathfloat@loc@TMPa##1:##2\relax{% + \edef\pgfmathprintnumber@STD@getlowerbound{% + \noexpand\c@pgf@counta=##1\space + }% + \edef\pgfmathprintnumber@STD@upperbound{##2}% + }% + \expandafter\pgfmathfloat@loc@TMPa\pgfmathfloat@loc@TMPb\relax + \else + % we have just the lower bound: + \def\pgfmathprintnumber@STD@upperbound{4}% + \edef\pgfmathprintnumber@STD@getlowerbound{% + \noexpand\c@pgf@counta=\pgfmathfloat@loc@TMPb\space + }% + \fi + \fi +}% + \def\pgfmathprintnumber@STD@issci#1#2e#3\relax{% \expandafter\ifnum#1<3 - \expandafter\ifnum#3>4 + \expandafter\ifnum#3>\pgfmathprintnumber@STD@upperbound\relax \pgfmathprintnumber@SCI@issci#1#2e#3\relax% \else \begingroup - \c@pgf@counta=\pgfmathfloat@round@precision\relax - \divide\c@pgf@counta by-2\relax + \pgfmathprintnumber@STD@getlowerbound \ifnum#3<\c@pgf@counta \pgfmathprintnumber@SCI@issci#1#2e#3\relax% \else @@ -893,6 +979,198 @@ \fi } +\def\pgfmathprintnumber@frac#1{% + % parse the input: + \pgfmathfloatparsenumber{#1}% + \pgfmathfloatgetfrac{\pgfmathresult}% + \expandafter\pgfmathprintnumber@frac@formatresult\pgfmathresult +} +\def\pgfmathprintnumber@frac@issci#1#2e#3\relax{% + \pgfmathfloatcreate{#1}{#2}{#3}% + \pgfmathfloatgetfrac{\pgfmathresult}% + \expandafter\pgfmathprintnumber@frac@formatresult\pgfmathresult +} +\def\pgfmathprintnumber@frac@formatresult#1#2#3{% + \begingroup + \pgfkeysgetvalue{/pgf/number format/frac TeX}\pgfmathresult + \toks0=\expandafter{\pgfmathresult}% + \def\pgfmathfloat@loc@TMPa{#1}% + \ifx\pgfmathfloat@loc@TMPa\pgfutil@empty + \ifpgfmathprintnumber@showpositive + \def\pgfmathfloat@loc@TMPa{+}% + \fi + \else + % FIXME : doesn't respect show pos! + \fi + \toks1=\expandafter{\pgfmathfloat@loc@TMPa}% + \edef\pgfmathresult{% + \the\toks1 \the\toks0 {#2}{#3}% + }% + \pgfmath@smuggleone\pgfmathresult + \endgroup +}% + +% Defines \pgfmathresult to contain three sets of braces containing +% the sign (optionally containing any components >1), the counter and the denominator for #1. +% +% \pgfmathfloatgetfrac{0.5} -> \pgfmathresult contains {}{1}{2} +% \pgfmathfloatgetfrac{-0.5} -> \pgfmathresult contains {-}{1}{2} +\def\pgfmathfloatgetfrac#1{% + \begingroup + \edef\pgfmathfloat@arg{#1}% + \expandafter\pgfmathfloat@decompose@tok\pgfmathfloat@arg\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E + \def\pgfmathfloat@loc@TMPa{0}% + \ifcase\pgfmathfloat@a@S + % #1 = 0: + \def\pgfmathresult{{}{0}{1}}% + \or% #1 > 0 + \pgfmathfloat@a@S=1 + \def\pgfmathfloat@loc@TMPa{1}% + \or% #1 < 0 + \pgfmathfloat@a@S=-1 + \def\pgfmathfloat@loc@TMPa{1}% + \or + \edef\pgfmathresult{{}{NaN}{1}}% + \or + \edef\pgfmathresult{{}{\infty}{1}}% + \or + \edef\pgfmathresult{{-}{\infty}{1}}% + \fi + \if1\pgfmathfloat@loc@TMPa + \ifnum\pgfmathfloat@a@E<0 + \def\pgfmathfloat@wholenumber{}% + \else + \pgfmathfloattofixed{#1}% + \def\pgfmathfloat@loc@TMPa##1.##2\relax{% + \def\pgfmathfloat@wholenumber{##1}% + \pgfmathfloatparsenumber{0.##2}% + }% + \expandafter\pgfmathfloat@loc@TMPa\pgfmathresult\relax + \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@b@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E + \fi + \pgfmathfloat@a@E=-\pgfmathfloat@a@E + % + \def\pgfmathfloat@loc@TMPa##1.##2\relax{% + \def\pgfmathfloat@mantisse@first{##1}% + \def\pgfmathfloat@mantisse@ltone{0.##2}% + }% + \expandafter\pgfmathfloat@loc@TMPa\the\pgfmathfloat@a@Mtok\relax + % + \def\pgfmathfloat@loc@@to@int##1.##2\relax##3{% + ##3=##1 + \ifdim0.##2pt>0.5pt + \advance##3 by1 + \fi + }% + % + \ifdim\pgfmathfloat@mantisse@ltone pt=0pt + \def\pgfmathfloat@factor{1}% + \edef\pgfmathfloat@scaled@counter{\the\pgfmathfloat@a@Mtok}% + \else + % FIXME : this here is numerically instable. + % + % The errors of 1/r are magnified by 10^k which + % doesn't work. + \pgfutil@ifundefined{FPdiv}{% + \pgfmathfloatparsenumber{\pgfmathfloat@mantisse@ltone}% + \pgfmathfloatreciprocal@{\pgfmathresult}% + }{% + % \usepackage{fp}. + % yields higher absolute precision. + \FPmessagesfalse% + \FPdebugfalse% + \FPdiv\pgfmathresult{1}{\pgfmathfloat@mantisse@ltone}% + \pgfmathfloatparsenumber{\pgfmathresult}% + }% + \let\pgfmathfloat@inv=\pgfmathresult + \pgfmathfloatcreate{1}{1.0}{\pgfkeysvalueof{/pgf/number format/frac shift}}% + \let\pgfmathfloat@scalebaseten=\pgfmathresult + \pgfmathfloatmultiply@{\pgfmathfloat@inv}{\pgfmathfloat@scalebaseten}% + \let\pgfmathfloat@factor=\pgfmathresult + % + \expandafter\pgfmathfloatparsenumber\expandafter{\the\pgfmathfloat@a@Mtok}% + \let\pgfmathfloat@loc@TMPa=\pgfmathresult + \pgfmathfloatmultiply@{\pgfmathfloat@factor}{\pgfmathfloat@loc@TMPa}% + \pgfmathfloattofixed\pgfmathresult + \let\pgfmathfloat@scaled@counter=\pgfmathresult + % + \pgfmathfloattofixed\pgfmathfloat@factor + \expandafter\pgfmathfloat@loc@@to@int\pgfmathresult\relax{\pgfmathfloat@b@S}% + \edef\pgfmathfloat@factor{\the\pgfmathfloat@b@S}% + \fi + % + \let\pgfmathresultcounter=\pgfmathfloat@b@S + \let\pgfmathresultdenom=\pgfmathfloat@b@E + % + \pgfmathresultdenom=\pgfmathfloat@factor\relax + \pgfmathfloat@multiply@ten@to@the@E\pgfmathresultdenom + % + \expandafter\pgfmathfloat@loc@@to@int\pgfmathfloat@scaled@counter\relax{\pgfmathresultcounter}% +%\message{scale = \pgfmathfloat@factor; Z = \the\pgfmathresultcounter\space ( von \pgfmathfloat@scaled@counter), N = \the\pgfmathresultdenom.}% + % + \pgfmathgreatestcommondivisor{\pgfmathresultcounter}{\pgfmathresultdenom}% + \divide\pgfmathresultcounter by\pgfmathresult\relax + \divide\pgfmathresultdenom by\pgfmathresult\relax + \ifpgfmathprintnumber@frac@warn + \ifnum\pgfmathresultdenom>1000 + \pgfutil@ifundefined{FPdiv}{% + \pgfmathfloattosci@\pgfmathfloat@arg + \immediate\write16{! Package pgf /pgf/number format/frac warning=true: /pgf/number format/frac of `\pgfmathresult' = \the\pgfmathresultcounter\space / \the\pgfmathresultdenom\space might be large due to instabilities. Try \string\usepackage{fp} to improve accuracy.}% + }{}% + \fi + \fi + \ifnum\pgfmathfloat@a@S<0 + \edef\pgfmathresult{{-\pgfmathfloat@wholenumber}{\the\pgfmathresultcounter}{\the\pgfmathresultdenom}}% + \else + \edef\pgfmathresult{{\pgfmathfloat@wholenumber}{\the\pgfmathresultcounter}{\the\pgfmathresultdenom}}% + \fi + \fi + \pgfmath@smuggleone\pgfmathresult + \endgroup +}% +\def\pgfmathfloat@gobble@until@relax#1\relax{} + +% computes the greatest common divisor of two integer numbers (in +% integer arithmetics). +\def\pgfmathgreatestcommondivisor#1#2{% + \begingroup + \count0=#1\relax + \count1=#2\relax + \ifnum\count0=0 + \edef\pgfmathresult{\the\count1}% + \else + \pgfmathgreatestcommondivisor@loop + \edef\pgfmathresult{\the\count0}% + \fi + \pgfmath@smuggleone\pgfmathresult + \endgroup +} +\def\pgfmathgreatestcommondivisor@loop{% + \ifnum\count1=0 + \else + \ifnum\count0>\count1 + \advance\count0 by-\count1 + \else + \advance\count1 by-\count0 + \fi + \expandafter\pgfmathgreatestcommondivisor@loop + \fi +}% + +% multiplies a TeX register by 10^E where E is stored in the register +% \pgfmathfloat@a@E (and it should be positive!)% +% +% #1 a TeX register +\def\pgfmathfloat@multiply@ten@to@the@E#1{% + \ifnum\pgfmathfloat@a@E>0 + \multiply#1 by10 + \advance\pgfmathfloat@a@E by-1 + \def\pgfmathfloat@multiply@ten@to@the@E@next{\pgfmathfloat@multiply@ten@to@the@E{#1}}% + \else + \let\pgfmathfloat@multiply@ten@to@the@E@next=\relax% + \fi + \pgfmathfloat@multiply@ten@to@the@E@next +}% \def\pgfmathprintnumber@INT@TRUNC#1{% \pgfmathfloatparsenumber{#1}% @@ -914,6 +1192,37 @@ \fi } +% Invokes '#2' if '#1' is actually an integer or '#3' if not. +% +% As a side--effect, \pgfretval will be set to the integer value if it +% actually *is* an integer. Otherwise, \pgfretval will contain the +% parsed floating point number. +% +% #1 a number constant (not necessarily a parsed float). +\def\pgfmathifisint#1#2#3{% + \gdef\pgfmathfloatisint@@{0}% + \begingroup + \pgfmathfloatparsenumber{#1}% + \let\pgfretval\pgfmathresult + \pgfmathfloat@to@FMeE@style\pgfmathresult + \expandafter\pgfmathfloatisint@\pgfmathresult\relax + \pgfmath@smuggleone\pgfretval + \endgroup + \if1\pgfmathfloatisint@@ #2\else #3\fi +}% +\def\pgfmathfloatisint@#1#2e#3\relax{% + \ifnum#1<3\relax + \pgfmathfloatcreate{#1}{#2}{#3}% + \pgfmathfloattofixed{\pgfmathresult}% + \def\pgfmathfloat@round@precision{6}% + \expandafter\pgfmathroundto\expandafter{\pgfmathresult}% + \ifpgfmathfloatroundhasperiod + \else + \let\pgfretval\pgfmathresult% + \gdef\pgfmathfloatisint@@{1}% + \fi + \fi +} \def\pgfmathprintnumber@INT@DETECT#1{% \pgfmathfloatparsenumber{#1}% @@ -926,8 +1235,10 @@ \ifnum#1<3\relax \pgfmathfloatcreate{#1}{#2}{#3}% \pgfmathfloattofixed{\pgfmathresult}% + \let\pgfmathfloat@round@precision@=\pgfmathfloat@round@precision \def\pgfmathfloat@round@precision{6}% \expandafter\pgfmathroundto\expandafter{\pgfmathresult}% + \let\pgfmathfloat@round@precision=\pgfmathfloat@round@precision@ \ifpgfmathfloatroundhasperiod \pgfmathprintnumber@SCI@issci#1#2e#3\relax \else @@ -979,7 +1290,9 @@ } \def\pgfmathprintnumber@SCI@issci#1#2e#3\relax{% + \begingroup \pgfmathfloatcreate{#1}{#2}{#3}% + \edef\pgfmathfloat@round@precision{\pgfmathprintnumber@sci@precision}% \ifpgfmathfloat@usezerofill@sci \pgfmathfloatroundzerofill{\pgfmathresult}% \else @@ -987,6 +1300,8 @@ \fi \pgfmathfloat@to@FMeE@style\pgfmathresult \expandafter\pgfmathfloatrounddisplaystyle\pgfmathresult\relax + \pgfmath@smuggleone\pgfmathresult + \endgroup } % Prints argument #1 using the current pretty printer environment (all @@ -994,6 +1309,11 @@ % % You may specify optional arguments with \pgfmathprintnumber[...]. \def\pgfmathprintnumber{% + % \protect allows to supply \pgfmathprintnumber inside of latex + % captions. The \csname yields \relax in case protect is undefined. + \csname protect\endcsname\pgfmathprintnumber@protected +}% +\def\pgfmathprintnumber@protected{% \pgfutil@ifnextchar[% {\pgfmathprintnumber@OPT}% {\pgfmathprintnumber@noopt}% @@ -1063,11 +1383,7 @@ \expandafter\let\expandafter\pgfmathprintnumber@issci\csname #1@issci\endcsname } -\pgfmath@set@number@printer{pgfmathprintnumber@STD} -%\pgfmath@set@number@printer{pgfmathprintnumber@FIXED} -%\pgfmath@set@number@printer{pgfmathprintnumber@FIXED@ZEROFILL} -%\pgfmath@set@number@printer{pgfmathprintnumber@SCI@ZEROFILL} -%\pgfmath@set@number@printer{pgfmathprintnumber@SCI} +\pgfkeys{/pgf/number format/std} %%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty index eefc385245e..7814fb566f6 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% @@ -45,7 +45,7 @@ \toksdef\t@tikzexternal@tmpb=1 \def\tikzexternalize{\@ifnextchar[{\tikzexternalize@opt}{\tikzexternalize@opt[]}}% -\def\tikzexternalize@opt[#1]#2{\def\tikzexternal@realjob{#2}} +\def\tikzexternalize@opt[#1]{\@ifnextchar\bgroup{\def\tikzexternal@realjob}{\let\tikzexternal@realjob=\jobname}}% \def\tikzsetnextfilename#1{\gdef\tikzexternal@nextfile{#1}} \def\tikzsetexternalprefix#1{\def\tikzexternal@filenameprefix{#1}} 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 1993db33660..1e788bd5a27 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 @@ -14,11 +14,11 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% -% Copyright 2008 by Christian Feuersaenger +% Copyright 2008-2010 by Christian Feuersaenger % % This file may be distributed and/or modified % @@ -87,7 +87,24 @@ \tikzexternalgetnextfilename\tikzexternal@temp \tikzifexternaljobnamematches\tikzexternal@temp{#1}{#2}% \else - #2 + #2% + \fi +}% +% Invokes '#1' if the external lib is currently externalizing the +% current picture. It invokes '#2' if that is not the case. +% +% If the command is invoked outside of a picture, '#2' will be +% invoked. +\def\tikzifexternalizingcurrent#1#2{% + \ifpgf@external@grabshipout + \tikzexternalgetcurrentfilename\tikzexternal@temp + \ifx\tikzexternal@temp\pgfutil@empty + #2% + \else + \tikzifexternaljobnamematches\tikzexternal@temp{#1}{#2}% + \fi + \else + #2% \fi }% @@ -96,25 +113,49 @@ % \def\tikzifexternaljobnamematches#1#2#3{% \edef\pgf@tempa{\expandafter\string\csname#1\endcsname}% - \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% + \edef\pgf@tempb{\expandafter\string\csname\pgfactualjobname\endcsname}% \ifx\pgf@tempa\pgf@tempb #2\else#3 \fi% }% + +\pgfutil@ifundefined{pdfshellescape}{% + \def\tikzexternalcheckshellescape{}% +}{% + \ifnum\pdfshellescape=1 + \def\tikzexternalcheckshellescape{\pgfkeysvalueof{/tikz/external/shell escape}\space}% + \else + \def\tikzexternalcheckshellescape{}% + \fi +}% +\newif\iftikzexternal@auto@detect@jobname + \pgfqkeys{/tikz/external}{ figure list/.is if=tikzexternal@genfigurelist, - figure list=true, + aux in dpth/.style={/pgf/images/aux in dpth=#1},% % 'mode' applies only if \jobname==real job name. mode/.is choice, - mode/only graphics/.code = {\def\tikzexternal@opmode{0}}, + mode/only graphics/.code = {% + \def\tikzexternal@opmode{0}% + \pgfkeysalso{/pgf/images/aux in dpth=true}% + }, mode/no graphics/.code = {\def\tikzexternal@opmode{1}}, % an alias for 'no graphics:' mode/only pictures/.code = {\def\tikzexternal@opmode{1}}, - mode/graphics if exists/.code= {\def\tikzexternal@opmode{2}}, + mode/graphics if exists/.code= {% + \def\tikzexternal@opmode{2}% + \pgfkeysalso{/pgf/images/aux in dpth=true}% + }, mode/list only/.code = {\def\tikzexternal@opmode{3}\tikzexternal@genfigurelisttrue}, - mode/convert with system call/.code={\def\tikzexternal@opmode{4}\tikzexternal@genfigurelistfalse}, - mode/list and make/.code = {\def\tikzexternal@opmode{5}\tikzexternal@genfigurelisttrue}, + mode/convert with system call/.code={% + \def\tikzexternal@opmode{4}% + \pgfkeysalso{/tikz/external/figure list=false,/pgf/images/aux in dpth=false}% + }, + mode/list and make/.code = {% + \def\tikzexternal@opmode{5}% + \pgfkeysalso{/tikz/external/figure list=true,/pgf/images/aux in dpth=true}% + }, mode=convert with system call, - system call/.initial={pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}, + system call/.initial={pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}, % system call/.initial={pdflatex -interaction=batchmode -jobname '\image' '\texsource'; pdftops -eps \image.pdf}, force remake/.is if=tikzexternal@force@remake, force remake/.default=true, @@ -125,7 +166,9 @@ verbose IO/.is if=tikzexternal@verboseio, verbose IO/.default=true, verbose IO=true, + shell escape/.initial=-shell-escape, verbose optimize/.is if=tikzexternal@verbose@optimize, + read main aux/.is if=pgfexternalreadmainaux, optimize/.is choice, optimize/true/.code={% \tikzexternal@optimizetrue @@ -207,11 +250,20 @@ % This method initialises automatic externalization. % -% The first argument is the job's real name, without suffix. +% The command does need any argument, but it has two optional ones: % -% \tikzexternalize{myarticle} +% 1. \tikzexternalize[<options>] % -% Doing so will +% 2. \tikzexternalize{<real job's name>} +% +% 3. \tikzexternalize[<options>]{<real job's name>} +% +% The <real job's name> is the job's file name, without the suffix +% .tex . +% If the <real job's name> is omitted, it will be deduced +% automatically. +% +% The effect is: % 1. automatically surround EVERY tikzpicture by \beginpgfgraphicnamed % sections. % 2. in case that the job's real name and the current \jobname differ, % it will process ONLY the matching tikzpicture. @@ -222,22 +274,137 @@ \tikzexternalize@opt[]% }% }% -\def\tikzexternalize@hasbeencalled{0}% -\def\tikzexternalize@opt[#1]#2{% - \pgfqkeys{/tikz/external}{#1}% - \def\tikzexternal@realjob{#2}% - \pgfrealjobname{#2}% - \def\tikzexternalize@hasbeencalled{1}% - \tikzexternalenable - \def\tikzexternal@determineimgextension##1:##2\relax{\gdef\tikzexternal@imgext{##1}}% - \xdef\pgf@tempa{\pgfsys@imagesuffixlist}% - \expandafter\tikzexternal@determineimgextension\pgf@tempa\relax - \pgfutil@ifundefined{includegraphics}{% - \let\tikzexternal@orig@includegraphics=\relax +\def\tikzexternalize@opt[#1]{% + \pgfutil@ifnextchar\bgroup{% + \tikzexternal@auto@detect@jobnamefalse + \tikzexternalize@opt@withname[#1]% }{% - \let\tikzexternal@orig@includegraphics=\includegraphics + \tikzexternal@auto@detect@jobnametrue + \pgfutil@ifundefined{tikzexternalrealjob}{% + % ok, \tikzexternalrealjob is not known. + % Assume we are currently *not* externalizing. + \let\tikzexternalrealjob=\jobname + }{}% + \def\pgf@tempa{\tikzexternalize@opt@withname[#1]}% + \expandafter\pgf@tempa\expandafter{\tikzexternalrealjob}% }% +}% +\def\tikzexternalize@opt@withname[#1]#2{% + \gdef\tikzexternalrealjob{#2}% + \if1\tikzexternalize@hasbeencalled + \else + \pgfqkeys{/tikz/external}{#1}% + \def\tikzexternal@realjob{#2}% + \tikzexternalauxlock@init + \pgfrealjobname{#2}% + \def\tikzexternalize@hasbeencalled{1}% + \tikzexternalenable + \def\tikzexternal@determineimgextension##1:##2\relax{\gdef\tikzexternalimgextension{##1}}% + \xdef\pgf@tempa{\pgfsys@imagesuffixlist}% + \expandafter\tikzexternal@determineimgextension\pgf@tempa\relax + \pgfutil@ifundefined{includegraphics}{% + \let\tikzexternal@orig@includegraphics=\relax + }{% + \let\tikzexternal@orig@includegraphics=\includegraphics + }% + \let\tikzexternalfiledependsonfile=\tikzexternalfiledependsonfile@ACTIVE + \let\tikzpicturedependsonfile=\tikzpicturedependsonfile@ACTIVE + \fi } +\def\tikzexternalize@hasbeencalled{0}% + +% If mode=`convert with system call', the boolean \ifpgfexternalreadmainaux +% will be set depending on the current lock file. +% +% The idea is as follows: Suppose +% pdflatex -shell-escape mainjob.tex +% is running. +% +% While it runs, +% a) it modifies its mainjob.aux file, +% b) it issues pdflatex -jobname mainjob-figure0 mainjob.tex . +% +% The call (b) will try to read mainjob.aux in order to resolve \ref +% commands. This may fail since the aux +% file is not complete; it may be subject to output buffering. To +% avoid such failure, a locking mechanism is established. +% +% The locking mechanisms causes (a) to write a lock command into +% mainjob.auxlock +% just before (b) is called. Then, (b) will check it. After (b) has +% completed, the lock will be reset. +% +% Thus: mode=convert with system call does NOT support \ref commands +% inside of images. You will need to call the externalization command +% manually. In this case, it should work. +% +% @PRECONDITION : this command must be invoked AFTER +% \tikzexternal@realjob has been defined but BEFORE \pgfrealjobname is +% called. +% +% @POSTCONDITION : If \ifpgfexternalreadmainaux=\iffalse, we won't do +% anything. Otherwise, it will be changed depending for 'mode=convert +% with system call' if necessary. +\def\tikzexternalauxlock@init{% + \if4\tikzexternal@opmode + \ifpgfexternalreadmainaux + % mode=convert with system call + \edef\pgf@tempa{\expandafter\string\csname\tikzexternal@realjob\endcsname}% + \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% + \ifx\pgf@tempa\pgf@tempb + % we are *not* externalizing. Set lock into its + % initial "unlocked" state. + \tikzexternalauxlock@setlock{0}% + \else + % we are externalizing. Query the lock's value: + \tikzexternalauxlock@getlockvalue + \if1\tikzexternallocked + \pgfexternalreadmainauxfalse + \else + \pgfexternalreadmainauxtrue + \fi + \fi + \else + % NO-OP. We won't read the main aux file anyway. + \def\tikzexternalauxlock@setlock##1{}% + \fi + \fi +} +% defines \tikzexternallocked to be either 0 or 1, depending on the +% lock file. +\def\tikzexternalauxlock@getlockvalue{% + \openin\r@pgf@reada=\tikzexternal@realjob.auxlock + \ifeof\r@pgf@reada + % no lock file. Unlock. + \def\tikzexternallocked{0}% + \else + % read first line... + \read\r@pgf@reada to\pgf@tempa + % ... and execute it. + \pgf@tempa + % it should contain a definition of \tikzexternallocked. If + % not, lock it anyway. + \pgfutil@ifundefined + {tikzexternallocked} + {\def\tikzexternallocked{1}}% + {}% + \fi + \closein\r@pgf@reada +}% +\def\tikzexternalauxlock@setlock#1{% + \immediate\openout\w@pgf@writea=\tikzexternal@realjob.auxlock + \immediate\write\w@pgf@writea{\noexpand\def\noexpand\tikzexternallocked{#1}}% + \immediate\closeout\w@pgf@writea +} + +% Expands to the default image extension (it is set by +% \tikzexternalize). +% +% This image extension may not resemble the correct one; you may need +% to overwrite this macro *after* \tikzexternalize in this case. +% +% The default setting uses the first registered image extension. +\def\tikzexternalimgextension{}% % can be used to (temporarily) disable the externalization. \def\tikzexternaldisable{% @@ -339,6 +506,7 @@ \let\tikzexternal@origtikz=\tikz \let\tikzexternal@origpicture=\tikzpicture \let\tikzexternal@origendpicture=\endtikzpicture +\let\tikzexternal@curfilename=\relax % Replacement for '\tikzpicture'. % @@ -348,6 +516,7 @@ % externalize the picture selected by 'jobname' (and only this picture). \def\tikzexternal@tikzpicture@replacement{% \leavevmode + \global\tikzexternal@file@isuptodatetrue% may be set to false during checks. \tikzexternal@getnextfilename\tikzexternal@curfilename \ifx\tikzexternal@curfilename\pgfutil@empty \ifpgf@external@grabshipout @@ -455,11 +624,28 @@ \def\tikzexternalgetnextfilename#1{% \begingroup \let\tikzexternal@getnextfilename@advancecount\relax% NOP + \def\tikzexternal@protocol@to@file##1{}% NOP \tikzexternal@getnextfilename#1% \pgfmath@smuggleone#1% \endgroup }% +% Returns the file name of the current picture. +% +% It returns the empty string in case the command is invoked outside +% of a picture. +% #1 the macro which will contain the file name. +% @see \tikzexternalgetnextfilename +\def\tikzexternalgetcurrentfilename#1{% + \ifx\tikzexternal@curfilename\relax + % we are outside of a picture. + \let#1=\pgfutil@empty + \else + % we are inside of a picture. + \let#1=\tikzexternal@curfilename + \fi +} + % Fills #1 with a filename for the current picture. % % The filename will be generated automatically by appending '-figure<number>' to the real jobname. @@ -506,36 +692,24 @@ \global\let\tikzexternal@nextfile=\pgfutil@empty \global\tikzexternalexportnexttrue % - % Handle verbose output: + \tikzexternal@protocol@to@file#1% +}% + +% #1: the image file name which should be protocolled. (can be a +% macro) +\def\tikzexternal@protocol@to@file#1{% \ifpgf@external@grabshipout% \else \iftikzexternal@genfigurelist - \ifx#1\pgfutil@empty + \edef\tikzexternal@temp{#1}% + \ifx\tikzexternal@temp\pgfutil@empty \else \pgfutil@ifundefined{tikzexternal@listmode@openedfile}{% \message{Opening '\tikzexternal@realjob.figlist' for writing.}% \immediate\openout\tikzexternal@outfile=\tikzexternal@realjob.figlist\relax \gdef\tikzexternal@listmode@openedfile{1}% \if\tikzexternal@opmode5% mode='list and make' - \iftikzexternal@verboseio - \immediate\write16{Opening '\tikzexternal@realjob.makefile' for writing.}% - \fi - \begingroup - % this makes \tikzexternal@outmakefile global: - \globaldefs=1 - % this gets round '\outer\newwrite' in plain TeX: - \csname newwrite\endcsname\tikzexternal@outmakefile - \endgroup - \immediate\openout\tikzexternal@outmakefile=\tikzexternal@realjob.makefile\relax - \immediate\write\tikzexternal@outmakefile{ALL_FIGURE_NAMES=\tikzexternal@DOLLARchar(shell cat \tikzexternal@realjob.figlist)}% - \immediate\write\tikzexternal@outmakefile{ALL_FIGURES=\tikzexternal@DOLLARchar(ALL_FIGURE_NAMES:\tikzexternal@PERCENTchar=\tikzexternal@PERCENTchar\tikzexternal@imgext)}% - \immediate\write\tikzexternal@outmakefile{}% - \immediate\write\tikzexternal@outmakefile{allimages: \tikzexternal@DOLLARchar(ALL_FIGURES)}% - \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar @echo All images exist now. Use make -B to re-generate them.}% - \immediate\write\tikzexternal@outmakefile{}% - \pgfutil@ifundefined{AtEndDocument}{}{% - \AtEndDocument{\immediate\write16{===== mode=`list and make': Use 'make -f \tikzexternal@realjob.makefile' to generate all images. Then, re-run (pdf)latex \tikzexternal@realjob. =====}}% - }% + \tikzexternal@list@and@make@prepare \fi }{}% \iftikzexternal@verboseio @@ -543,19 +717,147 @@ \fi \immediate\write\tikzexternal@outfile{#1}% \if\tikzexternal@opmode5% mode='list and make' - \tikzexternal@assemble@systemcall{\pgf@tempa}% - \iftikzexternal@verboseio - \immediate\write16{Writing '#1' to '\tikzexternal@realjob.makefile'.}% - \fi - \immediate\write\tikzexternal@outmakefile{#1\tikzexternal@imgext:}% - \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar\pgf@tempa}% - \immediate\write\tikzexternal@outmakefile{}% + \tikzexternal@list@and@make@gentarget{#1}% \fi \fi \fi \fi }% +\def\tikzexternal@list@and@make@gentarget#1{% + \tikzexternal@assemble@systemcall{#1}{\pgf@tempa}% + \iftikzexternal@verboseio + \immediate\write16{Writing '#1' to '\tikzexternal@realjob.makefile'.}% + \fi + \global\tikzexternal@file@isuptodatetrue% only check for force remake: + \tikzexternal@checkforceremake% + \immediate\write\tikzexternal@outmakefile{#1\tikzexternalimgextension: \iftikzexternal@file@isuptodate\else FORCEREMAKE\fi}% + \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar\pgf@tempa}% + \immediate\write\tikzexternal@outmakefile{}% +} + +\def\tikzexternal@list@and@make@prepare{% + \iftikzexternal@verboseio + \immediate\write16{Opening '\tikzexternal@realjob.makefile' for writing.}% + \fi + \begingroup + % this makes \tikzexternal@outmakefile global: + \globaldefs=1 + % this gets round '\outer\newwrite' in plain TeX: + \csname newwrite\endcsname\tikzexternal@outmakefile + \endgroup + \immediate\openout\tikzexternal@outmakefile=\tikzexternal@realjob.makefile\relax + \immediate\write\tikzexternal@outmakefile{ALL_FIGURE_NAMES=\tikzexternal@DOLLARchar(shell cat \tikzexternal@realjob.figlist)}% + \immediate\write\tikzexternal@outmakefile{ALL_FIGURES=\tikzexternal@DOLLARchar(ALL_FIGURE_NAMES:\tikzexternal@PERCENTchar=\tikzexternal@PERCENTchar\tikzexternalimgextension)}% + \immediate\write\tikzexternal@outmakefile{}% + \immediate\write\tikzexternal@outmakefile{allimages: \tikzexternal@DOLLARchar(ALL_FIGURES)}% + \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar @echo All images exist now. Use make -B to re-generate them.}% + \immediate\write\tikzexternal@outmakefile{}% + \immediate\write\tikzexternal@outmakefile{FORCEREMAKE:}% + \immediate\write\tikzexternal@outmakefile{}% + % + % support for .dep files and auto-dependencies: + \immediate\write\tikzexternal@outmakefile{include $(ALL_FIGURE_NAMES:\tikzexternal@PERCENTchar=\tikzexternal@PERCENTchar.\tikzexternaldepext)}% + \immediate\write\tikzexternal@outmakefile{}% + \tikzexternalmakefiledefaultdeprule + \immediate\write\tikzexternal@outmakefile{}% + \tikzexternal@outmakefile@pendingcommands + \pgfutil@ifundefined{AtEndDocument}{}{% + \AtEndDocument{\immediate\write16{===== mode=`list and make': Use 'make -f \tikzexternal@realjob.makefile' to generate all images. Then, re-run (pdf)latex \tikzexternal@realjob. =====}}% + }% +}% +\def\tikzexternaldepext{dep} + +\def\tikzexternalmakefiledefaultdeprule{% + \immediate\write\tikzexternal@outmakefile{\tikzexternal@PERCENTchar.\tikzexternaldepext:}% + \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar touch $@ \tikzexternal@HASHchar\space will be filled later.}% +}% + +% Invokes '#1' if a makefile is to be written and '#2' if not. +\def\tikzexternalifwritesmakefile#1#2{% + \if5\tikzexternal@opmode #1\else #2\fi +}% +\def\tikzexternal@outmakefile@pendingcommands{}% + +% Will write something to the make file. If the makefile is not yet +% opened, #1 will be written as soon as it *is* opened. +\def\tikzexternalwritetomakefile#1{% + \pgfutil@ifundefined{tikzexternal@outmakefile}{% + \expandafter\gdef\expandafter\tikzexternal@outmakefile@pendingcommands\expandafter{% + \tikzexternal@outmakefile@pendingcommands + \immediate\write\tikzexternal@outmakefile{#1}% + }% + }{% + \immediate\write\tikzexternal@outmakefile{#1}% + }% +}% + +\def\tikzexternal@dep@file@name{} + +% Adds a dependency for the externalized picture file name `#1', +% namely another file `#2'. +% +% #1: the fully qualified path name (without image extension) of the +% external graphics for which we are adding a dependency. +% #2: a file name. If this file gets changed, #1 shall be remade. +% +% This command will be actived as soons as \tikzexternalize has been +% called. +\def\tikzexternalfiledependsonfile@ACTIVE#1#2{% + \begingroup + \def\tikzpicturedependsonfile@name{#1}% + \ifx\tikzpicturedependsonfile@name\pgfutil@empty + % could be auto-generated: empty file name means "picture + % won't be externalized". Skip it. + \else + \edef\tikzpicturedependsonfile@name{#1.\tikzexternaldepext}% + \ifx\tikzexternal@dep@file@name\tikzpicturedependsonfile@name + % file is open and ready. + \else + % create new output file. + \pgfutil@ifundefined{tikzexternal@dep@file}{% + \begingroup + % this makes \tikzexternal@dep@file global: + \globaldefs=1 + % this gets round '\outer\newwrite' in plain TeX: + \csname newwrite\endcsname\tikzexternal@dep@file + \endgroup + }{}% + \ifx\tikzexternal@dep@file@name\pgfutil@empty + \else + % it is already open. Close it. + \immediate\closeout\tikzexternal@dep@file + \fi + \global\let\tikzexternal@dep@file@name=\tikzpicturedependsonfile@name + \immediate\openout\tikzexternal@dep@file=\tikzexternal@dep@file@name\relax + \fi + \immediate\write\tikzexternal@dep@file{#1\tikzexternalimgextension: #2}% + \fi + \endgroup +}% +\def\tikzexternalfiledependsonfile#1#2{}% NO-OP until \tikzexternalize has been called. + +% Adds a dependency for the NEXT picture which is about to be +% externalized. If we are currently inside of a picture, the +% dependency is added for this current picture. +% +% #1: a file name. If this file gets changed, the tikzpicture's +% externalized graphics shall be remade. +% +% This command will be actived as soons as \tikzexternalize has been +% called. +\def\tikzpicturedependsonfile@ACTIVE#1{% + \begingroup + \tikzexternalgetcurrentfilename\tikzpicturedependsonfile@name + \ifx\tikzpicturedependsonfile@name\pgfutil@empty + \tikzexternalgetnextfilename\tikzpicturedependsonfile@name + \fi + \expandafter\tikzexternalfiledependsonfile\expandafter{\tikzpicturedependsonfile@name}{#1}% + \endgroup +}% +\def\tikzpicturedependsonfile#1{}% NO-OP until \tikzexternalize has been called. + + % This command is invoked % if and only if ( (grab mode && --jobname matches) || 'mode=graphics if exists' ) % @@ -616,29 +918,6 @@ \tikzpicture }% -% FIXME : this does not respect catcode changes! -%-------------------------------------------------- -% \long\def\tikzexternal@externalizefig@@#1{% -% \let\tikzpicture=\tikzexternal@origpicture -% \iftikzexternal@optimize -% \ifpgf@external@grabshipout -% \tikzexternal@optimize@RESTORE -% \fi -% \fi -% \expandafter\beginpgfgraphicnamed\expandafter{\tikzexternal@curfilename}% -% \tikzpicture -% #1 -% \endtikzpicture -% \endpgfgraphicnamed -% \let\tikzpicture=\tikzexternal@tikzpicture@replacement -% \iftikzexternal@optimize -% \ifpgf@external@grabshipout -% \tikzexternal@optimize@REPLACE -% \fi -% \fi -% \tikzexternal@closeenvironments -% }% -%-------------------------------------------------- % Used by the optimization code. % It will be called if GRAB mode is on. @@ -753,6 +1032,7 @@ \let\endtikzpicture=\relax \tikzexternal@TEXDIALECT@endpicture \let\endtikzpicture=\tikzexternal@origendpicture + \let\tikzexternal@curfilename=\relax } % Throws a tikzpicture away - without further notice. @@ -921,20 +1201,30 @@ \catcode`\^^I=12 \catcode`\$=12 \catcode`\%=12 -\xdef\tikzexternal@TABchar{^^I}\xdef\tikzexternal@PERCENTchar{%}\xdef\tikzexternal@DOLLARchar{$}} +\catcode`\#=12 +\gdef\tikzexternal@HASHchar{#} +\gdef\tikzexternal@TABchar{^^I}\gdef\tikzexternal@PERCENTchar{%}\xdef\tikzexternal@DOLLARchar{$}} % Creates the '/tikz/external/system call' command as string and -% returns it into the (global!) macro #1. -\def\tikzexternal@assemble@systemcall#1{% +% returns it into the (global!) macro #2. +% #1: the image file name (as returned by +% \tikzexternalgetnextfilename) +% #2: the global return value macro +% +\def\tikzexternal@assemble@systemcall#1#2{% \begingroup - \let\image=\tikzexternal@curfilename - \let\texsource=\tikzexternal@realjob + \def\image{#1}% + \iftikzexternal@auto@detect@jobname + \edef\texsource{\string\def\string\tikzexternalrealjob{\tikzexternal@realjob}\string\input{\tikzexternal@realjob}}% + \else + \let\texsource=\tikzexternal@realjob + \fi \ifnum\the\catcode`\"=13 \tikzexternal@activate@normal@dq\fi \ifnum\the\catcode`\'=13 \tikzexternal@activate@normal@sq\fi \ifnum\the\catcode`\;=13 \tikzexternal@activate@normal@semic\fi \ifnum\the\catcode`\-=13 \tikzexternal@activate@normal@dash\fi \let\\=\tikzexternal@normal@backslash - \xdef#1{\pgfkeysvalueof{/tikz/external/system call}}% + \xdef#2{\pgfkeysvalueof{/tikz/external/system call}}% \endgroup }% \long\def\tikzexternal@externalizefig@systemcall@@#1{% @@ -947,11 +1237,14 @@ \else \begingroup % no such image. Generate it! - \tikzexternal@assemble@systemcall{\pgf@tempa}% + \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}% + \tikzexternalauxlock@setlock0% \expandafter\tikzexternal@externalizefig@systemcall@assertsuccess\expandafter{\pgf@tempa}% \pgfmath@smuggleone\pgf@filename \endgroup @@ -989,6 +1282,19 @@ \tikzexternal@externalizefig@systemcall@next }% +% Sets \iftikzexternal@file@isuptodate to false if one of the "force +% remake" things is active. +\def\tikzexternal@checkforceremake{% + \iftikzexternal@force@remake + \global\tikzexternal@file@isuptodatefalse + \else + \iftikzexternalremakenext + \global\tikzexternal@file@isuptodatefalse + \global\tikzexternalremakenextfalse + \fi + \fi +} + % Checks whether the current picture needs to be externalized. % % This is the case if @@ -997,23 +1303,15 @@ % % It returns \iftikzexternal@file@isuptodate accordingly. \def\tikzexternal@externalizefig@systemcall@uptodatecheck{% - \iftikzexternal@force@remake - \global\tikzexternal@file@isuptodatefalse - \else - \iftikzexternalremakenext + \tikzexternal@checkforceremake + \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{}% + \xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}% + \pgf@tempa + \ifx\pgf@filename\pgfutil@empty% \global\tikzexternal@file@isuptodatefalse - \global\tikzexternalremakenextfalse - \else - % 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{}% - \xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}% - \pgf@tempa - \ifx\pgf@filename\pgfutil@empty% - \global\tikzexternal@file@isuptodatefalse - \else - \global\tikzexternal@file@isuptodatetrue - \fi \fi \fi }% 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 ee158b55427..a850f7f3608 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 @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Di 29. Dez 22:11:16 CET 2009 %%% +%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% @@ -81,3 +81,8 @@ }% \def\tikzexternal@laTeX@collect@until@end@tikzpicturetikzpicturestring{tikzpicture}% +\AtBeginDocument{% + \pgfutil@ifundefined{tikzexternalrealjob}{% + \global\let\tikzexternalrealjob=\jobname + }{}% +}% diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex index a5ba73ca4ad..bcc43c4051e 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex @@ -419,6 +419,7 @@ /pgfplots/descriptions/.is family, /pgfplots/style commands/.is family, /pgfplots/naming commands/.is family, + /pgfplots/shared with tikz/.is family, /pgfplots/error bars/.is family, /pgfplots/every axis/.style={}, /pgfplots/every axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis}}, @@ -483,7 +484,9 @@ },% % will be defined in \pgfplotspoint@initialisation: %/tikz/sloped like x axis/.code={...},% - /pgfplots/every axis title/.style={at={(0.5,1)},above,yshift=6pt}, + /pgfplots/title shift/.code={\pgfplots@error{Sorry, there is no 'title shift' option. Consider using 'title style={yshift=...}' (or the low level 'every axis title shift' which works only together with the initial 'every axis title' style)}},% + /pgfplots/every axis title shift/.initial=6pt, + /pgfplots/every axis title/.style={at={(0.5,1)},above,yshift=\pgfkeysvalueof{/pgfplots/every axis title shift}}, /pgfplots/every axis title/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis title}}, /pgfplots/every axis title/.belongs to family=/pgfplots/descriptions, /pgfplots/every tick/.style={very thin,gray}, @@ -778,7 +781,7 @@ /pgfplots/xticklabel=, /pgfplots/xticklabels/.belongs to family=/pgfplots/tick, /pgfplots/xticklabels/.code={% - \pgfplots@foreach@to@list{#1}\to\pgfplots@xticklabels + \pgfplotslistnew\pgfplots@xticklabels{#1}% \let\pgfplots@xticklabel=\pgfplots@user@ticklabel@list@x }, % #1 table name or macro @@ -790,7 +793,7 @@ /pgfplots/xticklabels from table/.belongs to family=/pgfplots/tick, /pgfplots/yticklabels/.belongs to family=/pgfplots/tick, /pgfplots/yticklabels/.code={% - \pgfplots@foreach@to@list{#1}\to\pgfplots@yticklabels + \pgfplotslistnew\pgfplots@yticklabels{#1}% \let\pgfplots@yticklabel=\pgfplots@user@ticklabel@list@y }, % #1 table name or macro @@ -805,7 +808,7 @@ /pgfplots/yticklabel=, /pgfplots/zticklabels/.belongs to family=/pgfplots/tick, /pgfplots/zticklabels/.code={% - \pgfplots@foreach@to@list{#1}\to\pgfplots@zticklabels + \pgfplotslistnew\pgfplots@zticklabels{#1}% \let\pgfplots@zticklabel=\pgfplots@user@ticklabel@list@z }, % #1 table name or macro @@ -832,15 +835,15 @@ /pgfplots/extra x tick label=, /pgfplots/extra x tick labels/.belongs to family=/pgfplots/tick, /pgfplots/extra x tick labels/.code={% - \pgfplots@foreach@to@list{#1}\to\pgfplots@extra@xticklabels + \pgfplotslistnew\pgfplots@extra@xticklabels{#1}% \let\pgfplots@extra@xticklabel=\pgfplots@user@extra@ticklabel@list@x }, /pgfplots/extra y tick labels/.code={% - \pgfplots@foreach@to@list{#1}\to\pgfplots@extra@yticklabels + \pgfplotslistnew\pgfplots@extra@yticklabels{#1}% \let\pgfplots@extra@yticklabel=\pgfplots@user@extra@ticklabel@list@y }, /pgfplots/extra z tick labels/.code={% - \pgfplots@foreach@to@list{#1}\to\pgfplots@extra@zticklabels + \pgfplotslistnew\pgfplots@extra@zticklabels{#1}% \let\pgfplots@extra@zticklabel=\pgfplots@user@extra@ticklabel@list@z }, /pgfplots/xtick/.store in= \pgfplots@xtick, @@ -1274,6 +1277,7 @@ /pgfplots/legend plot pos/none/.code= {\def\pgfplots@legend@plot@pos{2}}, /pgfplots/legend plot pos/none/.belongs to family=/pgfplots/legend, /pgfplots/legend plot pos=left, + /pgfplots/every legend image post/.code={},% /pgfplots/line legend/.style={% /pgfplots/legend image code/.code={% \draw[mark repeat=2,mark phase=2,##1] @@ -1449,6 +1453,8 @@ \fi} }, /pgfplots/translate gnuplot/.is if=pgfplots@translategnuplot, + /pgfplots/parametric/var 2d/.initial={\u,\v}, + /pgfplots/parametric/var 1d/.initial=\t, /pgfplots/xfilter/.initial=,% DEPRECATED /pgfplots/yfilter/.initial=,% DEPRECATED /pgfplots/zfilter/.initial=,% DEPRECATED @@ -1465,16 +1471,17 @@ /pgfplots/samples at/.initial=,% empty -> use value of /tikz/samples at! /pgfplots/samples/.initial=,% empty -> use /tikz/samples! /pgfplots/samples y/.initial=,% empty -> use the same as 'samples'. For use in mesh plots. + /pgfplots/variable/.code={\pgfkeysalso{/tikz/variable={#1}}}, /pgfplots/variable y/.initial=\y,% % and provide aliases in the '/pgfplots/' tree to avoid % search path problems just for the following options: - /pgfplots/name/.belongs to family=/pgfplots/naming commands, /pgfplots/name/.code={\pgfkeysalso{/tikz/name={#1}}}, - /pgfplots/alias/.belongs to family=/pgfplots/naming commands, + /pgfplots/overlay/.code={\pgfkeysalso{/tikz/overlay={#1}}}, /pgfplots/alias/.code={\pgfkeysalso{/tikz/alias={#1}}}, /pgfplots/id/.code={\pgfkeysalso{/tikz/id={#1}}}, /pgfplots/prefix/.code={\pgfkeysalso{/tikz/prefix={#1}}}, /pgfplots/raw gnuplot/.code={\pgfkeysalso{/tikz/raw gnuplot={#1}}}, + /pgfplots/parametric/.code={\pgfkeysalso{/tikz/parametric={#1}}},% % /pgfplots/width/.initial=,% /pgfplots/width/.belongs to family=/pgfplots, @@ -2682,22 +2689,39 @@ /pgfplots/max space between ticks=35, }, /pgfplots/small/.style={ - /pgfplots/width=6.5cm, - /pgfplots/height=, - /pgfplots/max space between ticks=25, + width=6.5cm, + height=, + tick label style={font=\footnotesize}, + label style={font=\small}, + max space between ticks=25, }, /pgfplots/footnotesize/.style={ - /pgfplots/width=5cm, - /pgfplots/height=, + width=5cm, + height=, legend style={font=\footnotesize}, tick label style={font=\footnotesize}, label style={font=\small}, - /pgfplots/max space between ticks=15, + title style={font=\small}, + every axis title shift=0pt, + max space between ticks=15, every mark/.append style={mark size=8}, major tick length=0.1cm, minor tick length=0.066cm, - %ylabel style={yshift=-0.3cm}, }, + /pgfplots/tiny/.style={ + width=4cm, + height=, + legend style={font=\tiny}, + tick label style={font=\tiny}, + label style={font=\tiny}, + title style={font=\footnotesize}, + every axis title shift=0pt, + max space between ticks=12, + every mark/.append style={mark size=6}, + major tick length=0.1cm, + minor tick length=0.066cm, + every legend image post/.append style={scale=0.8}, + }, /pgfplots/cube/set size/.code 2 args={% \expandafter\def\csname pgfplots@cube@gethalf@#1\endcsname{% \afterassignment\pgfplots@gobble@until@relax @@ -2716,15 +2740,17 @@ /pgfplots/ztick placement tolerance/.initial=0.05pt, /pgfplots/compat/anchors/.is choice, /pgfplots/compat/anchors/pre 1.3/.code={\pgfplots@deprecated@anchorstrue},% FIXME: WAS \global - /pgfplots/compat/anchors/newest/.code= {\pgfplots@deprecated@anchorsfalse},% - /pgfplots/compat/anchors/default/.code={\pgfplots@deprecated@anchorsfalse},% + /pgfplots/compat/anchors/1.3/.code= {\pgfplots@deprecated@anchorsfalse},% + /pgfplots/compat/anchors/newest/.style= {/pgfplots/compat/anchors/1.3},% + /pgfplots/compat/anchors/default/.style={/pgfplots/compat/anchors/1.3},% /pgfplots/compat/labels/.is choice, /pgfplots/compat/labels/pre 1.3/.style={% /pgfplots/xlabel absolute, /pgfplots/ylabel absolute},% - /pgfplots/compat/labels/newest/.style={% + /pgfplots/compat/labels/1.3/.style={% /pgfplots/xlabel near ticks, /pgfplots/ylabel near ticks},% + /pgfplots/compat/labels/newest/.style={/pgfplots/compat/labels/1.3},% /pgfplots/compat/labels/default/.style={/pgfplots/compat/labels/pre 1.3},% maintain backwards compatibility for labels :-( /pgfplots/compat/.style={% /pgfplots/compat/anchors=#1,% @@ -2771,8 +2797,46 @@ \pgfplotspointrelaxisxyz{-0.03}{-0.03}{-0.03}% \fi }, + /pgfplots/profiler/.code={% + \pgfutil@ifundefined{pgfprofilenew}{% + \usepgflibrary{profiler}% + }{}% + \pgfprofilenewforenvironment[all axes]{pgfplots@environment@opt}% + \pgfprofilesetrel{all axes}% + \pgfprofilenewforcommand[pgfkeys variants]{\pgfkeys}{1}% + \pgfprofilenewforcommand[pgfkeys variants]{\pgfqkeys}{2}% + \pgfprofilenewforcommand[pgfkeys variants]{\pgfkeysalso}{1}% + \pgfprofilenewforcommand[pgfkeys variants]{\pgfkeysfiltered}{1}% + \pgfprofilenewforcommand[pgfkeys variants]{\pgfqkeysfiltered}{2}% + \pgfprofilenewforcommand[pgfkeys variants]{\pgfkeysalsofiltered}{1}% + \pgfprofilenewforcommand[pgfplotsapplistXX handling]{\pgfplotsapplistXXpushback}{1}% + \pgfprofilenewforcommand[pgfplotsapplistXX handling]{\pgfplotsapplistXXflushbuffers}{0}% + \pgfprofilenewforcommandpattern + [pgfplots(app|prepent)listX handling]{\pgfplotsapplistXpushback}{##1\to##2}{{##1}\to{##2}}% + \pgfprofilenewforcommand + [pgfplots(app|prepent)listX handling]{\pgfplotsapplistXflushbuffers}{1}% + \pgfprofilenewforcommandpattern + [pgfplots(app|prepent)listX handling]{\pgfplotsprependlistXpushfront}{##1\to##2}{{##1}\to{##2}}% + \pgfprofilenewforcommand + [pgfplots(app|prepend)listX handling]{\pgfplotsprependlistXflushbuffers}{1}% + \pgfprofilenewforcommand[math parser (basic)]{\pgfmathparse}{1}% + \pgfprofilenewforcommand[math parser (fpu)]{\pgfmathfloatparse@}{1}% + \pgfprofilenewforcommand[math: division (basic)]{\pgfmathdivide@}{2}% + \pgfprofilenewforcommand[math: division (basic)]{\pgfmath@basic@divide@}{2}% + \pgfprofilenewforcommand[near ticklabel anchors]{\pgfplots@borderanchor@for@axis}{3}% + \pgfprofilenewforcommand[ticklabel cs]{\pgfplotspointticklabelcs}{2}% + },% +} + +% call +% \pgfkeyslet{.../.@cmd}\pgfplots@cant@set@in@this@context +% to replace a key with a generic error message. +\def\pgfplots@cant@set@in@this@context#1\pgfeov{\pgfplots@cant@set@in@this@context@} +\def\pgfplots@cant@set@in@this@context@{% + \pgfplotsthrow{unsupported operation}{Sorry, you can't change `\pgfkeyscurrentkeyRAW' in this context. Maybe you need to provide it as \string\begin{axis}[\pgfkeyscurrentkeyRAW=...] ?}\pgfeov } + { \pgfkeysdef{/pgfplots/empty command key}{}% \pgfkeysgetvalue{/pgfplots/empty command key/.@cmd}\pgfplots@loc@TMPa @@ -2873,7 +2937,7 @@ % #1 axis (x or y) % #2 the label -\def\pgfplots@show@label#1#2{% +\long\def\pgfplots@show@label#1#2{% \begingroup % Prepare special alignment features here. % @@ -2904,7 +2968,7 @@ } -\def\pgfplots@show@title#1{% +\long\def\pgfplots@show@title#1{% \node% [/pgfplots/every axis title] {#1}; @@ -3290,15 +3354,20 @@ \pgfplots@addlegendentryexpanded@opts[]% }% } -\def\pgfplots@addlegendentryexpanded@opts[#1]#2{% +\long\def\pgfplots@addlegendentryexpanded@opts[#1]#2{% \begingroup \let\protect=\noexpand - \edef\pgfplots@loc@TMPa{#2}% + \long\edef\pgfplots@loc@TMPa{#2}% \def\pgfplots@loc@TMPb{\pgfplots@addlegendentry@opts[#1]}% \expandafter\pgfplots@loc@TMPb\expandafter{\pgfplots@loc@TMPa}% \endgroup }% +\def\pgfplots@addlegendimage{\pgfutil@ifnextchar[{\pgfplots@addlegendimage@opt}{\pgfplots@addlegendimage@opt[]}}% +\def\pgfplots@addlegendimage@opt[#1]#2{% + \pgfplots@rememberplotspec[#1]{/pgfplots/every axis plot,#2,/pgfplots/.cd,/pgfplots/every axis plot post}% +}% + \def\pgfplots@addlegendentry{% \pgfutil@ifnextchar[{% \pgfplots@addlegendentry@opts @@ -3306,7 +3375,7 @@ \pgfplots@addlegendentry@opts[]% }% } -\def\pgfplots@addlegendentry@opts[#1]#2{% +\long\def\pgfplots@addlegendentry@opts[#1]#2{% \pgfplotslistpushbackglobal[#1]#2\to\pgfplots@legend } @@ -3343,7 +3412,7 @@ \long\def\pgfplots@show@small@legendplots#1#2{ \begingroup \pgfplots@define@currentplotstyle@as{#1,#2}% - \scope[/tikz/current plot style]% this scoping construction allows plot styles to change 'legend image code'. + \scope[/tikz/current plot style,/pgfplots/every legend image post]% this scoping construction allows plot styles to change 'legend image code'. \pgfkeysvalueof{/pgfplots/legend image code/.@cmd}\pgfeov \endscope \endgroup @@ -3357,9 +3426,9 @@ \pgfplots@split@opts@opts[]% }% } -\def\pgfplots@split@opts@opts[#1]#2\pgfplots@result@to#3#4{% - \def#3{#2}% - \def#4{#1}% +\long\def\pgfplots@split@opts@opts[#1]#2\pgfplots@result@to#3#4{% + \long\def#3{#2}% + \long\def#4{#1}% } % Typesets a legend node. @@ -7114,7 +7183,7 @@ \expandafter\def\csname pgfplots@#1minortickstrue\endcsname{\pgfplots@error{Sorry, minor ticks are not supported for this log basis.}}% \expandafter\def\csname pgfplots@#1minorgridstrue\endcsname{\pgfplots@error{Sorry, minor grid lines are not supported for this log basis.}}% \fi - \pgfkeysdef{/pgfplots/log basis #1}{\pgfplots@error{Sorry, you can't change 'log basis #1' in this context.}}% + \pgfkeyslet{/pgfplots/log basis #1/.@cmd}\pgfplots@cant@set@in@this@context % % recompute logtologten for this axis: \pgfmath@basic@multiply@{\reciproclogten}{\pgfplots@loc@TMPa}% @@ -7697,6 +7766,20 @@ \let\prettyprintnumber=\pgfmathprintnumber% +\def\pgfplots@set@options@sanitizemode{% + \pgfkeyslet{/pgfplots/xmode/.@cmd}\pgfplots@cant@set@in@this@context@ + \pgfkeyslet{/pgfplots/ymode/.@cmd}\pgfplots@cant@set@in@this@context@ + \pgfkeyslet{/pgfplots/zmode/.@cmd}\pgfplots@cant@set@in@this@context@ +} +\def\pgfplots@set@options@sanitize{% + \pgfkeyslet{/pgfplots/xmin/.@cmd}\pgfplots@cant@set@in@this@context + \pgfkeyslet{/pgfplots/ymin/.@cmd}\pgfplots@cant@set@in@this@context + \pgfkeyslet{/pgfplots/zmin/.@cmd}\pgfplots@cant@set@in@this@context + \pgfkeyslet{/pgfplots/xmax/.@cmd}\pgfplots@cant@set@in@this@context + \pgfkeyslet{/pgfplots/ymax/.@cmd}\pgfplots@cant@set@in@this@context + \pgfkeyslet{/pgfplots/zmax/.@cmd}\pgfplots@cant@set@in@this@context +}% + \def\pgfplots@set@options#1{% \pgfplots@bb@isactivetrue \pgfplots@curplot@threedimfalse @@ -7713,6 +7796,7 @@ % 'every axis'! \pgfkeyssetfamily{/tikz/name}{/pgfplots/naming commands}% \pgfkeyssetfamily{/tikz/alias}{/pgfplots/naming commands}% + \pgfkeyssetfamily{/tikz/overlay}{/pgfplots/shared with tikz}% \pgfkeyssetfamily{/tikz/variable}{/pgfplots}% \pgfkeysinstallkeyfilterhandler{/pgf/key filter handlers/append filtered to}{\pgfplots@rmopts}% % @@ -7753,16 +7837,16 @@ \fi \fi \pgfplots@deactivefamiliescmd - \pgfkeysdef{/pgfplots/xmode}{\pgfplots@error{You can't set 'xmode' in this context, sorry.}}% - \pgfkeysdef{/pgfplots/ymode}{\pgfplots@error{You can't set 'ymode' in this context, sorry.}}% - \pgfkeysdef{/pgfplots/zmode}{\pgfplots@error{You can't set 'zmode' in this context, sorry.}}% + \pgfplots@set@options@sanitizemode % % Acquire style commands and nameing commands from direct input % options '#1' BEFORE the 'every' styles are processed: \pgfkeysactivatefamily{/pgfplots/naming commands}% + \pgfkeysactivatefamily{/pgfplots/shared with tikz}% \pgfplots@setkeys@from@macro\pgfplots@remaining@input% \let\pgfplots@remaining@input=\pgfplots@rmopts \pgfkeysdeactivatefamily{/pgfplots/naming commands}% + \pgfkeysdeactivatefamily{/pgfplots/shared with tikz}% % % Now, any 'name' and 'alias' options have been processed. % @@ -7796,11 +7880,16 @@ % be set in its context. % \pgfkeysactivatefamily{/pgfplots/legend}% - % this special treatmeant allows the (usually illegal construction) + % this special treatmeant allows the (otherwise unsupported) construction % 'legend style={legend pos=outer north east}': \pgfkeysdef{/pgfplots/every axis legend/.append style}{\pgfkeysalso{##1}}% % \pgfplots@set@keys@from@tikz@style{every axis legend}% + % + % restore: + \pgfkeysdef{/pgfplots/every axis legend/.append style}{% + \pgfkeysalso{/pgfplots/every axis legend/.add code={}{\pgfkeysalso{##1}}}% + }% \pgfkeysdeactivatefamily{/pgfplots/legend}% % % FIXME : VERIFY! @@ -7884,6 +7973,8 @@ \global\let\pgfplots@firstplot@coords@z=\pgfutil@empty \fi \pgfkeysalso{/pgfplots/.search also=/tikz}% + % + \pgfplots@set@options@sanitize } \def\pgfplots@install@abbrev@commands{ @@ -7921,7 +8012,7 @@ }% % \let\legend=\pgfplots@command@legend - \let\addlegendimage=\pgfplots@rememberplotspec + \let\addlegendimage=\pgfplots@addlegendimage \let\addlegendentry=\pgfplots@addlegendentry \let\addlegendentryexpanded=\pgfplots@addlegendentryexpanded } @@ -8083,11 +8174,14 @@ % or something like that is interpreted as /tikz/ key: \pgfplots@invoke@pgfkeyscode{/handler config/full or existing/.@cmd}{}% restrict % set both, pgfplots and tikz keys: - \pgfplotsset{#1}% + % the draw is important since \addplot visualizes its stuff + % with \path coordinates ... + % -> we need to activate draw mode here. + \pgfplotsset{/tikz/draw,#1}% \pgfplots@invoke@pgfkeyscode{/handler config/all/.@cmd}{}% unrestrict % % remember these technical things: they will be - % reset in \draw, so we will need to re-activate + % reset in \path (see below!), so we will need to re-activate % them. % The re-activation is done in 'every path' (see below). % FIXME : is that portable!? diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex index e69591d0683..13b71f8e942 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex @@ -649,6 +649,13 @@ #3% }% }% +\def\pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn@allaxislinevariations#1#2#3{% + \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn@{#1}{% + #2% + }{% + #3% + }% +}% % A sub-part of \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn % which is /only/ based on foreground/background flags. @@ -678,9 +685,9 @@ \def\pgfplots@ifgridlines@onorientedsurf@should@be@drawn#1#2{% % grid lines shall be drawn % if and only if BOTH adjacent axis lines shall be drawn: - \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn{0}{% + \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn@allaxislinevariations{0}{% % remark: this is ALWAYS true for 2D plots. - \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn{1}{% + \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn@allaxislinevariations{1}{% #1% }{% #2% @@ -1131,6 +1138,7 @@ {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfpointorigin}% } + % Adds a further, temporary anchor to every node which will be % processed. The anchor will be named '#3'. It is placed such that % 1. the node's center is on a line in direction of the inwards normal @@ -1147,143 +1155,7 @@ \def\pgfplotsdeclareborderanchorforaxis#1#2#3{% % % - \pgfdeclaregenericanchor{#3}{% - \begingroup - \pgfutil@ifundefined{pgfreferencednodename}{% - % use given transformation matrix. - }{% - \ifx\pgfreferencednodename\pgfutil@empty - % just use the given transformation matrix - we are - % typesetting an unlabeled node. - \else - \pgfsettransform{\csname pgf@sh@nt@\pgfreferencednodename\endcsname}% - \fi - }% - % I only need to apply the trafo matrix to direction vectors. Eliminate - % shifts. - \pgf@pt@x=0pt - \pgf@pt@y=0pt - % - % I'll apply the inverse transformation matrix to direction - % vectors. To ensure the relative position of these vectors - % and the anchors of the node, I have to invert the matrix: - \pgftransforminvert - % - % - % This here is the normal direction (points to the axis) - \pgfqpointscale{-1}{\pgfplotspointouternormalvectorofaxis{#2}}% - % - % we apply the inverse CM onto it here: - \pgf@pos@transform\pgf@x\pgf@y - \edef\pgfplots@tmp@normaldir{\pgf@x=\the\pgf@x\space\pgf@y=\the\pgf@y\space}% - % - % Now: - % auto-determine the canonical (north, north east etc) anchor - % at which the node touches the axis (remember: the axis is to - % be found in direction of the normal vector). If we choose - % this anchor, we *won't* penetrate the axis! - % - % This is a heuristicial procedure. - % - \def\pgfplots@thresh{0.17pt }% 80 degrees - %\def\pgfplots@thresh{0.3pt }% - %\def\pgfplots@thresh{0.707pt }% 45 degrees - \ifdim\pgf@y>0pt - \ifdim\pgf@y>\pgfplots@thresh - % only north anchor - \def\pgfplots@ycomp{north}% - \else - \def\pgfplots@ycomp{}% - \fi - \else - \ifdim\pgf@y<-\pgfplots@thresh - \def\pgfplots@ycomp{south}% - % south anchor - \else - \def\pgfplots@ycomp{}% - \fi - \fi - \ifdim\pgf@x>0pt - \ifdim\pgf@x>\pgfplots@thresh - \def\pgfplots@xcomp{east}% - \else - \def\pgfplots@xcomp{}% - \fi - \else - \ifdim\pgf@x<-\pgfplots@thresh - \def\pgfplots@xcomp{west}% - \else - \def\pgfplots@xcomp{}% - \fi - \fi - \edef\pgfplots@anchor{% - \pgfplots@ycomp - \ifx\pgfplots@ycomp\pgfutil@empty - \else - \ifx\pgfplots@xcomp\pgfutil@empty - \else - \space - \fi - \fi - \pgfplots@xcomp}% - % - % - % Now, I'd like the 'center' of the node on one line with the - % 'at={}' coordinate at which it shall be placed! - % This can be done as follows: - % - % Now, compute two lines: - % 1. a line parallel to the #1 axis which goes - % through our recently identified anchor, - % { x = x_a + r_1 * (#1 axis direction) - % 2. a line from center in direction of the normal, - % { x = x_c + r_2 n, r in R } - % - % Calculate the intersection point and return it! This - % involves a lot of arithmetics :-( - % - % compute (unit#1 - normal): - \pgfplots@tmp@normaldir - \pgf@xb=\pgf@x - \pgf@yb=\pgf@y - % - % and the axis direction (in fact, I use -axis dir. But that - % doesn't matter). - % Scale unit vector to length 1 to improve conditioning: - \pgfqpointscale - {\csname pgfplotsunit#1invlength\endcsname} - {\csname pgfplotspointunit#1\endcsname}% - \pgf@pos@transform\pgf@x\pgf@y - % - \edef\pgfplots@LEQ{% - % solve linear system - {\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@x}% - {\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@y}% - }% - % - % apply inverse matrix to right-hand-side (and compute RHS): - \pgf@sh@reanchor{##1}{center}% - \edef\pgfplots@loc@center{\pgf@x=\the\pgf@x\space\pgf@y=\the\pgf@y\space}% - \pgfpointdiff% {<start>}{<end>} -> computes <end> - <start> - {\pgfplots@loc@center}% - {\pgf@sh@reanchor{##1}{\pgfplots@anchor}}% - \edef\pgfplots@RHS{{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}}% - % - \pgfutilsolvetwotwoleq{\pgfplots@LEQ}{\pgfplots@RHS}% - \def\pgfplots@extract####1####2{% - \def\pgfplots@r{####1}% - }% - \expandafter\pgfplots@extract\pgfmathresult - % GOT IT! - % - % compute x_c + r*n: - \pgfpointadd - {\pgfplots@loc@center}% - {\pgfqpointscale{\pgfplots@r}{\pgfplots@tmp@normaldir}}% -%\message{==========>>>>>>>>>> I got finally (\the\pgf@x,\the\pgf@y). <<<<<<<<<===================}% - \pgf@process{}% <- transport outside of group - \endgroup - }% + \pgfdeclaregenericanchor{#3}{\pgfplots@borderanchor@for@axis{#1}{#2}{##1}} % % This variant will ALWAYS be placed on the boundary of the node. % It is deprecated, I am keeping it for some time.... @@ -1321,6 +1193,151 @@ }% }% +% this does the work for \pgfplotsdeclareborderanchorforaxis. +% #1: either x,y or z the direction which varies +% #2: a three-char-string uniquely identifying the axis line. +% The parameter '#1' is redundand: it is the same as the 'v' +% character in '#2'. +% #3: the shape, provided as argument by the pgf routine invoking the +% anchor. +\def\pgfplots@borderanchor@for@axis#1#2#3{% + \begingroup + \pgfutil@ifundefined{pgfreferencednodename}{% + % use given transformation matrix. + }{% + \ifx\pgfreferencednodename\pgfutil@empty + % just use the given transformation matrix - we are + % typesetting an unlabeled node. + \else + \pgfsettransform{\csname pgf@sh@nt@\pgfreferencednodename\endcsname}% + \fi + }% + % I only need to apply the trafo matrix to direction vectors. Eliminate + % shifts. + \pgf@pt@x=0pt + \pgf@pt@y=0pt + % + % I'll apply the inverse transformation matrix to direction + % vectors. To ensure the relative position of these vectors + % and the anchors of the node, I have to invert the matrix: + \pgftransforminvert + % + % + % This here is the normal direction (points to the axis) + \pgfqpointscale{-1}{\pgfplotspointouternormalvectorofaxis{#2}}% + % + % we apply the inverse CM onto it here: + \pgf@pos@transform\pgf@x\pgf@y + \edef\pgfplots@tmp@normaldir{\pgf@x=\the\pgf@x\space\pgf@y=\the\pgf@y\space}% + % + % Now: + % auto-determine the canonical (north, north east etc) anchor + % at which the node touches the axis (remember: the axis is to + % be found in direction of the normal vector). If we choose + % this anchor, we *won't* penetrate the axis! + % + % This is a heuristicial procedure. + % + \def\pgfplots@thresh{0.17pt }% 80 degrees + %\def\pgfplots@thresh{0.3pt }% + %\def\pgfplots@thresh{0.707pt }% 45 degrees + \ifdim\pgf@y>0pt + \ifdim\pgf@y>\pgfplots@thresh + % only north anchor + \def\pgfplots@ycomp{north}% + \else + \def\pgfplots@ycomp{}% + \fi + \else + \ifdim\pgf@y<-\pgfplots@thresh + \def\pgfplots@ycomp{south}% + % south anchor + \else + \def\pgfplots@ycomp{}% + \fi + \fi + \ifdim\pgf@x>0pt + \ifdim\pgf@x>\pgfplots@thresh + \def\pgfplots@xcomp{east}% + \else + \def\pgfplots@xcomp{}% + \fi + \else + \ifdim\pgf@x<-\pgfplots@thresh + \def\pgfplots@xcomp{west}% + \else + \def\pgfplots@xcomp{}% + \fi + \fi + \edef\pgfplots@anchor{% + \pgfplots@ycomp + \ifx\pgfplots@ycomp\pgfutil@empty + \else + \ifx\pgfplots@xcomp\pgfutil@empty + \else + \space + \fi + \fi + \pgfplots@xcomp}% + % + % + % Now, I'd like the 'center' of the node on one line with the + % 'at={}' coordinate at which it shall be placed! + % This can be done as follows: + % + % Now, compute two lines: + % 1. a line parallel to the #1 axis which goes + % through our recently identified anchor, + % { x = x_a + r_1 * (#1 axis direction) + % 2. a line from center in direction of the normal, + % { x = x_c + r_2 n, r in R } + % + % Calculate the intersection point and return it! This + % involves a lot of arithmetics :-( + % + % compute (unit#1 - normal): + \pgfplots@tmp@normaldir + \pgf@xb=\pgf@x + \pgf@yb=\pgf@y + % + % and the axis direction (in fact, I use -axis dir. But that + % doesn't matter). + % Scale unit vector to length 1 to improve conditioning: + \pgfqpointscale + {\csname pgfplotsunit#1invlength\endcsname} + {\csname pgfplotspointunit#1\endcsname}% + \pgf@pos@transform\pgf@x\pgf@y + % + \edef\pgfplots@LEQ{% + % solve linear system + {\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@x}% + {\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@y}% + }% + % + % apply inverse matrix to right-hand-side (and compute RHS): + \pgf@sh@reanchor{#3}{center}% + \edef\pgfplots@loc@center{\pgf@x=\the\pgf@x\space\pgf@y=\the\pgf@y\space}% + \pgfpointdiff% {<start>}{<end>} -> computes <end> - <start> + {\pgfplots@loc@center}% + {\pgf@sh@reanchor{#3}{\pgfplots@anchor}}% + \edef\pgfplots@RHS{{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}}% + % + \pgfutilsolvetwotwoleq{\pgfplots@LEQ}{\pgfplots@RHS}% + \def\pgfplots@extract##1##2{% + \def\pgfplots@r{##1}% + }% + \expandafter\pgfplots@extract\pgfmathresult + % GOT IT! + % + % compute x_c + r*n: + \pgfpointadd + {\pgfplots@loc@center}% + {\pgfqpointscale{\pgfplots@r}{\pgfplots@tmp@normaldir}}% +%\message{==========>>>>>>>>>> I got finally (\the\pgf@x,\the\pgf@y). <<<<<<<<<===================}% + \pgf@process{}% <- transport outside of group + \endgroup +}% + % Takes azimuth (horizontal angle) '#1' and elongation (vertical % angle) '#2' (both in degrees) and computes % x,y and z vectors which define the view in the direction @@ -1748,7 +1765,14 @@ },% initfor={% \pgfkeyssetvalue{/pgfplots/point meta/expr}{#1}% - \let\pgfpmeta@expr@origchoice\pgfplotspointmetainputhandler + \def\pgfplots@loc@TMPa{expr}% + \ifx\pgfplots@loc@TMPa\pgfplotspointmetainputhandler + \else + \let\pgfpmeta@expr@origchoice\pgfplotspointmetainputhandler + \fi + \ifx\pgfpmeta@expr@origchoice\pgfplots@loc@TMPa + \let\pgfpmeta@expr@origchoice\pgfutil@empty + \fi }, }% \pgfkeyssetvalue{/pgfplots/point meta/expr}{}% @@ -2650,7 +2674,7 @@ \noexpand\def\noexpand\pgfplotspointmetainputhandler{\pgfplotspointmetainputhandler}% }% {% draw command: - \noexpand\draw% + \noexpand\path% }% }% \pgfplotsapplistXXlet\pgfplots@coord@stream@recorded @@ -3749,10 +3773,10 @@ % \pgfplots@plot@ydomain (will be set to \pgfplots@plot@domain if empty) % \pgfplots@plot@samples@at % \pgfplots@plot@samples@y (will be set to the x variant if empty) -% \tikz@plot@var -% \pgfplots@plot@var@nonmacro -% \pgfplots@plot@var@y -% \pgfplots@plot@var@y@nonmacro +% \tikz@plot@var (will become a macro like '\x') +% \pgfplots@plot@var@nonmacro (the same as \tikz@plot@var, but without backslash) +% \pgfplots@plot@var@y (like \tikz@plot@var, but for y) +% \pgfplots@plot@var@y@nonmacro (like \pgfplots@plot@var@nonmacro, but for y) % 2. the following key-value things are set: % /pgfplots/mesh/rows % /pgfplots/mesh/cols @@ -3764,7 +3788,7 @@ % if the expression plotter should sample a line % and % \def\b@pgfplots@should@sample@LINE{0} -% if it should samples a mesh. +% if it should sample a mesh. \def\pgfplots@plot@expression@preparekeys{% \pgfkeysgetvalue{/pgfplots/domain}\pgfplots@plot@domain \pgfkeysgetvalue{/pgfplots/samples y}\pgfplots@plot@samples@y @@ -3784,6 +3808,15 @@ \let\pgfplots@plot@var@nonmacro=\pgfplots@glob@TMPa \let\pgfplots@plot@var@y@nonmacro=\pgfplots@glob@TMPb % + % make sure the 'plot vars' have a backslash (as it was in tikz + % plot expression): + \ifx\pgfplots@plot@var@nonmacro\tikz@plot@var + \edef\tikz@plot@var{\expandafter\noexpand\csname \tikz@plot@var\endcsname}% + \fi + \ifx\pgfplots@plot@var@y@nonmacro\pgfplots@plot@var@y + \edef\pgfplots@plot@var@y{\expandafter\noexpand\csname \pgfplots@plot@var@y\endcsname}% + \fi + % % Check if we have to sample a line. \def\b@pgfplots@should@sample@LINE{0}% \ifpgfplots@curplot@threedim @@ -4096,6 +4129,26 @@ \pgfplots@gettikzinternal@keyval{raw gnuplot}{iftikz@plot@raw@gnuplot}{\iffalse}% \pgfplots@gettikzinternal@keyval{parametric}{iftikz@plot@parametric}{\iffalse}% % + % determine dummy variables: + \iftikz@plot@parametric + \ifpgfplots@curplot@threedim + \pgfkeysgetvalue{/pgfplots/parametric/var 2d}\pgfplots@gnuplot@dummy% + \else + \pgfkeysgetvalue{/pgfplots/parametric/var 1d}\pgfplots@gnuplot@dummy% + \fi + \ifx\pgfplots@gnuplot@dummy\pgfutil@empty + \else + \expandafter\pgfutil@in@\expandafter,\expandafter{\pgfplots@gnuplot@dummy}% + \ifpgfutil@in@ + \def\pgfplots@loc@TMPa##1,##2\pgfeov{\pgfplotsset{variable={##1},variable y={##2}}}% + \else + \def\pgfplots@loc@TMPa##1\pgfeov{\pgfplotsset{variable={##1}}}% + \fi + \expandafter\pgfplots@loc@TMPa\pgfplots@gnuplot@dummy\pgfeov + \fi + \fi + % + % prepare domain and samples, normalize dummy variables: \pgfplots@plot@expression@preparekeys % % FIXME: what with 'samples at'!? @@ -4112,7 +4165,7 @@ % % \iftikz@plot@raw@gnuplot% - \def\pgfplots@plot@data{\pgfplotgnuplot[\pgfplots@plot@filename]{\pgfplots@gnuplotcode}}% + \def\pgfplots@plot@data{\pgfplotgnuplot[\pgfplots@plot@filename]{\pgfplots@gnuplot@format;\pgfplots@gnuplotcode}}% \else% % collect logs: \def\pgfplots@gnuplot@logdirs{}% @@ -4138,9 +4191,12 @@ \pgfplots@error{Sorry, I do not know how to sample 3D LINE plots with gnuplot... I only know 2D line and 3D mesh. You may want to help the author of pgfplots to improve this feature.}% \fi \fi + \def\pgfplots@gnuplot@x{\pgfplots@plot@var@nonmacro}% + \def\pgfplots@gnuplot@y{\pgfplots@plot@var@y@nonmacro}% \def\pgfplots@plot@data{\pgfplotgnuplot[\pgfplots@plot@filename]{% \pgfplots@gnuplot@format; set samples \pgfkeysvalueof{/pgfplots/samples}\if0\b@pgfplots@should@sample@LINE, \pgfkeysvalueof{/pgfplots/samples y}\fi; + set dummy \pgfplots@gnuplot@x,\pgfplots@gnuplot@y; \ifx\pgfplots@gnuplot@logdirs\pgfutil@empty \else set logscale \pgfplots@gnuplot@logdirs\space 2.71828182845905; @@ -4151,13 +4207,13 @@ % Samples twodimensionally (a lattice): % and the isosamples thing confuses me. set isosamples \pgfkeysvalueof{/pgfplots/samples}\if0\b@pgfplots@should@sample@LINE, \pgfkeysvalueof{/pgfplots/samples y}\fi; - splot [x=\pgfplots@plot@domain] [y=\pgfplots@plot@ydomain] \pgfplots@gnuplotcode;% + splot [\pgfplots@gnuplot@x=\pgfplots@plot@domain] [\pgfplots@gnuplot@y=\pgfplots@plot@ydomain] \pgfplots@gnuplotcode;% \else % *should* sample a line, but I don't know how. - splot [x=\pgfplots@plot@domain] \pgfplots@gnuplotcode;% + splot [\pgfplots@gnuplot@x=\pgfplots@plot@domain] \pgfplots@gnuplotcode;% \fi \else - plot [x=\pgfplots@plot@domain] \pgfplots@gnuplotcode;% + plot [\pgfplots@gnuplot@x=\pgfplots@plot@domain] \pgfplots@gnuplotcode;% \fi }}% \fi% @@ -4513,7 +4569,6 @@ % % % high level user interface functions: - \def\coordindex{\pgfplotstablerow}% \let\lineno=\coordindex% is the same here % % modify \pgfplots@plot@tbl@{x,y,z,meta} if there are |