summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-07 22:50:44 +0000
committerKarl Berry <karl@freefriends.org>2018-12-07 22:50:44 +0000
commit8ea05b291a97fc98c330f2c40922932a0c460398 (patch)
tree9be62aed6a7172fe0f52fac4297b19b5e95dfdc3
parent5d57c7c06864a08c811765622587b93af1d8cd23 (diff)
datatool (7dec18)
git-svn-id: svn://tug.org/texlive/trunk@49344 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/datatool/CHANGES56
-rw-r--r--Master/texmf-dist/doc/latex/datatool/README4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-code.pdfbin1184311 -> 1188072 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.pdfbin639231 -> 641116 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.tex87
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdfbin24923 -> 24911 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdfbin35066 -> 35054 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdfbin22860 -> 22848 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdfbin122428 -> 122418 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdfbin89557 -> 89544 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdfbin179796 -> 179887 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdfbin104427 -> 104516 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdfbin128788 -> 128777 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdfbin21869 -> 21655 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdfbin33957 -> 33945 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdfbin89724 -> 89703 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdfbin34614 -> 34602 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdfbin31751 -> 31739 bytes
-rw-r--r--Master/texmf-dist/source/latex/datatool/datatool.dtx244
-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.sty126
-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, 410 insertions, 127 deletions
diff --git a/Master/texmf-dist/doc/latex/datatool/CHANGES b/Master/texmf-dist/doc/latex/datatool/CHANGES
index 17613fc75c0..219c569cb24 100644
--- a/Master/texmf-dist/doc/latex/datatool/CHANGES
+++ b/Master/texmf-dist/doc/latex/datatool/CHANGES
@@ -1,17 +1,33 @@
-v2.30
+v2.31 (2018-12-07):
+
+ * datatool-base.sty:
+
+ - added conditional \ifDTLlistskipempty
+
+ - new commands \DTLlistelement and \DTLfetchlistelement
+
+ - made \DTLnumitemsinlist robust and now checks
+ \ifDTLlistskipempty
+
+ - \DTLformatlist now checks \ifDTLlistskipempty
+
+ - bug fix: \$ entry without value triggers
+ extra \else in \@dtl@checknumericalstart
+
+v2.30 (2018-04-16):
* datatool.sty
- bug fix: spurious spaces in \@dtl@lopoff
(used by \DTLloaddb and DTLloadrawdb)
-v2.29
+v2.29 (2017-11-12):
* datatool.sty:
- bug fix https://tex.stackexchange.com/questions/400921
-v2.28:
+v2.28 (2017-11-10):
* datatool.sty:
@@ -38,7 +54,7 @@ v2.28:
- \printterms uses \twocolumn if balance=false and columns=2
-v2.27:
+v2.27 (2016-07-28):
* datatool-base:
@@ -55,7 +71,7 @@ v2.27:
- new command \edtlinsertinto
-v2.26:
+v2.26 (2016-07-20):
* datatool-base:
@@ -71,7 +87,7 @@ v2.26:
- \FP... code replaced by \dtl... code
-v2.25:
+v2.25 (2016-01-18):
* datatool-base:
@@ -83,7 +99,7 @@ v2.25:
- Added section "Advanced Iteration".
-v2.24:
+v2.24 (2016-01-12):
* datatool-base:
@@ -96,7 +112,7 @@ v2.24:
\dtlsetdefaultUTFviiilccharcode for use with the comparison
handlers.
-v2.23:
+v2.23 (2015-07-11):
* datatool:
@@ -120,7 +136,7 @@ v2.23:
- Bug fix: replaced \@thisperson with #1 in \ifmale and
\iffemale
-v2.22:
+v2.22 (2014-06-10):
* datatool-base:
@@ -138,7 +154,7 @@ v2.22:
-v2.21:
+v2.21 (2014-03-08):
* datatool:
@@ -160,7 +176,7 @@ v2.21:
- Fixed bug in \datagidx@parse@location
-v2.20:
+v2.20 (2014-02-03):
* datatool:
@@ -172,7 +188,7 @@ v2.20:
- Fixed bug in \DTLforeach* (\@dtl@dbname undefined)
-v2.19:
+v2.19 (2014-01-17):
* datatool:
@@ -187,7 +203,7 @@ v2.19:
- defines \@idxitem if not already defined
-v2.18:
+v2.18 (2013-09-06):
* datatool:
@@ -200,7 +216,7 @@ v2.18:
Fixed error caused when article entry journal field missing
-v2.17:
+v2.17 (2013-08-29):
* datatool:
@@ -212,7 +228,7 @@ v2.17:
- fixed packaging of databib.bst
-v2.16:
+v2.16 (2013-08-16):
* datatool:
@@ -225,7 +241,7 @@ v2.16:
argument is a command that expands to empty.
-v2.15:
+v2.15 (2013-07-10):
* datagidx:
@@ -254,7 +270,7 @@ v2.15:
- fixed scoping issue with \DTLaddtoplotlegend
-v2.14:
+v2.14 (2013-06-28):
* datatool:
@@ -284,7 +300,7 @@ v2.14:
* Fixed minor typos in user manual
-v2.13:
+v2.13 (2013-01-15):
* Added new package `datagidx'
@@ -337,7 +353,7 @@ v2.13:
- added \dtlwordindexcompare
-v2.12:
+v2.12 (2012-11-30):
* datatool.sty:
@@ -350,7 +366,7 @@ v2.12:
- fixed bug in conditionals.
-v2.11:
+v2.11 (2012-09-25):
* datatool.sty:
diff --git a/Master/texmf-dist/doc/latex/datatool/README b/Master/texmf-dist/doc/latex/datatool/README
index 6ab220d637c..7e784650d6c 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.30
+LaTeX Bundle : datatool v2.31
-Last Modified : 2018-04-16
+Last Modified : 2018-12-07
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 b983b74ef2b..08f7743eb0a 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 c0c2615b5f2..8001340d5e9 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 aeefbfea21a..08f01e258ff 100644
--- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
+++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
@@ -103,11 +103,11 @@
\MakeShortVerb{"}
- \title{User Manual for datatool bundle version~2.30}
+ \title{User Manual for datatool bundle version~2.31}
\author{Nicola L.C. Talbot\\
\url{http://www.dickimaw-books.com/}}
- \date{2018-04-16}
+ \date{2018-12-07}
\maketitle
\pagenumbering{roman}
@@ -122,7 +122,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.30}
+ read \qt{Documented Code for datatool v2.31}
\item[INSTALL] Installation instructions.
@@ -148,7 +148,7 @@ your calculations or data manipulation and save the results in a
file that can be input into your document.} For large amounts of
data that need to be sorted or filtered or joined, consider storing your data
in an~SQL database and use
-\app{datatooltk}\footnote{\url{http://www.dickimaw-books.com/apps/datatooltk/}} to import the data,
+\app{datatooltk}\footnote{\url{http://www.dickimaw-books.com/software/datatooltk/}} to import the data,
using SQL syntax to filter, sort and otherwise
manipulate the values.
\end{important}
@@ -2069,7 +2069,7 @@ 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:
+a list of elements separated by commas, for example:
\begin{verbatim}
\newcommand{\mylist}{elephant,ant,zebra,duck}
\end{verbatim}
@@ -2083,16 +2083,40 @@ Formats the comma-separated list. The unstarred version scopes
the internal operation. The starred form doesn't.
The \meta{list} may either be an explicit comma-separated list or
a control sequence whose replacement
-text is a comma-separated list. For example:
+text is a comma-separated list. If the list contains empty
+elements then \cs{DTLformatlist} will either include or
+skip the empty element according to the conditional:
+\begin{definition}[\DescribeMacro{\ifDTLlistskipempty}]
+\cs{ifDTLlistskipempty}
+\end{definition}
+For example:
\begin{verbatim}
-\newcommand{\mylist}{elephant,ant,zebra,duck}%
+\newcommand{\mylist}{elephant,,ant,zebra,duck}%
+\DTLlistskipemptytrue
+\DTLformatlist{\mylist}\par
+\DTLlistskipemptyfalse
\DTLformatlist{\mylist}
\end{verbatim}
which produces:
\begin{display}
-\newcommand{\mylist}{elephant,ant,zebra,duck}%
+\newcommand{\mylist}{elephant,,ant,zebra,duck}%
+\DTLlistskipemptytrue
+\DTLformatlist{\mylist}\par
+\DTLlistskipemptyfalse
\DTLformatlist{\mylist}
\end{display}
+The default setting is
+\begin{verbatim}
+\DTLlistskipemptytrue
+\end{verbatim}
+Note that this may cause a difference when upgrading to v2.31
+as in previous versions \cs{DTLformatlist} didn't skip empty
+elements. To restore the original behaviour use:
+\begin{verbatim}
+\DTLlistskipemptyfalse
+\end{verbatim}
+before \cs{DTLformatlist}.
+
The list formatting command inserts
\begin{definition}[\DescribeMacro\DTLlistformatsep]
\cs{DTLlistformatsep}
@@ -2166,8 +2190,53 @@ expansion on \meta{element}.)
\begin{definition}[\DescribeMacro{\DTLnumitemsinlist}]
\cs{DTLnumitemsinlist}\marg{list}\marg{cmd}
\end{definition}
-Counts the number of non-empty elements in \meta{list} and stores
+Counts the number of elements in \meta{list} and stores the
result in \meta{cmd}, which must be a control sequence.
+As from v2.31, this obeys the conditional \cs{ifDTLlistskipempty}
+to determine if empty elements should be skipped. For example:
+\begin{verbatim}
+\newcommand{\mylist}{foo,,bar,baz,wibble}
+Number of non-empty elements:
+\DTLnumitemsinlist{\mylist}{\listnum}\listnum.\par
+\DTLlistskipemptyfalse
+Number of elements (including empty):
+\DTLnumitemsinlist{\mylist}{\listnum}\listnum.
+\end{verbatim}
+This produces:
+\begin{display}
+\newcommand{\mylist}{foo,,bar,baz,wibble}
+Number of non-empty elements: \DTLnumitemsinlist{\mylist}{\listnum}\listnum.\par
+\DTLlistskipemptyfalse
+Number of elements (including empty): \DTLnumitemsinlist{\mylist}{\listnum}\listnum.
+\end{display}
+
+\begin{definition}[\DescribeMacro{\DTLlistelement}]
+\cs{DTLlistelement}\marg{list}\marg{index}
+\end{definition}
+Does the \meta{index}th element of the list (starting at 1 for
+the first element) or generates a warning if the index is out
+of range. This obeys the conditional \cs{ifDTLlistskipempty}
+to determine if empty elements should be skipped.
+For example:
+\begin{verbatim}
+\newcommand{\mylist}{foo,,bar,baz,wibble}
+3rd item in list (skip empty): \DTLlistelement{\mylist}{3}.\par
+\ifDTLlistskipempty
+3rd item in list (include empty): \DTLlistelement{\mylist}{3}.
+\end{verbatim}
+This produces:
+\begin{display}
+\newcommand{\mylist}{foo,,bar,baz,wibble}
+3rd item in list (skip empty): \DTLlistelement{\mylist}{3}.\par
+\ifDTLlistskipempty
+3rd item in list (include empty): \DTLlistelement{\mylist}{3}.
+\end{display}
+
+\begin{definition}[\DescribeMacro{\DTLfetchlistelement}]
+\cs{DTLfetchlistelement}\marg{list}\marg{index}\marg{cs}
+\end{definition}
+Like \cs{DTLlistelement} but it stores the \meta{index}th
+element in the command given by \meta{cs}.
\begin{definition}[\DescribeMacro\dtlsortlist]
\cs{dtlsortlist}\marg{list cs}\marg{criteria cs}
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 669196e6ad4..5bde2cc5eb3 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 9ddc840d062..9cdf92def92 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 f8bd379e3d1..9c63274acfd 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 4fc9f9a5443..cd16bc3eac1 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 6030f223fad..38abdb70441 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 858eaf34a46..66217482114 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 44be4994a97..59129431dd0 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 f6e1660ee35..16a363c58ba 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 40bc857d604..3e9fa499211 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 ae31c92eb77..0bce7fb05c1 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 e3e31bb5152..18eb0c79b4d 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 a5b45bb8c29..9b85095fb12 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 4a7cce8b685..f22fea8cc6c 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 a95ce9f9c1f..9115c37a69d 100644
--- a/Master/texmf-dist/source/latex/datatool/datatool.dtx
+++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx
@@ -1,11 +1,9 @@
%\iffalse
% datatool.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
+% -macrocode "databib\.bst"
% -codetitle ""
% -setambles "databib\.bst=>\nopreamble\nopostamble"
-% -doc "datatool-manual.tex"
-% -macrocode "databib\.bst"
-% -comment "databib\.bst"
% -src "datatool-base.sty\Z=>datatool-base.sty"
% -src "datatool-fp.sty\Z=>datatool-fp.sty"
% -src "datatool-pgfmath.sty\Z=>datatool-pgfmath.sty"
@@ -17,9 +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"
+% -comment "databib\.bst"
% datatool
-% Created on 2018/4/16 11:49
+% Created on 2018/12/7 15:44
%\fi
%\iffalse
%<*package>
@@ -68,7 +68,7 @@ datatool.dtx
\doxitem{Counter}{counter}{counters}
\doxitem{Option}{option}{package options}
-\CheckSum{23963}
+\CheckSum{24081}
\RecordChanges
\PageIndex
@@ -81,11 +81,11 @@ datatool.dtx
%\fi
%\MakeShortVerb{"}
%
-%\title{Documented Code for datatool v2.30}
+%\title{Documented Code for datatool v2.31}
%\author{Nicola L. C. Talbot\\
%\url{http://www.dickimaw-books.com/}}
%
-%\date{2018-04-16}
+%\date{2018-12-07}
%\maketitle
%
%\pagenumbering{roman}
@@ -121,7 +121,7 @@ datatool.dtx
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-base}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool-base}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -399,7 +399,7 @@ datatool.dtx
% \end{macrocode}
%\end{macro}
%\begin{macro}{\long@push@begins}
-%\changes{2.10}{2012-07-16}{new}
+%\changes{2.10}{2012-07-18}{new}
%Adapted from \isty{amsmath}'s \cs{push@begins}
% \begin{macrocode}
\long\def\long@push@begins#1\begin#2{%
@@ -437,22 +437,114 @@ datatool.dtx
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\ifDTLlistskipempty}
+%\changes{2.31}{2018-12-07}{new}
+%If true, skip empty elements in the list-related commands below.
+% \begin{macrocode}
+\newif\ifDTLlistskipempty
+\DTLlistskipemptytrue
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTLlistelement}
+%\begin{definition}
+%\cs{DTLlistelement}\marg{list}\marg{idx}
+%\end{definition}
+%Does the \meta{idx}th element in the list. The index
+%should start from 1 for the first element.
+% \begin{macrocode}
+\newrobustcmd{\DTLlistelement}[2]{%
+% \end{macrocode}
+%The \cs{@for}-loop is scoped in case it's nested.
+% \begin{macrocode}
+ \begingroup
+ \@dtl@tmpcount=0\relax
+ \@for\@dtl@element:=#1\do{%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@element}%
+ {}%
+ {%
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@dtl@element\@endfortrue\fi
+ }%
+ \else
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@dtl@element\@endfortrue\fi
+ \fi
+ }%
+ \if@endfor \else\@dtl@listelement@outofrange{#2}\fi
+ \endgroup
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTLfetchlistelement}
+%\begin{definition}
+%\cs{DTLfetchlistelement}\marg{list}\marg{idx}\marg{cs}
+%\end{definition}
+%Fetches the \meta{idx}th element in the list and stores in \meta{cs}. The index
+%should start from 1 for the first element.
+% \begin{macrocode}
+\newrobustcmd{\DTLfetchlistelement}[3]{%
+% \end{macrocode}
+%The \cs{@for}-loop is scoped in case it's nested.
+% \begin{macrocode}
+ \begingroup
+ \@dtl@tmpcount=0\relax
+ \@for\@dtl@element:=#1\do{%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@element}%
+ {}%
+ {%
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@endfortrue\fi
+ }%
+ \else
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@endfortrue\fi
+ \fi
+ }%
+ \if@endfor \else\def\@dtl@element{\@dtl@listelement@outofrange{#2}}\fi
+ \edef\x{%
+ \endgroup
+ \noexpand\def\noexpand#3{\expandonce\@dtl@element}%
+ }\x
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@dtl@listelement@outofrange}
+%\changes{2.31}{2018-12-07}{new}
+% \begin{macrocode}
+\newcommand{\@dtl@listelement@outofrange}[1]{%
+ \PackageWarning{datatool-base}{List index `\number#1' out of range}%
+}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\DTLnumitemsinlist}
+%\begin{definition}
%\cs{DTLnumitemsinlist}\marg{list}\marg{cmd}
-%\end{macro}
+%\end{definition}
% Counts number of non-empty elements in list and stores result in control
% sequence \meta{cmd}.
+%\changes{2.31}{2018-12-07}{made robust}
% \begin{macrocode}
-\newcommand*{\DTLnumitemsinlist}[2]{%
+\newrobustcmd{\DTLnumitemsinlist}[2]{%
\@dtl@tmpcount=0\relax
\@for\@dtl@element:=#1\do{%
- \ifdefempty{\@dtl@element}%
- {}%
- {\advance\@dtl@tmpcount by 1\relax}%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@element}%
+ {}%
+ {\advance\@dtl@tmpcount by 1\relax}%
+ \else
+ \advance\@dtl@tmpcount by 1\relax
+ \fi
}%
\edef#2{\number\@dtl@tmpcount}%
}
% \end{macrocode}
+%\end{macro}
%
%\begin{macro}{\dtl@choplast}
%\begin{definition}
@@ -634,7 +726,7 @@ datatool.dtx
%\end{macro}
%
%\begin{macro}{\dtlsortlist}
-%\changes{2.27}{2016/07/28}{new}
+%\changes{2.27}{2016-07-28}{new}
%\begin{definition}
% \cs{dtlsortlist}\marg{list}\marg{criteria cmd}
%\end{definition}
@@ -653,7 +745,7 @@ datatool.dtx
%\end{macro}
%
%\begin{macro}{\dtlinsertinto}
-%\changes{2.27}{2016/07/28}{new}
+%\changes{2.27}{2016-07-28}{new}
%\begin{definition}
% \cs{dtlinsertinto}\marg{element}\marg{sorted-list}\marg{criteria cmd}
%\end{definition}
@@ -740,7 +832,7 @@ datatool.dtx
%\end{macro}
%
%\begin{macro}{\edtlinsertinto}
-%\changes{2.27}{2016/07/28}{new}
+%\changes{2.27}{2016-07-28}{new}
%\begin{definition}
% \cs{edtlinsertinto}\marg{element}\marg{sorted-list}\marg{criteria cmd}
%\end{definition}
@@ -851,7 +943,13 @@ datatool.dtx
\def\@dtl@formatlist@prelastitem{}%
\def\@dtl@formatlist@prelastitemsep{}%
\@for\@dtl@formatlist@item:=#1\do{%
- \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@formatlist@item}%
+ {}%
+ {\expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}}%
+ \else
+ \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}%
+ \fi
}%
\@dtl@formatlist@prelastitem\@dtl@formatlist@lastitem
}
@@ -961,7 +1059,7 @@ datatool.dtx
% number is stored in \meta{cmd}. This command has to be redefined
% whenever the decimal and number group characters are changed
% as they form part of the command definitions.
-%\changes{2.12}{2012-10-06}{switched to \cs{ifdefempty}}
+%\changes{2.12}{2012-11-30}{switched to \cs{ifdefempty}}
% \begin{macrocode}
\edef\@dtl@construct@getintfrac#1{%
\noexpand\def\noexpand\@dtl@getintfrac##1#1##2\noexpand\relax{%
@@ -2653,28 +2751,40 @@ datatool.dtx
}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\@dtl@protect}
+%\changes{2.31}{2018-12-07}{new}
+% \begin{macrocode}
+\newcommand*{\@dtl@protect}{\protect}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\@dtl@minus}
+%\changes{2.31}{2018-12-07}{new}
+% \begin{macrocode}
+\newcommand*{\@dtl@minus}{-}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\@dtl@plus}
+%\changes{2.31}{2018-12-07}{new}
+% \begin{macrocode}
+\newcommand*{\@dtl@plus}{+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\@dtl@dollar}
+%\changes{2.31}{2018-12-07}{new}
+% \begin{macrocode}
+\newcommand*{\@dtl@dollar}{\$}
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\@dtl@checknumericalstart}
% Check first character for checknumerical process to see if
% it's a plus or minus sign.
% \begin{macrocode}
\def\@dtl@checknumericalstart#1#2\@nil\@nil{%
-\ifx#1\protect\relax
- \@dtl@checknumericalstart#2\@nil\@nil\relax
-\else
- \ifx-#1\relax
- \def\@dtl@tmp{#2}%
- \ifdefempty{\@dtl@tmp}%
- {%
- \@dtl@datatype=0\relax
- }%
- {%
- \ifnum\@dtl@datatype=0\relax
- \@dtl@datatype=1\relax
- \fi
- \@dtl@checknumericalstart#2\@nil\@nil\relax
- }%
+ \def\@dtl@tmp{#1}%
+ \ifx\@dtl@tmp\@dtl@protect
+ \@dtl@checknumericalstart#2\@nil\@nil\relax
\else
- \ifx+#1\relax
+ \ifx\@dtl@tmp\@dtl@minus
\def\@dtl@tmp{#2}%
\ifdefempty{\@dtl@tmp}%
{%
@@ -2687,11 +2797,8 @@ datatool.dtx
\@dtl@checknumericalstart#2\@nil\@nil\relax
}%
\else
- \def\@dtl@tmp{#1}%
- \ifx#1\$\relax
- \@dtl@datatype=3\relax
- \@dtl@checknumericalstart#2\@nil\@nil\relax
- \else
+ \ifx\@dtl@tmp\@dtl@plus
+ \def\@dtl@tmp{#2}%
\ifdefempty{\@dtl@tmp}%
{%
\@dtl@datatype=0\relax
@@ -2700,12 +2807,35 @@ datatool.dtx
\ifnum\@dtl@datatype=0\relax
\@dtl@datatype=1\relax
\fi
- \@dtl@checknumericalloop#1#2\@nil\@nil\relax
+ \@dtl@checknumericalstart#2\@nil\@nil\relax
}%
+ \else
+ \def\@dtl@tmp{#1}%
+ \ifx\@dtl@tmp\@dtl@dollar
+ \def\@dtl@tmp{#2}%
+ \ifdefempty{\@dtl@tmp}%
+ {%
+ \@dtl@datatype=0\relax
+ }%
+ {%
+ \@dtl@datatype=3\relax
+ \@dtl@checknumericalstart#2\@nil\@nil\relax
+ }%
+ \else
+ \ifdefempty{\@dtl@tmp}%
+ {%
+ \@dtl@datatype=0\relax
+ }%
+ {%
+ \ifnum\@dtl@datatype=0\relax
+ \@dtl@datatype=1\relax
+ \fi
+ \@dtl@checknumericalloop#1#2\@nil\@nil\relax
+ }%
+ \fi
\fi
\fi
\fi
-\fi
}
% \end{macrocode}
%\end{macro}
@@ -6008,7 +6138,7 @@ datatool.dtx
% Definitions of fixed-point commands that use the \sty{fp} package.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-fp}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool-fp}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -6297,7 +6427,7 @@ datatool.dtx
% Definitions of fixed-point commands that use the \sty{pgfmath} package.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-pgfmath}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool-pgfmath}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -6325,7 +6455,7 @@ datatool.dtx
% character and no number group separator. The \verb|\number0| part
% allows an empty argument to be treated as zero. (\cs{number}
% required to prevent a zero prefix indicating an octal number.)
-%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion}
+%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion}
%\changes{2.26}{2016-07-20}{added \cs{number}}
% \begin{macrocode}
\newcommand*{\dtlifnumeq}[4]{%
@@ -6352,7 +6482,7 @@ datatool.dtx
% Does \meta{true part} if \meta{num1} \textless \meta{num2}, otherwise does
% \meta{false part}. The numbers must use a full stop as the decimal
% character and no number group separator.
-%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion}
+%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion}
%\changes{2.26}{2016-07-20}{added \cs{number}}
% \begin{macrocode}
\newcommand*{\dtlifnumlt}[4]{%
@@ -6373,7 +6503,7 @@ datatool.dtx
% Does \meta{true part} if \meta{num1} \textgreater \meta{num2}, otherwise does
% \meta{false part}. The numbers must use a full stop as the decimal
% character and no number group separator.
-%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion}
+%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion}
%\changes{2.26}{2016-07-20}{added \cs{number}}
% \begin{macrocode}
\newcommand*{\dtlifnumgt}[4]{%
@@ -6392,7 +6522,7 @@ datatool.dtx
%\end{definition}
% Determines if \meta{min} $<$ \meta{num} $<$ \meta{max} where
% all numerical arguments are in standard fixed point notation.
-%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion}
+%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion}
%\changes{2.26}{2016-07-20}{added \cs{number}}
% \begin{macrocode}
\newcommand*{\dtlifnumopenbetween}[5]{%
@@ -6412,7 +6542,7 @@ datatool.dtx
%\end{definition}
% Determines if \meta{min} $\leq$ \meta{num} $\leq$ \meta{max} where
% all numerical arguments are in standard fixed point notation.
-%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion}
+%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion}
%\changes{2.26}{2016-07-20}{added \cs{number}}
% \begin{macrocode}
\newcommand*{\dtlifnumclosedbetween}[5]{%
@@ -6638,7 +6768,7 @@ datatool.dtx
%\section{Package Declaration}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Load required packages:
% \begin{macrocode}
@@ -13891,7 +14021,7 @@ datatool.dtx
% Check if the line is empty.
%\changes{2.0}{2009 February 27}{changed \cs{ifthenelse} to
%\cs{ifx} to improve efficiency}
-%\changes{2.10}{2012-07-16}{changed \cs{ifx} to \cs{ifdefempty}}
+%\changes{2.10}{2012-07-18}{changed \cs{ifx} to \cs{ifdefempty}}
% \begin{macrocode}
\ifdefempty{\@dtl@line}%
{%
@@ -14233,7 +14363,7 @@ datatool.dtx
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datagidx}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datagidx}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -20283,7 +20413,7 @@ datatool.dtx
%\section{Package Declaration}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databib}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{databib}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Load required packages:
% \begin{macrocode}
@@ -23206,7 +23336,7 @@ already exists}{}}}}
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databar}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{databar}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Require \sty{xkeyval} package
% \begin{macrocode}
@@ -24513,7 +24643,7 @@ already exists}{}}}}
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datapie}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datapie}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Require \sty{xkeyval} package
% \begin{macrocode}
@@ -25315,7 +25445,7 @@ already exists}{}}}}
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{dataplot}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{dataplot}[2018/12/07 v2.31 (NLCT)]
% \end{macrocode}
% Required packages
% \begin{macrocode}
@@ -26937,7 +27067,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
% Package identification:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{person}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{person}[2018/12/07 v2.31 (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 2420ca733c1..512f5a07a63 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.2 2018/4/16 11:49
+% datatool.ins generated using makedtx version 1.2 2018/12/7 15:44
\input docstrip
\preamble
diff --git a/Master/texmf-dist/tex/latex/datatool/databar.sty b/Master/texmf-dist/tex/latex/datatool/databar.sty
index c4fc87c5885..b00bc9c0d8f 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{databar}[2018/12/07 v2.31 (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 7566095f896..e6e60cc6c98 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{databib}[2018/12/07 v2.31 (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 26788602407..7485711aca1 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datagidx}[2018/12/07 v2.31 (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 890ebc158b8..2ff28193efd 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datapie}[2018/12/07 v2.31 (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 e5c00a27a6b..d5a0239fb4a 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{dataplot}[2018/12/07 v2.31 (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 3ac36bf6f15..34109c37115 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool-base}[2018/12/07 v2.31 (NLCT)]
\RequirePackage{etoolbox}
\RequirePackage{amsmath}
\RequirePackage{xkeyval}
@@ -180,12 +180,62 @@
#3%
\fi
}
-\newcommand*{\DTLnumitemsinlist}[2]{%
+\newif\ifDTLlistskipempty
+\DTLlistskipemptytrue
+\newrobustcmd{\DTLlistelement}[2]{%
+ \begingroup
+ \@dtl@tmpcount=0\relax
+ \@for\@dtl@element:=#1\do{%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@element}%
+ {}%
+ {%
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@dtl@element\@endfortrue\fi
+ }%
+ \else
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@dtl@element\@endfortrue\fi
+ \fi
+ }%
+ \if@endfor \else\@dtl@listelement@outofrange{#2}\fi
+ \endgroup
+}
+\newrobustcmd{\DTLfetchlistelement}[3]{%
+ \begingroup
+ \@dtl@tmpcount=0\relax
+ \@for\@dtl@element:=#1\do{%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@element}%
+ {}%
+ {%
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@endfortrue\fi
+ }%
+ \else
+ \advance\@dtl@tmpcount by 1\relax%
+ \ifnum\@dtl@tmpcount=#2 \@endfortrue\fi
+ \fi
+ }%
+ \if@endfor \else\def\@dtl@element{\@dtl@listelement@outofrange{#2}}\fi
+ \edef\x{%
+ \endgroup
+ \noexpand\def\noexpand#3{\expandonce\@dtl@element}%
+ }\x
+}
+\newcommand{\@dtl@listelement@outofrange}[1]{%
+ \PackageWarning{datatool-base}{List index `\number#1' out of range}%
+}
+\newrobustcmd{\DTLnumitemsinlist}[2]{%
\@dtl@tmpcount=0\relax
\@for\@dtl@element:=#1\do{%
- \ifdefempty{\@dtl@element}%
- {}%
- {\advance\@dtl@tmpcount by 1\relax}%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@element}%
+ {}%
+ {\advance\@dtl@tmpcount by 1\relax}%
+ \else
+ \advance\@dtl@tmpcount by 1\relax
+ \fi
}%
\edef#2{\number\@dtl@tmpcount}%
}
@@ -393,7 +443,13 @@
\def\@dtl@formatlist@prelastitem{}%
\def\@dtl@formatlist@prelastitemsep{}%
\@for\@dtl@formatlist@item:=#1\do{%
- \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}%
+ \ifDTLlistskipempty
+ \ifdefempty{\@dtl@formatlist@item}%
+ {}%
+ {\expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}}%
+ \else
+ \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}%
+ \fi
}%
\@dtl@formatlist@prelastitem\@dtl@formatlist@lastitem
}
@@ -1448,24 +1504,16 @@
\fi
\fi
}
+\newcommand*{\@dtl@protect}{\protect}
+\newcommand*{\@dtl@minus}{-}
+\newcommand*{\@dtl@plus}{+}
+\newcommand*{\@dtl@dollar}{\$}
\def\@dtl@checknumericalstart#1#2\@nil\@nil{%
-\ifx#1\protect\relax
- \@dtl@checknumericalstart#2\@nil\@nil\relax
-\else
- \ifx-#1\relax
- \def\@dtl@tmp{#2}%
- \ifdefempty{\@dtl@tmp}%
- {%
- \@dtl@datatype=0\relax
- }%
- {%
- \ifnum\@dtl@datatype=0\relax
- \@dtl@datatype=1\relax
- \fi
- \@dtl@checknumericalstart#2\@nil\@nil\relax
- }%
+ \def\@dtl@tmp{#1}%
+ \ifx\@dtl@tmp\@dtl@protect
+ \@dtl@checknumericalstart#2\@nil\@nil\relax
\else
- \ifx+#1\relax
+ \ifx\@dtl@tmp\@dtl@minus
\def\@dtl@tmp{#2}%
\ifdefempty{\@dtl@tmp}%
{%
@@ -1478,11 +1526,8 @@
\@dtl@checknumericalstart#2\@nil\@nil\relax
}%
\else
- \def\@dtl@tmp{#1}%
- \ifx#1\$\relax
- \@dtl@datatype=3\relax
- \@dtl@checknumericalstart#2\@nil\@nil\relax
- \else
+ \ifx\@dtl@tmp\@dtl@plus
+ \def\@dtl@tmp{#2}%
\ifdefempty{\@dtl@tmp}%
{%
\@dtl@datatype=0\relax
@@ -1491,12 +1536,35 @@
\ifnum\@dtl@datatype=0\relax
\@dtl@datatype=1\relax
\fi
- \@dtl@checknumericalloop#1#2\@nil\@nil\relax
+ \@dtl@checknumericalstart#2\@nil\@nil\relax
}%
+ \else
+ \def\@dtl@tmp{#1}%
+ \ifx\@dtl@tmp\@dtl@dollar
+ \def\@dtl@tmp{#2}%
+ \ifdefempty{\@dtl@tmp}%
+ {%
+ \@dtl@datatype=0\relax
+ }%
+ {%
+ \@dtl@datatype=3\relax
+ \@dtl@checknumericalstart#2\@nil\@nil\relax
+ }%
+ \else
+ \ifdefempty{\@dtl@tmp}%
+ {%
+ \@dtl@datatype=0\relax
+ }%
+ {%
+ \ifnum\@dtl@datatype=0\relax
+ \@dtl@datatype=1\relax
+ \fi
+ \@dtl@checknumericalloop#1#2\@nil\@nil\relax
+ }%
+ \fi
\fi
\fi
\fi
-\fi
}
\newif\if@dtl@numgrpsep
\newcommand*{\@dtl@ifDigitOrDecimalSep}[3]{%
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty
index 83bf3e9db8f..35e494caab0 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool-fp}[2018/12/07 v2.31 (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 8c73becaebd..903eee29c8f 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool-pgfmath}[2018/12/07 v2.31 (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 b5ee1db93af..b90881d77b1 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{datatool}[2018/12/07 v2.31 (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 b21bd8c6c47..3c850394864 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}[2018/04/16 v2.30 (NLCT)]
+\ProvidesPackage{person}[2018/12/07 v2.31 (NLCT)]
\RequirePackage{ifthen}
\RequirePackage{datatool}
\newcounter{people}