summaryrefslogtreecommitdiff
path: root/Master
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
parentef1b5554439daf89b038b385c15e92f969a88a37 (diff)
datatool (28jul16)
git-svn-id: svn://tug.org/texlive/trunk@41772 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/datatool/CHANGES17
-rw-r--r--Master/texmf-dist/doc/latex/datatool/README4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-code.pdfbin1170895 -> 1175201 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.pdfbin613586 -> 631018 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.tex128
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdfbin24923 -> 24923 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdfbin35068 -> 35068 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdfbin22860 -> 22860 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdfbin122588 -> 122588 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdfbin89557 -> 89557 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdfbin179545 -> 179722 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdfbin104200 -> 104379 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdfbin128779 -> 128779 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdfbin21618 -> 21631 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdfbin33957 -> 33957 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdfbin89724 -> 89724 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdfbin34614 -> 34614 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdfbin31751 -> 31751 bytes
-rw-r--r--Master/texmf-dist/source/latex/datatool/datatool.dtx166
-rw-r--r--Master/texmf-dist/source/latex/datatool/datatool.ins2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/databar.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/databib.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datagidx.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datapie.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/dataplot.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool-base.sty64
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool-fp.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool.sty2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/person.sty2
30 files changed, 351 insertions, 48 deletions
diff --git a/Master/texmf-dist/doc/latex/datatool/CHANGES b/Master/texmf-dist/doc/latex/datatool/CHANGES
index 04a54a35c0e..32497e242ed 100644
--- a/Master/texmf-dist/doc/latex/datatool/CHANGES
+++ b/Master/texmf-dist/doc/latex/datatool/CHANGES
@@ -1,3 +1,20 @@
+v2.27:
+
+ * datatool-base:
+
+ - reverted \dtl@insertinto to pre v2.26. (The bug fixes
+ in v2.26 caused backward-compatibility issues, which
+ break glossaries.sty's "noidx" code.)
+
+ - new commands \dtlsortlist and \dtlinsertinto (which
+ are how \dtl@sortlist and \dtl@insertinto ought to
+ behave but don't). The internal commands are left for
+ backward compatibility. The user commands should be
+ used for the correct function. (Added new section in
+ the user manual documenting these new commands.)
+
+ - new command \edtlinsertinto
+
v2.26:
* datatool-base:
diff --git a/Master/texmf-dist/doc/latex/datatool/README b/Master/texmf-dist/doc/latex/datatool/README
index 6bacaf67ec8..cbae48e774e 100644
--- a/Master/texmf-dist/doc/latex/datatool/README
+++ b/Master/texmf-dist/doc/latex/datatool/README
@@ -1,6 +1,6 @@
-LaTeX Bundle : datatool v2.26
+LaTeX Bundle : datatool v2.27
-Last Modified : 2016-07-20
+Last Modified : 2016-07-28
Author : Nicola Talbot
diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf b/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf
index 23dcc06d45e..b2a076679c4 100644
--- a/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf b/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf
index 333429d92cd..53f1d9cedf4 100644
--- a/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
index 140fe1f1282..b5e65957904 100644
--- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
+++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
@@ -102,11 +102,11 @@
\MakeShortVerb{"}
- \title{User Manual for datatool bundle version~2.26}
+ \title{User Manual for datatool bundle version~2.27}
\author{Nicola L.C. Talbot\\
\url{http://www.dickimaw-books.com/}}
- \date{2016-07-20}
+ \date{2016-07-28}
\maketitle
\pagenumbering{roman}
@@ -121,7 +121,7 @@ The \styfmt{datatool} bundle comes with the following documentation:
\item[\url{datatool-code.pdf}]
Advanced users wishing to know more about the inner workings of
all the packages provided in the \styfmt{datatool} bundle should
- read \qt{Documented Code for datatool v2.26}
+ read \qt{Documented Code for datatool v2.27}
\item[INSTALL] Installation instructions.
@@ -2043,6 +2043,122 @@ produces:
\renewcommand*{\DTLinitialhyphen}{}\relax
\DTLinitials{Marie-{\'E}lise del~Rosario}}
+\chapter{Comma-Separated Lists}
+\label{sec:csvlists}
+
+The \styfmt{datatool-base} package automatically loads the
+\sty{etoolbox} package, so you can use any of the list
+commands provided by that package, or you can use
+the internal command \cs{@for} provided by the \LaTeX\ kernel
+(and modified by the \sty{xfor} package, which is also loaded
+by \styfmt{datatool-base}).
+
+In addition to those commands, \styfmt{datatool-base}
+provides some commands that deal with comma-separated lists.
+Note that this just refers to a control sequence that stores
+a list of elements separated by commands, for example:
+\begin{verbatim}
+\newcommand{\mylist}{elephant,ant,zebra,duck}
+\end{verbatim}
+This isn't the same as comma-separated files, which is dealt
+with in \sectionref{sec:databases}.
+
+\begin{definition}[\DescribeMacro\dtlsortlist]
+\cs{dtlsortlist}\marg{list cs}\marg{criteria cs}
+\end{definition}
+This sorts the comma-separated list stored in the command
+\meta{list cs} according to the criteria command
+\meta{criteria cs}. The criteria command must take three arguments:
+a count register in which to store the result, element \meta{A} and
+element \meta{B}. If \meta{A} is considered less that \meta{B}, the
+count register should be set to $-1$, if \meta{A} and \meta{B} are
+considered the same then the count register should be set to 0,
+and if \meta{A} is considered greater than \meta{B}, then the count
+register should be set to 1.
+
+The \styfmt{datatool-base} package provides some predefined
+criteria commands:
+\begin{definition}[\DescribeMacro\dtlcompare]
+\cs{dtlcompare}\marg{register}\marg{A}\marg{B}
+\end{definition}
+A case-sensitive comparison.
+\begin{definition}[\DescribeMacro\dtlicompare]
+\cs{dtlicompare}\marg{register}\marg{A}\marg{B}
+\end{definition}
+A case-insensitive comparison.
+\begin{definition}[\DescribeMacro\dtlwordindexcompare]
+\cs{dtlwordindexcompare}\marg{register}\marg{A}\marg{B}
+\end{definition}
+English word-ordering comparison for indexes, as described by
+the Oxford Style Manual.
+\begin{definition}[\DescribeMacro\dtlletterindexcompare]
+\cs{dtlletterindexcompare}\marg{register}\marg{A}\marg{B}
+\end{definition}
+English letter-ordering comparison for indexes.
+Those last two commands are described in more detail in
+\sectionref{sec:sort}.
+
+For example:
+\begin{verbatim}
+\newcommand{\mylist}{elephant,ant,zebra,duck}
+\dtlsortlist{\mylist}{\dtlcompare}
+
+\mylist.
+\end{verbatim}
+produces:
+\begin{display}
+\newcommand{\mylist}{elephant,ant,zebra,duck}
+\dtlsortlist{\mylist}{\dtlcompare}
+
+\mylist.
+\end{display}
+
+If you are building up a list, you may prefer to use:
+\begin{definition}[\DescribeMacro\dtlinsertinto]
+\cs{dtlinsertinto}\marg{element}\marg{list cs}\marg{criteria cs}
+\end{definition}
+which inserts \meta{element} into the list stored in the
+command \meta{list cs} according to the criteria command
+\meta{criteria cs}. This is more efficient than first building the
+list and then sorting it.
+
+For example:
+\begin{verbatim}
+\newcommand{\mylist}{}
+\dtlinsertinto{elephant}{\mylist}{\dtlcompare}
+\dtlinsertinto{ant}{\mylist}{\dtlcompare}
+\dtlinsertinto{zebra}{\mylist}{\dtlcompare}
+\dtlinsertinto{duck}{\mylist}{\dtlcompare}
+
+\mylist.
+\end{verbatim}
+produces:
+\begin{display}
+\newcommand{\mylist}{}
+\dtlinsertinto{elephant}{\mylist}{\dtlcompare}
+\dtlinsertinto{ant}{\mylist}{\dtlcompare}
+\dtlinsertinto{zebra}{\mylist}{\dtlcompare}
+\dtlinsertinto{duck}{\mylist}{\dtlcompare}
+
+\mylist.
+\end{display}
+
+Note that \cs{dtlinsertinto} doesn't expand \meta{element}.
+If the element is stored in a command, you need to
+expand it first. For example:
+\begin{verbatim}
+\newcommand*{\element}{ant}
+\expandafter\dtlinsertinto\expandafter{\element}{\mylist}{\dtlcompare}
+\end{verbatim}
+
+To ensure that the element is first fully expanded, you can
+use:
+\begin{definition}[\DescribeMacro\edtlinsertinto]
+\cs{edtlinsertinto}\marg{element}\marg{list cs}\marg{criteria cs}
+\end{definition}
+This will fully expand \meta{element} using \cs{protected@edef}
+and then use \cs{dtlinsertinto}.
+
\chapter{Databases}
\label{sec:databases}
@@ -4522,9 +4638,9 @@ the data type for a given key, and uses this to determine whether
an alphabetical or numerical sort is required.
The final argument \meta{handler} is the command used for the
-comparisons. These handlers are described in more detail on
-page~\pageref*{src:dtlcompare} of the documented code (datatool-code.pdf). The following
-handlers are provided:
+comparisons and is the same as the \meta{criteria cs} command
+used by \cs{dtlsortlist} and \cs{dtlinsertinto}, described
+in \sectionref{sec:csvlists}. The predefined handlers are:
\begin{description}
\item[\ics{dtlcompare}] A case-sensitive comparison.
\item[\ics{dtlicompare}] A case-insensitive comparison.
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdf
index d9f777bafbd..066a7dacb8d 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf
index 85179d1124e..8cfeed51c1f 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf
index adff6e25539..3edcf8f6282 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf
index 538a773ff66..0b3c08d8ea7 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdf
index 87b21abc0f0..354505fe7c0 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf
index 0e6b95463da..3f45901c694 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf
index 06296653448..d2969ec2cb5 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf
index 2d5038a0451..35e8bdd2a68 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf
index 7a68eae9c54..b6966f6ef30 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf
index 50ffa2b949b..6bd3622cb87 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdf
index 6fbc9418403..5a2b5fc0220 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf
index 773f0373444..7e6084b0e8d 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf
index 2490cf7f781..8d2778b94c4 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx
index 54027354f9f..d84c46f7ee0 100644
--- a/Master/texmf-dist/source/latex/datatool/datatool.dtx
+++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx
@@ -2,11 +2,8 @@
% datatool.dtx generated using makedtx version 1.1 (c) Nicola Talbot
% Command line args:
% -macrocode "databib\.bst"
-% -codetitle ""
% -comment "databib\.bst"
-% -author "Nicola Talbot"
% -setambles "databib\.bst=>\nopreamble\nopostamble"
-% -doc "datatool-manual.tex"
% -src "datatool-base.sty\Z=>datatool-base.sty"
% -src "datatool-fp.sty\Z=>datatool-fp.sty"
% -src "datatool-pgfmath.sty\Z=>datatool-pgfmath.sty"
@@ -18,8 +15,11 @@
% -src "dataplot.sty\Z=>dataplot.sty"
% -src "person.sty\Z=>person.sty"
% -src "databib.bst\Z=>databib.bst"
+% -doc "datatool-manual.tex"
+% -author "Nicola Talbot"
+% -codetitle ""
% datatool
-% Created on 2016/7/20 19:31
+% Created on 2016/7/28 15:09
%\fi
%\iffalse
%<*package>
@@ -53,6 +53,8 @@ datatool-manual.tex is a stub file used by makedtx to create
datatool.dtx
\fi
+\DeleteShortVerb{|}
+
\usepackage{datatool}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
@@ -66,7 +68,7 @@ datatool.dtx
\doxitem{Counter}{counter}{counters}
\doxitem{Option}{option}{package options}
-\CheckSum{23620}
+\CheckSum{23739}
\RecordChanges
\PageIndex
@@ -79,11 +81,11 @@ datatool.dtx
%\fi
%\MakeShortVerb{"}
%
-%\title{Documented Code for datatool v2.26}
+%\title{Documented Code for datatool v2.27}
%\author{Nicola L. C. Talbot\\
%\url{http://www.dickimaw-books.com/}}
%
-%\date{2016-07-20}
+%\date{2016-07-28}
%\maketitle
%
%\pagenumbering{roman}
@@ -119,7 +121,7 @@ datatool.dtx
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-base}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool-base}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -533,6 +535,19 @@ datatool.dtx
% \end{macrocode}
%\end{macro}
%
+%I made a bit of a blunder here. \cs{dtl@sortlist} was supposed to
+%work with commands like \cs{dtlcompare}, but those commands require
+%three arguments, the first being the register in which to store the
+%result. This contradicts the requirements of \cs{dtl@sortlist}. The
+%\qt{bug fix} in v2.26 fixed it to work with commands like
+%\cs{dtlcompare}, but that broke the documented design (which breaks
+%the \sty{glossaries} package). The other problem is that
+%\cs{dtl@insertinto} actually sorts in the reverse order.
+%So v2.27 undoes the change from v2.26 to ensure backward
+%compatibility and provides an alternative user-level command
+%\cs{dltsortlist}, that's designed to work with the three-argument
+%handler commands like \cs{dtlcompare}.
+%
%\begin{macro}{\dtl@sortlist}
%\begin{definition}
% \cs{dtl@sortlist}\marg{list}\marg{criteria cmd}
@@ -540,8 +555,8 @@ datatool.dtx
% Performs an insertion sort on \meta{list}, where \meta{criteria cmd}
% is a macro which takes two arguments \meta{a} and \meta{b}.
% \meta{criteria cmd} must set the count register \cs{dtl@sortresult}
-% to either $-1$ (\meta{a} less than \meta{b}), 0 (\meta{a} is
-% equal to \meta{b}) or 1 (\meta{a} is greater than \meta{b}.)
+% to either $-1$ (\meta{b} less than \meta{a}), 0 (\meta{a} is
+% equal to \meta{b}) or 1 (\meta{b} is greater than \meta{a}.)
% \begin{macrocode}
\newcommand{\dtl@sortlist}[2]{%
\def\@dtl@sortedlist{}%
@@ -565,6 +580,94 @@ datatool.dtx
\def\@dtl@newsortedlist{}%
\@dtl@insertdonefalse
\@for\dtl@srtelement:=#2\do{%
+ \if@dtl@insertdone
+ \expandafter\toks@\expandafter{\dtl@srtelement}%
+ \edef\@dtl@newstuff{{\the\toks@}}%
+ \else
+% \end{macrocode}
+%\changes{2.26}{2016-07-20}{fixed bug (missing \cs{dtl@sortresult})}
+%\changes{2.27}{2016-07-28}{undone the incorrect change in v2.26}
+% \begin{macrocode}
+ \expandafter#3\expandafter{\dtl@srtelement}{#1}%
+% \end{macrocode}
+%\changes{2.26}{2016-07-20}{fixed bug (incorrect inequality sign)}
+%\changes{2.27}{2016-07-28}{undone the incorrect change in v2.26}
+% \begin{macrocode}
+ \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
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\dtlsortlist}
+%\changes{2.27}{2016/07/28}{new}
+%\begin{definition}
+% \cs{dtlsortlist}\marg{list}\marg{criteria cmd}
+%\end{definition}
+% As \cs{dtl@sortlist} but the \meta{criteria} command must take
+% three arguments.
+% \begin{macrocode}
+\newcommand{\dtlsortlist}[2]{%
+\def\@dtl@sortedlist{}%
+\@for\@dtl@currentrow:=#1\do{%
+\expandafter\dtlinsertinto\expandafter
+ {\@dtl@currentrow}{\@dtl@sortedlist}{#2}%
+\@endforfalse}%
+\let#1=\@dtl@sortedlist
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\dtlinsertinto}
+%\changes{2.27}{2016/07/28}{new}
+%\begin{definition}
+% \cs{dtlinsertinto}\marg{element}\marg{sorted-list}\marg{criteria cmd}
+%\end{definition}
+% Inserts \meta{element} into the sorted list \meta{sorted-list}
+% according to the criteria given by \meta{criteria cmd}, which
+% should be a command that takes three arguments
+% \marg{reg}\marg{A}\marg{B}, where \meta{reg} is a count register
+% in which to store the result, \meta{A} is the first element and
+% \meta{B} is the second element to compare.
+% \begin{macrocode}
+\newcommand{\dtlinsertinto}[3]{%
+ \def\@dtl@newsortedlist{}%
+ \@dtl@insertdonefalse
+ \@for\dtl@srtelement:=#2\do{%
\expandafter\DTLifSubString\expandafter{\dtl@srtelement}{,}
{%
\expandafter\toks@\expandafter{\dtl@srtelement}%
@@ -575,14 +678,8 @@ datatool.dtx
\if@dtl@insertdone
\let\@dtl@newstuff\dtl@srtelement
\else
-% \end{macrocode}
-%\changes{2.26}{2016-07-20}{fixed bug (missing \cs{dtl@sortresult})}
-% \begin{macrocode}
- \expandafter#3\expandafter\dtl@sortresult\expandafter
- {\dtl@srtelement}{#1}%
-% \end{macrocode}
-%\changes{2.26}{2016-07-20}{fixed bug (incorrect inequality sign)}
-% \begin{macrocode}
+ \expandafter#3\expandafter\dtl@sortresult
+ \expandafter{\dtl@srtelement}{#1}%
\ifnum\dtl@sortresult>0\relax
\DTLifSubString{#1}{,}%
{%
@@ -641,6 +738,21 @@ datatool.dtx
}
% \end{macrocode}
%\end{macro}
+%
+%\begin{macro}{\edtlinsertinto}
+%\changes{2.27}{2016/07/28}{new}
+%\begin{definition}
+% \cs{edtlinsertinto}\marg{element}\marg{sorted-list}\marg{criteria cmd}
+%\end{definition}
+%First expands \meta{element} before inserting into the list.
+% \begin{macrocode}
+\newcommand*{\edtlinsertinto}[3]{%
+ \protected@edef\dtl@srtelement{#1}%
+ \expandafter\dtlinsertinto\expandafter{\dtl@srtelement}{#2}{#3}%
+}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\if@dtl@insertdone}
% Define conditional to indicate whether the new entry has
% been inserted into the sorted list.
@@ -5795,7 +5907,7 @@ datatool.dtx
% Definitions of fixed-point commands that use the \sty{fp} package.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-fp}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool-fp}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -6084,7 +6196,7 @@ datatool.dtx
% Definitions of fixed-point commands that use the \sty{pgfmath} package.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-pgfmath}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool-pgfmath}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -6425,7 +6537,7 @@ datatool.dtx
%\section{Package Declaration}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Load required packages:
% \begin{macrocode}
@@ -14018,7 +14130,7 @@ datatool.dtx
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datagidx}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datagidx}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -19927,7 +20039,7 @@ datatool.dtx
%\section{Package Declaration}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databib}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{databib}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Load required packages:
% \begin{macrocode}
@@ -22850,7 +22962,7 @@ already exists}{}}}}
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databar}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{databar}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Require \sty{xkeyval} package
% \begin{macrocode}
@@ -24157,7 +24269,7 @@ already exists}{}}}}
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datapie}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datapie}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Require \sty{xkeyval} package
% \begin{macrocode}
@@ -24959,7 +25071,7 @@ already exists}{}}}}
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{dataplot}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{dataplot}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Required packages
% \begin{macrocode}
@@ -26581,7 +26693,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
% Package identification:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{person}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{person}[2016/07/28 v2.27 (NLCT)]
% \end{macrocode}
% Requires the \sty{ifthen} package.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/datatool/datatool.ins b/Master/texmf-dist/source/latex/datatool/datatool.ins
index 97634e61b8d..e8f57a2928b 100644
--- a/Master/texmf-dist/source/latex/datatool/datatool.ins
+++ b/Master/texmf-dist/source/latex/datatool/datatool.ins
@@ -1,4 +1,4 @@
-% datatool.ins generated using makedtx version 1.1 2016/7/20 19:31
+% datatool.ins generated using makedtx version 1.1 2016/7/28 15:09
\input docstrip
\preamble
diff --git a/Master/texmf-dist/tex/latex/datatool/databar.sty b/Master/texmf-dist/tex/latex/datatool/databar.sty
index d0ef470fe52..4ac4e031e06 100644
--- a/Master/texmf-dist/tex/latex/datatool/databar.sty
+++ b/Master/texmf-dist/tex/latex/datatool/databar.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databar}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{databar}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{dataplot}
\newif\ifDTLcolorbarchart
diff --git a/Master/texmf-dist/tex/latex/datatool/databib.sty b/Master/texmf-dist/tex/latex/datatool/databib.sty
index 925c7c0fa84..528f05adbdd 100644
--- a/Master/texmf-dist/tex/latex/datatool/databib.sty
+++ b/Master/texmf-dist/tex/latex/datatool/databib.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databib}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{databib}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{datatool}
\newcommand*{\dtlbib@style}{plain}
\define@choicekey{databib.sty}{style}{plain,abbrv,alpha}{%
diff --git a/Master/texmf-dist/tex/latex/datatool/datagidx.sty b/Master/texmf-dist/tex/latex/datatool/datagidx.sty
index eb7ba8b128e..8818f59428e 100644
--- a/Master/texmf-dist/tex/latex/datatool/datagidx.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datagidx.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datagidx}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datagidx}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{datatool}
\RequirePackage{etoolbox}
\RequirePackage{xkeyval}
diff --git a/Master/texmf-dist/tex/latex/datatool/datapie.sty b/Master/texmf-dist/tex/latex/datatool/datapie.sty
index 169941de50c..59bd0ac835f 100644
--- a/Master/texmf-dist/tex/latex/datatool/datapie.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datapie.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datapie}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datapie}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{xkeyval}
\newif\ifDTLcolorpiechart
\DTLcolorpiecharttrue
diff --git a/Master/texmf-dist/tex/latex/datatool/dataplot.sty b/Master/texmf-dist/tex/latex/datatool/dataplot.sty
index d1ed4d28549..eaa2d1b8ab8 100644
--- a/Master/texmf-dist/tex/latex/datatool/dataplot.sty
+++ b/Master/texmf-dist/tex/latex/datatool/dataplot.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{dataplot}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{dataplot}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{tikz}
\RequirePackage{datatool}
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]{%
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty
index 4280f6bf182..665b0cb2f90 100644
--- a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-fp}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool-fp}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{fp}
\RequirePackage{datatool-base}
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty b/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty
index f588ec69d68..2c46893738e 100644
--- a/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-pgfmath}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool-pgfmath}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{pgfrcs,pgfkeys,pgfmath}
\ProcessOptionsX
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty
index 19c0d34e553..688f37a7312 100644
--- a/Master/texmf-dist/tex/latex/datatool/datatool.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datatool.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{datatool}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{ifthen}
\RequirePackage{xfor}
diff --git a/Master/texmf-dist/tex/latex/datatool/person.sty b/Master/texmf-dist/tex/latex/datatool/person.sty
index 95605050413..ec001c01820 100644
--- a/Master/texmf-dist/tex/latex/datatool/person.sty
+++ b/Master/texmf-dist/tex/latex/datatool/person.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{person}[2016/07/20 v2.26 (NLCT)]
+\ProvidesPackage{person}[2016/07/28 v2.27 (NLCT)]
\RequirePackage{ifthen}
\RequirePackage{datatool}
\newcounter{people}