diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex index bea65490068..fa90ea613f6 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex @@ -72,6 +72,8 @@ % - it requires O(N) different macros. % - it ***can't*** be copied outside of the current TeX group! % +% I have never used it (besides early tests) +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -132,6 +134,9 @@ % LOCAL, however: 'to global' is to be used inside of a local % group such that the final result, when all buffers are flushed, % is assigned globally. +% +% ATTENTION: maybe that [to global] thing is useless. +% Consider using the \pgfplotsapplistXglobal list (see below) \def\pgfplotsapplistXnewempty{% \pgfutil@ifnextchar[{% \pgfplotsapplistXnewempty@opt @@ -526,3 +531,85 @@ \def\pgfplotsapplistXXglobalexecute#1{% \pgfplotsapplistXXglobalflushbuffers #1}% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \pgfplotsapplistXglobalnewempty --> same as \pgfplotsapplistX, but +% it always assigns everything *globally*. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\pgfplotsgloballet{\global\let}% + +% Usage: +% \pgfplotsapplistXglobalnewempty\macro +% \pgfplotsapplistXglobalnewempty[to global]\macro +% +% The 'to global' flag will configure the list such that all +% assignments to \macro are global. The list accumulation is +% LOCAL, however: 'to global' is to be used inside of a local +% group such that the final result, when all buffers are flushed, +% is assigned globally. +\def\pgfplotsapplistXglobalnewempty#1{% + \pgfplotsgloballet#1=\pgfutil@empty + \expandafter\pgfplotsgloballet\csname\string#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\pgfplotsgloballet\csname\string#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\gdef\csname\string#1@smallbuf@c\endcsname{0}% + \expandafter\gdef\csname\string#1@bigbuf@c\endcsname{0}% +}% + +% #1: the item to append +% #2: the list as macro name +\long\def\pgfplotsapplistXglobalpushback#1\to#2{% + \begingroup + \c@pgf@counta=\csname\string#2@smallbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \expandafter\xdef\csname\string#2@smallbuf@c\endcsname{\the\c@pgf@counta}% + \endgroup + \ifnum\csname\string#2@smallbuf@c\endcsname<40 + \t@pgfplots@toka=\expandafter\expandafter\expandafter{\csname\string#2@smallbuf\endcsname#1}% + \expandafter\xdef\csname\string#2@smallbuf\endcsname{\the\t@pgfplots@toka}% + \else + \pgfplotsapplistXglobalpushback@smallbufoverfl{#1}{#2}% + \fi +}% +\long\def\pgfplotsapplistXglobalpushback@smallbufoverfl#1#2{% + \begingroup + \c@pgf@counta=\csname\string#2@bigbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \expandafter\xdef\csname\string#2@bigbuf@c\endcsname{\the\c@pgf@counta}% + \endgroup + % + \ifnum\csname\string#2@bigbuf@c\endcsname<30 + \t@pgfplots@toka=\expandafter\expandafter\expandafter{\csname\string#2@bigbuf\endcsname}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{\csname\string#2@smallbuf\endcsname#1}% + \expandafter\xdef\csname\string#2@bigbuf\endcsname{\the\t@pgfplots@toka\the\t@pgfplots@tokb}% + \expandafter\pgfplotsgloballet\csname\string#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\gdef\csname\string#2@smallbuf@c\endcsname{0}% + \else% + \t@pgfplots@toka=\expandafter{#2}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{\csname\string#2@bigbuf\endcsname}% + \t@pgfplots@tokc=\expandafter\expandafter\expandafter{\csname\string#2@smallbuf\endcsname#1}% + \xdef#2{\the\t@pgfplots@toka\the\t@pgfplots@tokb\the\t@pgfplots@tokc}% + \expandafter\pgfplotsgloballet\csname\string#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\gdef\csname\string#2@smallbuf@c\endcsname{0}% + \expandafter\pgfplotsgloballet\csname\string#2@bigbuf\endcsname=\pgfutil@empty + \expandafter\gdef\csname\string#2@bigbuf@c\endcsname{0}% + \fi% +}% +\def\pgfplotsapplistXglobalflushbuffers#1{% + \t@pgfplots@toka=\expandafter{#1}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{\csname\string#1@bigbuf\endcsname}% + \t@pgfplots@tokc=\expandafter\expandafter\expandafter{\csname\string#1@smallbuf\endcsname}% + \xdef#1{\the\t@pgfplots@toka\the\t@pgfplots@tokb\the\t@pgfplots@tokc}% + \expandafter\pgfplotsgloballet\csname\string#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\gdef\csname\string#1@smallbuf@c\endcsname{0}% + \expandafter\pgfplotsgloballet\csname\string#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\gdef\csname\string#1@bigbuf@c\endcsname{0}% +}% + + +\def\pgfplotsapplistXgloballet#1=#2{% + \pgfplotsapplistXglobalflushbuffers#2% + \let#1=#2} |