summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-07-11 23:29:36 +0000
committerKarl Berry <karl@freefriends.org>2013-07-11 23:29:36 +0000
commitced128389da6e12bc2da23bc40adfa2ee6eb7eec (patch)
tree52e007224ffd57a34c60740546dc7a1677c1e7e4
parentb863f2bfeab599875bf798ab734b9404f972625f (diff)
datatool (10jul13)
git-svn-id: svn://tug.org/texlive/trunk@31174 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/datatool/CHANGES29
-rw-r--r--Master/texmf-dist/doc/latex/datatool/README4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-code.pdfbin902217 -> 909585 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.pdfbin583806 -> 591809 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.tex235
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/data-raw-psaved.dbtex33
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/data-raw-saved.dbtex167
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/data-raw.dbtex166
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/data.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/data2.csv4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/exp25a.csv4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/exp25b.csv4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/exp30a.csv4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/fruit.csv6
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/groupa.csv11
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/groupb.csv11
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/index.csv4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/mydata.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/mynewdata.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/onecol.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/plotdata.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/polygon.csv6
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/profits.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/rawdata.csv2
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/rawdata2.csv2
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdfbin35087 -> 35087 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdfbin22872 -> 22872 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdfbin122656 -> 122606 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdfbin179885 -> 179639 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdfbin104039 -> 103763 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdfbin128873 -> 128798 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdfbin21885 -> 21885 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdfbin33977 -> 33977 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdfbin34628 -> 34628 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdfbin31764 -> 31764 bytes
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample3.csv4
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/sample4.csv5
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/scores2.csv10
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/semesterscores.csv7
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/students.csv7
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/studentscores.csv7
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/test-export-from-calc.csv3
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/test-missing-some-headers.csv2
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/test-rawtex.dbtex167
-rw-r--r--Master/texmf-dist/doc/latex/datatool/samples/test-scores.csv10
-rw-r--r--Master/texmf-dist/source/latex/datatool/datatool.dtx389
-rw-r--r--Master/texmf-dist/source/latex/datatool/datatool.ins2
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datagidx.sty73
-rw-r--r--Master/texmf-dist/tex/latex/datatool/dataplot.sty21
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool.sty112
51 files changed, 1387 insertions, 158 deletions
diff --git a/Master/texmf-dist/doc/latex/datatool/CHANGES b/Master/texmf-dist/doc/latex/datatool/CHANGES
index 657f9fc5724..65bda9bbd0b 100644
--- a/Master/texmf-dist/doc/latex/datatool/CHANGES
+++ b/Master/texmf-dist/doc/latex/datatool/CHANGES
@@ -1,3 +1,32 @@
+v2.15:
+
+ * datagidx:
+
+ - Removed spurious space in \do@locrange
+
+ - Added \loadgidx
+
+ - Added nowarn package option
+
+ - Fixed bug that occurred with locations occurring in
+ page-spanning paragraphs.
+
+ * datatool:
+
+ - added \dtllastloadeddb to \DTLsaverawdb etc
+
+ - fixed bug that caused \DTLsaverawdb to perform extremely slowly.
+ Now provide \DTLprotectedsaverawdb to save databases that contain
+ fragile commands.
+
+ - fixed bug in \DTLminforkeys
+
+ * dataplot:
+
+ - added \dtlplothandlermark
+
+ - fixed scoping issue with \DTLaddtoplotlegend
+
v2.14:
* datatool:
diff --git a/Master/texmf-dist/doc/latex/datatool/README b/Master/texmf-dist/doc/latex/datatool/README
index f9fa3ee5c74..9c1b881e04d 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.14
+LaTeX Bundle : datatool v2.15
-Last Modified : 2013-06-28
+Last Modified : 2013-07-10
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 1925afd9794..fde7720c668 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 ae0e4ce277e..f76bd3eefe8 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 d2cb0a0eb38..2caff13201c 100644
--- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
+++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
@@ -91,11 +91,11 @@
\MakeShortVerb{"}
\DeleteShortVerb{\|}
- \title{User Manual for datatool bundle version~2.14}
+ \title{User Manual for datatool bundle version~2.15}
\author{Nicola L.C. Talbot\\
\url{http://www.dickimaw-books.com/}}
- \date{2013-06-28}
+ \date{2013-07-10}
\maketitle
\pagenumbering{roman}
@@ -110,7 +110,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.14}
+ read \qt{Documented Code for datatool v2.15}
\item[INSTALL] Installation instructions.
@@ -147,6 +147,9 @@ numerical and string functions. Automatically
loads \sty{datatool-fp} or \sty{datatool-pgfmath} depending on
package options.
+\item[\sty{datagidx}] Package for generating indexes and glossaries.
+Automatically loads \sty{datatool}.
+
\item[\sty{databar}] Package for drawing bar charts.
Automatically loads \sty{datatool}.
@@ -211,18 +214,20 @@ and the second uses the \sty{pgfmath} package:
\changes{1.0}{2007 July 22}{Initial version}
The \sty{datatool} bundle consists of the following
-packages: \sty{datatool} (which loads \sty{datatool-base} and either \sty{datatool-fp} or \sty{datatool-pgfmath}), \sty{datapie}, \sty{dataplot},
-\sty{databar} and \sty{databib}.
+packages: \sty{datatool} (which loads \sty{datatool-base} and either
+\sty{datatool-fp} or \sty{datatool-pgfmath}), \sty{datagidx}, \sty{datapie}, \sty{dataplot},
+\sty{databar}, \sty{databib} and \sty{person}.
-The \sty{datatool} package can be used to:
+\begin{itemize}
+\item The \sty{datatool} package can be used to:
\begin{itemize}
\item Create or load databases.
\item Sort rows of a database (either numerically or alphabetically,
ascending or descending).
\item Perform repetitive operations on each row of a database
(e.g.\ mail merging). Conditions may be imposed to exclude rows.
-
-\item Package Options:
+\end{itemize}
+Package Options:
\begin{description}
\item[\pkgopt{verbose}] Boolean key. If
\pkgoptval{true}{verbose}, prints informational messages in
@@ -236,9 +241,8 @@ ascending or descending).
\item[\pkgopt{separator}] Delimiter used in CSV files.
Default is a comma (\texttt{,}).
\end{description}
-\end{itemize}
-The \sty{datatool-base} package can be used to:
+\item The \sty{datatool-base} package can be used to:
\begin{itemize}
\item Determine whether an argument is an integer, a real number,
currency or a string. (Scientific notation is currently not
@@ -251,8 +255,8 @@ arithmetic to be performed on elements of the database.
\item Names can be converted to initials.
\item Determine if strings are all upper or lower case.
\item Perform string comparisons (both case sensitive and case insensitive).
-
-\item Package Options:
+\end{itemize}
+Package Options:
\begin{description}
\item[\pkgopt{verbose}] Boolean key. If
\pkgoptval{true}{verbose}, prints informational messages in
@@ -262,9 +266,12 @@ arithmetic to be performed on elements of the database.
\pkgoptval{pgfmath}{math} (load \sty{datatool-pgfmath}). Default is:
\pkgoptval{fp}{math}.
\end{description}
-\end{itemize}
-The \sty{datapie} package (see \autoref{sec:datapie}) can be used to convert a database into
+\item The \sty{datagidx} package (see \autoref{sec:datagidx}) can be used
+to generate indexes or glossaries as an alternative to packages
+such as \sty{glossaries}.
+
+\item The \sty{datapie} package (see \autoref{sec:datapie}) can be used to convert a database into
a pie chart:
\begin{itemize}
\item Segments can be separated from the rest of the chart to make
@@ -274,7 +281,7 @@ them stand out.
\item Hooks provided to add extra information to the chart
\end{itemize}
-The \sty{databar} package (see \autoref{sec:databar}) can be used to convert a database into
+\item The \sty{databar} package (see \autoref{sec:databar}) can be used to convert a database into
a bar chart:
\begin{itemize}
\item Colour/grey scale options.
@@ -290,13 +297,19 @@ dimensional graphics cause distortion, which can result in misleading
impressions. The \sty{pgf} manual provides a more in-depth
discussion on the matter.)
-The \sty{dataplot} package (see \autoref{sec:dataplot}) can be used to convert a database into
+\item The \sty{dataplot} package (see \autoref{sec:dataplot}) can be used to convert a database into
a two dimensional plot using markers and/or lines. Three dimensional
plots are currently not supported.
-The \sty{databib} package (see \autoref{sec:databib}) can be used to convert a \BibTeX\ database
+\item The \sty{databib} package (see \autoref{sec:databib}) can be used to convert a \BibTeX\ database
into a \sty{datatool} database.
+\item The \sty{person} package (see \autoref{sec:person}) can be
+used for gender-specific mail-merging and similar uses to avoid the
+cumbersome use of the impersonal \qt{he\slash she}.
+
+\end{itemize}
+
\chapter{Data Types}
\label{sec:datatypes}
@@ -2017,12 +2030,12 @@ described in \autoref{sec:advanced}, but using \TeX\ is nowhere near
as efficient as, say, using a SQL database, so don't expect too much
from this package.
-
+\label{datatooltk}%
I'm working on a Java helper application to accompany \sty{datatool}
called \app{datatooltk}. The source code is available on GitHub at
\url{https://github.com/nlct/datatooltk}. I'll upload it to CTAN
when it's ready for release. The application will allow you to edit
-files saved using \ics{DTLsaverawdb} in a~graphical interface or
+files saved using \ics{DTLsaverawdb} or \ics{DTLprotectedsaverawdb} in a~graphical interface or
import data from a~SQL database, a~CSV file or a~\sty{probsoln}
dataset.
@@ -2184,12 +2197,23 @@ exists.
\section{Loading a Database from an External ASCII File}
\label{sec:loaddb}
+\begin{important}
+\cs{DTLloaddb} and \cs{DTLloadrawdb}, described in this section, can't
+parse files that have newline characters within entries. The
+\app{datatooltk} application (see page~\pageref{datatooltk}) can
+parse them, so if you have multilined entries in a CSV file, you
+can convert it to \sty{datatool}'s internal database format using
+\app{datatooltk} and the input it using \ics{input}. See the
+\app{datatooltk} documentation for further details.
+\end{important}
+
Instead of using the commands described in \autoref{sec:newdb}
to create a new database, you can load a database from an
external ASCII file using:
\begin{definition}[\DescribeMacro{\DTLloaddb}]%
\cs{DTLloaddb}\oarg{options}\marg{db name}\marg{filename}
\end{definition}
+
\begin{important}
Make sure your document uses the same encoding as \meta{filename}.
For example, if \meta{filename} is UTF-8, then include the following
@@ -4789,7 +4813,32 @@ readability you can use:
\cs{DTLsaverawdb}\marg{db name}\marg{filename}
\end{definition}
This saves the database to \meta{filename} in its internal
-representation, which makes it faster to load.
+representation, which makes it faster to load. Fragile commands
+cause a~problem for \cs{DTLsaverawdb} so if your database contains
+any use:
+\begin{definition}[\DescribeMacro{\DTLprotectedsaverawdb}]%
+\cs{DTLprotectedsaverawdb}\marg{db name}\marg{filename}
+\end{definition}
+instead.
+
+\begin{important}
+If you find a~problem caused by \TeX's automatic insertion of a line
+break every 80 characters when writing to a file, try loading the
+\sty{morewrites} package before \sty{datatool}.
+\end{important}
+
+Databases saved using \cs{DTLsavetexdb}, \cs{DTLsaverawdb} and
+\cs{DTLprotectedsaverawdb} can be loaded using \LaTeX's standard
+\ics{input} command. As from version 2.15, the last line of the
+database file defines
+\begin{definition}[\DescribeMacro{\dtllastloadeddb}]
+\cs{dtllastloadeddb}
+\end{definition}
+to the name of the database, in case it's required.
+
+Databases saved using \cs{DTLsaverawdb} and
+\cs{DTLprotectedsaverawdb} can also be loaded and edited by
+\app{datatooltk} (see page~\pageref{datatooltk}).
\section{Deleting or Clearing a Database}\label{sec:deletedb}
@@ -5208,7 +5257,45 @@ If, however, you are happy to exchange efficiency for the
convenience of not having to invoke an external application in
between \LaTeX\ runs, read on.
+Sections~\ref{sec:newgidx} and~\ref{sec:newterm} describe how to
+create and populate a database that's used to store terms or
+acronyms. By default the database is sorted when it's displayed
+using \ics{printterms} (see section~\ref{sec:printterms}). This is
+where the main inefficiency lies in this package. A~faster
+alternative is to use \app{datatooltk} (see page~\pageref{datatooltk})
+and its \texttt{datagidx} plugin, which will allow you to enter
+terms in a graphical environment and sort the terms. This way, you
+only need to sort the database after you enter a new term and the
+sorting is done by a more efficient language than \TeX. Note that
+this means returning to using an external helper application, but it
+only needs to be used when you add a new term rather than between
+each pair of \LaTeX\ runs.
+
+Once you've edited and sorted the database in \app{datatooltk},
+you can then just load it using:
+\begin{definition}[\DescribeMacro{\loadgidx}]
+\cs{loadgidx}\oarg{options}\marg{filename}\marg{title}
+\end{definition}
+where \meta{filename} is the name of the file saved in
+\app{datatooltk}. The remaining arguments \meta{options} and
+\meta{title} are the same as for \cs{newgidx}, described in
+section~\ref{sec:newgidx}. This command automatically sets the
+default database to the loaded database. You can change the default
+database using \cs{DTLgidxSetDefaultDB}, described in
+section~\ref{sec:newterm}.
+
+Since \cs{loadgidx} is intended for use with presorted databases,
+the \csopt{loadgidx}{sort} key defaults to nothing.
+
+\begin{important}
+If you've opted to use \sty{datagidx} over \sty{glossaries} because
+you don't want to install Perl, then don't bother with
+\app{datatooltk} because, although it's a Java application, it requires
+Perl for the plugins.
+\end{important}
+
\section{Defining Index/Glossary Databases}
+\label{sec:newgidx}
\begin{important}
The databases and their associated entries described here can only
@@ -5218,13 +5305,14 @@ place by constantly returning to the preamble to add a new term
while you edit your document, consider putting all your definitions
in a separate file which can be \cs{input} in the preamble.
You can then switch between files without losing your place
-(provided you are using a decent text editor).
+(provided you are using a decent text editor). Alternatively, use
+\app{datatooltk}'s \texttt{datagidx} plugin as described above.
\end{important}
First you need to define a customised database that will be used to
store the entries in your index, glossary or list of acronyms:
\begin{definition}[\DescribeMacro\newgidx]
-\cs{newgidx}\marg{label}\marg{title}
+\cs{newgidx}\oarg{options}\marg{label}\marg{title}
\end{definition}
This defines a new database with a unique label and a title.
For example:
@@ -5235,6 +5323,35 @@ I can now identify this database using the label \texttt{index}. The
title ``Index'' is the default heading when the database is
displayed using \cs{printterms} (see \autoref{sec:printterms}).
+The optional argument \meta{options} should be a key=value list.
+Available options:
+\begin{description}
+\item[\csopt{newgidx}{showgroups}] Boolean option that indicates
+whether or not to insert group headings (and a group separator)
+between index groups, if headings are supported by the given style.
+If no value is supplied, \textsf{true} is assumed.
+
+\item[\csopt{newgidx}{style}] The style to use. The value should
+be the name of the style. Available styles are listed in
+\autoref{sec:indexstyles}.
+
+\item[\csopt{newgidx}{sort}] How to sort the database. See
+\autoref{sec:indexsort} for further details.
+
+\item[\csopt{newgidx}{balance}] This is a boolean option that
+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.
+
+\item[\csopt{newgidx}{heading}] The heading at the start of the
+index/glossary.
+
+\item[\csopt{newgidx}{postheading}] What to put immediately after
+the heading.
+
+\end{description}
+
\section{Locations}
\label{sec:locations}
@@ -5316,6 +5433,8 @@ each new term. Instead you can identify the default database using
\begin{definition}[\DescribeMacro\DTLgidxSetDefaultDB]
\cs{DTLgidxSetDefaultDB}\marg{label}
\end{definition}
+\textbf{Note:} the argument \meta{label} is not expanded.
+
Example:
\begin{verbatim}
% define two indexes:
@@ -5343,7 +5462,11 @@ extracted from \meta{name} (see below).
extracted from \meta{name} (see below).
\item[\csopt{newterm}{parent}] The parent entry, if this is a
-sub-term.
+sub-term. An entry may only have one parent. If you want the same
+term to appear under two different parents, you'll have to define
+two separate terms with the same name but different parents (and
+different labels). This is the only way to avoid ambiguity with the
+hyperlinks (if enabled).
\item[\csopt{newterm}{text}] How the entry should appear in the
document text. This is \meta{name} by default. If this option is
@@ -6513,6 +6636,9 @@ target names.
\item[\pkgopt{verbose}] Use \sty{datatool}'s verbose mode.
+\item[\pkgopt{nowarn}] A boolean option that suppresses
+\sty{datagidx}'s rerun warnings.
+
\end{description}
\begin{example}{Creating an Index}{ex:index}
@@ -6572,16 +6698,11 @@ starts with an accented letter. A \gls{crocodylian} is a family of
The index can then be displayed using:
\begin{verbatim}
-\printterms
- [
- heading={\section*},
- database=index
- ]
+\printterms[heading={\section*},database=index]
\end{verbatim}
This requires two runs to ensure the index is up-to-date. The
resulting index is as follows:
-\newpage
\printterms
[
heading={\section*},
@@ -7540,7 +7661,17 @@ and
They are both defined to do nothing by default, but can be redefined
to add commands to the image. The unit vectors are set prior to
using these hooks, so you can use the same co-ordinates as those
-in the data sets.
+in the data sets. However, to reduce the problem of exceeding \TeX's
+maximum dimension, \cs{DTLplot} scales the plot which may distort
+plot marks. To get around this use
+\begin{definition}[\DescribeMacro{\dtlplothandlermark}]
+\cs{dtlplothandlermark}\marg{pgf code}
+\end{definition}
+instead of \ics{pgfplothandlermark}\marg{pgf code}. (See
+\autoref{ex:multikey}.) Note that \cs{dtlplothandlermark} is only
+intended for use within the definition of \cs{DTLplotatbegintikz} or
+\cs{DTLplotatendtikz}. If used elsewhere it will produce a warning
+and act as though you'd just used \cs{pgfplothandlermark}.
\begin{definition}[\DescribeMacro{\DTLaddtoplotlegend}]%
\cs{DTLaddtoplotlegend}\marg{marker}\marg{line style}\marg{text}
@@ -7855,28 +7986,28 @@ in \autoref{ex:2db}. Instead I can use a combination of
\begin{verbatim}
\begin{figure}[tbhp]
\centering
- % computer bounds
+ % compute bounds
\DTLminforkeys{growth}{Time}{\minX}
\DTLminforkeys{growth}{Experiment 1,Experiment 2}{\minY}
\DTLmaxforkeys{growth}{Time}{\maxX}
\DTLmaxforkeys{growth}{Experiment 1,Experiment 2}{\maxY}
- % round x tick labels
-\setcounter{DTLplotroundXvar}{0}
+ % round x tick labels to 1 d.p.
+\setcounter{DTLplotroundXvar}{1}
% redefine \DTLplotatbegintikz to plot the data for Experiment 1
\renewcommand*{\DTLplotatbegintikz}{%
- % set plot mark
-\pgfplothandlermark{\color{green}\pgfuseplotmark{x}}
- % start plot stream
-\pgfplotstreamstart
- % add data from Experiment 1 to plot stream
-\DTLplotstream{growth}{Time}{Experiment 1}%
- % end plot stream
-\pgfplotstreamend
- % stroke path
-\pgfusepath{stroke}
- % add information to legend (no line is require so use \relax)
-\DTLaddtoplotlegend{\color{green}%
-\pgfuseplotmark{x}}{\relax}{Experiment 1}
+ % set plot mark
+ \dtlplothandlermark{\color{green}\pgfuseplotmark{x}}
+ % start plot stream
+ \pgfplotstreamstart
+ % add data from Experiment 1 to plot stream
+ \DTLplotstream{growth}{Time}{Experiment 1}%
+ % end plot stream
+ \pgfplotstreamend
+ % stroke path
+ \pgfusepath{stroke}
+ % add information to legend (no line is require so use \relax)
+ \DTLaddtoplotlegend{\color{green}%
+ \pgfuseplotmark{x}}{\relax}{Experiment 1}
}
% now plot the data for Experiment 2
\DTLplot{growth}{x=Time,y=Experiment 2,legend,
@@ -7893,12 +8024,12 @@ Notes:
the new plot to the legend, since \ics{DTLplotatendtikz} is
used after the legend is plotted. The $x$ and $y$ unit vectors
are set before \ics{DTLplotatbegintikz} so I don't need to
-worry about the co-ordinates.
-\item I set the counter \ctr{DTLplotroundXvar} to zero
-otherwise the $x$ axis would have looked too cluttered.
+worry about the co-ordinates, however I've had to use
+\ics{dtlplothandlermark} instead of \ics{pgfplothandlermark}
+to prevent the plot marks from being distorted.
\item I have used \ics{DTLminforkeys} and \ics{DTLmaxforkeys} to
determine the bounds since \ics{DTLplot} won't take the data
-for Experiment 1 into account when computing the bounds.
+for Experiment~1 into account when computing the bounds.
\end{itemize}
\begin{figure}[htbp]
@@ -7906,9 +8037,9 @@ for Experiment 1 into account when computing the bounds.
\DTLminforkeys{growth}{Experiment 1,Experiment 2}{\minY}
\DTLmaxforkeys{growth}{Time}{\maxX}
\DTLmaxforkeys{growth}{Experiment 1,Experiment 2}{\maxY}
-\setcounter{DTLplotroundXvar}{0}
+\setcounter{DTLplotroundXvar}{1}
\renewcommand*{\DTLplotatbegintikz}{%
-\pgfplothandlermark{\color{green}\pgfuseplotmark{x}}
+\dtlplothandlermark{\color{green}\pgfuseplotmark{x}}
\pgfplotstreamstart
\DTLplotstream{growth}{Time}{Experiment 1}%
\pgfplotstreamend
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/data-raw-psaved.dbtex b/Master/texmf-dist/doc/latex/datatool/samples/data-raw-psaved.dbtex
new file mode 100644
index 00000000000..24c32fd469c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/data-raw-psaved.dbtex
@@ -0,0 +1,33 @@
+\DTLifdbexists{mydata}%
+{\PackageError{datatool}{Database `mydata'
+already exists}{}%
+\aftergroup\endinput}{}%
+\bgroup\makeatletter
+\dtl@message{Reconstructing database
+`mydata'}%
+\expandafter\global\expandafter
+\newtoks\csname dtlkeys@mydata\endcsname
+\expandafter\global
+ \csname dtlkeys@mydata\endcsname={%
+\db@plist@elt@w \db@col@id@w 1\db@col@id@end@ \db@key@id@w Incubation Temperature\db@key@id@end@ \db@type@id@w 1\db@type@id@end@ \db@header@id@w Incubation Temperature\db@header@id@end@ \db@col@id@w 1\db@col@id@end@ \db@plist@elt@end@ \db@plist@elt@w \db@col@id@w 2\db@col@id@end@ \db@key@id@w Incubation Time\db@key@id@end@ \db@type@id@w 1\db@type@id@end@ \db@header@id@w Incubation Time\db@header@id@end@ \db@col@id@w 2\db@col@id@end@ \db@plist@elt@end@ \db@plist@elt@w \db@col@id@w 3\db@col@id@end@ \db@key@id@w Time to Growth\db@key@id@end@ \db@type@id@w 1\db@type@id@end@ \db@header@id@w Time to Growth\db@header@id@end@ \db@col@id@w 3\db@col@id@end@ \db@plist@elt@end@ }
+\expandafter\global\expandafter
+\newtoks\csname dtldb@mydata\endcsname
+\expandafter\global
+\csname dtldb@mydata\endcsname={%
+\db@row@elt@w \db@row@id@w 1\db@row@id@end@ \db@col@id@w 1\db@col@id@end@ \db@col@elt@w 40\db@col@elt@end@ \db@col@id@w 1\db@col@id@end@ \db@col@id@w 2\db@col@id@end@ \db@col@elt@w 120\db@col@elt@end@ \db@col@id@w 2\db@col@id@end@ \db@col@id@w 3\db@col@id@end@ \db@col@elt@w 40\db@col@elt@end@ \db@col@id@w 3\db@col@id@end@ \db@row@id@w 1\db@row@id@end@ \db@row@elt@end@ \db@row@elt@w \db@row@id@w 2\db@row@id@end@ \db@col@id@w 1\db@col@id@end@ \db@col@elt@w 40\db@col@elt@end@ \db@col@id@w 1\db@col@id@end@ \db@col@id@w 2\db@col@id@end@ \db@col@elt@w 90\db@col@elt@end@ \db@col@id@w 2\db@col@id@end@ \db@col@id@w 3\db@col@id@end@ \db@col@elt@w 60\db@col@elt@end@ \db@col@id@w 3\db@col@id@end@ \db@row@id@w 2\db@row@id@end@ \db@row@elt@end@ \db@row@elt@w \db@row@id@w 3\db@row@id@end@ \db@col@id@w 1\db@col@id@end@ \db@col@elt@w 35\db@col@elt@end@ \db@col@id@w 1\db@col@id@end@ \db@col@id@w 2\db@col@id@end@ \db@col@elt@w 180\db@col@elt@end@ \db@col@id@w 2\db@col@id@end@ \db@col@id@w 3\db@col@id@end@ \db@col@elt@w 20\db@col@elt@end@ \db@col@id@w 3\db@col@id@end@ \db@row@id@w 3\db@row@id@end@ \db@row@elt@end@ \db@row@elt@w \db@row@id@w 4\db@row@id@end@ \db@col@id@w 1\db@col@id@end@ \db@col@elt@w 55\db@col@elt@end@ \db@col@id@w 1\db@col@id@end@ \db@col@id@w 2\db@col@id@end@ \db@col@elt@w 190\db@col@elt@end@ \db@col@id@w 2\db@col@id@end@ \db@col@id@w 3\db@col@id@end@ \db@col@elt@w 40\db@col@elt@end@ \db@col@id@w 3\db@col@id@end@ \db@row@id@w 4\db@row@id@end@ \db@row@elt@end@ }
+\expandafter\global
+ \expandafter\newcount\csname dtlrows@mydata\endcsname
+\expandafter\global
+ \csname dtlrows@mydata\endcsname=4\relax
+\expandafter\global
+ \expandafter\newcount\csname dtlcols@mydata\endcsname
+\expandafter\global
+ \csname dtlcols@mydata\endcsname=3\relax
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Temperature\endcsname{1}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Time\endcsname{2}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Time to Growth\endcsname{3}%
+\egroup
+\def\dtllastloadeddb{mydata}
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/data-raw-saved.dbtex b/Master/texmf-dist/doc/latex/datatool/samples/data-raw-saved.dbtex
new file mode 100644
index 00000000000..c4eca6df538
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/data-raw-saved.dbtex
@@ -0,0 +1,167 @@
+\DTLifdbexists{mydata}%
+{\PackageError{datatool}{Database `mydata'
+already exists}{}%
+\aftergroup\endinput}{}%
+\bgroup\makeatletter
+\dtl@message{Reconstructing database
+`mydata'}%
+\expandafter\global\expandafter
+\newtoks\csname dtlkeys@mydata\endcsname
+\expandafter\global
+ \csname dtlkeys@mydata\endcsname={%
+%
+\db@plist@elt@w %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@key@id@w Incubation Temperature%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Incubation Temperature%
+\db@header@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@plist@elt@end@ %
+\db@plist@elt@w %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@key@id@w Incubation Time%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Incubation Time%
+\db@header@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@plist@elt@end@ %
+\db@plist@elt@w %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@key@id@w Time to Growth%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Time to Growth%
+\db@header@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@plist@elt@end@
+}%
+\expandafter\global\expandafter
+\newtoks\csname dtldb@mydata\endcsname
+\expandafter\global
+\csname dtldb@mydata\endcsname={%
+%
+\db@row@elt@w %
+\db@row@id@w 1%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 120%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 1%
+\db@row@id@end@ %
+\db@row@elt@end@ %
+\db@row@elt@w %
+\db@row@id@w 2%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 90%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 60%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 2%
+\db@row@id@end@ %
+\db@row@elt@end@ %
+\db@row@elt@w %
+\db@row@id@w 3%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 35%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 180%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 20%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 3%
+\db@row@id@end@ %
+\db@row@elt@end@ %
+\db@row@elt@w %
+\db@row@id@w 4%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 55%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 190%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 4%
+\db@row@id@end@ %
+\db@row@elt@end@
+}%
+\expandafter\global
+ \expandafter\newcount\csname dtlrows@mydata\endcsname
+\expandafter\global
+ \csname dtlrows@mydata\endcsname=4\relax
+\expandafter\global
+ \expandafter\newcount\csname dtlcols@mydata\endcsname
+\expandafter\global
+ \csname dtlcols@mydata\endcsname=3\relax
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Temperature\endcsname{1}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Time\endcsname{2}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Time to Growth\endcsname{3}%
+\egroup
+\def\dtllastloadeddb{mydata}
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/data-raw.dbtex b/Master/texmf-dist/doc/latex/datatool/samples/data-raw.dbtex
new file mode 100644
index 00000000000..e6d99175d04
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/data-raw.dbtex
@@ -0,0 +1,166 @@
+\DTLifdbexists{mydata}%
+{\PackageError{datatool}{Database `mydata'
+already exists}{}%
+\aftergroup\endinput}{}%
+\bgroup\makeatletter
+\dtl@message{Reconstructing database
+`mydata'}%
+\expandafter\global\expandafter
+\newtoks\csname dtlkeys@mydata\endcsname
+\expandafter\global
+ \csname dtlkeys@mydata\endcsname={%
+%
+\db@plist@elt@w %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@key@id@w Incubation Temperature%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Incubation Temperature%
+\db@header@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@plist@elt@end@ %
+\db@plist@elt@w %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@key@id@w Incubation Time%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Incubation Time%
+\db@header@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@plist@elt@end@ %
+\db@plist@elt@w %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@key@id@w Time to Growth%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Time to Growth%
+\db@header@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@plist@elt@end@
+}%
+\expandafter\global\expandafter
+\newtoks\csname dtldb@mydata\endcsname
+\expandafter\global
+\csname dtldb@mydata\endcsname={%
+%
+\db@row@elt@w %
+\db@row@id@w 1%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 120%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 1%
+\db@row@id@end@ %
+\db@row@elt@end@ %
+\db@row@elt@w %
+\db@row@id@w 2%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 90%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 60%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 2%
+\db@row@id@end@ %
+\db@row@elt@end@ %
+\db@row@elt@w %
+\db@row@id@w 3%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 35%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 180%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 20%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 3%
+\db@row@id@end@ %
+\db@row@elt@end@ %
+\db@row@elt@w %
+\db@row@id@w 4%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 55%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 190%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 4%
+\db@row@id@end@ %
+\db@row@elt@end@
+}%
+\expandafter\global
+ \expandafter\newcount\csname dtlrows@mydata\endcsname
+\expandafter\global
+ \csname dtlrows@mydata\endcsname=4\relax
+\expandafter\global
+ \expandafter\newcount\csname dtlcols@mydata\endcsname
+\expandafter\global
+ \csname dtlcols@mydata\endcsname=3\relax
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Temperature\endcsname{1}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Time\endcsname{2}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Time to Growth\endcsname{3}%
+\egroup
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/data.csv b/Master/texmf-dist/doc/latex/datatool/samples/data.csv
new file mode 100644
index 00000000000..d04c806f912
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/data.csv
@@ -0,0 +1,5 @@
+Incubation Temperature,Incubation Time,Time to Growth
+40,120,40
+40,90,60
+35,180,20
+55,190,40
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/data2.csv b/Master/texmf-dist/doc/latex/datatool/samples/data2.csv
new file mode 100644
index 00000000000..5225a7b75e1
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/data2.csv
@@ -0,0 +1,4 @@
+40,120,40
+40,90,60
+35,180,20
+55,190,40
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/exp25a.csv b/Master/texmf-dist/doc/latex/datatool/samples/exp25a.csv
new file mode 100644
index 00000000000..66f1ccbff1b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/exp25a.csv
@@ -0,0 +1,4 @@
+Time,Log Count
+0,3.75
+23,3.9
+45,4.0
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/exp25b.csv b/Master/texmf-dist/doc/latex/datatool/samples/exp25b.csv
new file mode 100644
index 00000000000..58e1061e732
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/exp25b.csv
@@ -0,0 +1,4 @@
+Time,Log Count
+0,3.6
+60,3.8
+120,4.0
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/exp30a.csv b/Master/texmf-dist/doc/latex/datatool/samples/exp30a.csv
new file mode 100644
index 00000000000..bac369ecea7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/exp30a.csv
@@ -0,0 +1,4 @@
+Time,Log Count
+0,3.73
+23,3.67
+60,4.9
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/fruit.csv b/Master/texmf-dist/doc/latex/datatool/samples/fruit.csv
new file mode 100644
index 00000000000..9bc12a154c6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/fruit.csv
@@ -0,0 +1,6 @@
+Name,Value
+"Apples",30
+"Pears",25
+"lemons,limes",40.5
+"Peaches",34.5
+"Cherries",20
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/groupa.csv b/Master/texmf-dist/doc/latex/datatool/samples/groupa.csv
new file mode 100644
index 00000000000..a64f6560704
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/groupa.csv
@@ -0,0 +1,11 @@
+Height,Weight
+1.54,48.0
+1.55,45.4
+1.56,58.0
+1.56,50.2
+1.57,46.0
+1.58,48.3
+1.59,56.5
+1.59,58.1
+1.60,60.9
+1.62,56.3
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/groupb.csv b/Master/texmf-dist/doc/latex/datatool/samples/groupb.csv
new file mode 100644
index 00000000000..6a6304f2e5c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/groupb.csv
@@ -0,0 +1,11 @@
+Height,Weight
+1.54,48.4
+1.54,42.0
+1.55,64.0
+1.56,58.2
+1.56,49.0
+1.57,40.3
+1.58,51.5
+1.58,63.1
+1.59,74.9
+1.59,59.3
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/index.csv b/Master/texmf-dist/doc/latex/datatool/samples/index.csv
new file mode 100644
index 00000000000..87317a48c82
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/index.csv
@@ -0,0 +1,4 @@
+File,Temperature,NaCl,pH
+exp25a.csv,25,4.7,0.5
+exp25b.csv,25,4.8,1.5
+exp30a.csv,30,5.12,4.5
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/mydata.csv b/Master/texmf-dist/doc/latex/datatool/samples/mydata.csv
new file mode 100644
index 00000000000..69a0717c169
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/mydata.csv
@@ -0,0 +1,5 @@
+FirstName,Surname,Score
+Jane,Brown,75
+John,"Smith, Jr",68
+Z\"oe,Adams,52
+Andy,Brown,42
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/mynewdata.csv b/Master/texmf-dist/doc/latex/datatool/samples/mynewdata.csv
new file mode 100644
index 00000000000..51d773964cf
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/mynewdata.csv
@@ -0,0 +1,5 @@
+"Product","Quantity","Price","Description"
+Book,3,\$10.99,An interesting book\DTLpar(or so I thought!)
+DVD,1,\$12.55,A bit boring
+CD,2,\$5.99,My favourite!
+Tape,0,\$2.00,
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/onecol.csv b/Master/texmf-dist/doc/latex/datatool/samples/onecol.csv
new file mode 100644
index 00000000000..ecaff40a380
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/onecol.csv
@@ -0,0 +1,5 @@
+Column
+A
+B
+C
+D
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/plotdata.csv b/Master/texmf-dist/doc/latex/datatool/samples/plotdata.csv
new file mode 100644
index 00000000000..2823355ba51
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/plotdata.csv
@@ -0,0 +1,5 @@
+x,y
+0,0
+1,1
+2,0.5
+1.5,0.3
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/polygon.csv b/Master/texmf-dist/doc/latex/datatool/samples/polygon.csv
new file mode 100644
index 00000000000..326dfd5f1be
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/polygon.csv
@@ -0,0 +1,6 @@
+x,y
+0.5,3
+2,1
+5,1.2
+6.5,4
+2.3,5
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/profits.csv b/Master/texmf-dist/doc/latex/datatool/samples/profits.csv
new file mode 100644
index 00000000000..474c1dd41a3
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/profits.csv
@@ -0,0 +1,5 @@
+Year,Profit
+2000,"\pounds 2,525"
+2001,"\pounds 3,752"
+2002,"-\pounds 1,520"
+2003,"\pounds 1,270"
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/rawdata.csv b/Master/texmf-dist/doc/latex/datatool/samples/rawdata.csv
new file mode 100644
index 00000000000..e5d0235539c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/rawdata.csv
@@ -0,0 +1,2 @@
+Product,Cost,Comments
+Fruit & Veg,£0.50,Contains special characters # { } ^ _ ~ % manœuvre
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/rawdata2.csv b/Master/texmf-dist/doc/latex/datatool/samples/rawdata2.csv
new file mode 100644
index 00000000000..3c93ef607b7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/rawdata2.csv
@@ -0,0 +1,2 @@
+Fruit & Veg,£0.50
+Cake & Biscuits,£0.80
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 f577cf34278..bdb343e3dc5 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 7cf69ccb5bb..5a700b54650 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-datatooltk.tex b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex
index dec5f1582bb..23ea4a98245 100644
--- a/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex
@@ -16,4 +16,8 @@
% Save to a new file to test \DTLsaverawdb:
\DTLsaverawdb{mydata}{data-raw-saved.dbtex}
+
+% Now try the protected version:
+
+\DTLprotectedsaverawdb{mydata}{data-raw-psaved.dbtex}
\end{document}
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 525cbcde12f..9899148d876 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-gidx.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf
index 26100c2a282..20cc564ac16 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 241bf8295e3..c54a75176af 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 b1acc29d28d..80060752d9d 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 ffe0f8ad7bc..da04184da04 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 c8b3a8d3ebf..7c503175ca9 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-student-scores.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf
index c8edaa3ee32..5061df422ce 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 53785b034ce..ac91bad3ee2 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/doc/latex/datatool/samples/sample3.csv b/Master/texmf-dist/doc/latex/datatool/samples/sample3.csv
new file mode 100644
index 00000000000..69fd4c6c5a2
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample3.csv
@@ -0,0 +1,4 @@
+File,Caption
+circle.png,A Circle
+rectangle.png,A Rectangle
+triangle.png,A Triangle
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample4.csv b/Master/texmf-dist/doc/latex/datatool/samples/sample4.csv
new file mode 100644
index 00000000000..6a6b89984be
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/sample4.csv
@@ -0,0 +1,5 @@
+Name,Assignment 1,Assignment 2,Total
+A. Smith,80,70,150
+B. Jones,60,80,140
+J. Doe,85,75,160
+,75,75,150
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/scores2.csv b/Master/texmf-dist/doc/latex/datatool/samples/scores2.csv
new file mode 100644
index 00000000000..4ef8fd6f50b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/scores2.csv
@@ -0,0 +1,10 @@
+FirstName,Surname,StudentNo,Score
+John,"Smith, Jr",102689,68
+Jane,Brown,102647,75
+Andy,Brown,103569,42
+Z\"oe,Adams,105987,52
+Roger,Brady,106872,58
+Clare,Verdon,104356,45
+Henk,\switchargs{Mere}{van der },106789,71
+Jos,\switchargs{Mere}{de la },104256,58
+
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/semesterscores.csv b/Master/texmf-dist/doc/latex/datatool/samples/semesterscores.csv
new file mode 100644
index 00000000000..059653cca47
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/semesterscores.csv
@@ -0,0 +1,7 @@
+FirstName,Surname,StudentNumber,Assignment 1,Assignment 2,Assignment 3
+John,"Smith, Jr",102689,68,57,72
+Jane,Brown,102647,75,84,80
+Andy,Brown,103569,42,52,54
+Z\"oe,Adams,105987,52,48,57
+Roger,Brady,106872,58,60,62
+Clare,Vernon,104356,45,50,48
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/students.csv b/Master/texmf-dist/doc/latex/datatool/samples/students.csv
new file mode 100644
index 00000000000..a97af0e0532
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/students.csv
@@ -0,0 +1,7 @@
+FirstName,Surname,StudentNumber,Gender,Parent
+John,"Smith, Jr",102689,M,Mr and Mrs Smith
+Jane,Brown,102647,F,Ms Brown
+Andy,Brown,103569,male,Mr Brown and Miss Sepia
+Z\"oe,Adams,105987,f,Mr and Mrs Adams
+Roger,Brady,106872,m,Mrs Brady
+Clare,Vernon,104356,female,Mr Vernon
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/studentscores.csv b/Master/texmf-dist/doc/latex/datatool/samples/studentscores.csv
new file mode 100644
index 00000000000..bbc0b6fe009
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/studentscores.csv
@@ -0,0 +1,7 @@
+FirstName,Surname,StudentNumber,Score
+John,"Smith, Jr",102689,68
+Jane,Brown,102647,75
+Andy,Brown,103569,42
+Z\"oe,Adams,105987,52
+Roger,Brady,106872,58
+Clare,Vernon,104356,45
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/test-export-from-calc.csv b/Master/texmf-dist/doc/latex/datatool/samples/test-export-from-calc.csv
new file mode 100644
index 00000000000..9b925647d0b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/test-export-from-calc.csv
@@ -0,0 +1,3 @@
+"Header 1","Header 2"
+"Some text","Some “quoted text”"
+"More text","More ""quoted text"""
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/test-missing-some-headers.csv b/Master/texmf-dist/doc/latex/datatool/samples/test-missing-some-headers.csv
new file mode 100644
index 00000000000..ace933f2d08
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/test-missing-some-headers.csv
@@ -0,0 +1,2 @@
+Header A,Header B,,Header C,,Header D
+1,2,3,4,5,6
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/test-rawtex.dbtex b/Master/texmf-dist/doc/latex/datatool/samples/test-rawtex.dbtex
new file mode 100644
index 00000000000..06ef7022ac4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/test-rawtex.dbtex
@@ -0,0 +1,167 @@
+% saved by datatooltk Sun Mar 10 15:36:03 2013
+\DTLifdbexists{mydata}%
+{\PackageError{datatool}{Database `mydata'
+already exists}{}%
+\aftergroup\endinput}{}%
+\bgroup\makeatletter
+\dtl@message{Reconstructing database
+`mydata'}%
+\expandafter\global\expandafter
+\newtoks\csname dtlkeys@mydata\endcsname
+\expandafter\global
+ \csname dtlkeys@mydata\endcsname={%
+%
+\db@plist@elt@w %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@key@id@w temperature%
+\db@key@id@end@ %
+\db@type@id@w 2%
+\db@type@id@end@ %
+\db@header@id@w Incubation Temperature%
+\db@header@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@plist@elt@end@
+\db@plist@elt@w %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@key@id@w time%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Incubation Time%
+\db@header@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@plist@elt@end@
+\db@plist@elt@w %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@key@id@w T2G%
+\db@key@id@end@ %
+\db@type@id@w 1%
+\db@type@id@end@ %
+\db@header@id@w Time to Growth%
+\db@header@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@plist@elt@end@
+}%
+\expandafter\global\expandafter
+\newtoks\csname dtldb@mydata\endcsname
+\expandafter\global
+\csname dtldb@mydata\endcsname={%
+%
+\db@row@elt@w %
+\db@row@id@w 1%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 120%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 1%
+\db@row@id@end@ %
+\db@row@elt@end@
+\db@row@elt@w %
+\db@row@id@w 2%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 90%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 60%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 2%
+\db@row@id@end@ %
+\db@row@elt@end@
+\db@row@elt@w %
+\db@row@id@w 3%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 35%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 180%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 20%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 3%
+\db@row@id@end@ %
+\db@row@elt@end@
+\db@row@elt@w %
+\db@row@id@w 4%
+\db@row@id@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@elt@w 55%
+\db@col@elt@end@ %
+\db@col@id@w 1%
+\db@col@id@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@elt@w 190%
+\db@col@elt@end@ %
+\db@col@id@w 2%
+\db@col@id@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@col@elt@w 40%
+\db@col@elt@end@ %
+\db@col@id@w 3%
+\db@col@id@end@ %
+\db@row@id@w 4%
+\db@row@id@end@ %
+\db@row@elt@end@
+}%
+\expandafter\global
+ \expandafter\newcount\csname dtlrows@mydata\endcsname
+\expandafter\global
+ \csname dtlrows@mydata\endcsname=4\relax
+\expandafter\global
+ \expandafter\newcount\csname dtlcols@mydata\endcsname
+\expandafter\global
+ \csname dtlcols@mydata\endcsname=3\relax
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Temperature\endcsname{1}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Incubation Time\endcsname{2}%
+\expandafter
+ \gdef\csname dtl@ci@mydata@Time to Growth\endcsname{3}%
+\egroup
diff --git a/Master/texmf-dist/doc/latex/datatool/samples/test-scores.csv b/Master/texmf-dist/doc/latex/datatool/samples/test-scores.csv
new file mode 100644
index 00000000000..ebdf3168aee
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/datatool/samples/test-scores.csv
@@ -0,0 +1,10 @@
+FirstName,Surname,StudentNo,Assignment1,Assignment2
+John,"Smith, Jr",102689,68,60
+Jane,Brown,102647,75,80
+Andy,Brown,103569,42,50
+Z\"oe,Adams,105987,52,61
+Roger,Brady,106872,58,56
+%Clare,Verdon,104356,45,50
+Henk,\switchargs{Mere}{van der },106789,71,80
+Jos,\switchargs{Mere}{de la },104256,58,60
+
diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx
index abb64150269..ed09b5a23ac 100644
--- a/Master/texmf-dist/source/latex/datatool/datatool.dtx
+++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx
@@ -17,7 +17,7 @@
% -author "Nicola Talbot"
% -codetitle ""
% datatool
-% Created on 2013/6/28 15:53
+% Created on 2013/7/10 13:59
%\fi
%\iffalse
%<*package>
@@ -64,7 +64,7 @@ datatool.dtx
\doxitem{Counter}{counter}{counters}
\doxitem{Option}{option}{package options}
-\CheckSum{22657}
+\CheckSum{22994}
\RecordChanges
\PageIndex
@@ -77,11 +77,11 @@ datatool.dtx
%\fi
%\MakeShortVerb{"}
%
-%\title{Documented Code for datatool v2.14}
+%\title{Documented Code for datatool v2.15}
%\author{Nicola L. C. Talbot\\
%\url{http://www.dickimaw-books.com/}}
%
-%\date{2013-06-28}
+%\date{2013-07-10}
%\maketitle
%
%\pagenumbering{roman}
@@ -5701,7 +5701,7 @@ datatool.dtx
%\section{Package Declaration}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datatool}[2013/06/28 v2.14 (NLCT)]
+\ProvidesPackage{datatool}[2013/07/10 v2.15 (NLCT)]
% \end{macrocode}
% Load required packages:
% \begin{macrocode}
@@ -10841,7 +10841,11 @@ datatool.dtx
\dtlgetentryfromrow{\DTLthisval}{\@dtl@col}{\dtlcurrentrow}%
\expandafter\ifthenelse\expandafter{\@dtl@cond}%
{%
- \ifstrempty{#4}%
+% \end{macrocode}
+%\changes{2.15}{2013-07-10}{Replaced \cs{ifstrempty} with
+%\cs{ifdefempty}}
+% \begin{macrocode}
+ \ifdefempty{#4}%
{%
\let#4\DTLthisval
}%
@@ -11948,6 +11952,11 @@ datatool.dtx
\string\DTLsetheader*{#1}{\@dtl@k}{\@dtl@h}}%
}%
% \end{macrocode}
+% Store name of database in case required after database loaded:
+%\changes{2.15}{2013-07-10}{added \cs{dtllastloadeddb}}
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\def\string\dtllastloadeddb{#1}}%
+% \end{macrocode}
% Close output file
% \begin{macrocode}
\closeout\@dtl@write
@@ -11994,7 +12003,7 @@ datatool.dtx
}\expandafter\@gobble\string\%
}%
% \end{macrocode}
-% Scope needed to localise definitions:
+% Scope need to localise definitions:
% \begin{macrocode}
{%
% \end{macrocode}
@@ -12002,7 +12011,8 @@ datatool.dtx
% writing to a file. This may break a control sequence. This is a
% patch that puts the row and column markers on a new line.
% (Problems may still occur if the database contains very long
-% entries, but I'm not sure how to get around that.)
+% entries, in which case try loading \sty{morewrites} before
+% \sty{datatool}.)
% \begin{macrocode}
\def\db@row@elt@w{\expandafter\@gobble\string\%^^J\string\db@row@elt@w\space}%
\def\db@row@elt@end@{\expandafter\@gobble\string\%^^J\string\db@row@elt@end@\space}%
@@ -12030,8 +12040,9 @@ datatool.dtx
% If in verbose mode, add a message to let the user know what's
% happening when the file is later loaded.
% \begin{macrocode}
- \protected@write{\@dtl@write}{}{\string\dtl@message{Reconstructing database
- ^^J`#1'}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}{%
+ \string\dtl@message{Reconstructing database^^J`#1'}%
+ \expandafter\@gobble\string\%}%
% \end{macrocode}
% Save the contents of the token register that holds the column
% information (column id, header, type). (The write is delayed,
@@ -12050,7 +12061,8 @@ datatool.dtx
\expandafter\protected@xdef\csname dtl@rawwritedbkeys@#1\endcsname{%
\the\csname dtlkeys@#1\endcsname}%
\protected@write{\@dtl@write}{}{\csname dtl@rawwritedbkeys@#1\endcsname}%
- \protected@write{\@dtl@write}{}{\expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}%
+ {\expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
% \end{macrocode}
% Hook used by \sty{datagidx}:
% \begin{macrocode}
@@ -12067,17 +12079,9 @@ datatool.dtx
\string\expandafter
\string\global^^J\string\csname\space dtldb@#1\string\endcsname
=\expandafter\@gobble\string\{\expandafter\@gobble\string\%}%
-% \end{macrocode}
-% Sanitize contents so we don't need to worry about fragile
-% commands, but we need to substitute back the element tags so get
-% it formatted correctly.
-% \begin{macrocode}
- \@dtl@fmt@bodytok{\csname dtldb@#1\endcsname}%
- \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{%
- \@dtl@contents}%
+ \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{\the\csname dtldb@#1\endcsname}%
\protected@write{\@dtl@write}{}{\csname dtl@rawwritedb@#1\endcsname}%
- \protected@write{\@dtl@write}{}{%
- \expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}{\expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
% \end{macrocode}
% Now for the count register that keeps track of the row count.
% \begin{macrocode}
@@ -12118,6 +12122,11 @@ datatool.dtx
% \begin{macrocode}
}%
% \end{macrocode}
+% Store name of database in case required after database loaded:
+%\changes{2.15}{2013-07-10}{added \cs{dtllastloadeddb}}
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\def\string\dtllastloadeddb{#1}}%
+% \end{macrocode}
% Close output file
% \begin{macrocode}
\closeout\@dtl@write
@@ -12130,33 +12139,146 @@ datatool.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\@dtl@fmt@bodytok}
-% Format token contents for writing to file.
-%\changes{2.14}{2013-06-28}{new}
+%\begin{macro}{\DTLprotectedsaverawdb}
+% Like \cs{DTLloaddb} but works with fragile contents. If there's a
+% problem with unwanted line breaks every 80 characters, try loading
+% \sty{morewrites} before \sty{datatool}.
+%\changes{2.15}{2013-07-10}{new}
% \begin{macrocode}
-\newcommand*{\@dtl@fmt@bodytok}[1]{%
- \edef\@dtl@contents{\the#1}%
- \@onelevel@sanitize\@dtl@contents
- \@dtl@replace@elt{\@dtl@contents}{db@row@elt@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@row@elt@end@}%
- \@dtl@replace@elt{\@dtl@contents}{db@row@id@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@row@id@end@}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@id@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@id@end@}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@elt@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@elt@end@}%
-}
+\newcommand*{\DTLprotectedsaverawdb}[2]{%
+ \DTLifdbexists{#1}%
+ {%
% \end{macrocode}
-%\end{macro}
-%\begin{macro}{\@dlt@replace@elt}
-% Replace element tag.
-%\changes{2.14}{2013-06-28}{new}
+% Open output file
+% \begin{macrocode}
+ \openout\@dtl@write=#2\relax
+% \end{macrocode}
+% Add code at the start of the output file to check for the
+% existence of the database:
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{%
+ \string\DTLifdbexists{#1}\expandafter\@gobble\string\%^^J%
+ {%
+ \string\PackageError{datatool}{Database `#1' ^^Jalready exists}{}%
+ \expandafter\@gobble\string\%^^J%
+ \string\aftergroup\string\endinput
+ }%
+ {%
+ }\expandafter\@gobble\string\%
+ }%
+% \end{macrocode}
+% Scope needed to localise definitions:
+% \begin{macrocode}
+ {%
+% \end{macrocode}
+% Need to ensure the @ character can be used so \ics{makeatletter}
+% is required, but localise the effect.
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\bgroup\string\makeatletter}%
+% \end{macrocode}
+% If in verbose mode, add a message to let the user know what's
+% happening when the file is later loaded.
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\dtl@message{Reconstructing database
+ ^^J`#1'}\expandafter\@gobble\string\%}%
+% \end{macrocode}
+% Start writing the header token definition.
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter
+ \string\global\string\expandafter^^J\string\newtoks
+ \string\csname\space dtlkeys@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter
+ \string\global^^J
+ \string\csname\space dtlkeys@#1\string\endcsname
+ =\expandafter\@gobble\string\{\expandafter\@gobble\string\%}%
+% Store the contents of the token register that holds the column
+% information (column id, header, type) and sanitize.
+% \begin{macrocode}
+ \edef\dtl@rawwrite@keys{\the\csname dtlkeys@#1\endcsname}%
+ \@onelevel@sanitize\dtl@rawwrite@keys
+% \end{macrocode}
+% The write can get delayed, so expand after to ensure it has the
+% actual contents of the database rather than
+% \cs{dtl@rawwrite@keys}, which may have changed by the time the
+% write occurs. Include the closing brace of the token contents.
+% \begin{macrocode}
+ \expandafter\write\expandafter\@dtl@write\expandafter
+ {\dtl@rawwrite@keys\expandafter\@gobble\string\}}%
+% \end{macrocode}
+% Similarly for the token register that holds the database
+% body.
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter\string\global
+ \string\expandafter^^J\string\newtoks
+ \string\csname\space dtldb@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter
+ \string\global^^J\string\csname\space dtldb@#1\string\endcsname
+ =\expandafter\@gobble\string\{\expandafter\@gobble\string\%}%
+% \end{macrocode}
+% \begin{macrocode}
+ \edef\dtl@rawwrite@db{\the\csname dtldb@#1\endcsname}%
+ \@onelevel@sanitize\dtl@rawwrite@db
+% \end{macrocode}
+% Now write the sanitize contents.
+% \begin{macrocode}
+ \expandafter\write\expandafter\@dtl@write\expandafter
+ {\dtl@rawwrite@db\expandafter\@gobble\string\}}%
+% \end{macrocode}
+% Now for the count register that keeps track of the row count.
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\expandafter\string\newcount
+ \string\csname\space dtlrows@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\csname\space dtlrows@#1\string\endcsname
+ =\expandafter\number\csname dtlrows@#1\endcsname\string\relax}%
+% \end{macrocode}
+% Similarly for the column count.
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\expandafter\string\newcount
+ \string\csname\space dtlcols@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\csname\space dtlcols@#1\string\endcsname
+ =\expandafter\number\csname dtlcols@#1\endcsname\string\relax}%
+% \end{macrocode}
+% Add key mappings
+% \begin{macrocode}
+ \dtlforeachkey(\@dtl@key,\@dtl@col,\@dtl@type,\@dtl@head)\in{#1}\do
+ {%
+ \edef\dtl@tmp{%
+ \string\expandafter^^J
+ \string\gdef
+ \string\csname\space dtl@ci@#1@\@dtl@key\string\endcsname
+ {\csname dtl@ci@#1@\@dtl@key\endcsname}\expandafter\@gobble\string\%
+ }%
+ \expandafter\write\expandafter\@dtl@write\expandafter{\dtl@tmp}%
+ }%
+% \end{macrocode}
+% End the scope for \ics{makeatletter}:
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\egroup}%
+% \end{macrocode}
+% End current scope:
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+% Provide a means to keep track of the last loaded file:
+% \begin{macrocode}
+ \protected@write{\@dtl@write}{}{\string\def\string\dtllastloadeddb{#1}}%
+% \end{macrocode}
+% Close output file
% \begin{macrocode}
-\newcommand*{\@dtl@replace@elt}[2]{%
- \expandafter\def\expandafter\dtl@tmp\expandafter{\csname#2\endcsname }%
- \@onelevel@sanitize\dtl@tmp
- \expandafter\DTLsubstituteall\expandafter#1\expandafter{\dtl@tmp}%
- {\csname#2\endcsname}%
+ \closeout\@dtl@write
+ }%
+ {%
+ \PackageError{datatool}{Can't save database `#1': no such
+ database}{}%
+ }%
}
% \end{macrocode}
%\end{macro}
@@ -12885,7 +13007,7 @@ datatool.dtx
% Declare package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datagidx}[2013/06/28 v2.14 (NLCT)]
+\ProvidesPackage{datagidx}[2013/07/10 v2.15 (NLCT)]
% \end{macrocode}
% Required packages:
% \begin{macrocode}
@@ -12897,6 +13019,10 @@ datatool.dtx
\RequirePackage{multicol}
\RequirePackage{textcase}
% \end{macrocode}
+%\changes{2.15}{2013-07-10}{added afterpage as a required package}
+% \begin{macrocode}
+\RequirePackage{afterpage}
+% \end{macrocode}
%
%\section{Default Settings}
% These commands need to be defined before the package options are
@@ -13442,16 +13568,23 @@ datatool.dtx
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\if@datagidx@warn}
+% Provide a switch to allow warnings to be suppressed.
+% \begin{macrocode}
+\newif\if@datagidx@warn
+\@datagidx@warntrue
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\@datagidx@dorerun@warn}
% \begin{macrocode}
\newcommand*\@datagidx@dorerun@warn{}
-\AtEndDocument{\@datagidx@dorerun@warn}
+\AtEndDocument{\if@datagidx@warn\@datagidx@dorerun@warn\fi}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\@datagidx@dorerun@warn@sort}
% \begin{macrocode}
\newcommand*\@datagidx@dorerun@warn@sort{}
-\AtEndDocument{\@datagidx@dorerun@warn@sort}
+\AtEndDocument{\if@datagidx@warn\@datagidx@dorerun@warn@sort\fi}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\@datagidx@rerun@warn@sort}
@@ -13616,6 +13749,21 @@ datatool.dtx
% \end{macrocode}
%\end{option}
%
+%\begin{option}{nowarn}
+% A boolean option to suppress warnings.
+%\changes{2.15}{2013-07-10}{new}
+% \begin{macrocode}
+\define@choicekey{datagidx.sty}{nowarn}[\val\nr]{true,false}[true]%
+{%
+ \ifcase\nr\relax
+ \@datagidx@warnfalse
+ \or
+ \@datagidx@warntrue
+ \fi
+}
+% \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
@@ -15782,18 +15930,18 @@ datatool.dtx
% If the format is different, let the non-empty format over-ride
% the empty format.
% \begin{macrocode}
- \ifstrequal{\datagidx@prev@format}{\datagidx@current@format}
+ \ifstrequal{\datagidx@prev@format}{\datagidx@current@format}%
{%
}%
{%
- \ifdefempty{\datagidx@current@format}
+ \ifdefempty{\datagidx@current@format}%
{%
% \end{macrocode}
% Current format is empty, so keep previous unchanged.
% \begin{macrocode}
}%
{%
- \ifdefempty{\datagidx@prev@format}
+ \ifdefempty{\datagidx@prev@format}%
{%
% \end{macrocode}
% Previous format is empty, so update.
@@ -15827,17 +15975,17 @@ datatool.dtx
% \end{macrocode}
% A change in font format breaks the sequence.
% \begin{macrocode}
- \ifdefequal{\datagidx@prev@format}{\datagidx@current@format}
+ \ifdefequal{\datagidx@prev@format}{\datagidx@current@format}%
{%
% \end{macrocode}
% A change in location format breaks the sequence.
% \begin{macrocode}
- \ifdefequal{\datagidx@prev@locationformat}{\datagidx@current@locationformat}
+ \ifdefequal{\datagidx@prev@locationformat}{\datagidx@current@locationformat}%
{%
% \end{macrocode}
% A change in prefix breaks the sequence.
% \begin{macrocode}
- \ifdefequal{\datagidx@prev@prefix}{\datagidx@current@prefix}
+ \ifdefequal{\datagidx@prev@prefix}{\datagidx@current@prefix}%
{%
}%
{%
@@ -16020,9 +16168,10 @@ datatool.dtx
{%
% \end{macrocode}
% No, they aren't so don't form a range:
+%\changes{2.15}{2013-07-10}{removed spurious space}
% \begin{macrocode}
\DTLgidxLocationF
- {
+ {%
\datagidxlink{\datagidx@location@target}%
{%
\datagidx@formatlocation
@@ -16150,6 +16299,47 @@ datatool.dtx
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\loadgidx}
+%\begin{definition}
+%\cs{loadgidx}\oarg{options}\marg{filename}\marg{title}
+%\end{definition}
+%\changes{2.15}{2013-07-10}{new}
+% Loads a datagidx database.
+% \begin{macrocode}
+\newcommand*{\loadgidx}[3][]{%
+% \end{macrocode}
+% Load database:
+% \begin{macrocode}
+ \input{#2}%
+% \end{macrocode}
+% Update the `datagidx' database. (Assume database is already
+% sorted.)
+% \begin{macrocode}
+ \bgroup
+ \setkeys{newgloss}{sort={},#1}%
+ \expandafter\datagidx@newgidx@update\expandafter
+ {\dtllastloadeddb}{#3}%
+ \egroup
+% \end{macrocode}
+% Set this as the default database:
+% \begin{macrocode}
+ \edef\datagidx@defaultdatabase{\dtllastloadeddb}%
+% \end{macrocode}
+% Assign labels to this database.
+% \begin{macrocode}
+ \dtlforcolumn{\Label}{\dtllastloadeddb}{Label}%
+ {%
+ \csxdef{datagidxentry@\Label}{\dtllastloadeddb}%
+ }%
+}
+% \end{macrocode}
+% May only be used in the preamble (otherwise the entries will be
+% undefined when their locations are read from the aux file).
+% \begin{macrocode}
+\@onlypreamble\loadgidx
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\datagidx@newgidx}
% The normal behaviour of \cs{newgidx}
% \begin{macrocode}
@@ -17454,6 +17644,17 @@ datatool.dtx
{%
\bgroup
\datagidx@escapelocation
+% \end{macrocode}
+% Need to prevent \cs{@arabic} etc from being expanded just yet (or it
+% will throw the page numbering out of sync for entries that occur
+% by a page break).
+%\changes{2.15}{2013-07-10}{fixed page breaking bug}
+% \begin{macrocode}
+ \def\@arabic{\noexpand\@arabic}%
+ \def\@roman{\noexpand\@roman}%
+ \def\@Roman{\noexpand\@Roman}%
+ \def\@alph{\noexpand\@alph}%
+ \def\@Alph{\noexpand\@Alph}%
\protected@edef\@datagidx@dowriteaux{%
\noexpand\datagidx@write@usedentry{#1}%
{[#2]{#3}{\@datagidx@target}}%
@@ -17751,9 +17952,36 @@ datatool.dtx
% Add to this run's location field.
% \begin{macrocode}
\protected@edef\datagidx@do@usedentry{%
- \noexpand\datagidx@usedentry[CurrentLocation]{#1}{#2}%
+ \noexpand\datagidx@xusedentry{CurrentLocation}{#1}{#2}%
}%
- \datagidx@do@usedentry
+% \end{macrocode}
+% If the location counter is the page counter, defer until after the
+% page break.
+%\changes{2.15}{2013-07-10}{Added check for page counter}
+% \begin{macrocode}
+ \expandafter\ifstrequal\expandafter{\DTLgidxCounter}{page}%
+ {%
+ \expandafter\afterpage\expandafter{\datagidx@do@usedentry}%
+ }%
+ {
+ \datagidx@do@usedentry
+ }%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\datagidx@xusedentry}
+%\begin{definition}
+%\cs{datagidx@usedentry}\marg{location tag}\marg{label}\marg{location}
+%\end{definition}
+% Like \cs{datagidx@usedentry} but expands the location. Unlike
+% \cs{datagidx@usedentry} the first argument isn't optional.
+% \begin{macrocode}
+\newcommand*{\datagidx@xusedentry}[3]{%
+ \protected@edef\@datagidx@do@xusedentry{%
+ \noexpand\datagidx@usedentry[#1]{#2}{#3}%
+ }%
+ \@datagidx@do@xusedentry
}
% \end{macrocode}
%\end{macro}
@@ -18540,8 +18768,15 @@ datatool.dtx
{%
% \end{macrocode}
% Current location was saved in the previous run. Has it changed?
-% \begin{macrocode}
- \ifcsequal{datagidx@prev@loc@\Label}{CurrentLocation}%
+%\changes{2.15}{2013-07-10}{expanded and sanitize locations before
+%comparing them}%
+% \begin{macrocode}
+ \protected@edef\@prev@location{%
+ \csname datagidx@prev@loc@\Label\endcsname}%
+ \@onelevel@sanitize\@prev@location
+ \protected@edef\@cur@location{\CurrentLocation}%
+ \@onelevel@sanitize\@cur@location
+ \ifdefequal{\@prev@location}{\@cur@location}%
{}%
{%
\global\let\@datagidx@dorerun@warn\@data@rerun@warn
@@ -23687,6 +23922,34 @@ Try #2-#1 instead of #1-#2}%
\newcommand*{\DTLplotatbegintikz}{}
% \end{macrocode}
%\end{macro}
+%
+%\begin{macro}{\dtlplothandlermark}
+%\changes{2.15}{2013-07-10}{new}
+% Provide a convenient access to \cs{pgfplothandlermark} that
+% reverses the effect of the plot scaling.
+% \begin{macrocode}
+\newcommand*{\@dtlplothandlermark}[1]{%
+ \pgfplothandlermark
+ {%
+ \pgfmathparse{1/\dtl@scale@x}%
+ \pgftransformxscale{\pgfmathresult}%
+ \pgfmathparse{1/\dtl@scale@y}%
+ \pgftransformyscale{\pgfmathresult}%
+ #1%
+ }%
+}
+% \end{macrocode}
+% Just in case a user attempts to use \cs{dtlplothandermark} outside
+% \ics{DTLplot}:
+% \begin{macrocode}
+\newcommand*{\dtlplothandlermark}[1]{%
+ \PackageWarning{dataplot}{\string\dtlplothandlermark\space
+ found outside \string\DTLplot}%
+ \pgfplothandlermark{#1}%
+}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\DTLplotatendtikz}
% \cs{DTLplotatendtikz} is a hook to insert stuff at the end
% of the \env{tikzpicture} environment.
@@ -24186,6 +24449,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
% \end{macrocode}
% Add any extra information the user requires
% \begin{macrocode}
+ \let\dtlplothandlermark\@dtlplothandlermark
\DTLplotatbegintikz
% \end{macrocode}
% Determine whether to put a box around the plot
@@ -24696,6 +24960,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
% \end{macrocode}
% End hook
% \begin{macrocode}
+ \let\dtlplothandlermark\@dtlplothandlermark
\DTLplotatendtikz
\end{tikzpicture}
\fi
@@ -24924,6 +25189,8 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
%\cs{DTLaddtoplotlegend}\marg{marker}\marg{line style}\marg{label}
%\end{definition}
% Adds entry to legend.
+%\changes{2.15}{2013-07-10}{Used \cs{xdef} instead of \cs{edef} as
+%may be scoped.}
% \begin{macrocode}
\newcommand*{\DTLaddtoplotlegend}[3]{%
\def\dtl@legendline{}%
@@ -24943,10 +25210,10 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
\fi
\expandafter\toks@\expandafter{\dtl@legendline}%
\ifx\dtl@legend\@empty
- \edef\dtl@legend{\noexpand\tikz\the\toks@; \noexpand& #3}%
+ \xdef\dtl@legend{\noexpand\tikz\the\toks@; \noexpand& #3}%
\else
\expandafter\@dtl@toks\expandafter{\dtl@legend}%
- \edef\dtl@legend{\the\@dtl@toks\noexpand\\%
+ \xdef\dtl@legend{\the\@dtl@toks\noexpand\\%
\noexpand\tikz\the\toks@; \noexpand& #3}%
\fi
}
diff --git a/Master/texmf-dist/source/latex/datatool/datatool.ins b/Master/texmf-dist/source/latex/datatool/datatool.ins
index fc054a86ee0..4f5658b9eb3 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 0.94b 2013/6/28 15:53
+% datatool.ins generated using makedtx version 0.94b 2013/7/10 13:59
\input docstrip
\preamble
diff --git a/Master/texmf-dist/tex/latex/datatool/datagidx.sty b/Master/texmf-dist/tex/latex/datatool/datagidx.sty
index b9cd631badb..53c6e35e0dd 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}[2013/06/28 v2.14 (NLCT)]
+\ProvidesPackage{datagidx}[2013/07/10 v2.15 (NLCT)]
\RequirePackage{datatool}
\RequirePackage{etoolbox}
\RequirePackage{xkeyval}
@@ -47,6 +47,7 @@
\RequirePackage{xfor}
\RequirePackage{multicol}
\RequirePackage{textcase}
+\RequirePackage{afterpage}
\newcommand*{\datagidx@columns}{2}
\newcommand*{\DTLgidxSetColumns}[1]{%
\DTLifint{#1}%
@@ -312,10 +313,12 @@
\global\let\@datagidx@dorerun@warn@sort\@data@rerun@warn@sort
}%
}
+\newif\if@datagidx@warn
+\@datagidx@warntrue
\newcommand*\@datagidx@dorerun@warn{}
-\AtEndDocument{\@datagidx@dorerun@warn}
+\AtEndDocument{\if@datagidx@warn\@datagidx@dorerun@warn\fi}
\newcommand*\@datagidx@dorerun@warn@sort{}
-\AtEndDocument{\@datagidx@dorerun@warn@sort}
+\AtEndDocument{\if@datagidx@warn\@datagidx@dorerun@warn@sort\fi}
\newcommand*\@data@rerun@warn@sort{%
\PackageWarningNoLine{datagidx}{Rerun required to sort the
index/glossary databases}%
@@ -395,6 +398,14 @@
\datagidx@do@highopt@optimize
\fi
}
+\define@choicekey{datagidx.sty}{nowarn}[\val\nr]{true,false}[true]%
+{%
+ \ifcase\nr\relax
+ \@datagidx@warnfalse
+ \or
+ \@datagidx@warntrue
+ \fi
+}
\define@key{datagidx.sty}{columns}%
{%
\DTLgidxSetColumns{#1}%
@@ -1737,15 +1748,15 @@
\datagidx@getlocation#1\relax
\ifdefequal{\datagidx@prev@locationstring}{\datagidx@current@locationstring}%
{%
- \ifstrequal{\datagidx@prev@format}{\datagidx@current@format}
+ \ifstrequal{\datagidx@prev@format}{\datagidx@current@format}%
{%
}%
{%
- \ifdefempty{\datagidx@current@format}
+ \ifdefempty{\datagidx@current@format}%
{%
}%
{%
- \ifdefempty{\datagidx@prev@format}
+ \ifdefempty{\datagidx@prev@format}%
{%
\let\datagidx@prev@format\datagidx@current@format
}%
@@ -1765,11 +1776,11 @@
}
\newcommand*{\@datagidx@parse@location}{%
\@dtl@sequentialtrue
- \ifdefequal{\datagidx@prev@format}{\datagidx@current@format}
+ \ifdefequal{\datagidx@prev@format}{\datagidx@current@format}%
{%
- \ifdefequal{\datagidx@prev@locationformat}{\datagidx@current@locationformat}
+ \ifdefequal{\datagidx@prev@locationformat}{\datagidx@current@locationformat}%
{%
- \ifdefequal{\datagidx@prev@prefix}{\datagidx@current@prefix}
+ \ifdefequal{\datagidx@prev@prefix}{\datagidx@current@prefix}%
{%
}%
{%
@@ -1870,7 +1881,7 @@
}%
{%
\DTLgidxLocationF
- {
+ {%
\datagidxlink{\datagidx@location@target}%
{%
\datagidx@formatlocation
@@ -1930,6 +1941,20 @@
\datagidx@newgidx[#1]{#2}{#3}%
}%
}
+\newcommand*{\loadgidx}[3][]{%
+ \input{#2}%
+ \bgroup
+ \setkeys{newgloss}{sort={},#1}%
+ \expandafter\datagidx@newgidx@update\expandafter
+ {\dtllastloadeddb}{#3}%
+ \egroup
+ \edef\datagidx@defaultdatabase{\dtllastloadeddb}%
+ \dtlforcolumn{\Label}{\dtllastloadeddb}{Label}%
+ {%
+ \csxdef{datagidxentry@\Label}{\dtllastloadeddb}%
+ }%
+}
+\@onlypreamble\loadgidx
\newcommand*{\datagidx@newgidx}[3][]{%
\bgroup
\setkeys{newgloss}{#1}%
@@ -2565,6 +2590,11 @@
{%
\bgroup
\datagidx@escapelocation
+ \def\@arabic{\noexpand\@arabic}%
+ \def\@roman{\noexpand\@roman}%
+ \def\@Roman{\noexpand\@Roman}%
+ \def\@alph{\noexpand\@alph}%
+ \def\@Alph{\noexpand\@Alph}%
\protected@edef\@datagidx@dowriteaux{%
\noexpand\datagidx@write@usedentry{#1}%
{[#2]{#3}{\@datagidx@target}}%
@@ -2701,9 +2731,21 @@
\string\datagidx@usedentry{#1}{#2}%
}%
\protected@edef\datagidx@do@usedentry{%
- \noexpand\datagidx@usedentry[CurrentLocation]{#1}{#2}%
+ \noexpand\datagidx@xusedentry{CurrentLocation}{#1}{#2}%
+ }%
+ \expandafter\ifstrequal\expandafter{\DTLgidxCounter}{page}%
+ {%
+ \expandafter\afterpage\expandafter{\datagidx@do@usedentry}%
+ }%
+ {
+ \datagidx@do@usedentry
+ }%
+}
+\newcommand*{\datagidx@xusedentry}[3]{%
+ \protected@edef\@datagidx@do@xusedentry{%
+ \noexpand\datagidx@usedentry[#1]{#2}{#3}%
}%
- \datagidx@do@usedentry
+ \@datagidx@do@xusedentry
}
\newcommand*{\datagidx@usedentry}[3][Location]{%
\ifcsundef{datagidxentry@#2}%
@@ -3098,7 +3140,12 @@
{%
\ifcsdef{datagidx@prev@loc@\Label}%
{%
- \ifcsequal{datagidx@prev@loc@\Label}{CurrentLocation}%
+ \protected@edef\@prev@location{%
+ \csname datagidx@prev@loc@\Label\endcsname}%
+ \@onelevel@sanitize\@prev@location
+ \protected@edef\@cur@location{\CurrentLocation}%
+ \@onelevel@sanitize\@cur@location
+ \ifdefequal{\@prev@location}{\@cur@location}%
{}%
{%
\global\let\@datagidx@dorerun@warn\@data@rerun@warn
diff --git a/Master/texmf-dist/tex/latex/datatool/dataplot.sty b/Master/texmf-dist/tex/latex/datatool/dataplot.sty
index 564cc58d12b..36209d39185 100644
--- a/Master/texmf-dist/tex/latex/datatool/dataplot.sty
+++ b/Master/texmf-dist/tex/latex/datatool/dataplot.sty
@@ -137,6 +137,21 @@
\newif\ifDTLshowlines
\DTLshowlinesfalse
\newcommand*{\DTLplotatbegintikz}{}
+\newcommand*{\@dtlplothandlermark}[1]{%
+ \pgfplothandlermark
+ {%
+ \pgfmathparse{1/\dtl@scale@x}%
+ \pgftransformxscale{\pgfmathresult}%
+ \pgfmathparse{1/\dtl@scale@y}%
+ \pgftransformyscale{\pgfmathresult}%
+ #1%
+ }%
+}
+\newcommand*{\dtlplothandlermark}[1]{%
+ \PackageWarning{dataplot}{\string\dtlplothandlermark\space
+ found outside \string\DTLplot}%
+ \pgfplothandlermark{#1}%
+}
\newcommand*{\DTLplotatendtikz}{}
\define@key{dataplot}{x}{%
\def\dtl@xkey{#1}}
@@ -418,6 +433,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
\begin{scope}
\pgftransformcm{\dtl@scale@x}{0}{0}{\dtl@scale@y}%
{\pgfpoint{\dtl@offset@x pt}{\dtl@offset@y pt}}%
+ \let\dtlplothandlermark\@dtlplothandlermark
\DTLplotatbegintikz
\ifDTLbox
\draw (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY) --
@@ -789,6 +805,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
\fi
\pgftransformcm{\dtl@scale@x}{0}{0}{\dtl@scale@y}%
{\pgfpoint{\dtl@offset@x pt}{\dtl@offset@y pt}}%
+ \let\dtlplothandlermark\@dtlplothandlermark
\DTLplotatendtikz
\end{tikzpicture}
\fi
@@ -948,10 +965,10 @@ east,southeast,south,southwest,west,northwest}[northeast]{%
\fi
\expandafter\toks@\expandafter{\dtl@legendline}%
\ifx\dtl@legend\@empty
- \edef\dtl@legend{\noexpand\tikz\the\toks@; \noexpand& #3}%
+ \xdef\dtl@legend{\noexpand\tikz\the\toks@; \noexpand& #3}%
\else
\expandafter\@dtl@toks\expandafter{\dtl@legend}%
- \edef\dtl@legend{\the\@dtl@toks\noexpand\\%
+ \xdef\dtl@legend{\the\@dtl@toks\noexpand\\%
\noexpand\tikz\the\toks@; \noexpand& #3}%
\fi
}
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty
index 35300a8d2c1..4764e53d48d 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}[2013/06/28 v2.14 (NLCT)]
+\ProvidesPackage{datatool}[2013/07/10 v2.15 (NLCT)]
\RequirePackage{xkeyval}
\RequirePackage{ifthen}
\RequirePackage{xfor}
@@ -2291,7 +2291,7 @@
\dtlgetentryfromrow{\DTLthisval}{\@dtl@col}{\dtlcurrentrow}%
\expandafter\ifthenelse\expandafter{\@dtl@cond}%
{%
- \ifstrempty{#4}%
+ \ifdefempty{#4}%
{%
\let#4\DTLthisval
}%
@@ -2761,6 +2761,7 @@
\protected@write\@dtl@write{}{%
\string\DTLsetheader*{#1}{\@dtl@k}{\@dtl@h}}%
}%
+ \protected@write{\@dtl@write}{}{\string\def\string\dtllastloadeddb{#1}}%
\closeout\@dtl@write
}%
{%
@@ -2801,8 +2802,9 @@
\def\db@header@id@w{\expandafter\@gobble\string\%^^J\string\db@header@id@w\space}%
\def\db@header@id@end@{\expandafter\@gobble\string\%^^J\string\db@header@id@end@\space}%
\protected@write{\@dtl@write}{}{\string\bgroup\string\makeatletter}%
- \protected@write{\@dtl@write}{}{\string\dtl@message{Reconstructing database
- ^^J`#1'}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}{%
+ \string\dtl@message{Reconstructing database^^J`#1'}%
+ \expandafter\@gobble\string\%}%
\protected@write{\@dtl@write}{}{%
\string\expandafter
\string\global\string\expandafter^^J\string\newtoks
@@ -2815,7 +2817,8 @@
\expandafter\protected@xdef\csname dtl@rawwritedbkeys@#1\endcsname{%
\the\csname dtlkeys@#1\endcsname}%
\protected@write{\@dtl@write}{}{\csname dtl@rawwritedbkeys@#1\endcsname}%
- \protected@write{\@dtl@write}{}{\expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}%
+ {\expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
\dtl@saverawdbhook
\protected@write{\@dtl@write}{}{%
\string\expandafter\string\global
@@ -2825,12 +2828,9 @@
\string\expandafter
\string\global^^J\string\csname\space dtldb@#1\string\endcsname
=\expandafter\@gobble\string\{\expandafter\@gobble\string\%}%
- \@dtl@fmt@bodytok{\csname dtldb@#1\endcsname}%
- \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{%
- \@dtl@contents}%
+ \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{\the\csname dtldb@#1\endcsname}%
\protected@write{\@dtl@write}{}{\csname dtl@rawwritedb@#1\endcsname}%
- \protected@write{\@dtl@write}{}{%
- \expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}{\expandafter\@gobble\string\}\expandafter\@gobble\string\%}%
\protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
\string\expandafter\string\newcount
\string\csname\space dtlrows@#1\string\endcsname}%
@@ -2855,6 +2855,7 @@
}%
\protected@write{\@dtl@write}{}{\string\egroup}%
}%
+ \protected@write{\@dtl@write}{}{\string\def\string\dtllastloadeddb{#1}}%
\closeout\@dtl@write
}%
{%
@@ -2862,23 +2863,80 @@
database}{}%
}%
}
-\newcommand*{\@dtl@fmt@bodytok}[1]{%
- \edef\@dtl@contents{\the#1}%
- \@onelevel@sanitize\@dtl@contents
- \@dtl@replace@elt{\@dtl@contents}{db@row@elt@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@row@elt@end@}%
- \@dtl@replace@elt{\@dtl@contents}{db@row@id@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@row@id@end@}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@id@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@id@end@}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@elt@w}%
- \@dtl@replace@elt{\@dtl@contents}{db@col@elt@end@}%
-}
-\newcommand*{\@dtl@replace@elt}[2]{%
- \expandafter\def\expandafter\dtl@tmp\expandafter{\csname#2\endcsname }%
- \@onelevel@sanitize\dtl@tmp
- \expandafter\DTLsubstituteall\expandafter#1\expandafter{\dtl@tmp}%
- {\csname#2\endcsname}%
+\newcommand*{\DTLprotectedsaverawdb}[2]{%
+ \DTLifdbexists{#1}%
+ {%
+ \openout\@dtl@write=#2\relax
+ \protected@write{\@dtl@write}{}{%
+ \string\DTLifdbexists{#1}\expandafter\@gobble\string\%^^J%
+ {%
+ \string\PackageError{datatool}{Database `#1' ^^Jalready exists}{}%
+ \expandafter\@gobble\string\%^^J%
+ \string\aftergroup\string\endinput
+ }%
+ {%
+ }\expandafter\@gobble\string\%
+ }%
+ {%
+ \protected@write{\@dtl@write}{}{\string\bgroup\string\makeatletter}%
+ \protected@write{\@dtl@write}{}{\string\dtl@message{Reconstructing database
+ ^^J`#1'}\expandafter\@gobble\string\%}%
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter
+ \string\global\string\expandafter^^J\string\newtoks
+ \string\csname\space dtlkeys@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter
+ \string\global^^J
+ \string\csname\space dtlkeys@#1\string\endcsname
+ =\expandafter\@gobble\string\{\expandafter\@gobble\string\%}%
+ \edef\dtl@rawwrite@keys{\the\csname dtlkeys@#1\endcsname}%
+ \@onelevel@sanitize\dtl@rawwrite@keys
+ \expandafter\write\expandafter\@dtl@write\expandafter
+ {\dtl@rawwrite@keys\expandafter\@gobble\string\}}%
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter\string\global
+ \string\expandafter^^J\string\newtoks
+ \string\csname\space dtldb@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{%
+ \string\expandafter
+ \string\global^^J\string\csname\space dtldb@#1\string\endcsname
+ =\expandafter\@gobble\string\{\expandafter\@gobble\string\%}%
+ \edef\dtl@rawwrite@db{\the\csname dtldb@#1\endcsname}%
+ \@onelevel@sanitize\dtl@rawwrite@db
+ \expandafter\write\expandafter\@dtl@write\expandafter
+ {\dtl@rawwrite@db\expandafter\@gobble\string\}}%
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\expandafter\string\newcount
+ \string\csname\space dtlrows@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\csname\space dtlrows@#1\string\endcsname
+ =\expandafter\number\csname dtlrows@#1\endcsname\string\relax}%
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\expandafter\string\newcount
+ \string\csname\space dtlcols@#1\string\endcsname}%
+ \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J
+ \string\csname\space dtlcols@#1\string\endcsname
+ =\expandafter\number\csname dtlcols@#1\endcsname\string\relax}%
+ \dtlforeachkey(\@dtl@key,\@dtl@col,\@dtl@type,\@dtl@head)\in{#1}\do
+ {%
+ \edef\dtl@tmp{%
+ \string\expandafter^^J
+ \string\gdef
+ \string\csname\space dtl@ci@#1@\@dtl@key\string\endcsname
+ {\csname dtl@ci@#1@\@dtl@key\endcsname}\expandafter\@gobble\string\%
+ }%
+ \expandafter\write\expandafter\@dtl@write\expandafter{\dtl@tmp}%
+ }%
+ \protected@write{\@dtl@write}{}{\string\egroup}%
+ }%
+ \protected@write{\@dtl@write}{}{\string\def\string\dtllastloadeddb{#1}}%
+ \closeout\@dtl@write
+ }%
+ {%
+ \PackageError{datatool}{Can't save database `#1': no such
+ database}{}%
+ }%
}
\newread\@dtl@read
\newcount\dtl@entrycr