diff options
author | Karl Berry <karl@freefriends.org> | 2014-08-06 22:47:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-08-06 22:47:59 +0000 |
commit | 1da164bf9c4fed03b30b98439a239f5a1873f9ae (patch) | |
tree | 2ed76752cb203cacf4135b821206b45c24b1a534 /Master/texmf-dist/tex/generic/pgfplots/util | |
parent | e16354c1642ffdd8e82798c9f0f60108e85059c6 (diff) |
pgfplots (6aug14)
git-svn-id: svn://tug.org/texlive/trunk@34851 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/util')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex index 58ae93cbc1a..655c96f2c86 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex @@ -458,7 +458,8 @@ % for two-dimensional plots and shall be optimized. \def\pgfplotsqpointxy@orthogonal#1#2{% \global\pgf@x=#1\pgf@xx% - \global\pgf@y=#2\pgf@yy} + \global\pgf@y=#2\pgf@yy +} % Takes a domain as input and generates a foreach argument which @@ -1278,6 +1279,32 @@ }% }% +% Tests if string '#2' starts with pattern '#1'. +% +% If so, it executes #3 and defines \pgfplotsretval to contain the +% suffix which is not equal to #1. Otherwise it executes #4. +\def\pgfplotsutilifstartswith#1#2#3#4{% + \def\pgfplotsutilifstartswith@ ##1#1##2\pgfplots@EOI{% + \def\pgfplotsutil@tmp{##1}% + \ifx\pgfplotsutil@tmp\pgfutil@empty + % Ah - a hit! + % + % define \pgfplotsretval to be the suffix... + \def\pgfplotsutil@tmp#1####1\pgfplots@EOI{% + \def\pgfplotsretval{####1}% + }% + \pgfplotsutil@tmp#2\pgfplots@EOI + % + % ... and execute the <true> code: + #3\relax + \else + % hm. No such prefix. + #4\relax + \fi + }% + \pgfplotsutilifstartswith@#2--#1\pgfplots@EOI +}% + % Usage: % \pgfplotsutilstrreplace{<token>}{<replacement>}{<string>} % |