texlive[45742] Master/texmf-dist: datatool (10nov17)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 10 22:46:24 CET 2017


Revision: 45742
          http://tug.org/svn/texlive?view=revision&revision=45742
Author:   karl
Date:     2017-11-10 22:46:23 +0100 (Fri, 10 Nov 2017)
Log Message:
-----------
datatool (10nov17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/datatool/CHANGES
    trunk/Master/texmf-dist/doc/latex/datatool/README
    trunk/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.tex
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf
    trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf
    trunk/Master/texmf-dist/source/latex/datatool/datatool.dtx
    trunk/Master/texmf-dist/source/latex/datatool/datatool.ins
    trunk/Master/texmf-dist/tex/latex/datatool/databar.sty
    trunk/Master/texmf-dist/tex/latex/datatool/databib.sty
    trunk/Master/texmf-dist/tex/latex/datatool/datagidx.sty
    trunk/Master/texmf-dist/tex/latex/datatool/datapie.sty
    trunk/Master/texmf-dist/tex/latex/datatool/dataplot.sty
    trunk/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
    trunk/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty
    trunk/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty
    trunk/Master/texmf-dist/tex/latex/datatool/datatool.sty
    trunk/Master/texmf-dist/tex/latex/datatool/person.sty

Modified: trunk/Master/texmf-dist/doc/latex/datatool/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/latex/datatool/CHANGES	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/doc/latex/datatool/CHANGES	2017-11-10 21:46:23 UTC (rev 45742)
@@ -1,3 +1,30 @@
+v2.28:
+
+  * datatool.sty:
+
+   - added \xdtlgetrowindex
+
+   - \DTLloadrawdb: changed \xdef to \protected at xdef
+
+   - some bug fixes
+
+  * datatool-base.sty:
+
+   - added \DTLformatlist and accompanying commands
+     \DTLlistformatsep, \DTLlistformatoxford, \DTLlistformatlastsep,
+     \DTLandname and \DTLlistformatitem.
+
+  * datagidx.sty:
+
+   - changed initialisation of label in \datagidx at setfieldvalues
+
+   - \datagidxstripaccents now changes \add at accent@, 
+     \@text at composite@x and \@tabacckludge
+
+   - added \datagidxextendedtoascii
+
+   - \printterms uses \twocolumn if balance=false and columns=2
+
 v2.27:
 
   * datatool-base:

Modified: trunk/Master/texmf-dist/doc/latex/datatool/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/datatool/README	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/doc/latex/datatool/README	2017-11-10 21:46:23 UTC (rev 45742)
@@ -1,6 +1,6 @@
-LaTeX Bundle : datatool v2.27 
+LaTeX Bundle : datatool v2.28 
 
-Last Modified : 2016-07-28
+Last Modified : 2017-11-10
 
 Author        : Nicola Talbot
 

Modified: trunk/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/datatool/datatool-user.tex	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/doc/latex/datatool/datatool-user.tex	2017-11-10 21:46:23 UTC (rev 45742)
@@ -6,6 +6,7 @@
 \usepackage[utf8]{inputenc}
 \usepackage{ifthen}
 \usepackage[verbose=false]{datatool}
+\usepackage{mfirstuc}[2017/11/10]
 \usepackage{datapie,databar,databib,person,datagidx}
 \usepackage{textcomp}
 \usepackage{graphicx}
@@ -102,11 +103,11 @@
 
 \MakeShortVerb{"}
 
- \title{User Manual for datatool bundle version~2.27}
+ \title{User Manual for datatool bundle version~2.28}
  \author{Nicola L.C. Talbot\\
 \url{http://www.dickimaw-books.com/}}
 
- \date{2016-07-28}
+ \date{2017-11-10}
  \maketitle
 
 \pagenumbering{roman}
@@ -121,7 +122,7 @@
   \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.27}
+  read \qt{Documented Code for datatool v2.28}
 
   \item[INSTALL] Installation instructions.
 
@@ -211,6 +212,12 @@
 
 \end{enumerate}
 
+\begin{important}
+Both \sty{fp} and \sty{pgfmath} have some limitations. These limitations
+will therefore also be present in the various packages provided
+with \sty{datatool}, according to the underlying package used.
+\end{important}
+
 \cleardoublepage
 \pdfbookmark[0]{Contents}{contents}
 \tableofcontents
@@ -244,6 +251,12 @@
 \end{itemize}
 Package Options:
   \begin{description}
+   \item[\pkgopt{utf8}] Boolean key. May be used to switch off the UTF-8
+   support described on \pageref{utf8support} in \sectionref{sec:sort}.
+   If you both load \sty{inputenc} with UTF-8
+   support and you use accent commands like \cs{'} or \cs{c} then make
+   sure you have at least version 2.05 of \sty{mfirstuc}
+   if you want to use commands like \ics{makefirstuc}.
    \item[\pkgopt{verbose}] Boolean key. If
     \pkgoptval{true}{verbose}, prints informational messages in
      transcript.
@@ -2063,6 +2076,99 @@
 This isn't the same as comma-separated files, which is dealt
 with in \sectionref{sec:databases}.
 
+\begin{definition}[\DescribeMacro{\DTLformatlist}]
+\cs{DTLformatlist}\marg{list}
+\end{definition}
+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:
+\begin{verbatim}
+\newcommand{\mylist}{elephant,ant,zebra,duck}%
+\DTLformatlist{\mylist}
+\end{verbatim}
+which produces:
+\begin{display}
+\newcommand{\mylist}{elephant,ant,zebra,duck}%
+\DTLformatlist{\mylist}
+\end{display}
+The list formatting command inserts
+\begin{definition}[\DescribeMacro\DTLlistformatsep]
+\cs{DTLlistformatsep}
+\end{definition}
+between each item, except for the last pair which uses:
+\begin{definition}[\DescribeMacro\DTLlistformatlastsep]
+\cs{DTLlistformatlastsep}
+\end{definition}
+if there are only two items in the list or
+\begin{definition}[\DescribeMacro\DTLlistformatoxford]
+\cs{DTLlistformatoxford}\cs{DTLlistformatlastsep}
+\end{definition}
+if there are three or more items in the list.
+\cs{DTLlistformatlastsep} uses
+\begin{definition}[\DescribeMacro\DTLandname]
+\cs{DTLandname}
+\end{definition}
+Each item in the list is formatted according to
+\begin{definition}[\DescribeMacro\DTLlistformatitem]
+\cs{DTLlistformatitem}\marg{item}
+\end{definition}
+
+The default definitions are:
+\begin{itemize}
+\item \cs{DTLlistformatitem}\marg{item}: just does \meta{item};
+\item \cs{DTLlistformatsep}: \verb*|, | (comma followed by a space);
+\item \cs{DTLandname}: if \ics{andname} is
+defined this is defined as \cs{andname}
+otherwise it's defined as \verb|\&|;
+\item \cs{DTLlistformatlastsep}: does \verb*| \DTLandname\space|;
+\item \cs{DTLlistformatoxford}: does nothing (so if you want an
+Oxford comma you need to redefine this).
+\end{itemize}
+For example
+\begin{verbatim}
+\renewcommand{\DTLlistformatitem}[1]{\emph{#1}}%
+\renewcommand{\DTLlistformatoxford}{,}%
+\renewcommand{\DTLandname}{and}%
+One: \DTLformatlist{elephant}.
+
+Two: \DTLformatlist{elephant,ant}.
+
+Three: \DTLformatlist{elephant,ant,zebra}.
+
+Four: \DTLformatlist{elephant,ant,zebra,duck}.
+\end{verbatim}
+produces:
+\begin{display}
+\renewcommand{\DTLlistformatitem}[1]{\emph{#1}}%
+\renewcommand{\DTLlistformatoxford}{,}%
+\renewcommand{\DTLandname}{and}%
+One: \DTLformatlist{elephant}.
+
+Two: \DTLformatlist{elephant,ant}.
+
+Three: \DTLformatlist{elephant,ant,zebra}.
+
+Four: \DTLformatlist{elephant,ant,zebra,duck}.
+\end{display}
+
+You can test if an element is contained in a comma-separated list
+using:
+\begin{definition}[\DescribeMacro{\DTLifinlist}]
+\cs{DTLifinlist}\marg{element}\marg{list}\marg{true part}\marg{false part}
+\end{definition}
+If \meta{element} is contained in the comma-separated list given
+by \meta{list}, then this does \meta{true part} otherwise it does false
+part. (Does a one level expansion on \meta{list}, but no
+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
+result in \meta{cmd}, which must be a control sequence.
+
 \begin{definition}[\DescribeMacro\dtlsortlist]
 \cs{dtlsortlist}\marg{list cs}\marg{criteria cs}
 \end{definition}
@@ -2075,6 +2181,12 @@
 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.
+\begin{important}
+It's inefficient to use \TeX\ to sort and comparisons are only
+made according to the character codes and so are inappropriate
+for extended Latin or non-Latin alphabets. It's better to use 
+an external tool where possible.
+\end{important}
 
 The \styfmt{datatool-base} package provides some predefined
 criteria commands:
@@ -2196,6 +2308,18 @@
 import data from a~SQL database, a~CSV file or a~\sty{probsoln}
 dataset.
 
+Each database has the data stored internally in a token register and
+the header information is stored in an internal control sequence.
+In general you don't need to worry about the way it's stored, except
+that row indexes start from 1 (the first row of data) and column
+indexes also start from 1. Columns may be referenced by a label
+but rows can only be referenced by the row index. Once the internal
+commands and registers have been set, \styfmt{datatool} doesn't keep
+a record of how or where the information came from (such as a CSV
+file or through a file created by \app{datatooltk}). Changes to the
+data only modify the internal commands and are lost at the end of
+the \LaTeX\ run unless you save the data.
+
 \section{Creating a New Database}
 \label{sec:newdb}
 
@@ -2364,6 +2488,8 @@
 \app{datatooltk} and the input it using \ics{input} or \ics{DTLloaddbtex}. See the 
 \app{datatooltk} documentation for further details.
 \end{important}
+Remember that row numbers in \sty{datatool} refer to the row index
+of the internal data not to line numbers in the CSV file.
 
 Instead of using the commands described in \autoref{sec:newdb}
 to create a new database, you can load a database from an
@@ -2537,7 +2663,7 @@
 \begin{definition}[\DescribeMacro{\DTLloadrawdb}]%
 \cs{DTLloadrawdb}\oarg{options}\marg{db name}\marg{filename}
 \end{definition}
-This is the same as \ics{DTLloaddb} except that it maps nine of
+This is similar to \ics{DTLloaddb} except that it maps nine of
 the ten special characters onto commands which produce that
 symbol. The only character that retains its active state is the
 backslash character, so you will still need to check the file
@@ -2561,6 +2687,22 @@
 database should be created with \ics{DTLnewdbonloadtrue} and
 \ics{DTLnewdbonloadfalse}.
 
+Note that \cs{DTLloadrawdb} is not recommended for CSV files that
+contain commands. Any active characters occurring within the
+file must be mapped. The mapping is done through
+expansion. Version 2.28 now uses \cs{xdef} rather than
+\cs{protected at xdef}, but \cs{DTLloadrawdb} isn't intended for files
+containing \LaTeX\ code, but rather for files generated by a
+non-\TeX\ aware method that doesn't guard against \LaTeX\ special
+characters. 
+
+If you have UTF-8 data, it's best to use an engine that natively
+supports Unicode. Remember that there's no point using
+\cs{DTLloadrawdb} (instead of \cs{DTLloaddb}) if your file doesn't
+contain any special characters that require mapping. It's less
+efficient to load if each row has to be converted, particularly for
+large files.
+
 \begin{table}[htbp]
 \caption[Special character mappings used by 
 \cs{DTLloadrawdb}]{Special character mappings used by 
@@ -4193,7 +4335,9 @@
 \end{verbatim}
 will delete the second row in the database labelled ``scores''.
 There is also a starred version that doesn't check for the 
-existence of the database.
+existence of the database. Remember that the row index refers to the
+internal data not to a reference in the external source if the data
+has been input.
 
 The following commands may be used in the body of the
 \ics{DTLforeach} loop,\footnote{Only the unstarred version of
@@ -4625,6 +4769,12 @@
 \section{Sorting a Database}
 \label{sec:sort}
 
+The sort methods described here use \TeX\ to sort, which is very
+inefficient. The comparison handlers use a character code comparison
+rather than locale-sensitive alphabetic ordering. It's more
+efficient to use \app{datatooltk} to import and sort at the same
+time.
+
 \begin{definition}[\DescribeMacro{\dtlsort}]%
 \cs{dtlsort}\oarg{replacement key list}\marg{sort criteria}\marg{db
 name}\marg{handler}
@@ -4752,6 +4902,7 @@
 consider uploading your handler as a separate package to CTAN if you
 think it will be of general use.)
 
+\label{utf8support}%
 As from version 2.24, the predefined handlers now have limited support for UTF-8
 characters. \emph{This is still experimental.} The support will
 automatically be switched on if the \sty{inputenc} package is loaded
@@ -4769,6 +4920,8 @@
 \usepackage[utf8]{datatool-base}
 \usepackage[utf8]{inputenc}
 \end{verbatim}
+(As from version 2.28, you can now also pass the \pkgopt{utf8}
+option to \sty{datatool} and \sty{datagidx}.)
 You can also enable this option after \sty{datatool-base} has been loaded
 using
 \begin{definition}[\DescribeMacro\dtlenableUTFviii]
@@ -5494,20 +5647,6 @@
 \end{verbatim}
 will swap the third and fifth rows.
 
-\begin{definition}[\DescribeMacro{\DTLifinlist}]
-\cs{DTLifinlist}\marg{element}\marg{list}\marg{true part}\marg{false part}
-\end{definition}
-If \meta{element} is contained in the comma-separated list given
-by \meta{list}, then do \meta{true part} otherwise do false
-part. (Does a one level expansion on \meta{list}, but no
-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
-result in \meta{cmd}, which must be a control sequence.
-
 \begin{example}{Two Database Rows Per Tabular Row
 (Column-Wise)}{ex:twoblocks}
 This example adapts \autoref{ex:2rows} so that the list is ordered
@@ -5578,7 +5717,9 @@
 
 If you want to select from or edit a particular row in a database without having
 to iterate through the database using \cs{DTLforeach}, you can use
-the commands described in this section.
+the commands described in this section. Remember that the row index
+is a reference to the internal data and is unrelated to references
+in the original source (such as line numbers in a CSV file).
 
 \begin{definition}[\DescribeMacro{\DTLgetrowindex}]
 \cs{DTLgetrowindex}\marg{row cs}\marg{db name}\marg{col
@@ -5604,6 +5745,16 @@
 \fi
 \end{verbatim}
 
+If you want \meta{value} to be fully expanded before testing
+you can use
+\begin{definition}[\DescribeMacro{\xdtlgetrowindex}]
+\cs{xdtlgetrowindex}\marg{row cs}\marg{db name}\marg{col
+idx}\marg{value}
+\end{definition}
+(The \sty{etoolbox} package provides \cs{expandonce} if you
+only want one level of expansion. See the \sty{etoolbox} manual for
+further details.)
+
 \begin{definition}[\DescribeMacro{\dtlgetrow}]
 \cs{dtlgetrow}\marg{db name}\marg{row idx}
 \end{definition}
@@ -6356,7 +6507,8 @@
 is only applied if \csopt{printterms}{columns} is greater than~1.
 If \textsf{true}, the columns are balanced. If \textsf{false}, the
 columns aren't balanced. If no value is specified, \textsf{true} is
-assumed.
+assumed. If \verb|balance=false| and \verb|columns=2| 
+\ics{twocolumn} is used instead of \env{multicols*}.
 
 \item[\csopt{newgidx}{heading}] The heading at the start of the
 index/glossary.
@@ -7617,6 +7769,12 @@
 
 The following package options are available for \styfmt{datagidx}:
 \begin{description}
+\item[\pkgopt{utf8}] A boolean option (same as for
+\sty{datatool-base}). If you both load \sty{inputenc} with UTF-8
+support and you use accent commands like \cs{'} or \cs{c} then make
+sure you have at least version 2.05 of \sty{mfirstuc} if you want to
+use commands like \cs{Gls}.
+
 \item[\pkgopt{optimize}] Sets the optimization. (See
 \autoref{sec:optimize}.)
 

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-autokeys.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.tex	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.tex	2017-11-10 21:46:23 UTC (rev 45742)
@@ -14,7 +14,7 @@
 
 % Make a database labelled 'index' with the given title
 
-\newgidx[heading={\title}]{index}{Sample Dictionary Created Using datagidx}
+\newgidx{index}{Sample Dictionary Created Using datagidx}
 
 % Define some terms for the dictionary
 
@@ -415,21 +415,16 @@
   \par
 }
 
-% Title information
-\author{}
-\date{}
-
 \begin{document}
-% don't number the chapters
-\setcounter{secnumdepth}{-1}
 
 \printterms
 [
    database=index,
-   postheading={\maketitle This is an example document illustrating
+   postheading={This is an example document illustrating
    the use of the datagidx package. The examples here are taken from
-   the Compact Oxford English Dictionary.
+   the Compact Oxford English Dictionary.\medskip
    },
+   balance=false,
    columns=2,
    postdesc=dot,%
    childsort=false,% don't sort the child lists

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-europecv-bib.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-sort.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/datatool/datatool.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/datatool/datatool.dtx	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/source/latex/datatool/datatool.dtx	2017-11-10 21:46:23 UTC (rev 45742)
@@ -1,9 +1,11 @@
 %\iffalse
-% datatool.dtx generated using makedtx version 1.1 (c) Nicola Talbot
+% datatool.dtx generated using makedtx version 1.2 (c) Nicola Talbot
 % Command line args:
+%   -setambles "databib\.bst=>\nopreamble\nopostamble"
+%   -comment "databib\.bst"
+%   -codetitle ""
 %   -macrocode "databib\.bst"
-%   -comment "databib\.bst"
-%   -setambles "databib\.bst=>\nopreamble\nopostamble"
+%   -author "Nicola Talbot"
 %   -src "datatool-base.sty\Z=>datatool-base.sty"
 %   -src "datatool-fp.sty\Z=>datatool-fp.sty"
 %   -src "datatool-pgfmath.sty\Z=>datatool-pgfmath.sty"
@@ -16,10 +18,8 @@
 %   -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/28 15:09
+% Created on 2017/11/10 16:07
 %\fi
 %\iffalse
 %<*package>
@@ -42,7 +42,7 @@
 %\fi
 % \iffalse
 % Doc-Source file to use with LaTeX2e
-% Copyright (C) 2016 Nicola Talbot, all rights reserved.
+% Copyright (C) 2017 Nicola Talbot, all rights reserved.
 % \fi
 % \iffalse
 %<*driver>
@@ -68,7 +68,7 @@
 \doxitem{Counter}{counter}{counters}
 \doxitem{Option}{option}{package options}
 
-\CheckSum{23739}
+\CheckSum{23978}
 
 \RecordChanges
 \PageIndex
@@ -81,11 +81,11 @@
 %\fi
 %\MakeShortVerb{"}
 %
-%\title{Documented Code for datatool v2.27}
+%\title{Documented Code for datatool v2.28}
 %\author{Nicola L. C. Talbot\\
 %\url{http://www.dickimaw-books.com/}}
 %
-%\date{2016-07-28}
+%\date{2017-11-10}
 %\maketitle
 %
 %\pagenumbering{roman}
@@ -121,7 +121,7 @@
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-base}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-base}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Required packages:
 %    \begin{macrocode}
@@ -767,34 +767,135 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%This next command is based on the list iteration exercise
+%given at
+%\url{http://www.dickimaw-books.com/latex/admin/html/foreachtips.shtml#oxfordcomma}
+%It's designed to format a comma-separated list using
+%\cs{DTLlistformatsep}
+%between each item except for the last. The separator for the
+%last pair is \cs{DTLlistformatlastsep} if the list only contains two
+%items or \cs{DTLlistformatoxford}\cs{DTLlistformatlastsep} if the list contains three or
+%more items. Each item is formatted according to
+%\cs{DTLlistformatitem}.
+%\begin{macro}{\DTLlistformatsep}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\DTLlistformatsep}{, }
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\DTLlistformatoxford}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\DTLlistformatoxford}{}
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\DTLandname}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\ifdef\andname
+{\newcommand*{\DTLandname}{\andname}}
+{\newcommand*{\DTLandname}{\&}}
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\DTLlistformatlastsep}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\DTLlistformatlastsep}{ \DTLandname\space}
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\DTLlistformatitem}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\DTLlistformatitem}[1]{#1}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@dtl at formatlist@handler}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\@dtl at formatlist@handler}[1]{%
+  \@dtl at formatlist@itemsep
+  \@dtl at formatlist@lastitem
+  \renewcommand{\@dtl at formatlist@lastitem}{%
+    \renewcommand{\@dtl at formatlist@itemsep}{%
+      \DTLlistformatsep 
+      \renewcommand*{\@dtl at formatlist@prelastitemsep}{%
+        \DTLlistformatoxford}}%
+    \renewcommand{\@dtl at formatlist@prelastitem}{%
+      \@dtl at formatlist@prelastitemsep
+       \DTLlistformatlastsep}%
+    \DTLlistformatitem{#1}%
+  }%
+}%
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTLformatlist}
+%\changes{2.28}{2017-11-10}{new}
+%Formats the comma-separated list supplied in its argument.
+%The unstarred version adds grouping.
+%    \begin{macrocode}
+\newrobustcmd*{\DTLformatlist}{%
+ \@ifstar{\s at dtlformatlist}{\@dtlformatlist}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\s at dtlformatlist}
+%\changes{2.28}{2017-11-10}{new}
+%Starred version of \cs{DTLformatlist} doesn't add grouping.
+%    \begin{macrocode}
+\newcommand*{\s at dtlformatlist}[1]{%
+  \def\@dtl at formatlist@itemsep{}%
+  \def\@dtl at formatlist@lastitem{}%
+  \def\@dtl at formatlist@prelastitem{}%
+  \def\@dtl at formatlist@prelastitemsep{}%
+  \@for\@dtl at formatlist@item:=#1\do{%
+    \expandafter\@dtl at formatlist@handler\expandafter{\@dtl at formatlist@item}%
+  }%
+  \@dtl at formatlist@prelastitem\@dtl at formatlist@lastitem
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@dtlformatlist}
+%\changes{2.28}{2017-11-10}{new}
+%Unstarred version of \cs{DTLformatlist} adds grouping.
+%    \begin{macrocode}
+\newcommand*{\@dtlformatlist}[1]{{\s at dtlformatlist{#1}}}
+%    \end{macrocode}
+%\end{macro}
+%
 % \subsection{General Token Utilities}
-%\begin{macro}{\toks at gput@right at cx}
+%\changes{2.28}{2017-11-10}{renamed \cs{toks at g...} to
+%\cs{dtl at toks@g...}}
+%\begin{macro}{\@dtl at toks@gput at right@cx}
 %\begin{definition}
-%\cs{toks at gput@right at cx}\marg{toks name}\marg{stuff}
+%\cs{dtl at toks@gput at right@cx}\marg{toks name}\marg{stuff}
 %\end{definition}
 % Globally appends stuff to token register \cs{}\meta{toks name}
 %    \begin{macrocode}
-\newcommand{\toks at gput@right at cx}[2]{%
-  \def\@toks at name{#1}%
+\newcommand{\@dtl at toks@gput at right@cx}[2]{%
+  \def\@dtl at toks@name{#1}%
   \edef\@dtl at stuff{#2}%
-  \global\csname\@toks at name\endcsname\expandafter
+  \global\csname\@dtl at toks@name\endcsname\expandafter
     \expandafter\expandafter{\expandafter\the
-    \csname\expandafter\@toks at name\expandafter\endcsname\@dtl at stuff}%
+    \csname\expandafter\@dtl at toks@name\expandafter\endcsname\@dtl at stuff}%
 }
 %    \end{macrocode}
 %\end{macro}
-%\begin{macro}{\toks at gconcat@middle at cx}
+%\begin{macro}{\@dtl at toks@gconcat at middle@cx}
 %\begin{definition}
-%\cs{toks at gconcat@middle at cx}\marg{toks name}\marg{before toks}\marg{stuff}\marg{after toks}
+%\cs{dtl at toks@gconcat at middle@cx}\marg{toks name}\marg{before toks}\marg{stuff}\marg{after toks}
 %\end{definition}
 % Globally sets token register \cs{}\meta{toks name} to
 % the contents of \meta{before toks} concatenated with
 % \meta{stuff} (expanded) and the contents of \meta{after toks}
 %    \begin{macrocode}
-\newcommand{\toks at gconcat@middle at cx}[4]{%
-  \def\@toks at name{#1}%
+\newcommand{\@dtl at toks@gconcat at middle@cx}[4]{%
+  \def\@dtl at toks@name{#1}%
   \edef\@dtl at stuff{#3}%
-  \global\csname\@toks at name\endcsname\expandafter\expandafter
+  \global\csname\@dtl at toks@name\endcsname\expandafter\expandafter
     \expandafter\expandafter\expandafter
     \expandafter\expandafter{\expandafter\expandafter\expandafter
     \the\expandafter\expandafter\expandafter#2%
@@ -5907,7 +6008,7 @@
 % Definitions of fixed-point commands that use the \sty{fp} package.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-fp}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-fp}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Required packages:
 %    \begin{macrocode}
@@ -6196,7 +6297,7 @@
 % Definitions of fixed-point commands that use the \sty{pgfmath} package.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-pgfmath}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-pgfmath}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Required packages:
 %    \begin{macrocode}
@@ -6537,7 +6638,7 @@
 %\section{Package Declaration}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Load required packages:
 %    \begin{macrocode}
@@ -6741,6 +6842,21 @@
 %    \end{macrocode}
 %\end{option}
 %
+%\begin{macro}{\@dtl at set@options}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\@dtl at set@options}{}
+%    \end{macrocode}
+%\end{macro}
+%\begin{option}{utf8}
+%\changes{2.28}{2017-11-10}{new}
+%Pass to \sty{datatool-base}
+%    \begin{macrocode}
+\define at choicekey{datatool.sty}{utf8}{true,false}[true]{%
+  \renewcommand*{\@dtl at set@options}{\setbool{@dtl at utf8}{#1}}%
+}
+%    \end{macrocode}
+%\end{option}
 % Process package options:
 %    \begin{macrocode}
 \ProcessOptionsX
@@ -6755,6 +6871,10 @@
 %    \begin{macrocode}
 \RequirePackage{datatool-base}
 %    \end{macrocode}
+%Set options that depend on \sty{datatool-base}:
+%    \begin{macrocode}
+\@dtl at set@options
+%    \end{macrocode}
 %
 %\begin{macro}{\DTLpar}
 % Many of the commands used by this package are short commands.
@@ -7109,7 +7229,7 @@
 %    \end{macrocode}
 % Append an empty row to the database
 %    \begin{macrocode}
-  \toks at gput@right at cx{dtldb@#1}{%
+  \@dtl at toks@gput at right@cx{dtldb@#1}{%
      \noexpand\db at row@elt at w%
        \noexpand\db at row@id at w \number\csname dtlrows@#1\endcsname
        \noexpand\db at row@id at end@%
@@ -7660,7 +7780,7 @@
 %    \end{macrocode}
 % Update required
 %    \begin{macrocode}
-        \toks at gconcat@middle at cx{dtlkeys@#1}%
+        \@dtl at toks@gconcat at middle@cx{dtlkeys@#1}%
         {\@dtl at before}%
         {%
           \noexpand\db at plist@elt at w% start of key block
@@ -7687,7 +7807,7 @@
       \csname dtlcols@#1\endcsname by 1\relax
     \dtlcolumnnum=\csname dtlcols@#1\endcsname\relax
 %    \end{macrocode}
-% Set column index for this key
+% Set column index for this key.
 %    \begin{macrocode}
     \expandafter\xdef\csname dtl at ci@#1@#2\endcsname{%
       \number\dtlcolumnnum}%
@@ -7705,7 +7825,7 @@
 %    \end{macrocode}
 % Append to property list
 %    \begin{macrocode}
-    \toks at gput@right at cx{dtlkeys@#1}%
+    \@dtl at toks@gput at right@cx{dtlkeys@#1}%
     {%
       \noexpand\db at plist@elt at w
       \noexpand\db at col@id at w \the\dtlcolumnnum
@@ -7799,7 +7919,7 @@
 % Reconstruct property list
 %    \begin{macrocode}
   \edef\@dtl at colnum{\number#2}\relax
-  \toks at gconcat@middle at cx{dtlkeys@#1}%
+  \@dtl at toks@gconcat at middle@cx{dtlkeys@#1}%
   {\@dtl at before}%
   {%
     \noexpand\db at plist@elt at w% start of block
@@ -7903,7 +8023,7 @@
 % There are no entries in this row for the given column.
 % Add this entry.
 %    \begin{macrocode}
-    \toks at gconcat@middle at cx{dtldb@#1}%
+    \@dtl at toks@gconcat at middle@cx{dtldb@#1}%
     {\dtlbeforerow}%
     {%
 %    \end{macrocode}
@@ -8532,7 +8652,7 @@
 % \cs{dtlcurrentrow} and \cs{dtlafterrow}
 %    \begin{macrocode}
 \newcommand*{\dtlrecombine}{%
-   \toks at gconcat@middle at cx{dtldb@\dtldbname}%
+   \@dtl at toks@gconcat at middle@cx{dtldb@\dtldbname}%
    {\dtlbeforerow}%
    {%
 %    \end{macrocode}
@@ -8582,7 +8702,7 @@
 % \cs{dtlbeforerow} and \cs{dtlafterrow}
 %    \begin{macrocode}
   \csname dtldb@\dtldbname\endcsname=\dtlbeforerow
-  \toks at gput@right at cx{dtldb@\dtldbname}{\the\dtlafterrow}%
+  \@dtl at toks@gput at right@cx{dtldb@\dtldbname}{\the\dtlafterrow}%
   \dtl at message{Removed row \number\dtlrownum\space in database 
     `\dtldbname'}%
 }
@@ -8805,7 +8925,7 @@
 %    \end{macrocode}
 % Append this entry to the current row.
 %    \begin{macrocode}
-        \toks at gput@right at cx{dtlcurrentrow}%
+        \@dtl at toks@gput at right@cx{dtlcurrentrow}%
         {%
 %    \end{macrocode}
 % Begin column index specs:
@@ -8878,7 +8998,7 @@
 %    \end{macrocode}
 % Append this entry to the current row.
 %    \begin{macrocode}
-        \toks at gput@right at cx{dtlcurrentrow}%
+        \@dtl at toks@gput at right@cx{dtlcurrentrow}%
         {%
 %    \end{macrocode}
 % Begin column index specs:
@@ -9024,11 +9144,26 @@
 %    \end{macrocode}
 %\end{macro}
 %
-%\begin{macro}{\DTLgetrowindex}
+%\begin{macro}{\xdtlgetrowindex}
 %\begin{definition}
-%\cs{DTLgetrowindex}\marg{row cs}\marg{database}\marg{column index}%
+%\cs{xdtlgetrowindex}\marg{row cs}\marg{database}\marg{column index}%
 %\marg{value}
 %\end{definition}
+% As above but expands the value.
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\xdtlgetrowindex}[4]{%
+  \protected at edef\dtl at dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{#4}}%
+  \dtl at dogetrowindex
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@dtlgetrowindex}
+%\begin{definition}
+%\cs{@dtlgetrowindex}\marg{row cs}\marg{database}\marg{column index}%
+%\marg{value}
+%\end{definition}
 % Column index must be fully expanded.
 %\changes{2.11}{2012-09-25}{new}
 %    \begin{macrocode}
@@ -9762,7 +9897,7 @@
                 \dtlforeachlevel\endcsname
               \@dtl at after=\csname @dtl at next\romannumeral
                 \dtlforeachlevel\endcsname
-              \toks at gconcat@middle at cx{dtldb@#2}%
+              \@dtl at toks@gconcat at middle@cx{dtldb@#2}%
               {\@dtl at before}%
               {%
 %    \end{macrocode}
@@ -10099,7 +10234,7 @@
 %    \end{macrocode}
 % Append this entry to the current row.
 %    \begin{macrocode}
-        \toks at gput@right at cx{@dtl at cur\romannumeral\dtlforeachlevel}%
+        \@dtl at toks@gput at right@cx{@dtl at cur\romannumeral\dtlforeachlevel}%
         {%
           \noexpand\db at col@id at w \number\dtlcolumnnum
             \noexpand\db at col@id at end@
@@ -10309,7 +10444,7 @@
           \expandafter\@dtl at toks\expandafter{\@dtl at tmp}% new value
           \expandafter\@dtl at before\expandafter{\dtl at pre}%
           \expandafter\@dtl at after\expandafter{\dtl at post}%
-          \toks at gconcat@middle at cx
+          \@dtl at toks@gconcat at middle@cx
             {@dtl at cur\romannumeral\dtlforeachlevel}%
             {\@dtl at before}%
             {%
@@ -13887,16 +14022,30 @@
 %\cs{dtl at trim}\marg{line}
 %\end{definition}
 % Trims the trailing space from \meta{line}.
+%\changes{2.28}{2017-11-10}{fix bug no 123}
 %    \begin{macrocode}
 \newcommand{\dtl at trim}[1]{%
   \def\@dtl at trmstr{}%
-  \expandafter\@dtl at starttrim#1\@nil
+  \if#1\par
+  \else
+    \expandafter\@dtl at start@trim#1\@dtl at end@trim
+  \fi
   \let#1=\@dtl at trmstr
 }
 %    \end{macrocode}
 %\end{macro}
+%\begin{macro}{\@dtl at start@trim}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\def\@dtl at start@trim#1 \@dtl at end@trim{%
+ \def\@dtl at trmstr{#1}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\@dtl at starttrim}
-% Start trimming
+% Start trimming. (No longer used as from v2.28. May be removed in
+% later versions.)
 %\changes{2.10}{2012-07-18}{added check in the event there's no
 %trailing space}
 %\changes{2.23}{2015-07-11}{fixed bug in the event that either argument is
@@ -13903,6 +14052,8 @@
 %in a group}
 %    \begin{macrocode}
 \long\def\@dtl at starttrim#1#2{%
+\def\tmpA{#1}\show\tmpA
+\def\tmpB{#2}\show\tmpB
   \dtl at ifsingle{#2}%
   {%
     \def\@dtl at tmpB{#2}%
@@ -13933,6 +14084,7 @@
 %    \end{macrocode}
 %\end{macro}
 %\begin{macro}{\@dtl at trim}
+% No longer used as from v2.28. May be removed in later versions.
 %    \begin{macrocode}
 \long\def\@dtl at trim#1 \@nil{\long\def\@dtl at trmstr{#1}}
 %    \end{macrocode}
@@ -13996,10 +14148,11 @@
 \@dtl at doreadraw?1?2>>>
 \gdef\@dtl at doreadraw?1?2<\relax
 \read?1 to \tmp
-\xdef?2<\tmp>\relax
+\protected at xdef?2<\tmp>\relax
 >
 \endgroup
 %    \end{macrocode}
+%\changes{2.28}{2017-11-10}{changed \cs{xdef} to \cs{protected at xdef}}.
 %\end{macro}
 %\begin{macro}{\@dtl at activatebraces}
 % \cs{@dtl at activatebraces} resets braces for \cs{@dtl at rawread}
@@ -14130,7 +14283,7 @@
 % Declare package:
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datagidx}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datagidx}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Required packages:
 %    \begin{macrocode}
@@ -14887,6 +15040,15 @@
 %    \end{macrocode}
 %\end{option}
 %
+%\begin{option}{utf8}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\define at choicekey{datatool.sty}{utf8}{true,false}[true]{%
+  \setbool{@dtl at utf8}{#1}%
+}
+%    \end{macrocode}
+%\end{option}
+%
 % These options govern the general layout of the glossary/index.
 %\begin{option}{columns}
 % The number of columns used by \env{multicols} (or
@@ -17347,11 +17509,22 @@
 \define at key{newgloss}{postheading}{%
   \renewcommand*{\datagidx at postheading}{#1}%
 }
+%    \end{macrocode}
+%\begin{macro}{\ifdatagidxbalance}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newif\ifdatagidxbalance
+\datagidxbalancetrue
+%    \end{macrocode}
+%\end{macro}
+%    \begin{macrocode}
 \define at choicekey{newgloss}{balance}[\val\nr]{true,false}[true]{%
  \ifcase\nr\relax
    \renewcommand*{\datagidx at multicols}{multicols}%
+   \datagidxbalancetrue
  \or
    \renewcommand*{\datagidx at multicols}{multicols*}%
+   \datagidxbalancefalse
  \fi
 }
 \define at key{newgloss}{sort}{\renewcommand*{\datagidx at sort}{#1}}
@@ -18025,13 +18198,71 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\datagidxextendedtoascii}
+% Convert commands like \ics{aa} into the closest ASCII equivalent.
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand{\datagidxextendedtoascii}{%
+  \def\AE{AE}%
+  \def\ae{ae}%
+  \def\OE{OE}%
+  \def\oe{oe}%
+  \def\AA{AA}%
+  \def\aa{aa}%
+  \def\L{L}%
+  \def\l{l}%
+  \def\O{O}%
+  \def\o{o}%
+  \def\SS{SS}%
+  \def\ss{ss}%
+  \def\th{th}%
+  \def\TH{TH}%
+  \def\dh{dh}%
+  \def\DH{DH}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\datagidxconvertchars}
+% Convert commands like \cs{\&}.
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\datagidxconvertchars}{%
+  \let~\space
+  \ifdef\andname
+  {%
+    \let\&\andname
+  }%
+  {%
+    \def\&{\expandafter\@gobble\string\&}%
+  }%
+  \def\_{\string_}%
+  \def\${\string$}%
+  \def\#{\expandafter\@gobble\string\#}%
+  \def\%{\expandafter\@gobble\string\%}%
+  \def\{{\expandafter\@gobble\string\{}%
+  \def\}{\expandafter\@gobble\string\}}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\datagidxstripaccents}
 % Strip accents so they don't interfere with the label and sort.
 % If you want to write your own comparison handler macro, you'll
 % need to redefine this if you want accented letters to be sorted
-% differently from the unaccented version.
+% differently from the unaccented version. This command should
+% only be used within a scope.
 %    \begin{macrocode}
 \newcommand*{\datagidxstripaccents}{%
+%    \end{macrocode}
+% These redefinitions will only work with \cs{edef} or \cs{xdef}:
+%    \begin{macrocode}
+ \let\add at accent@\@secondoftwo
+ \let\@text at composite@x\@secondoftwo
+ \let\@tabacckludge\@secondoftwo
+%    \end{macrocode}
+% The following are need with \cs{protected at edef} or \cs{protected at xdef}:
+%    \begin{macrocode}
  \expandafter\def\csname \encodingdefault-cmd\endcsname##1##2##3{##3}%
  \expandafter\def\csname OT1-cmd\endcsname##1##2##3{##3}%
  \expandafter\def\csname T1-cmd\endcsname##1##2##3{##3}%
@@ -18047,12 +18278,7 @@
 %\end{definition}
 % Defaults to normal behaviour.
 %    \begin{macrocode}
-\ifdef\newterm
-{%
-}%
-{%
-  \newcommand{\newterm}{\datagidx at newterm}
-}
+\providecommand{\newterm}{\datagidx at newterm}
 %    \end{macrocode}
 %\end{macro}
 %
@@ -18127,15 +18353,11 @@
    \let\textsl\DTLgidxNoFormat
    \let\emph\DTLgidxNoFormat
    \let\textsuperscript\DTLgidxNoFormat
-   \let~\space
-   \ifdef\andname
-   {%
-     \let\&\andname
-   }%
-   {%
-     \def\&{and}%
-   }%
 %    \end{macrocode}
+% Convert character commands like \cs{\&}.
+%    \begin{macrocode}
+  \datagidxconvertchars
+%    \end{macrocode}
 % Strip \cs{ensuremath}.
 %    \begin{macrocode}
    \let\ensuremath\DTLgidxNoFormat
@@ -18156,10 +18378,15 @@
 % Strip accent commands so they don't interfere with the label.
 %    \begin{macrocode}
    \datagidxstripaccents
+   \datagidxextendedtoascii
 %    \end{macrocode}
 % Allow user to hook into this.
 %    \begin{macrocode}
    \newtermlabelhook
+%    \end{macrocode}
+%There shouldn't really be any fragile commands in \verb|#2| but
+%using \cs{protected at xdef} to be on the safe side.
+%    \begin{macrocode}
    \protected at xdef\newterm at label{\newterm at label}%
 %    \end{macrocode}
 % These commands behave differently for the sort key:
@@ -18175,6 +18402,10 @@
    \let\DTLgidxRank\datagidx at rank
    \let\DTLgidxParticle\datagidx at particle
    \let\DTLgidxNameNum\datagidx at namenum
+%    \end{macrocode}
+%Need to use \cs{protected at xdef} here, which means limited support
+%for stripping accents.
+%    \begin{macrocode}
    \protected at xdef\newterm at sort{\newterm at sort}%
  \egroup
 }
@@ -19705,6 +19936,60 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\printtermsstartpar}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand{\printtermsstartpar}{\par}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\printterms at setupmulticol}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\printterms at setupmulticol}{%
+ \ifdefempty\datagidx at postheading
+ {%
+   \edef\datagidx at prestart{%
+    \noexpand\datagidx at heading{\noexpand\datagidx at title}%
+    \noexpand\begin{\datagidx at multicols}{\datagidx at columns}%
+   }%
+ }%
+ {%
+   \edef\datagidx at prestart{%
+    \noexpand\datagidx at heading{\noexpand\datagidx at title}%
+    \noexpand\begin{\datagidx at multicols}{\datagidx at columns}%
+    [\noexpand\datagidx at postheading]%
+   }%
+ }%
+ \edef\datagidx at postend{%
+  \noexpand\end{\datagidx at multicols}%
+ }%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\printterms at setuptwocol}
+%\changes{2.28}{2017-11-10}{new}
+%    \begin{macrocode}
+\newcommand*{\printterms at setuptwocol}{%
+ \def\datagidx at prestart{%
+   \twocolumn[\datagidx at heading{\datagidx at title}%
+   \datagidx at postheading]}%
+ \if at twocolumn
+   \def\datagidx at postend{}%
+ \else
+   \def\datagidx at postend{\printtermsrestoreonecolumn}%
+ \fi
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\printtermsrestoreonecolumn}
+%    \begin{macrocode}
+\newcommand{\printtermsrestoreonecolumn}{\onecolumn}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\printterms}
 %\begin{definition}
 %\cs{printterms}[options]
@@ -19773,12 +20058,15 @@
 % Do we need to use \env{multicols}?
 %    \begin{macrocode}
     \ifnum\datagidx at columns>1\relax
-       \edef\datagidx at prestart{%
-        \noexpand\begin{\datagidx at multicols}{\datagidx at columns}%
-       }%
-       \edef\datagidx at postend{%
-        \noexpand\end{\datagidx at multicols}%
-       }%
+       \ifnum\datagidx at columns=2\relax
+        \ifdatagidxbalance
+          \printterms at setupmulticol
+        \else
+          \printterms at setuptwocol
+        \fi
+       \else
+          \printterms at setupmulticol
+       \fi
     \else
        \def\datagidx at prestart{}%
        \def\datagidx at postend{}%
@@ -19793,10 +20081,16 @@
 % Now display the glossary/index:
 %    \begin{macrocode}
     \def\datagidx at labellist{}%
-    \datagidx at heading{\datagidx at title}%
-    \datagidx at postheading
+    \ifnum\datagidx at columns=1\relax
+      \datagidx at heading{\datagidx at title}%
+      \datagidx at postheading
+    \fi
     \datagidx at do@sort
     \datagidx at prestart
+%    \end{macrocode}
+%\changes{2.28}{2017-11-10}{added paragraph break at the start}:
+%    \begin{macrocode}
+    \printtermsstartpar
     \datagidxstart
     \let\DTLgidxName\datagidx at invert
     \let\DTLgidxPlace\datagidx at invert
@@ -20039,7 +20333,7 @@
 %\section{Package Declaration}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databib}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{databib}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Load required packages:
 %    \begin{macrocode}
@@ -22962,7 +23256,7 @@
 % Declare package:
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databar}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{databar}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Require \sty{xkeyval} package
 %    \begin{macrocode}
@@ -24269,7 +24563,7 @@
 % Declare package:
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datapie}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datapie}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Require \sty{xkeyval} package
 %    \begin{macrocode}
@@ -25071,7 +25365,7 @@
 % Declare package:
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{dataplot}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{dataplot}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Required packages
 %    \begin{macrocode}
@@ -26693,7 +26987,7 @@
 % Package identification:
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{person}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{person}[2017/11/10 v2.28 (NLCT)]
 %    \end{macrocode}
 % Requires the \sty{ifthen} package.
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/datatool/datatool.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/datatool/datatool.ins	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/source/latex/datatool/datatool.ins	2017-11-10 21:46:23 UTC (rev 45742)
@@ -1,14 +1,14 @@
-% datatool.ins generated using makedtx version 1.1 2016/7/28 15:09
+% datatool.ins generated using makedtx version 1.2 2017/11/10 16:07
 \input docstrip
 
 \preamble
 
  datatool.dtx
- Copyright 2016 Nicola Talbot
+ Copyright 2017 Nicola Talbot
 
  This work may be distributed and/or modified under the
  conditions of the LaTeX Project Public License, either version 1.3
- of this license of (at your option) any later version.
+ of this license or (at your option) any later version.
  The latest version of this license is in
    http://www.latex-project.org/lppl.txt
  and version 1.3 or later is part of all distributions of LaTeX

Modified: trunk/Master/texmf-dist/tex/latex/datatool/databar.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/databar.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/databar.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `databar.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databar}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{databar}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{xkeyval}
 \RequirePackage{dataplot}
 \newif\ifDTLcolorbarchart

Modified: trunk/Master/texmf-dist/tex/latex/datatool/databib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/databib.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/databib.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `databib.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{databib}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{databib}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{datatool}
 \newcommand*{\dtlbib at style}{plain}
 \define at choicekey{databib.sty}{style}{plain,abbrv,alpha}{%

Modified: trunk/Master/texmf-dist/tex/latex/datatool/datagidx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/datagidx.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/datagidx.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `datagidx.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datagidx}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datagidx}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{datatool}
 \RequirePackage{etoolbox}
 \RequirePackage{xkeyval}
@@ -406,6 +406,9 @@
     \@datagidx at warntrue
   \fi
 }
+\define at choicekey{datatool.sty}{utf8}{true,false}[true]{%
+  \setbool{@dtl at utf8}{#1}%
+}
 \define at key{datagidx.sty}{columns}%
 {%
   \DTLgidxSetColumns{#1}%
@@ -1906,11 +1909,15 @@
 \define at key{newgloss}{postheading}{%
   \renewcommand*{\datagidx at postheading}{#1}%
 }
+\newif\ifdatagidxbalance
+\datagidxbalancetrue
 \define at choicekey{newgloss}{balance}[\val\nr]{true,false}[true]{%
  \ifcase\nr\relax
    \renewcommand*{\datagidx at multicols}{multicols}%
+   \datagidxbalancetrue
  \or
    \renewcommand*{\datagidx at multicols}{multicols*}%
+   \datagidxbalancefalse
  \fi
 }
 \define at key{newgloss}{sort}{\renewcommand*{\datagidx at sort}{#1}}
@@ -2180,7 +2187,44 @@
   \def\Psi{Psi}%
   \def\Omega{Omega}%
 }
+\newcommand{\datagidxextendedtoascii}{%
+  \def\AE{AE}%
+  \def\ae{ae}%
+  \def\OE{OE}%
+  \def\oe{oe}%
+  \def\AA{AA}%
+  \def\aa{aa}%
+  \def\L{L}%
+  \def\l{l}%
+  \def\O{O}%
+  \def\o{o}%
+  \def\SS{SS}%
+  \def\ss{ss}%
+  \def\th{th}%
+  \def\TH{TH}%
+  \def\dh{dh}%
+  \def\DH{DH}%
+}
+\newcommand*{\datagidxconvertchars}{%
+  \let~\space
+  \ifdef\andname
+  {%
+    \let\&\andname
+  }%
+  {%
+    \def\&{\expandafter\@gobble\string\&}%
+  }%
+  \def\_{\string_}%
+  \def\${\string$}%
+  \def\#{\expandafter\@gobble\string\#}%
+  \def\%{\expandafter\@gobble\string\%}%
+  \def\{{\expandafter\@gobble\string\{}%
+  \def\}{\expandafter\@gobble\string\}}%
+}
 \newcommand*{\datagidxstripaccents}{%
+ \let\add at accent@\@secondoftwo
+ \let\@text at composite@x\@secondoftwo
+ \let\@tabacckludge\@secondoftwo
  \expandafter\def\csname \encodingdefault-cmd\endcsname##1##2##3{##3}%
  \expandafter\def\csname OT1-cmd\endcsname##1##2##3{##3}%
  \expandafter\def\csname T1-cmd\endcsname##1##2##3{##3}%
@@ -2187,12 +2231,7 @@
  \expandafter\def\csname PD1-cmd\endcsname##1##2##3{##3}%
  \def\IeC##1{\@gobbletwo##1}%
 }
-\ifdef\newterm
-{%
-}%
-{%
-  \newcommand{\newterm}{\datagidx at newterm}
-}
+\providecommand{\newterm}{\datagidx at newterm}
 \@onlypreamble\newterm
 \newcommand{\datagidx at setfieldvalues}[2]{%
  \def\newterm at name{#2}%
@@ -2232,14 +2271,7 @@
    \let\textsl\DTLgidxNoFormat
    \let\emph\DTLgidxNoFormat
    \let\textsuperscript\DTLgidxNoFormat
-   \let~\space
-   \ifdef\andname
-   {%
-     \let\&\andname
-   }%
-   {%
-     \def\&{and}%
-   }%
+  \datagidxconvertchars
    \let\ensuremath\DTLgidxNoFormat
    \let\DTLgidxParen\@gobble
    \let\DTLgidxName\@secondoftwo
@@ -2249,6 +2281,7 @@
    \let\DTLgidxParticle\datagidx at bothoftwo
    \datagidxwordifygreek
    \datagidxstripaccents
+   \datagidxextendedtoascii
    \newtermlabelhook
    \protected at xdef\newterm at label{\newterm at label}%
    \let\DTLgidxName\datagidx at person
@@ -3013,6 +3046,37 @@
 }
 \newcommand*{\printterms at condition}{\boolean{true}}
 \define at key{printterms}{condition}{\renewcommand*{\printterms at condition}{#1}}
+\newcommand{\printtermsstartpar}{\par}
+\newcommand*{\printterms at setupmulticol}{%
+ \ifdefempty\datagidx at postheading
+ {%
+   \edef\datagidx at prestart{%
+    \noexpand\datagidx at heading{\noexpand\datagidx at title}%
+    \noexpand\begin{\datagidx at multicols}{\datagidx at columns}%
+   }%
+ }%
+ {%
+   \edef\datagidx at prestart{%
+    \noexpand\datagidx at heading{\noexpand\datagidx at title}%
+    \noexpand\begin{\datagidx at multicols}{\datagidx at columns}%
+    [\noexpand\datagidx at postheading]%
+   }%
+ }%
+ \edef\datagidx at postend{%
+  \noexpand\end{\datagidx at multicols}%
+ }%
+}
+\newcommand*{\printterms at setuptwocol}{%
+ \def\datagidx at prestart{%
+   \twocolumn[\datagidx at heading{\datagidx at title}%
+   \datagidx at postheading]}%
+ \if at twocolumn
+   \def\datagidx at postend{}%
+ \else
+   \def\datagidx at postend{\printtermsrestoreonecolumn}%
+ \fi
+}
+\newcommand{\printtermsrestoreonecolumn}{\onecolumn}
 \newcommand{\printterms}[1][]{%
 \bgroup
   \let\newterm at database\datagidx at defaultdatabase
@@ -3051,12 +3115,15 @@
     \edef\dtl at do@setkeys{\noexpand\setkeys{newgloss}{\expandonce\newterm at styles}}%
     \dtl at do@setkeys
     \ifnum\datagidx at columns>1\relax
-       \edef\datagidx at prestart{%
-        \noexpand\begin{\datagidx at multicols}{\datagidx at columns}%
-       }%
-       \edef\datagidx at postend{%
-        \noexpand\end{\datagidx at multicols}%
-       }%
+       \ifnum\datagidx at columns=2\relax
+        \ifdatagidxbalance
+          \printterms at setupmulticol
+        \else
+          \printterms at setuptwocol
+        \fi
+       \else
+          \printterms at setupmulticol
+       \fi
     \else
        \def\datagidx at prestart{}%
        \def\datagidx at postend{}%
@@ -3065,10 +3132,13 @@
     \csuse{datagidxshowgroups\datagidx at showgroups}%
     \datagidxsetstyle{\datagidx at style}%
     \def\datagidx at labellist{}%
-    \datagidx at heading{\datagidx at title}%
-    \datagidx at postheading
+    \ifnum\datagidx at columns=1\relax
+      \datagidx at heading{\datagidx at title}%
+      \datagidx at postheading
+    \fi
     \datagidx at do@sort
     \datagidx at prestart
+    \printtermsstartpar
     \datagidxstart
     \let\DTLgidxName\datagidx at invert
     \let\DTLgidxPlace\datagidx at invert

Modified: trunk/Master/texmf-dist/tex/latex/datatool/datapie.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/datapie.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/datapie.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `datapie.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datapie}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datapie}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{xkeyval}
 \newif\ifDTLcolorpiechart
 \DTLcolorpiecharttrue

Modified: trunk/Master/texmf-dist/tex/latex/datatool/dataplot.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/dataplot.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/dataplot.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `dataplot.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{dataplot}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{dataplot}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{xkeyval}
 \RequirePackage{tikz}
 \RequirePackage{datatool}

Modified: trunk/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/datatool-base.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/datatool-base.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `datatool-base.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-base}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-base}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{etoolbox}
 \RequirePackage{amsmath}
 \RequirePackage{xkeyval}
@@ -363,17 +363,52 @@
 }
 \newif\if at dtl@insertdone
 \newcount\dtl at sortresult
-\newcommand{\toks at gput@right at cx}[2]{%
-  \def\@toks at name{#1}%
+\newcommand*{\DTLlistformatsep}{, }
+\newcommand*{\DTLlistformatoxford}{}
+\ifdef\andname
+{\newcommand*{\DTLandname}{\andname}}
+{\newcommand*{\DTLandname}{\&}}
+\newcommand*{\DTLlistformatlastsep}{ \DTLandname\space}
+\newcommand*{\DTLlistformatitem}[1]{#1}
+\newcommand*{\@dtl at formatlist@handler}[1]{%
+  \@dtl at formatlist@itemsep
+  \@dtl at formatlist@lastitem
+  \renewcommand{\@dtl at formatlist@lastitem}{%
+    \renewcommand{\@dtl at formatlist@itemsep}{%
+      \DTLlistformatsep
+      \renewcommand*{\@dtl at formatlist@prelastitemsep}{%
+        \DTLlistformatoxford}}%
+    \renewcommand{\@dtl at formatlist@prelastitem}{%
+      \@dtl at formatlist@prelastitemsep
+       \DTLlistformatlastsep}%
+    \DTLlistformatitem{#1}%
+  }%
+}%
+\newrobustcmd*{\DTLformatlist}{%
+ \@ifstar{\s at dtlformatlist}{\@dtlformatlist}%
+}
+\newcommand*{\s at dtlformatlist}[1]{%
+  \def\@dtl at formatlist@itemsep{}%
+  \def\@dtl at formatlist@lastitem{}%
+  \def\@dtl at formatlist@prelastitem{}%
+  \def\@dtl at formatlist@prelastitemsep{}%
+  \@for\@dtl at formatlist@item:=#1\do{%
+    \expandafter\@dtl at formatlist@handler\expandafter{\@dtl at formatlist@item}%
+  }%
+  \@dtl at formatlist@prelastitem\@dtl at formatlist@lastitem
+}
+\newcommand*{\@dtlformatlist}[1]{{\s at dtlformatlist{#1}}}
+\newcommand{\@dtl at toks@gput at right@cx}[2]{%
+  \def\@dtl at toks@name{#1}%
   \edef\@dtl at stuff{#2}%
-  \global\csname\@toks at name\endcsname\expandafter
+  \global\csname\@dtl at toks@name\endcsname\expandafter
     \expandafter\expandafter{\expandafter\the
-    \csname\expandafter\@toks at name\expandafter\endcsname\@dtl at stuff}%
+    \csname\expandafter\@dtl at toks@name\expandafter\endcsname\@dtl at stuff}%
 }
-\newcommand{\toks at gconcat@middle at cx}[4]{%
-  \def\@toks at name{#1}%
+\newcommand{\@dtl at toks@gconcat at middle@cx}[4]{%
+  \def\@dtl at toks@name{#1}%
   \edef\@dtl at stuff{#3}%
-  \global\csname\@toks at name\endcsname\expandafter\expandafter
+  \global\csname\@dtl at toks@name\endcsname\expandafter\expandafter
     \expandafter\expandafter\expandafter
     \expandafter\expandafter{\expandafter\expandafter\expandafter
     \the\expandafter\expandafter\expandafter#2%

Modified: trunk/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `datatool-fp.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-fp}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-fp}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{xkeyval}
 \RequirePackage{fp}
 \RequirePackage{datatool-base}

Modified: trunk/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `datatool-pgfmath.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool-pgfmath}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-pgfmath}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{xkeyval}
 \RequirePackage{pgfrcs,pgfkeys,pgfmath}
 \ProcessOptionsX

Modified: trunk/Master/texmf-dist/tex/latex/datatool/datatool.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/datatool.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/datatool.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `datatool.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{xkeyval}
 \RequirePackage{ifthen}
 \RequirePackage{xfor}
@@ -116,9 +116,14 @@
   \renewcommand*\@dtl at mathprocessor{#1}%
 }
 \providecommand*{\@dtl at mathprocessor}{fp}
+\newcommand*{\@dtl at set@options}{}
+\define at choicekey{datatool.sty}{utf8}{true,false}[true]{%
+  \renewcommand*{\@dtl at set@options}{\setbool{@dtl at utf8}{#1}}%
+}
 \ProcessOptionsX
 \@dtl at construct@lopoffs
 \RequirePackage{datatool-base}
+\@dtl at set@options
 \DeclareRobustCommand{\DTLpar}{\par}
 \newcommand*{\DTLnewdb}[1]{%
   \DTLifdbexists{#1}%
@@ -244,7 +249,7 @@
 }
 \newcommand*{\@sDTLnewrow}[1]{%
   \global\advance\csname dtlrows@#1\endcsname by 1\relax
-  \toks at gput@right at cx{dtldb@#1}{%
+  \@dtl at toks@gput at right@cx{dtldb@#1}{%
      \noexpand\db at row@elt at w%
        \noexpand\db at row@id at w \number\csname dtlrows@#1\endcsname
        \noexpand\db at row@id at end@%
@@ -462,7 +467,7 @@
       }%
       \ifx\@dtl at oldtype\@dtl at type
       \else
-        \toks at gconcat@middle at cx{dtlkeys@#1}%
+        \@dtl at toks@gconcat at middle@cx{dtlkeys@#1}%
         {\@dtl at before}%
         {%
           \noexpand\db at plist@elt at w% start of key block
@@ -495,7 +500,7 @@
       \@dtl at checknumerical{#3}%
       \edef\@dtl at type{\number\@dtl at datatype}%
     }%
-    \toks at gput@right at cx{dtlkeys@#1}%
+    \@dtl at toks@gput at right@cx{dtlkeys@#1}%
     {%
       \noexpand\db at plist@elt at w
       \noexpand\db at col@id at w \the\dtlcolumnnum
@@ -541,7 +546,7 @@
   \@dtl at dogetprops
   \@dtl at colhead={#3}%
   \edef\@dtl at colnum{\number#2}\relax
-  \toks at gconcat@middle at cx{dtlkeys@#1}%
+  \@dtl at toks@gconcat at middle@cx{dtlkeys@#1}%
   {\@dtl at before}%
   {%
     \noexpand\db at plist@elt at w% start of block
@@ -588,7 +593,7 @@
   \dtl at dogetentry
   \ifx\dtl at entry\dtlnovalue
     \@dtl at setnewvalue{#3}%
-    \toks at gconcat@middle at cx{dtldb@#1}%
+    \@dtl at toks@gconcat at middle@cx{dtldb@#1}%
     {\dtlbeforerow}%
     {%
       \noexpand\db at row@elt at w%
@@ -825,7 +830,7 @@
   \@dtl at getrow#1\q at nil
 }
 \newcommand*{\dtlrecombine}{%
-   \toks at gconcat@middle at cx{dtldb@\dtldbname}%
+   \@dtl at toks@gconcat at middle@cx{dtldb@\dtldbname}%
    {\dtlbeforerow}%
    {%
       \noexpand\db at row@elt at w
@@ -843,7 +848,7 @@
 \newcommand{\dtlrecombineomitcurrent}{%
   \dtl at decrementrows{\dtlafterrow}{\dtlrownum}
   \csname dtldb@\dtldbname\endcsname=\dtlbeforerow
-  \toks at gput@right at cx{dtldb@\dtldbname}{\the\dtlafterrow}%
+  \@dtl at toks@gput at right@cx{dtldb@\dtldbname}{\the\dtlafterrow}%
   \dtl at message{Removed row \number\dtlrownum\space in database
     `\dtldbname'}%
 }
@@ -936,7 +941,7 @@
       \ifx\dtl at entry\dtlnovalue
         \protected at edef\@dtl at tmp{#2}%
         \expandafter\@dtl at toks\expandafter{\@dtl at tmp}%
-        \toks at gput@right at cx{dtlcurrentrow}%
+        \@dtl at toks@gput at right@cx{dtlcurrentrow}%
         {%
           \noexpand\db at col@id at w
             \number\dtlcolumnnum
@@ -966,7 +971,7 @@
       \ifx\dtl at entry\dtlnovalue
         \protected at edef\@dtl at tmp{#2}%
         \expandafter\@dtl at toks\expandafter{\@dtl at tmp}%
-        \toks at gput@right at cx{dtlcurrentrow}%
+        \@dtl at toks@gput at right@cx{dtlcurrentrow}%
         {%
           \noexpand\db at col@id at w
             \number\dtlcolumnnum
@@ -1044,6 +1049,10 @@
   \edef\dtl at dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{\the\toks@}}%
   \dtl at dogetrowindex
 }
+\newcommand*{\xdtlgetrowindex}[4]{%
+  \protected at edef\dtl at dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{#4}}%
+  \dtl at dogetrowindex
+}
 \newcommand*{\@dtlgetrowindex}[4]{%
   \def\@dtl at getrowindex##1% stuff before value
     \db at col@elt at w #4\db at col@elt at end@% value
@@ -1404,7 +1413,7 @@
                 \dtlforeachlevel\endcsname
               \@dtl at after=\csname @dtl at next\romannumeral
                 \dtlforeachlevel\endcsname
-              \toks at gconcat@middle at cx{dtldb@#2}%
+              \@dtl at toks@gconcat at middle@cx{dtldb@#2}%
               {\@dtl at before}%
               {%
                 \noexpand\db at row@elt at w%
@@ -1566,7 +1575,7 @@
       \ifx\dtl at entry\dtlnovalue
         \protected at edef\@dtl at tmp{#2}%
         \expandafter\@dtl at toks\expandafter{\@dtl at tmp}%
-        \toks at gput@right at cx{@dtl at cur\romannumeral\dtlforeachlevel}%
+        \@dtl at toks@gput at right@cx{@dtl at cur\romannumeral\dtlforeachlevel}%
         {%
           \noexpand\db at col@id at w \number\dtlcolumnnum
             \noexpand\db at col@id at end@
@@ -1682,7 +1691,7 @@
           \expandafter\@dtl at toks\expandafter{\@dtl at tmp}% new value
           \expandafter\@dtl at before\expandafter{\dtl at pre}%
           \expandafter\@dtl at after\expandafter{\dtl at post}%
-          \toks at gconcat@middle at cx
+          \@dtl at toks@gconcat at middle@cx
             {@dtl at cur\romannumeral\dtlforeachlevel}%
             {\@dtl at before}%
             {%
@@ -3248,10 +3257,18 @@
 }
 \newcommand{\dtl at trim}[1]{%
   \def\@dtl at trmstr{}%
-  \expandafter\@dtl at starttrim#1\@nil
+  \if#1\par
+  \else
+    \expandafter\@dtl at start@trim#1\@dtl at end@trim
+  \fi
   \let#1=\@dtl at trmstr
 }
+\def\@dtl at start@trim#1 \@dtl at end@trim{%
+ \def\@dtl at trmstr{#1}%
+}
 \long\def\@dtl at starttrim#1#2{%
+\def\tmpA{#1}\show\tmpA
+\def\tmpB{#2}\show\tmpB
   \dtl at ifsingle{#2}%
   {%
     \def\@dtl at tmpB{#2}%
@@ -3318,7 +3335,7 @@
 \@dtl at doreadraw?1?2>>>
 \gdef\@dtl at doreadraw?1?2<\relax
 \read?1 to \tmp
-\xdef?2<\tmp>\relax
+\protected at xdef?2<\tmp>\relax
 >
 \endgroup
 \begingroup

Modified: trunk/Master/texmf-dist/tex/latex/datatool/person.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/datatool/person.sty	2017-11-10 21:46:05 UTC (rev 45741)
+++ trunk/Master/texmf-dist/tex/latex/datatool/person.sty	2017-11-10 21:46:23 UTC (rev 45742)
@@ -7,11 +7,11 @@
 %% datatool.dtx  (with options: `person.sty,package')
 %% 
 %%  datatool.dtx
-%%  Copyright 2016 Nicola Talbot
+%%  Copyright 2017 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
-%%  of this license of (at your option) any later version.
+%%  of this license or (at your option) any later version.
 %%  The latest version of this license is in
 %%    http://www.latex-project.org/lppl.txt
 %%  and version 1.3 or later is part of all distributions of LaTeX
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{person}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{person}[2017/11/10 v2.28 (NLCT)]
 \RequirePackage{ifthen}
 \RequirePackage{datatool}
 \newcounter{people}



More information about the tex-live-commits mailing list