summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-28 21:32:49 +0000
committerKarl Berry <karl@freefriends.org>2019-09-28 21:32:49 +0000
commitccc34419a1783744295ce86fffaf9138b91d72f7 (patch)
tree59be2264d2a34af9404a0fadb20e2b7dc6071d05 /Master/texmf-dist/tex/latex/datatool/datatool-base.sty
parentcc09915f2283c012a12045169ce8e1caa621dbe3 (diff)
datatool (28sep19)
git-svn-id: svn://tug.org/texlive/trunk@52198 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.sty308
1 files changed, 187 insertions, 121 deletions
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
index 34109c37115..bf18843e419 100644
--- a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
@@ -7,7 +7,7 @@
%% datatool.dtx (with options: `datatool-base.sty,package')
%%
%% datatool.dtx
-%% Copyright 2018 Nicola Talbot
+%% Copyright 2019 Nicola Talbot
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-base}[2018/12/07 v2.31 (NLCT)]
+\ProvidesPackage{datatool-base}[2019/09/27 v2.32 (NLCT)]
\RequirePackage{etoolbox}
\RequirePackage{amsmath}
\RequirePackage{xkeyval}
@@ -1435,8 +1435,7 @@
\dtl@split@str##2\@nil
}%
}%
- \def\dtl@split@str##1#2\@nil{%
- \def#4{##1}}%
+ \def\dtl@split@str##1#2\@nil{\def#4{##1}}%
\dtl@splitstr#1#2\@nil
}
\newcommand{\DTLsubstituteall}[3]{%
@@ -1698,6 +1697,8 @@
#4%
}%
}
+\newif\ifdtlcompareskipcs
+\dtlcompareskipcsfalse
\newcommand*{\dtlcompare}[3]{%
\dtl@subnobrsp{#2}{\@dtl@argA}%
\dtl@subnobrsp{#3}{\@dtl@argB}%
@@ -1717,87 +1718,123 @@
#1=1\relax
}%
{%
- \DTLsubstituteall{\@dtl@argA}{ }{\space }%
- \DTLsubstituteall{\@dtl@argB}{ }{\space }%
+ \dtl@setwordbreaksnohyphens{\@dtl@argA}{\@dtl@wordbreak}%
+ \let\@dtl@argA\dtl@string
+ \dtl@setwordbreaksnohyphens{\@dtl@argB}{\@dtl@wordbreak}%
+ \let\@dtl@argB\dtl@string
\expandafter\dtl@getfirst\@dtl@argA\end@dtl@getfirst
\let\dtl@firstA=\dtl@first
\let\dtl@restA=\dtl@rest
\expandafter\dtl@getfirst\@dtl@argB\end@dtl@getfirst
\let\dtl@firstB=\dtl@first
\let\dtl@restB=\dtl@rest
- \expandafter\dtl@ifsingleorUTFviii\expandafter{\dtl@firstA}{%
- \expandafter\dtl@ifsingleorUTFviii\expandafter{\dtl@firstB}{%
- \expandafter\dtl@setcharcode\expandafter{\dtl@firstA}{\dtl@codeA}%
- \expandafter\dtl@setcharcode\expandafter{\dtl@firstB}{\dtl@codeB}%
- \ifnum\dtl@codeA=-1\relax
- \ifnum\dtl@codeB=-1\relax
- \edef\dtl@donext{%
- \noexpand\dtlcompare
- {\noexpand#1}{\expandonce\dtl@restA}{\expandonce\dtl@restB}}%
- \dtl@donext
- \else
- \edef\dtl@donext{%
- \noexpand\dtlcompare
- {\noexpand#1}%
- {\expandonce\dtl@restA}%
- {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
- \dtl@donext
- \fi
- \else
- \ifnum\dtl@codeB=-1\relax
- \edef\dtl@donext{%
- \noexpand\dtlcompare
- {\noexpand#1}%
- {\expandonce\dtl@firstA\expandonce\dtl@restA}%
- {\expandonce\dtl@restB}}%
- \dtl@donext
- \else
- \ifnum\dtl@codeA<\dtl@codeB
- #1=-1\relax
- \else
- \ifnum\dtl@codeA>\dtl@codeB
- #1=1\relax
+ \expandafter\dtl@ifsingleorUTFviii\expandafter{\dtl@firstA}%
+ {%
+ \expandafter\dtl@ifsingleorUTFviii\expandafter{\dtl@firstB}%
+ {%
+ \expandafter\dtl@setcharcode\expandafter{\dtl@firstA}{\dtl@codeA}%
+ \expandafter\dtl@setcharcode\expandafter{\dtl@firstB}{\dtl@codeB}%
+ \let\dtl@donextcompare\@firstofone
+ \ifdtlcompareskipcs
+ \ifnum\dtl@codeA=0\relax
+ \ifnum\dtl@codeB=0\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}{\expandonce\dtl@restA}{\expandonce\dtl@restB}}%
+ \dtl@donext
+ \let\dtl@donextcompare\@gobble
+ \else
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}{\expandonce\dtl@restA}{\expandonce\@dtl@argB}}%
+ \dtl@donext
+ \let\dtl@donextcompare\@gobble
+ \fi
\else
- \ifdefempty{\dtl@restA}%
- {%
- \ifdefempty{\dtl@restB}%
- {%
- #1=0\relax
- }%
- {%
- #1=-1\relax
- }%
- }%
- {%
- \ifdefempty{\restB}%
- {%
- #1=1\relax
- }%
- {%
- \protected@edef\dtl@donext{%
- \noexpand\dtlcompare
- {\noexpand#1}{\dtl@restA}{\dtl@restB}}%
- \dtl@donext
- }%
- }%
+ \ifnum\dtl@codeB=0\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}{\expandonce\@dtl@argA}{\expandonce\dtl@restB}}%
+ \dtl@donext
+ \let\dtl@donextcompare\@gobble
+ \fi
\fi
\fi
- \fi
- \fi
- }{%
- \edef\dtl@donext{%
- \noexpand\dtlcompare
- {\noexpand#1}%
- {\expandonce\dtl@firstA\expandonce\dtl@restA}%
- {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
- \dtl@donext
- }}{%
- \edef\dtl@donext{%
- \noexpand\dtlcompare
- {\noexpand#1}%
- {\expandonce\dtl@firstA\expandonce\dtl@restA}%
- {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
- \dtl@donext
+ \dtl@donextcompare
+ {%
+ \ifnum\dtl@codeA=-1\relax
+ \ifnum\dtl@codeB=-1\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}{\expandonce\dtl@restA}{\expandonce\dtl@restB}}%
+ \dtl@donext
+ \else
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}%
+ {\expandonce\dtl@restA}%
+ {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
+ \dtl@donext
+ \fi
+ \else
+ \ifnum\dtl@codeB=-1\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}%
+ {\expandonce\dtl@firstA\expandonce\dtl@restA}%
+ {\expandonce\dtl@restB}}%
+ \dtl@donext
+ \else
+ \ifnum\dtl@codeA<\dtl@codeB
+ #1=-1\relax
+ \else
+ \ifnum\dtl@codeA>\dtl@codeB
+ #1=1\relax
+ \else
+ \ifdefempty{\dtl@restA}%
+ {%
+ \ifdefempty{\dtl@restB}%
+ {%
+ #1=0\relax
+ }%
+ {%
+ #1=-1\relax
+ }%
+ }%
+ {%
+ \ifdefempty{\dtl@restB}%
+ {%
+ #1=1\relax
+ }%
+ {%
+ \protected@edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}{\dtl@restA}{\dtl@restB}}%
+ \dtl@donext
+ }%
+ }%
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+ }%
+ {%
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}%
+ {\expandonce\dtl@firstA\expandonce\dtl@restA}%
+ {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
+ \dtl@donext
+ }%
+ }%
+ {%
+ \edef\dtl@donext{%
+ \noexpand\dtlcompare
+ {\noexpand#1}%
+ {\expandonce\dtl@firstA\expandonce\dtl@restA}%
+ {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
+ \dtl@donext
}%
}%
}%
@@ -2216,63 +2253,92 @@
{%
\expandafter\dtl@setlccharcode\expandafter{\dtl@firstA}{\dtl@codeA}%
\expandafter\dtl@setlccharcode\expandafter{\dtl@firstB}{\dtl@codeB}%
- \ifnum\dtl@codeA=-1\relax
- \ifnum\dtl@codeB=-1\relax
- \edef\dtl@donext{%
- \noexpand\dtlicompare{\noexpand#1}%
- {\expandonce\dtl@restA}{\expandonce\dtl@restB}}%
- \dtl@donext
+ \let\dtl@donextcompare\@firstofone
+ \ifdtlcompareskipcs
+ \ifnum\dtl@codeA=0\relax
+ \ifnum\dtl@codeB=0\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare
+ {\noexpand#1}{\expandonce\dtl@restA}{\expandonce\dtl@restB}}%
+ \dtl@donext
+ \let\dtl@donextcompare\@gobble
+ \else
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare
+ {\noexpand#1}{\expandonce\dtl@restA}{\expandonce\@dtl@argB}}%
+ \dtl@donext
+ \let\dtl@donextcompare\@gobble
+ \fi
\else
- \edef\dtl@donext{%
- \noexpand\dtlicompare
- {\noexpand#1}%
- {\expandonce\dtl@restA}%
- {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
- \dtl@donext
+ \ifnum\dtl@codeB=0\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare
+ {\noexpand#1}{\expandonce\@dtl@argA}{\expandonce\dtl@restB}}%
+ \dtl@donext
+ \let\dtl@donextcompare\@gobble
+ \fi
\fi
- \else
- \ifnum\dtl@codeB=-1\relax
- \edef\dtl@donext{%
- \noexpand\dtlicompare
- {\noexpand#1}%
- {\expandonce\dtl@firstA\expandonce\dtl@restA}%
- {\expandonce\dtl@restB}}%
- \dtl@donext
+ \fi
+ \dtl@donextcompare
+ {%
+ \ifnum\dtl@codeA=-1\relax
+ \ifnum\dtl@codeB=-1\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare{\noexpand#1}%
+ {\expandonce\dtl@restA}{\expandonce\dtl@restB}}%
+ \dtl@donext
+ \else
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare
+ {\noexpand#1}%
+ {\expandonce\dtl@restA}%
+ {\expandonce\dtl@firstB\expandonce\dtl@restB}}%
+ \dtl@donext
+ \fi
\else
- \ifnum\dtl@codeA<\dtl@codeB
- #1=-1\relax
+ \ifnum\dtl@codeB=-1\relax
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare
+ {\noexpand#1}%
+ {\expandonce\dtl@firstA\expandonce\dtl@restA}%
+ {\expandonce\dtl@restB}}%
+ \dtl@donext
\else
- \ifnum\dtl@codeA>\dtl@codeB
- #1=1\relax
+ \ifnum\dtl@codeA<\dtl@codeB
+ #1=-1\relax
\else
- \ifdefempty{\dtl@restA}%
- {%
- \ifdefempty{\dtl@restB}%
- {%
- #1=0\relax
- }%
- {%
- #1=-1\relax
- }%
- }%
- {%
- \ifdefempty{\restB}%
+ \ifnum\dtl@codeA>\dtl@codeB
+ #1=1\relax
+ \else
+ \ifdefempty{\dtl@restA}%
{%
- #1=1\relax
+ \ifdefempty{\dtl@restB}%
+ {%
+ #1=0\relax
+ }%
+ {%
+ #1=-1\relax
+ }%
}%
{%
- \edef\dtl@donext{%
- \noexpand\dtlicompare
- {\noexpand#1}%
- {\expandonce\dtl@restA}%
- {\expandonce\dtl@restB}}%
- \dtl@donext
+ \ifdefempty{\dtl@restB}%
+ {%
+ #1=1\relax
+ }%
+ {%
+ \edef\dtl@donext{%
+ \noexpand\dtlicompare
+ {\noexpand#1}%
+ {\expandonce\dtl@restA}%
+ {\expandonce\dtl@restB}}%
+ \dtl@donext
+ }%
}%
- }%
+ \fi
\fi
\fi
\fi
- \fi
+ }%
}%
{%
\edef\dtl@donext{%