diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex | 83 |
1 files changed, 70 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex index b5aaadc42dc..026a1c83f78 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex @@ -36,6 +36,62 @@ \pgfplots@error{It seems your version of PGF/Tikz is older than 2.00. Unfortunately, pgfplots requires at least version 2.00 ... you may need to update your TeX-Distribution or install PGF manually, sorry}% }{\relax} +% Throws exception `#1' with arguments `#2'. +% +% #1 : the exception name +% #2: all what comes after the exception name is considered to be argument +% (or arguments) for the exception '#1'. +% the \pgfeov is IMPORTANT as it delimits the argument. +% +% Note that all standard pgfplots exceptions provide a feature to +% exchange the error message text: define \pgfplotsexceptionmsg +% set a replacement. +\def\pgfplotsthrow#1#2\pgfeov{% + \pgfkeysvalueof{/pgfplots/exception/#1/.@cmd}#2\pgfeov +}% +\pgfkeys{ + % #1: the argument which should have been assigned. + % #2: an error message. + /pgfplots/exception/invalid argument/.code 2 args={% + \ifx\pgfplotsexceptionmsg\relax + \pgfplots@error{#2}% + \else + \pgfplots@error{\pgfplotsexceptionmsg}% + \fi + \let#1=\pgfutil@empty + },% + % #1: the argument which should have been assigned. + % #2: an error message. + /pgfplots/exception/no such element/.code 2 args={% + \ifx\pgfplotsexceptionmsg\relax + \pgfplots@error{#2}% + \else + \pgfplots@error{\pgfplotsexceptionmsg}% + \fi + \let#1=\pgfutil@empty + },% + % #1: an error message + /pgfplots/exception/unsupported operation/.code={% + \ifx\pgfplotsexceptionmsg\relax + \pgfplots@error{#1}% + \else + \pgfplots@error{\pgfplotsexceptionmsg}% + \fi + },% + % #1: the argument which should have been assigned. + % #2: the file name + % #3: the error message + /pgfplots/exception/no such table file/.code args={#1#2#3}{% + \ifx\pgfplotsexceptionmsg\relax + \pgfplots@error{#3}% + \else + \pgfplots@error{\pgfplotsexceptionmsg}% + \fi + \let#1=\relax + }, +} +\let\pgfplotsexceptionmsg=\relax + \def\pgfplots@EOI{\pgfplots@EOI}% \newif\ifpgfplots@loc@tmp @@ -43,6 +99,13 @@ \newtoks\t@pgfplots@tokb \newtoks\t@pgfplots@tokc \newdimen\pgfplots@tmpa +\newcount\c@pgfplots@coordindex +\newcount\c@pgfplots@scanlineindex +\pgfutil@ifundefined{r@pgf@reada}{% + \csname newread\endcsname\r@pgfplots@reada +}{% + \let\r@pgfplots@reada=\r@pgf@reada +} % use these macros for GLOBAL temporary assignments. % you can NEVER rely on their values unless you know exactly what you are doing. @@ -58,20 +121,14 @@ % Invokes code #2 if file '#1' exists and #3 if not. -\def\pgfplots@iffileexists#1#2#3{% - \begingroup - \openin1=#1 - \ifeof1 - \xdef\pgfplots@glob@TMPa{0}% - \else - \closein1 - \xdef\pgfplots@glob@TMPa{1}% - \fi - \endgroup - \if1\pgfplots@glob@TMPa - #2% +\long\def\pgfplots@iffileexists#1#2#3{% + \openin\r@pgfplots@reada=#1 + \ifeof\r@pgfplots@reada + #3\relax \else - #3% + \closein\r@pgfplots@reada + #2\relax \fi } +\let\pgfplotsiffileexists=\pgfplots@iffileexists \endinput |