diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib')
15 files changed, 820 insertions, 423 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex index 180ca8ce195..42499218fef 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 @@ -17,7 +17,7 @@ % #2: for normal processing. \def\pgfplots@ifneedspgfcompabitibilitycode#1#2{% %\pgfkeysifdefined{/pgf/number format/sci precision/.@cmd}{#2}{#1}% - \pgfutil@ifundefined{tikzifinpicture}{#1}{#2}% + \pgfutil@ifundefined{pgfmath@tonumber@notrailingzero}{#1}{#2}% }% \pgfplots@ifneedspgfcompabitibilitycode @@ -45,4 +45,6 @@ } {}% + + \endinput diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex index 12d308255bd..dad89e7c7e1 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 @@ -2,13 +2,14 @@ % ====================================================== % compatibility with PGF 2.0 % ====================================================== +\def\pgfutil@gobble@until@relax#1\relax{} \expandafter\ifx\csname w@pgf@writea\endcsname\relax -\newwrite\w@pgf@writea +\csname newwrite\endcsname\w@pgf@writea \fi \expandafter\ifx\csname r@pgf@reada\endcsname\relax -\newread\r@pgf@reada +\csname newread\endcsname\r@pgf@reada \fi \let\pgfutil@inputcheck=\r@pgf@reada @@ -442,3 +443,333 @@ \global\pgf@picmaxy=-16000pt\relax% \global\pgf@picminy=16000pt\relax% }% + +% from pgfcorepathconstruct.code.tex: + + +\def\pgfpatharctomaxstepsize{45} + +% A specialized arc operation for an arc on an (axis--parallel) ellipse. +% +% In contrast to \pgfpatharc, it explicitly interpolates start- and end points. +% +% In contrast to \pgfpatharcto, this routine is numerically stable and +% quite fast since it relies on a lot of precomputed information. +% +% #1 center of ellipse +% #2 angle of last path position inside of the ellipse +% #3 end angle +% #4 end point (a \pgfpoint) +% #5 xradius +% #6 yradius +% #7 the ratio xradius/yradius of the ellipse +% #8 the ratio yradius/xradius of the ellipse +% Example: +% \def\cx{1cm}% center x +% \def\cy{1cm}% center y +% \def\startangle{0}% +% \def\endangle{45}% +% \def\a{5cm}% xradius +% \def\b{10cm}% yradius +% \pgfmathparse{\a/\b}\let\abratio=\pgfmathresult +% \pgfmathparse{\b/\a}\let\baratio=\pgfmathresult +% +% \pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}% +% \pgfpatharctoprecomputed +% {\pgfpoint{\cx}{\cy}} +% {\startangle} +% {\endangle} +% {\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}% +% {\a} +% {\b} +% {\abratio} +% {\baratio} +% +\def\pgfpatharctoprecomputed#1#2#3#4#5#6#7#8{% + \begingroup + % Implementation idea: + % + % let + % m = center (#1) + % \gamma_0 = start angle + % \gamma_1 = end angle + % a = x radius + % b = y radius + % + % an axis parallel ellipse is parameterized by + % C(\gamma) = m + ( a cos(\gamma), b sin(\gamma) ), \gamma in [0,360]. + % + % Now, consider the segment \gamma(t), + % \gamma:[0,1] -> [\gamma_0,\gamma_1], + % t -> \gamma_0 + t(\gamma_1 - \gamma_0) + % and + % C(\gamma(t)) which is defined on [0,1]. + % + % I'd like to approximate the arc by one or more cubic bezier + % splines which interpolate through the last and first provided + % points. + % + % In general, a Bezier spline C:[0,1] -> \R of order n fulfills + % C'(0) = n ( P_1 - P_0 ), + % C'(1) = n ( P_n - P_{n-1} ). + % For n=3 and given P_0 and P_3, I can directly compute P_1 and P_2 once I know + % the derivatives at t=0 and t=1. + % + % The derivatives in our case are + % ( C \circ \gamma )'(t) = C'[\gamma(t)] * \gamma'(t) + % = ( -a pi/180 sin(\gamma(t)), b pi/180 cos(\gamma(t)) ) * (\gamma_1 - \gamma_0). + % The pi/180 comes into play since we are working with degrees. + % + % Expression (C\circ\gamma)'(0) using P_0 and (C \circ \gamma)'(1) + % using P_3 yields the expressions + % (C \circ \gamma)'(0) = + % pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_0^y - my), b/a (P_0^x - mx) ] + % (C \circ \gamma)'(1) = + % pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_3^y - my), b/a (P_3^x - mx) ] + % + % defining + % scaleA = a/b * pi / (3*180) * (\gamma_1 - \gamma_0) + % and + % scaleB = b/a * pi / (3*180) * (\gamma_1 - \gamma_0) + % yields the direct expressions for the intermediate bezier + % control points + % + % P_1 = [ + % P_0^x - scaleA* ( P_0^y -my), + % P_0^y + scaleB* ( P_0^x -mx) ] + % and + % P_2 = [ + % P_3^x + scaleA* ( P_3^y -my), + % P_3^y - scaleB* ( P_3^x -mx) ]. + % + % This works fast, with few operations, if + % - a/b and b/a are known in advance + % - P_0 and P_3 are known in advance + % - \gamma_0 and \gamma_1 are known. + % + % It is also reliable if (\gamma_1 - \gamma_0) is small + % + \pgf@process{#1}% + \edef\pgfpath@center@x{\the\pgf@x}% + \edef\pgfpath@center@y{\the\pgf@y}% + \def\pgfpath@completearcend{#4}% + % compute scale (#3-#2) * pi/(3*180) = (#3 - #2) * pi/27 * 1/20 + % splitting pi/(3*180) into two scales has higher TeX accuracy + \pgf@xa=#2pt + \pgf@xb=#3pt + \edef\pgfpath@startangle{#2pt}% + \edef\pgfpath@endangle{\pgf@sys@tonumber\pgf@xb}% + % + \pgf@ya=\pgf@xb + \advance\pgf@ya by-\pgf@xa + % + \ifx\pgfpatharctomaxstepsize\pgfutil@empty + \def\pgfpath@N{1}% + \pgf@xc=\pgf@ya + \else + \pgf@xc=\pgf@ya% compute N = floor((gamma_1 - gamma_0) / max) +1 + \ifdim\pgf@xc<0pt + \multiply\pgf@xc by-1 + \fi + \divide\pgf@xc by\pgfpatharctomaxstepsize\relax + \afterassignment\pgfutil@gobble@until@relax + \c@pgf@counta=\the\pgf@xc\relax + \advance\c@pgf@counta by1 + \edef\pgfpath@N{\the\c@pgf@counta}% + % + \pgf@xc=\pgf@ya + \divide\pgf@xc by\c@pgf@counta + \fi + % + \edef\pgfpath@h{\pgf@sys@tonumber\pgf@xc}% + % +%\message{pgfpathellipse: using N =\pgfpath@N\space spline points y0 = \pgfpath@startangle, y0+i*h, yN=\pgfpath@endangle, i=1,...,(\pgfpath@N-1), with h=\pgfpath@h\space mesh width (total arc angle \pgf@sys@tonumber\pgf@ya).}% + % + % + \pgf@xc=0.116355283466289\pgf@xc % pi/27 + \divide\pgf@xc by20 + \pgf@xa=#7\pgf@xc + \edef\pgfpath@scale@A{\pgf@sys@tonumber\pgf@xa}% + \pgf@xa=#8\pgf@xc + \edef\pgfpath@scale@B{\pgf@sys@tonumber\pgf@xa}% + % + % compute intermediate spline segments for + % i = 1,...,N-1 + % this is a no-op for N=1. + \c@pgf@countd=1 + \pgfutil@loop + \ifnum\c@pgf@countd<\pgfpath@N\relax + % + \pgf@xa=\pgfpath@startangle % compute \pgf@xa = y_0 + i*h + \pgf@xb=\pgfpath@h pt + \multiply\pgf@xb by\c@pgf@countd + \advance\pgf@xa by\pgf@xb + \edef\pgfpath@angle@i{\pgf@sys@tonumber\pgf@xa}% +%\message{angle \the\c@pgf@countd: \pgfpath@angle@i...}% + % + \pgfpatharcofellipse@{% + \pgfpoint + {\pgfpath@center@x + #5*cos(\pgfpath@angle@i)} + {\pgfpath@center@y + #6*sin(\pgfpath@angle@i)} + }% + % + \advance\c@pgf@countd by1 + \pgfutil@repeat + % + % compute final spline segment. It only differs insofar as the + % final point is already known explicitly and should be + % interpolated without additional math error. +%\message{angle \pgfpath@N: \pgfpath@endangle...}% + \pgfpatharcofellipse@{\pgfpath@completearcend}% + \endgroup +}% +\def\pgfpatharcofellipse@#1{% + \begingroup + \pgf@process{#1}% + \edef\pgfpath@endpt{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}% + % + \pgfpathcurveto{ + \begingroup + \global\pgf@x=\pgf@path@lastx + \global\pgf@y=\pgf@path@lasty + \pgf@xa=\pgf@x \advance\pgf@xa by-\pgfpath@center@x + \pgf@ya=\pgf@y \advance\pgf@ya by-\pgfpath@center@y + \global\advance\pgf@x by-\pgfpath@scale@A\pgf@ya + \global\advance\pgf@y by \pgfpath@scale@B\pgf@xa + \endgroup + }{% + \begingroup + \pgfpath@endpt + \pgf@xa=\pgf@x \advance\pgf@xa by-\pgfpath@center@x + \pgf@ya=\pgf@y \advance\pgf@ya by-\pgfpath@center@y + \global\advance\pgf@x by \pgfpath@scale@A\pgf@ya + \global\advance\pgf@y by-\pgfpath@scale@B\pgf@xa + \endgroup + }{% + \pgfpath@endpt + }% + \endgroup +} + +% bugfix for pgf 2.10, pgfmathfunctions.basic.code.tex : +% +\newif\ifpgfmath@divide@period +\def\pgfmathdivide@#1#2{% + \begingroup% + \pgfmath@x=#1pt\relax% + \pgfmath@y=#2pt\relax% + \let\pgfmath@sign=\pgfmath@empty% + \ifdim0pt=\pgfmath@y% + \pgfmath@error{You've asked me to divide `#1' by `#2', % + but I cannot divide any number by `#2'}% + \fi% + \afterassignment\pgfmath@xa% + \c@pgfmath@counta\the\pgfmath@y\relax% + \ifdim0pt=\pgfmath@xa% + \divide\pgfmath@x by\c@pgfmath@counta% + \else% + \ifdim0pt>\pgfmath@x% + \def\pgfmath@sign{-}% + \pgfmath@x=-\pgfmath@x% + \fi% + \ifdim0pt>\pgfmath@y% + \expandafter\def\expandafter\pgfmath@sign\expandafter{\pgfmath@sign-}% + \pgfmath@y=-\pgfmath@y% + \fi% + \ifdim1pt>\pgfmath@y% + \pgfmathreciprocal@{\pgfmath@tonumber{\pgfmath@y}}% + \pgfmath@x=\pgfmath@sign\pgfmathresult\pgfmath@x% + \else% + \def\pgfmathresult{0}% + \pgfmath@divide@periodtrue% + \c@pgfmath@counta=0\relax% + \pgfmathdivide@@% + \pgfmath@x=\pgfmath@sign\pgfmathresult pt\relax% + \fi% + \fi% + \pgfmath@returnone\pgfmath@x% + \endgroup% +} +\def\pgfmath@small@number{0.00002} +\def\pgfmathdivide@@{% + \let\pgfmath@next=\relax% + \ifdim\pgfmath@small@number pt<\pgfmath@x% + \ifdim\pgfmath@small@number pt<\pgfmath@y% + \ifdim\pgfmath@y>\pgfmath@x% + \ifpgfmath@divide@period% + \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult.}% + \pgfmath@divide@periodfalse% + \fi% + \pgfmathdivide@dimenbyten\pgfmath@y% + \ifdim\pgfmath@y>\pgfmath@x% + \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult0}% + \fi% + \else% + \c@pgfmath@counta=\pgfmath@x% + \c@pgfmath@countb=\pgfmath@y% + \divide\c@pgfmath@counta by\c@pgfmath@countb% + \pgfmath@ya=\c@pgfmath@counta\pgfmath@y% + \advance\pgfmath@x by-\pgfmath@ya% + \def\pgfmath@next{% + \toks0=\expandafter{\pgfmathresult}% + \edef\pgfmathresult{\the\toks0 \the\c@pgfmath@counta}% + }% + \ifpgfmath@divide@period + \else + % we are behind the period. It may happen that the + % result is more than one digit - in that case, + % introduce special handling: + \ifnum\c@pgfmath@counta>9 % + \expandafter\pgfmathdivide@advance@last@digit\pgfmathresult CCCCC\@@ + \advance\c@pgfmath@counta by-10 % + \ifnum\c@pgfmath@counta=0 + \let\pgfmath@next=\relax + \fi + \fi + \fi + \pgfmath@next + \fi% + \let\pgfmath@next=\pgfmathdivide@@% + \fi% + \fi% + \pgfmath@next% +} + +% advances the last digit found in the number. Any missing digits are +% supposed to be filled with 'C'. +\def\pgfmathdivide@advance@last@digit#1.#2#3#4#5#6#7\@@{% + \pgfmath@ya=\pgfmathresult pt % + \if#2C% + \pgfmath@xa=1pt % + \else + \if#3C% + \pgfmath@xa=0.1pt % + \else + \if#4C% + \pgfmath@xa=0.01pt % + \else + \if#5C% + \pgfmath@xa=0.001pt % + \else + \if#6C% + \pgfmath@xa=0.0001pt % + \else + \pgfmath@xa=0.00001pt % + \fi + \fi + \fi + \fi + \fi + \advance\pgfmath@ya by\pgfmath@xa + \edef\pgfmathresult{\pgfmath@tonumber@notrailingzero\pgfmath@ya}% +}% + +{ +\catcode`\p=12 +\catcode`\t=12 +\gdef\Pgf@geT@NO@TRAILING@ZERO#1.#2pt{% + #1.% + \ifnum#2=0 \else #2\fi +} +} +\def\pgfmath@tonumber@notrailingzero#1{\expandafter\Pgf@geT@NO@TRAILING@ZERO\the#1} diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex index 8f769db849b..5b9be1a3087 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% @@ -27,16 +27,30 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.9 2010/07/14 19:32:13 ludewich Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.17 2010/09/01 08:56:40 ludewich Exp $ \newif\ifpgfexternal@aux@in@dpth +\newif\ifpgfexternal@info \pgfkeys{ - /pgf/images/include external/.code={\pgfimage{#1}}, - /pgf/images/aux in dpth/.is if=pgfexternal@aux@in@dpth, - /pgf/images/aux in dpth/.default=true + /pgf/images/include external/.code={\pgfimage{#1}}, + /pgf/images/aux in dpth/.is if=pgfexternal@aux@in@dpth, + /pgf/images/aux in dpth/.default=true, + /pgf/images/trim external/.code n args={4}{% + \def\pgf@external@kern@left{#1}% + \def\pgf@external@kern@bottom{#2}% + \def\pgf@external@kern@right{#3}% + \def\pgf@external@kern@top{#4}% + \ifx\pgf@external@kern@left\pgfutil@empty\def\pgf@external@kern@left{0sp}\fi% + \ifx\pgf@external@kern@bottom\pgfutil@empty\def\pgf@external@kern@bottom{0sp}\fi% + \ifx\pgf@external@kern@right\pgfutil@empty\def\pgf@external@kern@right{0sp}\fi% + \ifx\pgf@external@kern@top\pgfutil@empty\def\pgf@external@kern@top{0sp}\fi% + }, + /pgf/images/trim external={1truein}{1truein}{1truein}{1truein}, + /pgf/images/external info/.is if=pgfexternal@info, + /pgf/images/external info/.default=true, } % The external read/write mechanism is used as follows: @@ -103,68 +117,68 @@ \ifx\pgf@tempa\pgf@tempb% \else% \pgf@external@grabshipouttrue% - \pgfexternal@nofiles% see also \pgf@external@init@aux@in@dpth - \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@aux@in@dpth - \csname newwrite\endcsname\w@pgfexternal@auxout - \fi + \pgfexternal@nofiles% see also \pgf@external@init@aux@in@dpth + \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@aux@in@dpth + \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@ + % 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 \pgfutil@ifundefined{AtBeginDocument}{}{% - \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% - } + \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% + } }% \pgfutil@ifundefined{AtEndDocument}{}{% - \AtEndDocument{% - \ifpgf@external@grabshipout - \pgfutil@ifundefined{pgfexternal@did@a@shipout}{% - \pgfexternal@error@no@shipout - }{}% - \fi - }% + \AtEndDocument{% + \ifpgf@external@grabshipout + \pgfutil@ifundefined{pgfexternal@did@a@shipout}{% + \pgfexternal@error@no@shipout + }{}% + \fi + }% } % This will be overwritten by the tikz external lib if it is loaded. \def\pgfexternal@error@no@shipout{% - \PackageError{pgf}{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}% + \PackageError{pgf}{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}% }% @@ -215,7 +229,7 @@ } \long\def\pgf@replacepicturebygraphic#1\endpgfgraphicnamed{% - \expandafter\pgfincludeexternalgraphics\expandafter{\pgf@filename}\unskip + \expandafter\pgfincludeexternalgraphics\expandafter{\pgf@filename}\unskip } % This is almost the same as \includegraphics{#1}, but it checks @@ -226,22 +240,22 @@ % collected for the external graphics (references). They start after % the first line (if any). \def\pgfincludeexternalgraphics#1{% - \begingroup - \pgfexternalreaddpth{#1}% - \pgfkeysifdefined{/pgf/images/include external/#1/.@cmd}{% - \pgfkeysgetvalue{/pgf/images/include external/#1/.@cmd}\pgf@tempa - \pgfkeysgetlet{/pgf/images/include external/.@cmd}\pgf@tempa - }{}% - \setbox1=\hbox{\pgfkeysvalueof{/pgf/images/include external/.@cmd}{#1}\pgfeov}% - \ifdim\pgfexternaltrimleft=0sp \else \kern\pgfexternaltrimleft\relax \fi - \ifdim\pgfexternaldepth=0pt - \box1 - \else - \dimen0=\pgfexternaldepth\relax - \hbox{\lower\dimen0 \box1 }% - \fi - \ifdim\pgfexternaltrimright=0sp \else \kern\pgfexternaltrimright\relax \fi - \endgroup + \begingroup + \pgfexternalreaddpth{#1}% + \pgfkeysifdefined{/pgf/images/include external/#1/.@cmd}{% + \pgfkeysgetvalue{/pgf/images/include external/#1/.@cmd}\pgf@tempa + \pgfkeyslet{/pgf/images/include external/.@cmd}\pgf@tempa + }{}% + \setbox1=\hbox{\pgfkeysvalueof{/pgf/images/include external/.@cmd}{#1}\pgfeov}% + \ifdim\pgfexternaltrimleft=0sp \else \kern\pgfexternaltrimleft\relax \fi + \ifdim\pgfexternaldepth=0pt + \box1 + \else + \dimen0=\pgfexternaldepth\relax + \hbox{\lower\dimen0 \box1 }% + \fi + \ifdim\pgfexternaltrimright=0sp \else \kern\pgfexternaltrimright\relax \fi + \endgroup } % Defines \pgfexternaldepth to be the depth of the external picture @@ -252,81 +266,88 @@ % .dpth file (it appends it to the main aux file). % \def\pgfexternalreaddpth#1{% - % no \begingroup. Handle that manually: - \edef\pgfexternalreaddpth@restore{% - \noexpand\endlinechar=\the\endlinechar\space - \noexpand\catcode`\noexpand\@=\the\catcode`\@\space - }% - % - \def\pgfexternaldepth{0sp}% - \def\pgfexternaltrimleft{0sp}% - \def\pgfexternaltrimright{0sp}% - \endlinechar=-1 % suppress white space at end - \catcode`\@=11 - \openin\r@pgf@reada=#1.dpth - \pgfincludeexternalgraphics@read@dpth - % - \pgfexternalreaddpth@restore + % no \begingroup. Handle that manually: + \edef\pgfexternalreaddpth@restore{% + \noexpand\endlinechar=\the\endlinechar\space + \noexpand\catcode`\noexpand\@=\the\catcode`\@\space + }% + % + \def\pgfexternaldepth{0sp}% + \def\pgfexternaltrimleft{0sp}% + \def\pgfexternaltrimright{0sp}% + \endlinechar=-1 % suppress white space at end + \catcode`\@=11 + \openin\r@pgf@reada=#1.dpth + \pgfincludeexternalgraphics@read@dpth + % + \pgfexternalreaddpth@restore }% % % 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 + \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 }% -\def\pgfexternal@restore#1{}% - -\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. - % - \ifx#1\pgfexternal@restore - #2% - \else - % do NOT execute #1#2! 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 - }% - \fi - \else% it is the depth (which is simply a number for backwards compatibility) - \def\pgfexternaldepth{#1#2}% - \fi +\def\pgfexternal@restore#1{#1}% + +\long\def\pgfincludeexternalgraphics@read@dpth@line@getfirst#1#2\pgfincludeexternalgraphics@read@dpth@line@EOI{% + \def\pgf@first{#1}% +}% +\long\def\pgfincludeexternalgraphics@read@dpth@line#1\pgfincludeexternalgraphics@read@dpth@line@EOI{% + \pgfincludeexternalgraphics@read@dpth@line@getfirst#1\pgfincludeexternalgraphics@read@dpth@line@EOI + \expandafter\ifcat\expandafter\noexpand\pgf@first\relax + % Ah -- the first token is a control sequence. It belongs to + % the .aux file. + % + \expandafter\ifx\pgf@first\pgfexternal@restore + #1% + \else + % do NOT execute #1! 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}% + % 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 + }% + \fi + \else% it is the depth (which is simply a number for backwards compatibility) + \def\pgfexternaldepth{#1}% + \fi }% -% Stores '#1' into (expanded!) into the .dpth file of the currently +% Stores '#1' (expanded!) into the .dpth file of the currently % exported image. % -% Just before the image is included into the main document, '#1' will be -% invoked. -% % This command has only an effect if an image is being exported. +% +% The stored contents will be read in the context where +% /pgf/images/include external is active (i.e. by +% \pgfexternalreaddpth). +% \def\pgfexternalstorecommand#1{% }% \def\pgfexternalstorecommand@isexporting#1{% - \immediate\write\w@pgfexternal@auxout{\noexpand\pgfexternal@restore{#1}}% + \immediate\write\w@pgfexternal@auxout{\noexpand\pgfexternal@restore{#1}}% }% @@ -337,10 +358,10 @@ % this method is also invoked from within the tikz external library. \def\pgf@external@grab#1{% \def\pgf@filename{#1}% - \ifpgfexternal@aux@in@dpth - \begingroup - \pgf@external@init@aux@in@dpth - \let\G@refundefinedtrue=\pgf@external@grab@refundefinedtrue + \ifpgfexternal@aux@in@dpth + \begingroup + \pgf@external@init@aux@in@dpth + \let\G@refundefinedtrue=\pgf@external@grab@refundefinedtrue \fi \gdef\pgf@trimleft@final{0sp}% \gdef\pgf@trimright@final{0sp}% @@ -353,99 +374,115 @@ \expandafter\let\expandafter\pgf@external@grab@refundefinedtrue@orig\csname G@refundefinedtrue\endcsname \def\pgf@external@grab@refundefinedtrue{% - \pgf@external@grab@refundefinedtrue@orig - \begingroup - \def\n{\pgfexternal@hat\pgfexternal@hat J}% - \pgfexternalstorecommand{% - \noexpand\immediate\noexpand\write16{\pgf@external@grab@refundefinedtrue@warning}% - \noexpand\G@refundefinedtrue - }% - \endgroup + \pgf@external@grab@refundefinedtrue@orig + \begingroup + \def\n{\pgfexternal@hat\pgfexternal@hat J}% + \pgfexternalstorecommand{% + \noexpand\immediate\noexpand\write16{\pgf@external@grab@refundefinedtrue@warning}% + \noexpand\G@refundefinedtrue + }% + \endgroup }% \def\pgf@external@grab@refundefinedtrue@warning{% - LaTeX Warning: External picture `\pgfactualjobname' contains undefined references\noexpand\on@line.\n + LaTeX Warning: External picture `\pgfactualjobname' contains undefined references\noexpand\on@line.\n }% \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 + \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{% - \let\pgfexternalstorecommand=\pgfexternalstorecommand@isexporting - % - % 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 + \let\pgfexternalstorecommand=\pgfexternalstorecommand@isexporting + % + % 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 }% \def\pgf@externalend@storeshifts#1{% - \immediate\write#1{\the\dp\pgfpic}% - \ifx\pgf@trimleft@final\pgfutil@empty\else - \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternaltrimleft{\pgf@trimleft@final}}}% - \fi - \ifx\pgf@trimright@final\pgfutil@empty\else - \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternaltrimright{\pgf@trimright@final}}}% - \fi + \immediate\write#1{\the\dp\pgfpic}% store the depth simply as number for backw. compat. + \ifx\pgf@trimleft@final\pgfutil@empty\else + \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternaltrimleft{\pgf@trimleft@final}}}% + \fi + \ifx\pgf@trimright@final\pgfutil@empty\else + \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternaltrimright{\pgf@trimright@final}}}% + \fi + \ifpgfexternal@info + \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternalwidth{\the\wd\pgfpic}}}% + \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternalheight{\the\dimen0}}}% + \fi } % REMARK: % this method is also invoked from within the tikz external library. \def\pgf@externalend{% \unskip\egroup\egroup% {% - \def\pgf@external@trim{0}% - \def\pgf@external@store@dpth{0}% - % - \ifdim\pgf@trimleft@final=0sp \gdef\pgf@trimleft@final{} \else\def\pgf@external@trim{1}\fi - \ifdim\pgf@trimright@final=0sp \gdef\pgf@trimright@final{} \else\def\pgf@external@trim{1}\fi - \if1\pgf@external@trim - % UNDO the trimming! export to pdf doesn't supported trimmed - % bounding boxes (has to do with the mediabox/trimbox etc). - % I'll keep the bounding box intact and store the trim information - % into the .dpth file. - \setbox\pgfpic=\hbox{% - \ifx\pgf@trimleft@final\pgfutil@empty\else\kern-\pgf@trimleft@final\fi - \box\pgfpic - \ifx\pgf@trimright@final\pgfutil@empty\else\kern-\pgf@trimright@final\fi - }% - \def\pgf@external@store@dpth{1}% - \fi - % + \def\pgf@external@trim{0}% + \def\pgf@external@store@dpth{0}% + % + \ifpgf@trim@lowlevel + \gdef\pgf@trimleft@final{}% + \gdef\pgf@trimright@final{}% + \else + \ifdim\pgf@trimleft@final=0sp \gdef\pgf@trimleft@final{} \else\def\pgf@external@trim{1}\fi + \ifdim\pgf@trimright@final=0sp \gdef\pgf@trimright@final{} \else\def\pgf@external@trim{1}\fi + \if1\pgf@external@trim + % UNDO the trimming! export to pdf doesn't supported trimmed + % bounding boxes (has to do with the mediabox/trimbox etc). + % I'll keep the bounding box intact and store the trim information + % into the .dpth file. + \setbox\pgfpic=\hbox{% + \ifx\pgf@trimleft@final\pgfutil@empty\else\kern-\pgf@trimleft@final\fi + \box\pgfpic + \ifx\pgf@trimright@final\pgfutil@empty\else\kern-\pgf@trimright@final\fi + }% + \def\pgf@external@store@dpth{1}% + \fi + \fi + % \parindent0pt % leave the space % \leftmargin0pt% % \rightmargin0pt% + \hoffset=0pt % reset to default + \voffset=0pt \dimen0\ht\pgfpic% \advance\dimen0\dp\pgfpic% - \ifdim\dp\pgfpic=0pt\relax - \else% store the picture's depth. Otherwise, it would be lost. - \def\pgf@external@store@dpth{1}% - \fi - % - \if1\pgf@external@store@dpth - \ifpgfexternal@aux@in@dpth - \pgf@externalend@storeshifts\@auxout - \immediate\closeout\@auxout - \else - \immediate\openout\pgf@plotwrite=\pgf@filename.dpth - \pgf@externalend@storeshifts\pgf@plotwrite - \immediate\closeout\pgf@plotwrite - \fi - \fi + \ifdim\dp\pgfpic=0pt\relax + \else% store the picture's depth. Otherwise, it would be lost. + \def\pgf@external@store@dpth{1}% + \fi + \ifpgfexternal@info + \def\pgf@external@store@dpth{1}% + \fi + % + \if1\pgf@external@store@dpth + \ifpgfexternal@aux@in@dpth + \pgf@externalend@storeshifts\@auxout + \immediate\closeout\@auxout + \else + \immediate\openout\pgf@plotwrite=\pgf@filename.dpth + \pgf@externalend@storeshifts\pgf@plotwrite + \immediate\closeout\pgf@plotwrite + \fi + \fi \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}% + % \setbox0=\vbox{% - \kern -1truein % + % I admit that I don't know why there is this kerning: + \kern -\pgf@external@kern@top\relax% \hbox{% - \kern -1truein % + \kern -\pgf@external@kern@left\relax% \hbox to0pt{% \wd\pgfexternal@startupbox=0pt % \ht\pgfexternal@startupbox=0pt % @@ -453,29 +490,32 @@ \box\pgfexternal@startupbox% \pgfsys@atbegindocument\hss}% \box\pgfpic% - \kern 1truein }% - \kern1truein }% - % - % compatibility with eso-pic package: \nointerlineskip is not - % allowed here, but the eso-pic package uses \nointerlineskip in - % its shipout routine. - \let\pgfexternal@nointerlineskip@orig=\nointerlineskip - \let\nointerlineskip=\pgfexternal@nointerlineskip - % + \kern\pgf@external@kern@right\relax% + }% + \kern\pgf@external@kern@bottom\relax% + }% + % + % compatibility with eso-pic package: \nointerlineskip is not + % allowed here, but the eso-pic package uses \nointerlineskip in + % its shipout routine. + \let\pgfexternal@nointerlineskip@orig=\nointerlineskip + \let\nointerlineskip=\pgfexternal@nointerlineskip + % \pgfexternal@originalshipout\box0 % - \gdef\pgfexternal@did@a@shipout{1}% + \gdef\pgfexternal@did@a@shipout{1}% }% \ifpgfexternal@aux@in@dpth - \endgroup + \endgroup \fi } \def\pgfexternal@nointerlineskip{% - \ifvmode - \pgfexternal@nointerlineskip@orig - \else - \relax% \nointerlineskip in horizontal mode not allowed. Silently ignore the error message. - \fi + \ifvmode + \pgfexternal@nointerlineskip@orig + \else + \relax% \nointerlineskip in horizontal mode not allowed. Silently ignore the error message. + \fi }% \endinput +% vi: tabstop=4 shiftwidth=2 expandtab 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 a1410e84a0f..59688c15a67 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% @@ -773,6 +773,7 @@ \pgfkeys{/handlers/.style args/.code 2 args=\pgfkeys{\pgfkeyscurrentpath/.code args={#1}{\pgfkeysalso{#2}}}} \pgfkeys{/handlers/.estyle args/.code 2 args=\pgfkeys{\pgfkeyscurrentpath/.ecode args={#1}{\noexpand\pgfkeysalso{#2}}}} \pgfkeys{/handlers/.style 2 args/.code=\pgfkeys{\pgfkeyscurrentpath/.code 2 args=\pgfkeysalso{#1}}} +\pgfkeys{/handlers/.style n args/.code 2 args=\pgfkeys{\pgfkeyscurrentpath/.code n args={#1}{\pgfkeysalso{#2}}}} % Adding to a style @@ -924,7 +925,7 @@ \pgfkeys{/handlers/.expand twice/.code=\expandafter\expandafter\expandafter\pgfkeys@exp@call\expandafter\expandafter\expandafter{#1}} \pgfkeys{/handlers/.expanded/.code=\edef\pgfkeys@temp{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@temp}} -\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}} +\long\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}} % Try to set a key and do nothing if not define 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 82fb11cd2e9..0094344d89b 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% 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 39c273655bf..c08f7dee2fe 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% @@ -750,7 +750,7 @@ % 100 <= m < 1000 % instead of 1 <= m < 10. % -% The 'extended precision' means we have higher accuracy when we apply pgfmath operations to mantisses. +% The 'extended precision' means we have higher accuracy when we apply pgfmath operations to mantissas. % % The input argument is expected to be a normalized floating point number; the output argument is a non-normalized floating point number (well, normalized to extended precision). % 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 054598b052e..1cb2e67de17 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% 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 79d03962283..cabffe11ba6 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% 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 366a3212cba..380a696a1df 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% @@ -143,6 +143,11 @@ /pdflinks/internal link prefix/.initial=pgf, } +\begingroup + \catcode`\_=12 + \gdef\pgfmanualpdf@underscore{_}% +\endgroup + \gdef\pgfmanualpdf@installreplacements{% \def\marg##1{{##1}}% \def\oarg##1{[##1]}% @@ -156,6 +161,7 @@ \def\printanat{@}% \def\protect{}% \def\textasciicircum{o}% + \def\_{\pgfmanualpdf@underscore}% \expandafter\edef\pgfmanual@verb@activebar{\pgfmanual@verb@bar}% }% 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 dc5c3867277..b6ca2c4e2e0 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% 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 b8d956b6054..6ef0b8f63ff 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% @@ -54,6 +54,13 @@ % can be changed with options. \def\pgfmathfloat@round@precision{2} +% I introduced this to acces the "original" precision in case a +% formatted changes it locally... in this case, the formatter may +% overwrite \pgfmathfloat@round@precision@orig to provide the original +% one. +% The default implementation here does nothing: +\def\pgfmathfloat@round@precision@orig{\pgfmathfloat@round@precision}% + \gdef\pgfmathfloat@glob@TMP{} @@ -63,7 +70,7 @@ % meaning % [+-]X.XXXXXXX*10^C % where -% X.XXXXXX is a mantisse with first number != 0, C is an integer and +% X.XXXXXX is a mantissa with first number != 0, C is an integer and % FLAGS contains the sign and some other special cases. % % This method does NOT use TeX Registers to represent the numbers! The @@ -124,13 +131,13 @@ \let\pgfmathfloatqparsenumber=\pgfmathfloatparsenumber % Takes a floating point number #1 as input and writes flags to count -% register #2, mantisse to dimen register #3 and exponent to count +% register #2, mantissa to dimen register #3 and exponent to count % register #4. \def\pgfmathfloattoregisters#1#2#3#4{% \expandafter\pgfmathfloat@decompose#1\relax{#2}{#3}{#4}% } -% the same, but writes the mantisse into a token register. +% the same, but writes the mantissa into a token register. \def\pgfmathfloattoregisterstok#1#2#3#4{% \expandafter\pgfmathfloat@decompose@tok#1\relax{#2}{#3}{#4}% } @@ -144,14 +151,16 @@ \expandafter\pgfmathfloat@decompose@Fmacro#1\relax{#2}% }% -% Extracts the mantisse of #1 into the dimen register #2. -\def\pgfmathfloatgetmantisse#1#2{% +% Extracts the mantissa of #1 into the dimen register #2. +\def\pgfmathfloatgetmantissa#1#2{% \expandafter\pgfmathfloat@decompose@M#1\relax{#2}% } -% Extracts the mantisse of #1 into the token register #2. -\def\pgfmathfloatgetmantissetok#1#2{% +\let\pgfmathfloatgetmantisse=\pgfmathfloatgetmantissa +% Extracts the mantissa of #1 into the token register #2. +\def\pgfmathfloatgetmantissatok#1#2{% \expandafter\pgfmathfloat@decompose@Mtok#1\relax{#2}% } +\let\pgfmathfloatgetmantissetok=\pgfmathfloatgetmantissatok % Extracts the exponent of #1 into the count register #2. \def\pgfmathfloatgetexponent#1#2{% \expandafter\pgfmathfloat@decompose@E#1\relax{#2}% @@ -189,14 +198,14 @@ % decomposes a lowlevel floating point representation into flags, -% mantisse and exponent. +% mantissa and exponent. % % #4: integer register for the flags. -% #5: dimen registers for the mantisse. +% #5: dimen registers for the mantissa. % #6: integer register for the exponent. % % \expandafter\pgfmathfloat@decompose\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@M\pgfmathfloat@a@E -% -> the three temp registers contain flags, mantisse and exponent +% -> the three temp registers contain flags, mantissa and exponent \def\pgfmathfloat@decompose#1#2{% sanitize! \ifx#2Y% \expandafter\pgfmathfloat@decompose@% @@ -211,11 +220,11 @@ #6=#3\relax% } -% overloaded, #5 needs to be a token register for the mantisse. +% overloaded, #5 needs to be a token register for the mantissa. % @see also \pgfmathfloatvalueof which does also employ the load % level repr. % \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E -% -> the three temp registers contain flags, mantisse and exponent +% -> the three temp registers contain flags, mantissa and exponent \def\pgfmathfloat@decompose@tok#1#2{% \ifx#2Y% \expandafter\pgfmathfloat@decompose@tok@% @@ -329,7 +338,7 @@ \pgfmathfloat@decompose@TMP }% % Takes a floating point number #1 as input and writes flags to macro -% #2, mantisse to macro #3 and exponent to macro #4. +% #2, mantissa to macro #3 and exponent to macro #4. \def\pgfmathfloattomacro#1#2#3#4{% \begingroup \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E @@ -344,7 +353,7 @@ % Defines \pgfmathresult as the floating point number encoded by -% the flags #1, mantisse #2 and exponent #3. +% the flags #1, mantissa #2 and exponent #3. % % All arguments are characters and will be expanded using '\edef'. \def\pgfmathfloatcreate#1#2#3{% @@ -490,7 +499,7 @@ \pgfkeysgetvalue{/pgf/number format/set decimal separator}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP \pgfkeysgetvalue{/pgf/number format/@dec sep mark}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK \pgfkeysgetvalue{/pgf/number format/set thousands separator}\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP - \c@pgf@counta=#4\relax + \c@pgf@counta=#4\relax % it is the exponent here. \ifnum#2=0 \c@pgf@counta=0 \fi @@ -529,20 +538,30 @@ \else \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI \fi + \ifpgfmathprintnumber@thousand@sep@in@fractional + \let\pgfmathresultfractional\pgfutil@empty% + \pgfmathprintnumber@thousand@sep@in@fractional#2MMMM\@@ + \else + \def\pgfmathresultfractional{#2}% + \fi \begingroup \toks0=\expandafter{\pgfmathresult}% \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}% - \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP #2}% - \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }% + \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP}% + \toks3=\expandafter{\pgfmathresultfractional}% + \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 \the\toks3 }% \endgroup \let\pgfmathresult=\pgfmathfloat@glob@TMP }% + +% assigns \pgfmathresult such that it contains the formatted result. +% It assumes that none of the following tokens contains a period. \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod{% \ifx\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP\pgfutil@empty \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{% \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}% \else - \ifnum\c@pgf@counta<0\relax + \ifnum\c@pgf@counta<0\relax % exponent of the number in this context \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{% \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}% \else @@ -579,7 +598,7 @@ \fi \fi \fi - \ifnum\c@pgf@counta>0 + \ifnum\c@pgf@counta>0 % \c@pgf@counta = N MOD 3 in this context \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{% \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printtrailingdigits\pgfmathfloat@loc@TMPb }% @@ -591,7 +610,8 @@ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT } \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printtrailingdigits#1#2{% - \ifcase\c@pgf@counta + \ifcase\c@pgf@counta % = N MOD 3 in this context + % does not happen per construction \or \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}% \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{% @@ -603,7 +623,7 @@ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird% }% \fi - \ifnum\c@pgf@countb>0\relax + \ifnum\c@pgf@countb>0\relax % \c@pgf@countb = N DIV 3 in this context \begingroup \toks0=\expandafter{\pgfmathresult}% \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP}% @@ -643,6 +663,32 @@ \fi \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT } + +% \pgfmathprintnumber@thousand@sep@in@fractional 01234525MMMM\@@ +% -> +% 012<sep>345<sep>25 +\def\pgfmathprintnumber@thousand@sep@in@fractional#1#2#3#4{% + \if#4M% + % Ok, no further separator + \def\pgfmathprint@next{\pgfmathprintnumber@thousand@sep@in@fractional@finish#1#2#3#4}% + \else + \begingroup + \toks0=\expandafter{\pgfmathresultfractional}% + \toks1={#1#2#3}% + \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP}% + \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }% + \endgroup + \let\pgfmathresultfractional=\pgfmathfloat@glob@TMP + \def\pgfmathprint@next{\pgfmathprintnumber@thousand@sep@in@fractional#4}% + \fi + \pgfmathprint@next +}% +\def\pgfmathprintnumber@thousand@sep@in@fractional@finish#1M{% + \expandafter\def\expandafter\pgfmathresultfractional\expandafter{\pgfmathresultfractional #1}% + \pgfmathprintnumber@thousand@sep@in@fractional@finish@ +}% +\def\pgfmathprintnumber@thousand@sep@in@fractional@finish@#1\@@{}% + \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall#1{% \def\pgfmathfloat@loc@TMPb{#1}% \let\pgfmathfloat@loc@TMPc=\pgfutil@empty @@ -680,7 +726,7 @@ % The default style to display fixed point numbers. % -% It does not apply numerics, but it is responsable to typeset the +% It does not apply numerics, but it is responsable for typesetting the % rounded number. % It can access the \ifpgfmathfloatroundhasperiod boolean. % @@ -699,12 +745,12 @@ % Rounds a normalized floating point number to \pgfmathfloat@round@precision % digits precision and writes the result to \pgfmathresult. % -% This method uses \pgfmathroundto for the mantisse. +% This method uses \pgfmathroundto for the mantissa. % % @see pgfmathfloatroundzerofill % % SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set to -% whether the final mantisse #5 has a period or not. +% whether the final mantissa #5 has a period or not. \def\pgfmathfloatround#1{% \pgfmathfloatroundhasperiodtrue \begingroup @@ -717,13 +763,13 @@ % Overload. % -% This method uses a fixed width for the mantisse and fills in zeros +% This method uses a fixed width for the mantissa and fills in zeros % if necessary. % -% This method uses \pgfmathroundtozerofill for the mantisse. +% This method uses \pgfmathroundtozerofill for the mantissa. % % SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set to -% whether the final mantisse #5 has a period or not. +% whether the final mantissa #5 has a period or not. \def\pgfmathfloatroundzerofill#1{% \pgfmathfloatroundhasperiodtrue \begingroup @@ -734,16 +780,16 @@ \endgroup } -\newif\ifpgfmathfloatround@allow@empty@mantisse -\def\pgfmathfloatround@mantisse@ONE{1.0}% +\newif\ifpgfmathfloatround@allow@empty@mantissa +\def\pgfmathfloatround@mantissa@ONE{1.0}% % #1: sign -% #2: mantisse +% #2: mantissa % #3: exponent -% #4: CODE to display if the mantisse is drawn. +% #4: CODE to display if the mantissa is drawn. % This code will be shown just before the exponent. % Example: #4=\cdot -% #5: CODE to display if the mantisse is NOT draw. (unused currently) +% #5: CODE to display if the mantissa 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{% @@ -828,11 +874,11 @@ \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/mantissa sep}\pgfmathdisplay@aftermantissa + \pgfkeysgetvalue{/pgf/number format/sci generic/empty mantissa sep}\pgfmathdisplay@nomantissa \pgfkeysgetvalue{/pgf/number format/sci generic/exponent}\pgfmathdisplay@e - \toks0=\expandafter{\pgfmathdisplay@aftermantisse}% - \toks1=\expandafter{\pgfmathdisplay@nomantisse}% + \toks0=\expandafter{\pgfmathdisplay@aftermantissa}% + \toks1=\expandafter{\pgfmathdisplay@nomantissa}% \toks2=\expandafter{\pgfmathdisplay@e}% \xdef\pgfmathfloat@glob@TMP{\noexpand\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\noexpand\relax{\the\toks0}{\the\toks1}{\the\toks2}}% \endgroup @@ -845,7 +891,7 @@ % % PRECONDITION: % the floating point number has already been rounded properly and -% the mantisse has been rounded correcty. +% the mantissa has been rounded correcty. % % The argument needs to be in the format returned by % \pgfmathfloat@to@FMeE@style and terminated by '\relax'. @@ -859,6 +905,7 @@ \long\def\pgfmathfloatfrac@verbatim#1#2{#1/#2}% +\newif\ifpgfmathprintnumber@thousand@sep@in@fractional \pgfkeys{% /pgf/number format/.is family, /pgf/number format, @@ -866,6 +913,10 @@ sci/.code= \pgfmath@set@number@printer{pgfmathprintnumber@SCI}, std/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@STD}\pgfmathprintnumber@STD@setparam{#1}}, std/.default=,% + % relative={<exponent base 10>} + relative/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@RELATIVE}\def\pgfmathprintnumber@RELATIVE@param{#1}},% + relative/.value required, + every relative/.style=std, 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},% @@ -902,6 +953,8 @@ @dec sep mark/.initial=, @sci exponent mark/.initial=, set thousands separator/.initial=, + 1000 sep in fractionals/.is if=pgfmathprintnumber@thousand@sep@in@fractional, + 1000 sep in fractionals/.default=true, 1000 sep/.style={/pgf/number format/set thousands separator=#1}, min exponent for 1000 sep/.initial=0, use period/.style= {/pgf/number format/set decimal separator={.},/pgf/number format/set thousands separator={{{,}}}}, @@ -926,13 +979,15 @@ {##1##2##3}% {\pgfqkeys{/pgf/number format/sci generic}{#1}}% }, - sci generic/mantisse sep/.initial=,% - sci generic/empty mantisse sep/.initial=,% + sci generic/mantissa sep/.initial=,% + sci generic/empty mantissa sep/.initial=,% + sci generic/mantisse sep/.style={/pgf/number format/sci generic/mantissa sep={#1}},% + sci generic/empty mantisse sep/.style={/pgf/number format/sci generic/empty mantissa sep={#1}},% sci generic/exponent/.initial=,% sci generic/.value required, verbatim/.code={% \pgfqkeys{/pgf/number format}{% - sci generic={mantisse sep=,exponent={e##1}}, + sci generic={mantissa sep=,exponent={e##1}}, 1000 sep=, skip 0.=false, print sign=false, @@ -944,8 +999,8 @@ @sci exponent mark=, }% }, -% sci may skip mantisse/.is if=pgfmathfloatround@allow@empty@mantisse, -% sci may skip mantisse/.default=true, +% sci may skip mantissa/.is if=pgfmathfloatround@allow@empty@mantissa, +% sci may skip mantissa/.default=true, } @@ -962,7 +1017,7 @@ \ifx\pgfmathfloat@loc@TMPb\pgfutil@empty % DEFAULT for lower and upper bound. \def\pgfmathprintnumber@STD@getlowerbound{% - \c@pgf@counta=\pgfmathfloat@round@precision\relax + \c@pgf@counta=\pgfmathfloat@round@precision@orig\relax \divide\c@pgf@counta by-2\relax }% \def\pgfmathprintnumber@STD@upperbound{4}% @@ -1008,6 +1063,55 @@ \fi } +\def\pgfmathprintnumber@RELATIVE#1{% + % parse the input: + \pgfmathfloatparsenumber{#1}% + \pgfmathfloat@to@FMeE@style\pgfmathresult + \expandafter\pgfmathprintnumber@RELATIVE@issci\pgfmathresult\relax +} + +\def\pgfmathprintnumber@RELATIVE@issci#1#2e#3\relax{% + \begingroup + % format X / 10^{relative}: + \c@pgf@counta=#3\relax + \advance\c@pgf@counta by-\pgfmathprintnumber@RELATIVE@param\relax + \pgfmathfloatcreate{#1}{#2}{\the\c@pgf@counta}% + % OK, round it to the desired precision: + \ifnum\c@pgf@counta>0 + % hm. for positive exponents, we should round the + % mantissa rather than only the fractional part. + \expandafter\pgfmathfloatround\expandafter{\pgfmathresult}% + \else + % negative exponent -> round fixed representation: + \pgfmathfloattofixed\pgfmathresult + \expandafter\pgfmathroundto\expandafter{\pgfmathresult}% + \pgfmathfloatparsenumber{\pgfmathresult}% + \pgfmathfloatroundhasperiodtrue% make sure the code below works: + \fi + % Now, compute result * 10^{relative} and format the result: + \pgfmathfloattoregisterstok\pgfmathresult\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E + \ifnum\pgfmathfloat@a@S=0 + \pgfmathfloat@a@E=\pgfmathfloat@a@S % avoid 0 * 10^8 + \else + \advance\pgfmathfloat@a@E by+\pgfmathprintnumber@RELATIVE@param\relax + \fi + \edef\pgfmathresultX{% + \the\pgfmathfloat@a@S + \the\pgfmathfloat@a@Mtok + \ifpgfmathfloatroundhasperiod\else.0\fi + e\the\pgfmathfloat@a@E}% + % call another formatter for the result (but avoid rounding inside of it): + \pgfqkeys{/pgf/number format}{/pgf/number format/every relative}% + \ifx\pgfmathprintnumber@issci\pgfmathprintnumber@RELATIVE@issci + \pgfmath@error{The '/pgf/number format/every relative' style should set a valid display style}% + \fi + \let\pgfmathfloat@round@precision@orig=\pgfmathfloat@round@precision + \def\pgfmathfloat@round@precision{9999}% + \expandafter\pgfmathprintnumber@issci\pgfmathresultX\relax% + \pgfmath@smuggleone\pgfmathresult + \endgroup +} + \def\pgfmathprintnumber@frac#1{% % parse the input: \pgfmathfloatparsenumber{#1}% @@ -1106,8 +1210,8 @@ \fi % \def\pgfmathfloat@loc@TMPa##1.##2\relax{% - \def\pgfmathfloat@mantisse@first{##1}% - \def\pgfmathfloat@mantisse@ltone{0.##2}% + \def\pgfmathfloat@mantissa@first{##1}% + \def\pgfmathfloat@mantissa@ltone{0.##2}% }% \expandafter\pgfmathfloat@loc@TMPa\the\pgfmathfloat@a@Mtok\relax % @@ -1126,7 +1230,7 @@ \ifx\pgfmath@target@denominator\pgfutil@empty % \pgfmathfloat@a@E=-\pgfmathfloat@a@E - \ifdim\pgfmathfloat@mantisse@ltone pt=0pt + \ifdim\pgfmathfloat@mantissa@ltone pt=0pt \def\pgfmathfloat@factor{1}% \edef\pgfmathfloat@scaled@numerator{\the\pgfmathfloat@a@Mtok}% \else @@ -1135,14 +1239,14 @@ % The errors of 1/r are magnified by 10^k which % doesn't work. \pgfutil@ifundefined{FPdiv}{% - \pgfmathfloatparsenumber{\pgfmathfloat@mantisse@ltone}% + \pgfmathfloatparsenumber{\pgfmathfloat@mantissa@ltone}% \pgfmathfloatreciprocal@{\pgfmathresult}% }{% % \usepackage{fp}. % yields higher absolute precision. \FPmessagesfalse% \FPdebugfalse% - \FPdiv\pgfmathresult{1}{\pgfmathfloat@mantisse@ltone}% + \FPdiv\pgfmathresult{1}{\pgfmathfloat@mantissa@ltone}% \pgfmathfloatparsenumber{\pgfmathresult}% }% \let\pgfmathfloat@inv=\pgfmathresult @@ -1519,7 +1623,7 @@ % % Let 'k' be the desired precision. % -% Please note that pgfmathroundto rounds the mantisse, that means |abs(x)|. +% Please note that pgfmathroundto rounds the mantissa, that means |abs(x)|. % % There are exactly TWO cases: % 1. The case with p<=k and x_{-p-1} = end of input. @@ -1864,7 +1968,7 @@ %-------------------------------------------- -% flags, mantisse and exponent has already been stored into +% flags, mantissa and exponent has already been stored into % \pgfmathfloat@a@* [using ...@Mtok] % % PRECONDITION: @@ -1895,7 +1999,7 @@ -% ATTENTION: this thing REQUIRES a period in the mantisse! +% ATTENTION: this thing REQUIRES a period in the mantissa! % collects everything into \pgfmathresult \def\pgfmathfloattofixed@impl#1.#2\relax{% \ifnum\pgfmathfloat@a@E<0 @@ -1942,7 +2046,7 @@ % \edef\pgfmathresult{#1.#2}% % \else % \pgfmathfloat@a@Mtok={#1}% - % \pgfmathfloattofixed@impl@collectmantisse#2\count\pgfmathfloat@a@E + % \pgfmathfloattofixed@impl@collectmantissa#2\count\pgfmathfloat@a@E % \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok}% % \fi %-------------------------------------------------- @@ -1976,11 +2080,11 @@ \else%>=9 \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4#5#6#7#8}% \advance\pgfmathfloat@a@E by-8 - \pgfmathfloattofixed@impl@collectmantisse#9\count\pgfmathfloat@a@E + \pgfmathfloattofixed@impl@collectmantissa#9\count\pgfmathfloat@a@E \fi }% -\def\pgfmathfloattofixed@impl@collectmantisse#1#2\count#3{% +\def\pgfmathfloattofixed@impl@collectmantissa#1#2\count#3{% \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok #1}% \advance\pgfmathfloat@a@E by-1% \def\pgfmathfloat@loc@TMPb{#2}% @@ -1995,7 +2099,7 @@ \ifnum\pgfmathfloat@a@E=0 \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok .#2}% \else - \pgfmathfloattofixed@impl@collectmantisse#2\count#3% + \pgfmathfloattofixed@impl@collectmantissa#2\count#3% \fi \fi } diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathparse.opt.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathparse.opt.code.tex deleted file mode 100644 index e74d47c814e..00000000000 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathparse.opt.code.tex +++ /dev/null @@ -1,122 +0,0 @@ -% A small optimization package which provides -% -% \beginpgfmathparsecheckfornumber -% ... -% \endpgfmathparsecheckfornumber -% -% in order to optimize \pgfmathparse. It works as follows: inside of -% the environment (which doesn't use scopes), \pgfmathparse is -% *replaced* by a different method which uses an extremely fast check -% to decide whether the input is a number number. Is so, it returns -% the number. Otherwise, it invokes the standard math parser. -% It is about 400% faster than \pgfmathparse if the argument *is* a -% number. -% -% The \endpgfmathparsecheckfornumber is optional (no groups are -% introduced) -% -% Copyright 2010 by Christian Feuersänger. -% -% Replaces \pgfmathparse by the fast number checker. -\def\beginpgfmathparsecheckfornumber{% - \let\pgfmathparse=\pgfmathparsehashedcheck -}% -\def\endpgfmathparsecheckfornumber{% - \let\pgfmathparse=\pgfmathparsehashedcheck@orig -}% - -\def\pgfmp@EOI{\pgfmp@EOI}% -\def\pgfmathparsehashedcheck@isnumber@gobble#1\pgfmp@EOI{} - -\newdimen\r@pgfmathparse@hashedcheck@ -\newcount\c@pgfmathparse@hashedcheck@ -\let\pgfmathparsehashedcheck@orig=\pgfmathparse - -\def\pgfmathparsehashedcheck#1{% - \edef\pgfmathparse@temp{#1}% - \expandafter\pgfmathparsehashedcheck@isnumber@loop\pgfmathparse@temp\pgfmp@EOI - \pgfmathparsehashedcheck@finalize{#1}% -}% -\def\pgfmathparsehashedcheck@finalize@isnonumber#1{% - \pgfmathparsehashedcheck@orig{#1}% - \let\pgfmathparsehashedcheck@finalize\pgfmathparsehashedcheck@finalize@isnumber -}% -\def\pgfmathparsehashedcheck@finalize@isnumber#1{% - \r@pgfmathparse@hashedcheck@=#1pt - \expandafter\pgfmathparsehashed@assign\the\r@pgfmathparse@hashedcheck@ - %-------------------------------------------------- - % % - % \let\KKK=\pgfmathresult - % \pgfmathparsehashedcheck@orig{#1}% - % \ifx\KKK\pgfmathresult - % \else - % \pgfplots@error{FAILED FOR #1: expected `\pgfmathresult'; got `\KKK' (temp = \pgf@temp)}% - % \fi - %-------------------------------------------------- -}% -{\catcode`\p=12\catcode`\t=12\gdef\PGF@TEMP{pt}} -\expandafter\def\expandafter\pgfmathparsehashed@assign\expandafter#\expandafter1\expandafter.\expandafter#\expandafter2\PGF@TEMP{% - \def\pgf@temp{#2}% - \ifx\pgf@temp0% - \def\pgfmathresult{#1}% - \else - \def\pgfmathresult{#1.#2}% - \fi -}% -\let\pgfmathparsehashedcheck@finalize\pgfmathparsehashedcheck@finalize@isnumber - -\expandafter\def\csname pgf@pp+\endcsname{1} -\expandafter\def\csname pgf@pp-\endcsname{1} -\expandafter\def\csname pgf@p0\endcsname{1} -\expandafter\def\csname pgf@p1\endcsname{1} -\expandafter\def\csname pgf@p2\endcsname{1} -\expandafter\def\csname pgf@p3\endcsname{1} -\expandafter\def\csname pgf@p4\endcsname{1} -\expandafter\def\csname pgf@p5\endcsname{1} -\expandafter\def\csname pgf@p6\endcsname{1} -\expandafter\def\csname pgf@p7\endcsname{1} -\expandafter\def\csname pgf@p8\endcsname{1} -\expandafter\def\csname pgf@p9\endcsname{1} -\expandafter\def\csname pgf@p.\endcsname{1} - -\pgfutil@ifundefined{ifcsname}{% - \def\pgfmathparsehashedcheck@isnumber@loop#1{% - \expandafter\ifx\csname pgf@pp\string#1\endcsname\relax - \expandafter\pgfmathparsehashedcheck@isnumber@loop - \else - \expandafter\pgfmathparsehashedcheck@isnumber@loop@\expandafter#1% - \fi - }% - \def\pgfmathparsehashedcheck@isnumber@loop@#1{% - \expandafter\ifx\csname pgf@p\string#1\endcsname\relax - \expandafter\pgfmathparsehashedcheck@isnumber@loop@ - \else - \expandafter\pgfmathparsehashedcheck@isnumber@endfalse\expandafter#1% - \fi - }% -}{% - \def\pgfmathparsehashedcheck@isnumber@loop#1{% - \ifcsname pgf@pp\string#1\endcsname - \expandafter\pgfmathparsehashedcheck@isnumber@loop - \else - \expandafter\pgfmathparsehashedcheck@isnumber@loop@\expandafter#1% - \fi - }% - \def\pgfmathparsehashedcheck@isnumber@loop@#1{% - \ifcsname pgf@p\string#1\endcsname - \expandafter\pgfmathparsehashedcheck@isnumber@loop@ - \else - \expandafter\pgfmathparsehashedcheck@isnumber@endfalse\expandafter#1% - \fi - }% -}% -\def\pgfmathparsehashedcheck@isnumber@endfalse#1{% - \ifx#1\pgfmp@EOI - \else - \let\pgfmathparsehashedcheck@finalize=\pgfmathparsehashedcheck@finalize@isnonumber - \expandafter\pgfmathparsehashedcheck@isnumber@gobble - \fi -}% - - -\endinput 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 9025de703be..7dc97116753 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% 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 757439ed17f..2d7a81b2bf5 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,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% @@ -46,7 +46,6 @@ \toksdef\t@tikzexternal@tmpa=0 \toksdef\t@tikzexternal@tmpb=1 -\newwrite\tikzexternal@outfile \newif\iftikzexternal@nestedflag \newif\iftikzexternal@verboseio \newif\iftikzexternal@genfigurelist @@ -132,6 +131,9 @@ \pgfqkeys{/tikz/external}{ figure list/.is if=tikzexternal@genfigurelist, aux in dpth/.style={/pgf/images/aux in dpth=#1},% + disable dependency files/.code={% + \let\tikzexternalfiledependsonfile@ACTIVE=\tikzexternalfiledependsonfile + }, % 'mode' applies only if \jobname==real job name. mode/.is choice, mode/only graphics/.code = {% @@ -175,7 +177,7 @@ shell escape/.initial=-shell-escape, read main aux/.is if=pgfexternalreadmainaux, image discarded text/.initial={% - [[ {\sc Image Discarded Due To} {\tt`/tikz/external/% + [[ \textsc{Image Discarded Due To} \texttt{`/tikz/external/% \ifcase\tikzexternal@opmode\relax mode=only graphics% \or @@ -215,6 +217,7 @@ \tikzexternal@optimize@RESTORE },% optimize=true, + optimize away text/.code={[ \textsc{\string#1\ optimized away because it does not contribute to exported PDF}]}, optimize/install/.code={},% optimize/restore/.code={},% % Expects two arguments, the command name and (optionally) a count @@ -332,7 +335,7 @@ \tikzexternalenable \def\tikzexternal@determineimgextension##1:##2\relax{\gdef\tikzexternalimgextension{##1}}% \xdef\pgf@tempa{\pgfsys@imagesuffixlist}% - \expandafter\tikzexternal@determineimgextension\pgf@tempa\relax + \expandafter\tikzexternal@determineimgextension\pgf@tempa:\relax \pgfutil@ifundefined{includegraphics}{% \let\tikzexternal@orig@includegraphics=\relax }{% @@ -344,6 +347,14 @@ } \def\tikzexternalize@hasbeencalled{0}% +\def\tikzifexternalizehasbeencalled#1#2{% + \if1\tikzexternalize@hasbeencalled + #1% + \else + #2% + \fi +}% + % If mode=`convert with system call', the boolean \ifpgfexternalreadmainaux % will be set depending on the current lock file. % @@ -459,27 +470,40 @@ \else \ifx#1\@EOI \else - \expandafter\let\csname tikzexternalauxlock@handleref@orig@\string#1\endcsname=#1% - \def#1{\tikzexternalauxlock@handleref@repl{#1}}% + {% + % strip the leading '\' + % this allows proper \protect ion when you write + % \caption{...\cite{..}} and #1=\cite + \escapechar=-1 + \xdef\pgf@temp{\string#1}% + }% + \expandafter\let\csname tikzexternalauxlock@handleref@orig@\pgf@temp\endcsname=#1% + \edef#1{\noexpand\pgf@texdist@protect\noexpand\tikzexternalauxlock@handleref@repl{\pgf@temp}}% \expandafter\expandafter\expandafter\tikzexternalauxlock@handleref@loop \fi \fi }% \def\tikzexternalauxlock@handleref@repl#1{\pgfutil@ifnextchar[{\tikzexternalauxlock@handleref@repl@{#1}}{\tikzexternalauxlock@handleref@repl@{#1}[]}}% \def\tikzexternalauxlock@handleref@repl@#1[#2]#3{% - \csname tikzexternalauxlock@handleref@orig@\string#1\endcsname{#3}% - \begingroup - \def\n{\pgfexternal@hat\pgfexternal@hat J}% - \tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}% - \def\space{\noexpand\space}% - \pgfexternalstorecommand{% - \noexpand\begingroup - \noexpand\toks0={\pgf@tempa}% - \noexpand\immediate\noexpand\write16{\tikzexternalauxlock@handleref@warning{#3}{\noexpand\the\noexpand\toks0}}% - \noexpand\G@refundefinedtrue - \noexpand\endgroup + \tikzifexternalizingcurrent{% + % note that '#1' is NO control sequence! it is a protected string + \csname tikzexternalauxlock@handleref@orig@#1\endcsname{#3}% + \begingroup + \def\n{\pgfexternal@hat\pgfexternal@hat J}% + \tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}% + \def\space{\noexpand\space}% + \pgfexternalstorecommand{% + \noexpand\begingroup + \noexpand\toks0={\pgf@tempa}% + \noexpand\immediate\noexpand\write16{\tikzexternalauxlock@handleref@warning{#3}{\noexpand\the\noexpand\toks0}}% + \noexpand\G@refundefinedtrue + \noexpand\endgroup + }% + \endgroup + }{% + % ok. We are not externalizing this part of the document. + % Throw the citation away without further notice. }% - \endgroup }% \def\tikzexternalauxlock@handleref@warning#1#2{% \n @@ -798,6 +822,11 @@ \else \pgfutil@ifundefined{tikzexternal@listmode@openedfile}{% \message{Opening '\tikzexternal@realjob.figlist' for writing.}% + \begingroup + \globaldefs=1 + % this gets round '\outer\newwrite' in plain TeX: + \csname newwrite\endcsname\tikzexternal@outfile + \endgroup \immediate\openout\tikzexternal@outfile=\tikzexternal@realjob.figlist\relax \gdef\tikzexternal@listmode@openedfile{1}% \if\tikzexternal@opmode5% mode='list and make' @@ -818,6 +847,9 @@ \def\tikzexternal@list@and@make@gentarget#1{% \tikzexternal@assemble@systemcall{#1}{\pgf@tempa}% + \def\tikzexternal@tempb{\pgfutilstrreplace{^^J}{^^J\tikzexternal@TABchar}}% + \expandafter\tikzexternal@tempb\expandafter{\pgf@tempa}% + \let\pgf@tempa=\pgfretval \iftikzexternal@verboseio \immediate\write16{Writing '#1' to '\tikzexternal@realjob.makefile'.}% \fi @@ -862,6 +894,7 @@ \def\tikzexternalmakefiledefaultdeprule{% \immediate\write\tikzexternal@outmakefile{\tikzexternal@PERCENTchar.\tikzexternaldepext:}% + \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar mkdir -p $(dir $@)}% \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar touch $@ \tikzexternal@HASHchar\space will be filled later.}% }% @@ -1056,7 +1089,9 @@ \iftikzexternal@verbose@optimize \immediate\write16{The command '\the\toks0' has been optimized away. Use '/tikz/external/optimize=false' to disable this.}% \fi - [ {\sc \string#1\ optimized away because it does not contribute to exported PDF}]% + \endgroup + \begingroup + \pgfkeysvalueof{/tikz/external/optimize away text/.@cmd}#1\pgfeov% \endgroup }% 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 42056506818..badd22fd89d 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: Do 5. Aug 20:33:50 CEST 2010 %%% +%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% |