From d211c476a793546259e3fe8b6417f3f36d477a99 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 6 Sep 2013 23:13:16 +0000 Subject: datatool (6sep13) git-svn-id: svn://tug.org/texlive/trunk@31588 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/datatool/datatool-base.sty | 2 +- Master/texmf-dist/tex/latex/datatool/datatool.sty | 34 ++++++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty index 65be692efb1..8d7474b95ec 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}[2013/08/29 v2.17 (NLCT)] +\ProvidesPackage{datatool-base}[2013/09/06 v2.18 (NLCT)] \RequirePackage{etoolbox} \RequirePackage{amsmath} \RequirePackage{xkeyval} diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty index 7b65fd06807..9281a51c9cf 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool.sty @@ -39,11 +39,12 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2013/08/29 v2.17 (NLCT)] +\ProvidesPackage{datatool}[2013/09/06 v2.18 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{ifthen} \RequirePackage{xfor} \RequirePackage{substr} +\RequirePackage{etoolbox} \RequirePackage{etex} \newcommand*{\@dtl@separator}{,} \newcommand*{\DTLsetseparator}[1]{% @@ -116,7 +117,7 @@ \ProcessOptionsX \@dtl@construct@lopoffs \RequirePackage{datatool-base} -\let\DTLpar\@@par +\DeclareRobustCommand{\DTLpar}{\par} \newcommand*{\DTLnewdb}[1]{% \DTLifdbexists{#1}% {% @@ -2459,9 +2460,32 @@ \typeout{Sorting `#3' - this may take a while.}% \fi \edef\@dtl@replacementkeys{#1}% - \edef\@dtl@sortorder{#2}% - \let\@dtl@comparecs=#4% - \dtl@sortdata{#3}% + \def\@dtl@sortorder{}% + \@for\@dtl@level:=#2\do + {% + \expandafter\@dtl@getsortdirection\@dtl@level=\relax + \DTLifhaskey{#3}{\@dtl@key}% + {% + \ifdefempty\@dtl@sortorder + {\let\@dtl@sortorder=\@dtl@level}% + {\eappto\@dtl@sortorder{,\@dtl@level}}% + }% + {% + \PackageError{datatool}% + {% + Can't sort on `\@dtl@level'. + No such key `\@dtl@key' in database `#3'% + }{}% + }% + }% + \ifdefempty\@dtl@sortorder + {% + \PackageWarning{datatool}{No keys provided to sort database `#3'}% + }% + {% + \let\@dtl@comparecs=#4% + \dtl@sortdata{#3}% + }% }% {% \PackageError{datatool}{Database `#3' doesn't exist}{}% -- cgit v1.2.3