summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-07-30 23:10:06 +0000
committerKarl Berry <karl@freefriends.org>2016-07-30 23:10:06 +0000
commite8825f013e999a146ec53c7646086ac24d4adc8e (patch)
tree2b5cfc5d7628c7ab500552ff5314b9e13cbce680 /Master/texmf-dist/tex/latex/datatool/datatool-base.sty
parentef1b5554439daf89b038b385c15e92f969a88a37 (diff)
datatool (28jul16)
git-svn-id: svn://tug.org/texlive/trunk@41772 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/datatool/datatool-base.sty')
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool-base.sty64
1 files changed, 61 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
index 753f02324a0..8ab7d44a1a4 100644
--- a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-base}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool-base}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{etoolbox}
\RequirePackage{amsmath}
\RequirePackage{xkeyval}
@@ -235,6 +235,60 @@
\def\@dtl@newsortedlist{}%
\@dtl@insertdonefalse
\@for\dtl@srtelement:=#2\do{%
+ \if@dtl@insertdone
+ \expandafter\toks@\expandafter{\dtl@srtelement}%
+ \edef\@dtl@newstuff{{\the\toks@}}%
+ \else
+ \expandafter#3\expandafter{\dtl@srtelement}{#1}%
+ \ifnum\dtl@sortresult<0\relax
+ \expandafter\toks@\expandafter{\dtl@srtelement}%
+ \@dtl@toks{#1}%
+ \edef\@dtl@newstuff{{\the\@dtl@toks},{\the\toks@}}%
+ \@dtl@insertdonetrue
+ \else
+ \expandafter\toks@\expandafter{\dtl@srtelement}%
+ \edef\@dtl@newstuff{{\the\toks@}}%
+ \fi
+ \fi
+ \ifdefempty{\@dtl@newsortedlist}%
+ {%
+ \expandafter\toks@\expandafter{\@dtl@newstuff}%
+ \edef\@dtl@newsortedlist{\the\toks@}%
+ }%
+ {%
+ \expandafter\toks@\expandafter{\@dtl@newsortedlist}%
+ \expandafter\@dtl@toks\expandafter{\@dtl@newstuff}%
+ \edef\@dtl@newsortedlist{\the\toks@,\the\@dtl@toks}%
+ }%
+ \@endforfalse
+ }%
+ \ifdefempty{\@dtl@newsortedlist}%
+ {%
+ \@dtl@toks{#1}%
+ \edef\@dtl@newsortedlist{{\the\@dtl@toks}}%
+ }%
+ {%
+ \if@dtl@insertdone
+ \else
+ \expandafter\toks@\expandafter{\@dtl@newsortedlist}%
+ \@dtl@toks{#1}%
+ \edef\@dtl@newsortedlist{\the\toks@,{\the\@dtl@toks}}%
+ \fi
+ }%
+ \global\let#2=\@dtl@newsortedlist
+}
+\newcommand{\dtlsortlist}[2]{%
+\def\@dtl@sortedlist{}%
+\@for\@dtl@currentrow:=#1\do{%
+\expandafter\dtlinsertinto\expandafter
+ {\@dtl@currentrow}{\@dtl@sortedlist}{#2}%
+\@endforfalse}%
+\let#1=\@dtl@sortedlist
+}
+\newcommand{\dtlinsertinto}[3]{%
+ \def\@dtl@newsortedlist{}%
+ \@dtl@insertdonefalse
+ \@for\dtl@srtelement:=#2\do{%
\expandafter\DTLifSubString\expandafter{\dtl@srtelement}{,}
{%
\expandafter\toks@\expandafter{\dtl@srtelement}%
@@ -245,8 +299,8 @@
\if@dtl@insertdone
\let\@dtl@newstuff\dtl@srtelement
\else
- \expandafter#3\expandafter\dtl@sortresult\expandafter
- {\dtl@srtelement}{#1}%
+ \expandafter#3\expandafter\dtl@sortresult
+ \expandafter{\dtl@srtelement}{#1}%
\ifnum\dtl@sortresult>0\relax
\DTLifSubString{#1}{,}%
{%
@@ -303,6 +357,10 @@
}%
\global\let#2=\@dtl@newsortedlist
}
+\newcommand*{\edtlinsertinto}[3]{%
+ \protected@edef\dtl@srtelement{#1}%
+ \expandafter\dtlinsertinto\expandafter{\dtl@srtelement}{#2}{#3}%
+}
\newif\if@dtl@insertdone
\newcount\dtl@sortresult
\newcommand{\toks@gput@right@cx}[2]{%