summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/datatool/samples
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/datatool/samples
Initial commit
Diffstat (limited to 'macros/latex/contrib/datatool/samples')
-rw-r--r--macros/latex/contrib/datatool/samples/data-raw.dbtex166
-rw-r--r--macros/latex/contrib/datatool/samples/sample-autokeys-data.csv3
-rw-r--r--macros/latex/contrib/datatool/samples/sample-autokeys.pdfbin0 -> 24911 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-autokeys.tex12
-rw-r--r--macros/latex/contrib/datatool/samples/sample-barchart.pdfbin0 -> 35054 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-barchart.tex57
-rw-r--r--macros/latex/contrib/datatool/samples/sample-datatooltk.pdfbin0 -> 22848 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-datatooltk.tex23
-rw-r--r--macros/latex/contrib/datatool/samples/sample-dict.pdfbin0 -> 122418 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-dict.tex434
-rw-r--r--macros/latex/contrib/datatool/samples/sample-europecv-bib.pdfbin0 -> 89544 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-europecv-bib.tex19
-rw-r--r--macros/latex/contrib/datatool/samples/sample-gidx.pdfbin0 -> 179887 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-gidx.tex645
-rw-r--r--macros/latex/contrib/datatool/samples/sample-glossary.pdfbin0 -> 104516 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-glossary.tex248
-rw-r--r--macros/latex/contrib/datatool/samples/sample-index.pdfbin0 -> 128777 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-index.tex735
-rw-r--r--macros/latex/contrib/datatool/samples/sample-mail-merge.pdfbin0 -> 21655 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-mail-merge.tex21
-rw-r--r--macros/latex/contrib/datatool/samples/sample-piechart.pdfbin0 -> 33945 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-piechart.tex36
-rw-r--r--macros/latex/contrib/datatool/samples/sample-sort.pdfbin0 -> 89703 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-sort.tex133
-rw-r--r--macros/latex/contrib/datatool/samples/sample-student-records.csv7
-rw-r--r--macros/latex/contrib/datatool/samples/sample-student-scores.pdfbin0 -> 34602 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-student-scores.tex34
-rw-r--r--macros/latex/contrib/datatool/samples/sample-two-per-row.pdfbin0 -> 31739 bytes
-rw-r--r--macros/latex/contrib/datatool/samples/sample-two-per-row.tex55
29 files changed, 2628 insertions, 0 deletions
diff --git a/macros/latex/contrib/datatool/samples/data-raw.dbtex b/macros/latex/contrib/datatool/samples/data-raw.dbtex
new file mode 100644
index 0000000000..e6d99175d0
--- /dev/null
+++ b/macros/latex/contrib/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/macros/latex/contrib/datatool/samples/sample-autokeys-data.csv b/macros/latex/contrib/datatool/samples/sample-autokeys-data.csv
new file mode 100644
index 0000000000..3272841e38
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-autokeys-data.csv
@@ -0,0 +1,3 @@
+Product,Price ($)
+Fruit & Veg,0.50
+Cake & Biscuits,0.80
diff --git a/macros/latex/contrib/datatool/samples/sample-autokeys.pdf b/macros/latex/contrib/datatool/samples/sample-autokeys.pdf
new file mode 100644
index 0000000000..5bde2cc5eb
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-autokeys.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-autokeys.tex b/macros/latex/contrib/datatool/samples/sample-autokeys.tex
new file mode 100644
index 0000000000..30e36a121f
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-autokeys.tex
@@ -0,0 +1,12 @@
+\documentclass{article}
+
+\usepackage{color}
+\usepackage{datatool}
+
+\begin{document}
+\DTLloadrawdb[autokeys]{data}{sample-autokeys-data.csv}
+
+\DTLdisplaydb{data}
+
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-barchart.pdf b/macros/latex/contrib/datatool/samples/sample-barchart.pdf
new file mode 100644
index 0000000000..9cdf92def9
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-barchart.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-barchart.tex b/macros/latex/contrib/datatool/samples/sample-barchart.tex
new file mode 100644
index 0000000000..142f1eeb81
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-barchart.tex
@@ -0,0 +1,57 @@
+ % This file is public domain.
+\documentclass[captions=tableheading]{scrartcl}
+
+\usepackage{tikz}
+\usetikzlibrary{snakes}
+
+\usepackage{databar}
+
+\DTLloaddb{marks}{sample-student-records.csv}
+
+\begin{document}
+
+% Compute average mark for each student:
+\DTLforeach{marks}{%
+\assignI=Assignment 1,%
+\assignII=Assignment 2,%
+\assignIII=Assignment 3}{%
+\DTLmeanforall{\theMean}{\assignI,\assignII,\assignIII}%
+\DTLround{\theMean}{\theMean}{0}\DTLclip{\theMean}{\theMean}%
+\DTLappendtorow{Average}{\theMean}}
+
+\begin{table}
+\caption{Student Marks}
+ \centering
+\DTLdisplaydb[Address,RegNum,Title]{marks}
+\end{table}
+
+\begin{figure}[htbp]
+ \centering
+ % compute the overall mean
+ \DTLmeanforkeys{marks}{Average}{\overallmean}
+ % round it to 2 decimal places
+ \DTLround{\overallmean}{\overallmean}{2}
+ % draw a grey dotted line indicating the overall mean
+ % covering the entire width of the bar chart
+ \renewcommand*{\DTLbaratendtikz}{%
+ \draw[lightgray,loosely dotted] (0,\overallmean) --
+ (\DTLbarchartwidth,\overallmean)
+ node[right,black]{Average (\overallmean)};}
+ % Set the lower bar labels to draw a brace across the current
+ % group, along with the student's name and average score
+ \renewcommand*{\DTLdisplaylowerbarlabel}[1]{%
+ \tikz[baseline=(current bounding box.center)]{
+ \draw[snake=brace,rotate=-90](0,0) -- (\DTLbargroupwidth,0);}
+ \DTLround{\theMean}{\theMean}{2}%
+ \shortstack{#1\\(Average: \theMean)}}
+ % draw the bar chart
+ \DTLmultibarchart{variables={\assignI,\assignII,\assignIII},
+ barwidth=10pt,uppermultibarlabels={\assignI,\assignII,\assignIII},
+ barlabel={\firstname\ \surname}}{marks}
+ {\surname=Surname,\firstname=First Name,\assignI=Assignment 1,%
+ \assignII=Assignment 2,\assignIII=Assignment 3,\theMean=Average}
+ \caption{Student marks}
+\end{figure}
+
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-datatooltk.pdf b/macros/latex/contrib/datatool/samples/sample-datatooltk.pdf
new file mode 100644
index 0000000000..9c63274acf
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-datatooltk.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-datatooltk.tex b/macros/latex/contrib/datatool/samples/sample-datatooltk.tex
new file mode 100644
index 0000000000..23ea4a9824
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-datatooltk.tex
@@ -0,0 +1,23 @@
+% Sample file used with datatooltk
+\documentclass{article}
+
+\usepackage{datatool}
+
+% load database that was either previously saved using
+% \DTLsaverawdb{mydata}{data-raw.dbtex}
+% or created and saved using datatooltk
+
+\input{data-raw.dbtex}
+
+\begin{document}
+
+\DTLdisplaydb{mydata}
+
+% 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/macros/latex/contrib/datatool/samples/sample-dict.pdf b/macros/latex/contrib/datatool/samples/sample-dict.pdf
new file mode 100644
index 0000000000..cd16bc3eac
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-dict.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-dict.tex b/macros/latex/contrib/datatool/samples/sample-dict.tex
new file mode 100644
index 0000000000..fbf3273180
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-dict.tex
@@ -0,0 +1,434 @@
+\documentclass[oneside]{scrbook}
+
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{mathpazo}
+
+% The low optimize setting won't work for this example
+\usepackage[optimize=high]{datagidx}
+
+\usepackage[colorlinks]{hyperref}
+
+% This is an example document that uses datagidx to create a
+% sorted dictionary, using datatool to do the sorting.
+
+% Make a database labelled 'index' with the given title
+
+\newgidx{index}{Sample Dictionary Created Using datagidx}
+
+% Define some terms for the dictionary
+
+% First set the default database, so we don't have to keep using the
+% "database" key:
+\DTLgidxSetDefaultDB{index}
+
+% Add some custom fields
+
+\newtermaddfield{Derivatives}{derivatives}{}
+
+\newtermaddfield{Origin}{origin}{}
+
+\newtermaddfield{Phrases}{phrases}{}
+
+\newtermaddfield{Subject}{subject}{}
+
+\newtermaddfield{Variation}{variation}{}
+
+\newtermaddfield{Phonetic}{phonetic}{}
+
+\newtermaddfield{AltPlural}{altplural}{}
+
+\newtermaddfield{Parenthetical}{parenthetical}{}
+
+% Provide a convenient interface to define words:
+
+% Syntax: \newentry[main option list][cat opt list]{word}{category}{definition}
+
+\newcommand*{\newentry}[1][]{%
+ \def\newentryopts{#1}%
+ \nnewentry
+}
+
+\newcommand*{\nnewentry}[4][]{%
+ \expandafter\newterm\expandafter[\newentryopts]{#2}%
+ \newterm
+ [%
+ label={\datagidxlastlabel-#3},%
+ parent={\datagidxlastlabel},%
+ description={#4},%
+ text={#3},%
+ #1%
+ ]%
+ {#3}%
+ \setcounter{newentrysubcat}{0}%
+}
+
+% Syntax: \newentrycat{parent label}{category}{definition}
+
+\newcommand*{\newentrycat}[3]{%
+ \newterm
+ [%
+ label={#1-#2},%
+ parent={#1},%
+ description={#3}%
+ ]%
+ {#2}%
+ \setcounter{newentrysubcat}{0}%
+}
+
+% Syntax: \newentrysubcat[option list]{parent label}{description}
+
+\newcounter{newentrysubcat}
+
+\newcommand*{\newentrysubcat}[3][]{%
+ \stepcounter{newentrysubcat}%
+ \newterm
+ [%
+ label={#2-\arabic{newentrysubcat}},%
+ sort={#2-\arabic{newentrysubcat}},%
+ parent={#2},%
+ description={#3},%
+ #1%
+ ]
+ {}%
+}
+
+\newcommand*{\categoryand}{ \& }
+
+% hook into the mechanism that constructs the label and sort fields from
+% the name:
+
+\appto\newtermlabelhook{\def\categoryand{+}}
+
+\newcommand*{\namefont}[1]{\textbf{\sffamily #1}}
+\newcommand*{\subjectfont}[1]{\textsf{#1}}
+\newcommand*{\categoryfont}[1]{\namefont{#1}}
+\newcommand*{\originfont}[1]{\emph{#1}}
+\newcommand*{\derivativeformat}[2]{\textbf{#1}\space\textsf{#2}}
+\newcommand*{\phoneticformat}[1]{/#1/}
+
+\newcommand*{\stress}[1]{\textbf{#1}}
+
+\newcommand*{\crossref}[1]{\textbf{\useentry{#1}{Name}}}
+\newcommand*{\Crossref}[1]{\textbf{\textsc{\useentry{#1}{Name}}}}
+
+% Words and their definitions taken from the Compact Oxford English
+% Dictionary
+
+% label and sort must both be specified here as \newterm can't cope
+% with {\ae} when automatically generating the label and sort from
+% the name
+\newentry
+ [%
+ phonetic={ee-\stress{oh}-li-uhn},
+ origin={from \originfont{\AE olus}, the Greek god of the winds},
+ label=aeolian,
+ sort=aeolian
+ ]
+ {{\ae}olian harp}{noun}{a stringed instrument that produces musical
+sounds when a current of air passes through it}
+
+% Similarly label and sort are needed here
+\newentry
+ [%
+ phonetic={i-\stress{sof}-fuh-guhss},
+ plural={{œ}sophagi},
+ origin={Greek \originfont{oisophagos}},
+ label={oesophagus},
+ sort={oesophagus}
+ ]
+ {{œ}sophagus}{noun}{the muscular tube which connects throat to
+stomach}
+
+\newentry
+ [% additional info
+ origin={Old English}
+ ]%
+ [%
+ subject={literary}
+ ]
+ {asunder}{adverb}{apart}
+
+\newentry
+ [% additional info
+ origin={Old English},
+ parenthetical={\subjectfont{US} \namefont{adz}}
+ ]
+ {adze}{noun}{a tool similar to an axe, with an arched blade at right angles to
+ the handle}
+
+\newentry
+ [% additional info
+ origin={Latin \originfont{astutus}},
+ derivatives={\derivativeformat{astutely}{adverb}
+ \derivativeformat{astuteness}{noun}}
+ ]
+ {astute}{adjective}{good at making accurate judgements; shrewd}
+
+\newentry{astern}{adverb}{behind or towards the rear of a ship}
+
+\newentry{thunderbolt}{noun}{flash of lightning with a crash of
+thunder at the same time}
+
+\newentry{thunderclap}{noun}{a crash of thunder}
+
+\newentry
+ [%
+ origin={Italian \originfont{ticchio}}
+ ]
+ {tic}{noun}{a recurring spasm of the muscles, most often in
+the face}
+
+\newentry
+ [%
+ phonetic={thwort},
+ origin={from Old Norse, `transverse'}
+ ]
+ {thwart}{verb}{}
+
+\newentrysubcat{thwart-verb}{prevent someone from accomplishing
+something}
+
+\newentrysubcat{thwart-verb}{prevent something from succeeding}
+
+\newentrycat{thwart}{noun}{a crosspiece forming a seat for a rower
+in a boat}
+
+\newentry
+ [% additional info
+ origin={from an old sense of \Crossref{thwart}, meaning
+`across'},
+ phonetic={uh-\stress{thwart}}
+ ]
+ {athwart}{preposition\categoryand adverb}{from side to side of something;
+ across}
+
+\newentry
+ [%
+ phonetic={aw-\stress{bree}-shuh},
+ parenthetical={also \namefont{aubrietia}},
+ origin={named after the French botanist Claude \originfont{Aubriet}}
+ ]
+ {aubretia}{noun}{a trailing plant with purple, pink, or white
+flowers}
+
+\newentry
+ [%
+ phonetic={aw-\stress{day}-shuhss},
+ derivatives={\derivativeformat{audaciously}{adverb}
+ \derivativeformat{audaciousness}{noun}
+ \derivativeformat{audacity}{noun}},
+ origin={Latin \originfont{audax} `bold'}
+ ]
+ {audacious}{adjective}{}
+
+\newentrysubcat{audacious-adjective}{willing to take daring risks}
+\newentrysubcat{audacious-adjective}{showing lack of respect; rude
+or impudent}
+
+\newentry
+ [%
+ parenthetical={pl.\ \namefont{attorneys}},
+ phonetic={uh-\stress{ter}-ni},
+ origin={Old French \originfont{atorner} `assign'}
+ ]
+ {attorney}{noun}{}
+
+\newentrysubcat{attorney-noun}{a person appointed to act for another
+in legal matters}
+
+\newentrysubcat
+ [%
+ subject={chiefly US}%
+ ]
+ {attorney-noun}{a lawyer}
+
+\newentry
+ [
+ phonetic={\stress{ay}-tri-uhm},
+ altplural={atria},
+ parenthetical={pl.\ \namefont{atria}
+ \phoneticformat{\stress{ay}-tri-uh}
+ or \namefont{atriums}},
+ derivatives={\derivativeformat{atrial}{adjective}},
+ origin={Latin}
+ ]
+ {atrium}{noun}{}
+
+\newentrysubcat{atrium-noun}{a central hall rising through several
+storeys and having a glazed roof}
+
+\newentrysubcat{atrium-noun}{an open area in the centre of an
+ancient Roman house}
+
+\newentrysubcat{atrium-noun}{each of the two cavities of the heart}
+
+\newentry
+ [%
+ plural={austerities},
+ phonetic={oss-\stress{te}-ri-ti}
+ ]
+ {austerity}{noun}{}
+
+\newentrysubcat{austerity-noun}{strictness or severity of appearance
+or manner}
+\newentrysubcat{austerity-noun}{difficult economic conditions
+resulting from a cut in public spending}
+
+\newentry
+[
+ plural={cacti},
+ altplural={cactuses},
+ origin={Greek \originfont{kaktos} `cardoon'}
+]
+{cactus}{noun}{a succulent plant with thick fleshy stems bearing
+spikes but no leaves}
+
+\newentry
+ [%
+ phonetic={chahf},
+ phrases={\namefont{separate} (or \namefont{sort}) \namefont{the
+ wheat from the chaff} distinguish valuable people or things from
+ worthless ones},
+ origin={Old English}
+ ]
+ {chaff\textsuperscript{1}}{noun}{}
+
+\newentrysubcat{chaff1-noun}{the husks of grain from the seed by
+winnowing or threshing}
+
+\newentrysubcat{chaff1-noun}{chopped hay and straw used in cattle
+fodder}
+
+\newentry
+ [
+ phonetic={chaff},
+ ]
+ {chaff\textsuperscript{2}}{noun}{light-hearted joking}
+
+\newentrycat{chaff2}{verb}{tease someone}
+
+\newterm
+[
+ plural={elves},%
+ derivatives={\derivativeformat{elfish}{adjective}
+ \derivativeformat{elven}{adjective (literary)}
+ \derivativeformat{elvish}{adjective}},%
+ origin={Old English},%
+ description={a supernatural creature of folk tales, represented as
+ a small human figure with pointed ears}
+]
+{elf}
+
+% Be careful of words starting with an accent.
+
+\newterm
+ [
+ label={elite},%
+ phonetic={i-\stress{leet}},%
+ origin={French, `selection, choice'}%
+ ]
+ {{é}lite}
+
+\newentrycat{elite}{noun}{a group of people regarded as the best in a
+particular society or organisation}
+
+\newterm
+ [
+ description={plural of \Crossref{elf}}%
+ ]
+ {elves}
+
+% Add all entries
+
+\glsaddall{index}
+
+% Customise index format
+
+\renewcommand{\DTLgidxNameFont}[1]{\namefont{\large#1}}
+
+\newcommand{\postnamespace}{\space}
+
+\renewcommand{\DTLgidxPostName}{%
+ \ifdefempty\Subject
+ {%
+ }%
+ {%
+ \space\subjectfont{\Subject}%
+ }%
+ \ifdefempty\Phonetic
+ {%
+ }%
+ {%
+ \space\phoneticformat{\Phonetic}%
+ }%
+ \ifdefempty\Parenthetical
+ {%
+ \ifdefempty\AltPlural
+ {%
+ \ifthenelse{\equal{\Plural}{\Text s}}%
+ {%
+ }%
+ {%
+ \space (pl.\ \namefont{\Plural})%
+ }%
+ }%
+ {%
+ \space (pl. \namefont{\Plural} or \namefont{\AltPlural})%
+ }%
+ }%
+ {%
+ \space (\Parenthetical)%
+ }%
+ \postnamespace
+}
+
+\renewcommand{\DTLgidxCategoryNameFont}[1]{\categoryfont{#1}}
+\renewcommand{\DTLgidxCategorySep}{\space\textbullet\space}
+\renewcommand*{\DTLgidxChildCountLabel}{%
+ \def\postnamespace{~\def\postnamespace{\space}}%
+ \textbf{\sffamily\theDTLgidxChildCount}%
+}
+
+\renewcommand{\DTLgidxDictPostItem}{%
+ \ifdefempty\Derivatives
+ {}
+ {%
+ \par
+ \datagidxdictparshape
+ -- \textsc{derivatives} \Derivatives.
+ }%
+ \ifdefempty\Phrases
+ {}
+ {%
+ \par
+ \datagidxdictparshape
+ -- \textsc{phrases} \Phrases.
+ }%
+ \ifdefempty\Origin
+ {}
+ {%
+ \par
+ \datagidxdictparshape
+ -- \textsc{origin} \Origin.
+ }%
+ \par
+}
+
+\begin{document}
+
+\printterms
+[
+ database=index,
+ postheading={This is an example document illustrating
+ the use of the datagidx package. The examples here are taken from
+ the Compact Oxford English Dictionary.\medskip
+ },
+ balance=false,
+ columns=2,
+ postdesc=dot,%
+ childsort=false,% don't sort the child lists
+ style={dict} % use the 'dict' style
+]
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-europecv-bib.pdf b/macros/latex/contrib/datatool/samples/sample-europecv-bib.pdf
new file mode 100644
index 0000000000..38abdb7044
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-europecv-bib.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-europecv-bib.tex b/macros/latex/contrib/datatool/samples/sample-europecv-bib.tex
new file mode 100644
index 0000000000..cecc23010d
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-europecv-bib.tex
@@ -0,0 +1,19 @@
+\documentclass[narrow,helvetica,a4paper]{europecv}
+
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{databib}
+
+\begin{document}
+\DTLloadbbl{myrefs}{xampl.bib}
+\nocite{*}
+
+\begin{europecv}
+ \ecvsection{Publications}
+
+ \gDTLforeachbibentry*{myrefs}{%
+ \ecvitem{}{\gDTLformatbibentry}%
+}
+\end{europecv}
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-gidx.pdf b/macros/latex/contrib/datatool/samples/sample-gidx.pdf
new file mode 100644
index 0000000000..6621748211
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-gidx.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-gidx.tex b/macros/latex/contrib/datatool/samples/sample-gidx.tex
new file mode 100644
index 0000000000..1bc5109538
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-gidx.tex
@@ -0,0 +1,645 @@
+\documentclass{book}
+
+\usepackage{datagidx}
+
+\usepackage[colorlinks]{hyperref}
+
+\usepackage{fmtcount}
+
+\DTLgidxAddLocationType{numberstringnum}
+
+ % Define some convenient commands
+
+\newcommand*{\principleloc}[1]{\textbf{#1}}
+\newcommand*{\glossaryloc}[1]{\textit{#1}}
+\newcommand*{\appname}[1]{\texttt{#1}}
+
+ % Don't let \appname interfere with the sorting and labelling of
+ % terms:
+
+\appto\newtermlabelhook{\let\appname\DTLgidxNoFormat}
+
+ % (datagidx also does this for \MakeUppercase, \MakeTextUppercase,
+ % \MakeLowercase, \MakeTextLowercase, \textsc and \acronymfont.)
+
+ % Make an index database labelled 'index' with given title.
+ % (Omit optional argument to affect all indexing databases
+ % or use a comma-separated list of labels for each database
+ % to affect.)
+
+\newgidx[heading=\chapter]{index}{Index}
+
+ % Add custom fields to the 'index' database
+
+\newtermaddfield[index]{Ed}{ed}{\field{text}ed}
+
+\newtermaddfield[index]{Ing}{ing}{\field{text}ing}
+
+\newtermaddfield[index]{AltPlural}{altplural}{}% no default value
+
+ % Define some convenience commands to access these fields
+
+\newcommand*{\glsed}[1]{\useentry{#1}{Ed}}
+\newcommand*{\glsing}[1]{\useentry{#1}{Ing}}
+\newcommand*{\glsaltpl}[1]{\useentry{#1}{AltPlural}}
+
+ % Make a glossary database labelled 'glossary' with given title.
+
+\newgidx[heading=\section]{glossary}{Glossary}
+
+ % Make an acronym database labelled 'acronyms' with given title.
+ % A different heading for the table of contents is supplied.
+
+\newgidx[heading={\section[Acronyms]}]{acronyms}{List of Acronyms}
+
+ % Make a notation database labelled 'notation' with given title
+
+\newgidx[heading=\section]{notation}{Notation}
+
+ % Define some terms for the index
+
+ % Either use "database" key in optional argument
+ % or set the default database. It's less typing to set the default
+ % database, so let's do that:
+
+\DTLgidxSetDefaultDB{index}
+
+ % These definitions will add terms to the "index" database:
+
+\newterm{singular}
+\newterm{plural}
+\newterm
+ [% options
+ label=pluralalt,
+ parent=plural,
+ see={altplural}
+ ]
+ {alternative}
+\newterm[label=altplural]{alternative plural}
+\newterm{group}
+\newterm[see=group]{scope}
+\newterm[label={ind-glossary}]{glossary}
+\newterm
+ [%
+ label={ind-index},
+ seealso={ind-glossary},
+ ]
+ {index}
+\newterm
+ [
+ seealso={ind-glossary}
+ ]
+ {acronym}
+\newterm[parent=acronym]{reset}
+\newterm
+ [%
+ parent=acronym,
+ label={firstuse},
+ ]
+ {first use}
+\newterm
+ [%
+ parent=acronym,
+ label={acronymlist},
+ text={list of acronyms},
+ plural={lists of acronyms}
+ ]
+ {list}
+
+ % Be careful if a value contains a comma or an equal sign. The
+ % entire value must be grouped.
+\newterm
+ [%
+ label={comma},
+ sort={,},
+ text={comma (,)},
+ plural={commas (,)}
+ ]%
+ {, (comma)}
+
+\newterm
+ [%
+ label={equals},
+ sort={=},
+ text={equal sign (=)},
+ plural={equal signs (=)},
+ ]%
+ {= (equal sign)}
+
+ % Don't need to worry about makeindex's special characters (since
+ % we're not using makeindex!)
+\newterm
+ [%
+ label={"},
+ sort={"},
+ text={double quote (")},
+ plural={double quotes (")},
+ ]%
+ {" (double quote)}
+
+\newterm
+ [%
+ label={!},
+ sort={!},
+ text={exclamation mark (!)},
+ plural={exclamation marks (!)},
+ ]%
+ {! (exclamation mark)}
+
+\newterm
+ [%
+ label={|},
+ sort={|},
+ text={vertical bar (\textbar)},
+ plural={vertical bars (\textbar)},
+ ]%
+ {\textbar\ (vertical bar)}
+
+
+ % Be careful of special characters
+
+\newterm
+ [%
+ label={amp},
+ sort={\DTLgidxStripBackslash{\&}},
+ text={ampersand (\&)},
+ plural={ampersands (\&)},
+ ]
+ {\& (ampersand)}
+
+\newterm
+ [%
+ label={underscore},
+ sort={\DTLgidxStripBackslash{\_}},
+ text={underscore (\_)},
+ plural={underscores (\_)},
+ ]
+ {\_ (underscore)}
+
+\newterm
+ [%
+ label={dollar},
+ sort={\DTLgidxStripBackslash{\$}},
+ text={dollar (\$)},
+ plural={dollars (\$)},
+ ]
+ {\$ (dollar)}
+
+\newterm
+ [%
+ label={circum},
+ sort={\DTLgidxStripBackslash{\^}},
+ text={circumflex (\textasciicircum)},
+ plural={circumflexes (\textasciicircum)},
+ ]
+ {\textasciicircum\ (circumflex)}
+
+\newterm
+ [%
+ label={tilde},
+ sort={\string~},
+ text={tilde (\textasciitilde)},
+ plural={tildes (\textasciitilde)},
+ ]
+ {\textasciitilde\ (tilde)}
+
+\newterm
+ [
+ label={0},
+ sort={0},
+ ]
+ {0 (zero)}
+
+\newterm
+ [
+ label={1},
+ sort={1},
+ ]
+ {1 (one)}
+
+\newterm
+ [
+ label={2},
+ sort={2},
+ ]
+ {2 (two)}
+
+\newterm
+ [
+ label={3},
+ sort={3},
+ ]
+ {3 (three)}
+
+ % Let's index a person
+\newterm
+ [%
+ label={knuth},
+ text={Knuth},
+ ]
+ {Knuth, Donald E.}
+
+ % and have a few more entries in the same letter group to test case
+ % ordering:
+\newterm{kite}
+\newterm{koala}
+
+ % Earlier I modified \newtermlabelhook so
+ % that \appname won't interfere with the sorting
+ % and labelling mechanism, so I don't need to specify separate sort
+ % and label keys here:
+
+\newterm{\appname{makeindex}}% label and sort both set to just 'makeindex'
+\newterm{\appname{xindy}}% label and sort both set to just 'xindy'
+
+ % Define some terms for the glossary
+
+\DTLgidxSetDefaultDB{glossary}
+
+\newterm[description={sea mammal with flippers that eats fish}]{seal}
+\newterm[description={large seal},seealso={seal}]{sea lion}
+
+\newterm{bravo}
+\newterm
+ [%
+ label=bravocry,
+ description={cry of approval (pl.\ bravos)},
+ parent=bravo
+ ]
+ {bravo}
+\newterm
+ [% options
+ label=bravokiller,
+ description={hired ruffian or killer (pl.\ bravoes)},
+ plural=bravoes,
+ parent=bravo
+ ]
+ {bravo}
+
+\newterm
+ [%
+ plural={indices\glsadd{ind-index}},
+ altplural={indexes},
+ text={index\glsadd{ind-index}},
+ description={an alphabetical list of names or subjects with
+ references to their location in the document (pl.\ indices or
+ indexes)}
+ ]
+ {index\glsadd{[glossaryloc]ind-index}}
+
+\newterm
+ [% options
+ text={glossary\glsadd{ind-glossary}},
+ plural={glossaries\glsadd{ind-glossary}},
+ seealso={index}%
+ ]%
+ {glossary\glsadd{ind-glossary}}
+
+\newterm
+ [% options
+ label=glossarycol,
+ text={glossary\glsadd{ind-glossary}},
+ plural={glossaries\glsadd{ind-glossary}},
+ description={collection of glosses},
+ parent=glossary
+ ]
+ {glossary\glsadd{[glossaryloc]ind-glossary}}
+
+\newterm
+ [% options
+ label=glossarylist,
+ text={glossary\glsadd{ind-glossary}},
+ plural={glossaries\glsadd{ind-glossary}},
+ description={list of technical words},
+ parent=glossary
+ ]
+ {glossary\glsadd{[glossaryloc]ind-glossary}}
+
+\newterm
+ [% options
+ label=pglist,
+ % description contains commas so it must be grouped
+ description={a list of individual pages or page ranges
+ (e.g.\ 1,2,4,7--9)}
+ ]
+ {page list}
+
+ % define some acronyms
+
+\DTLgidxSetDefaultDB{acronyms}
+
+ % Let's redefine \newacro so that the short form is also indexed:
+
+\renewcommand{\newacro}[3][]{%
+ \newterm[database=index,label={ind-#2-long},see={ind-#2}]{#3}%
+ \newterm[database=index,label={ind-#2}]{\acronymfont{#2}}%
+ \newterm
+ [%
+ description={\capitalisewords{#3}},% long form capitalised
+ text={\DTLgidxAcrStyle{#3}{\acronymfont{#2}}},% produced via \gls
+ plural={\DTLgidxAcrStyle{#3}{\acronymfont{#2}}},% produced via \glspl
+ short={\acronymfont{#2}\glsadd{ind-#2}},% short form
+ long={#3},% long form
+ sort={#2},% sort on short form
+ #1%
+ ]%
+ {#2\glsadd{[glossaryloc]ind-#2}}
+}
+
+\newacro{html}{hyper-text markup language}
+\newacro{css}{cascading style sheet}
+\newacro{xml}{extensible markup language}
+
+% define some notation
+
+\DTLgidxSetDefaultDB{notation}
+
+\newterm
+ [%
+ symbol={\ensuremath{\mathcal{S}}},
+ description={a collection of distinct objects},
+ ]%
+ {set}
+
+\newterm
+ [%
+ parent=set,
+ symbol={\ensuremath{\mathcal{U}}},
+ text={universal set},
+ description={the set containing everything}
+ ]%
+ {universal}
+
+\newterm
+ [%
+ parent=set,
+ symbol={\ensuremath{\emptyset}},
+ text={empty set},
+ description={the set with no elements}
+ ]%
+ {empty}
+
+\newterm
+ [%
+ symbol={\ensuremath{|\mathcal{S}|}},
+ description={the number of elements in the set \ensuremath{\mathcal{S}}}
+ ]%
+ {cardinality}
+
+\title{Sample Document Using the datagidx Package}
+\author{Nicola L. C. Talbot}
+
+\begin{document}
+\pagenumbering{alph}% Stop hyperref complaining about duplicate page identifiers
+\maketitle
+\thispagestyle{empty}%
+
+\frontmatter
+
+\tableofcontents
+
+\chapter{Summary}
+
+This is a sample document illustrating the use of the
+\texttt{datagidx} package to create document \glspl{index},
+\glspl{glossarylist} and \glspl{acronymlist} without the use of
+external \glsing{index} % custom command defined earlier
+applications, such as \gls{makeindex} or
+\gls{xindy}. Please read the user guide (datatool-user.pdf) for
+further guidance.
+
+\mainmatter
+
+\chapter{Introduction}
+%\renewcommand{\thepage}{\numberstring{page}}
+
+Words can be \glsed{index}. % custom command defined earlier.
+
+A \gls{glossarylist}\glsadd{[principleloc]ind-glossary} is a useful addition to any technical document,
+although a \gls{glossarycol} can also simply be a collection of
+glosses, which is another thing entirely. Some documents have
+multiple \glspl{glossarylist}.
+
+A \gls{bravocry} is a cry of approval (plural \glspl{bravocry}) but a
+\gls{bravokiller} can also be a hired ruffian or killer (plural
+\glspl{bravokiller}).
+
+\section{Characters}
+
+When defining entries be careful of \glspl{comma} and \glspl{equals}
+so they don't interfere with the key=value mechanism. The sort and
+label keys get expanded so be careful of special characters, such as
+\gls{amp}, \gls{underscore}, \gls{circum}, \gls{dollar} and \gls{tilde}.
+
+Since we're not using \gls{makeindex}, we don't need to worry about
+\gls{makeindex}'s special characters, such as \gls{"}, \gls{!} and
+\gls{|}. (Unless they've been made active by packages such as
+\texttt{ngerman} or \texttt{babel}.)
+
+Non-alphabetical characters are usually grouped at the start of an
+index, and are usually followed by the number group. That is, the
+group of entries that are numerical, such as \gls{0}, \gls{1},
+\gls{2} and \gls{3}.
+
+\section{Custom Fields}
+
+You can add custom fields. For example, this document has added
+three custom fields to the `index' database.
+
+\section{Plurals}
+
+The \gls{plural} of \gls{glossarylist} is
+\glspl{glossarylist}. The \gls{plural} of \gls{index} is
+\glspl{index}. Some words have an \gls{altplural}. For example,
+an alternative to \glspl{index} is
+\glsaltpl{index}.% custom command defined earlier
+
+\section{Sorting}
+
+The only type of sorting available is letter sorting. If you want
+word sorting you'll need to use \gls{makeindex} or \gls{xindy}.
+So ``\gls{sea lion}'' comes after ``\gls{seal}''.
+
+The default sort is case-insensitive so \gls{kite} before
+\gls{knuth} and \gls{knuth} before \gls{koala}.
+
+\section{Using without indexing}
+
+Here's a defined entry that won't get into the glossary.
+Name: \glsdispentry{pglist}{Name}.
+Description: \glsdispentry{pglist}{Description}.
+(Unless I~later reference it using a command like \verb|\gls|.)
+
+\section{Links to Entries}
+
+You can reference and index entries using \verb|\gls|, \verb|\Gls|,
+\verb|\glspl|, \verb|\Glspl|, \verb|\glssym| and \verb|\Glssym|.
+(Note, if you're used to using the \texttt{glossaries} package
+the syntax is different.)
+
+Or you can reference a particular field using \verb|\useentry| or
+\verb|\Useentry|. So here's the description for \gls{seal}:
+\useentry{seal}{Description}.
+
+If the \texttt{hyperref} package has been loaded, commands like
+\verb|\gls| will link to the relevant entry in the glossary or
+index. Referencing using \verb|\glsdispentry| and
+\verb|\Glsdispentry| won't have hyperlinks.
+
+\subsection{Enabling and Disabling Hyperlinks}
+
+If the \texttt{hyperref} package has been loaded, hyperlinks can be
+enabled and disabled. Either globally
+\DTLgidxDisableHyper
+(here's a reference to \gls{seal} without a hyperlink
+\DTLgidxEnableHyper
+ and here's a reference to \gls{seal} with a hyperlink)
+or locally
+({%
+ \DTLgidxDisableHyper
+ here's a reference to \gls{seal} without a hyperlink
+}%
+and here's a reference to \gls{seal} with a hyperlink).
+
+\section{Acronyms}
+
+\glsadd{firstuse}Here's an \gls{acronym} referenced using \verb|\acr|: \acr{html}. And here
+it is again: \acr{html}. If you're used to the \texttt{glossaries}
+package, note the difference in using \verb|\gls|: \gls{html}.
+And again (no difference): \gls{html}.
+
+Now let's switch to displaying acronyms with a footnote.
+ % syntax: \DTLgidxAcrStyle{long}{short}
+\renewcommand*{\DTLgidxAcrStyle}[2]{%
+ #2\footnote{#1.}%
+}%
+First use: \acr{xml}. Next use: \acr{xml}.
+
+However it would look better if the footnote text started with a
+capital letter, so let's tweak things a bit.
+ % syntax: \DTLgidxFormatAcr{label}{long field}{short field}
+\renewcommand*{\DTLgidxFormatAcr}[3]{%
+ \DTLgidxAcrStyle{\Glsdispentry{#1}{#2}}{\useentry{#1}{#3}}%
+}%
+ % syntax: \DTLgidxFormatAcr{label}{long field}{short field}
+\renewcommand*{\DTLgidxFormatAcrUC}[3]{%
+ \DTLgidxAcrStyle{\Glsdispentry{#1}{#2}}{\Useentry{#1}{#3}}%
+}%
+Try with another acronym: \acr{css}. Next use: \acr{css}.
+
+\glsadd{reset}Reset: \glsresetall{acronyms}%
+\renewcommand*{\DTLgidxAcrStyle}[2]{#1 (#2)}%
+\renewcommand*{\DTLgidxFormatAcr}[3]{%
+ \DTLgidxAcrStyle{\glsdispentry{#1}{#2}}{\useentry{#1}{#3}}%
+}%
+\renewcommand*{\DTLgidxFormatAcrUC}[3]{%
+ \DTLgidxAcrStyle{\Glsdispentry{#1}{#2}}{\useentry{#1}{#3}}%
+}%
+Here are the acronyms again:
+\acr{html}, \acr{xml} and \acr{css}.
+Next use:
+\acr{html}, \acr{xml} and \acr{css}.
+Full form:
+\gls{html}, \gls{xml} and \gls{css}.
+
+Reset again. \glsresetall{acronyms}%
+Start with a capital. \Acr{html}.
+Next: \Acr{html}. Full: \Gls{html}.
+
+Prefer small-caps?
+\renewcommand{\acronymfont}[1]{\textsc{#1}}%
+\Acr{css}. Next: \acr{css}. Full: \gls{css}.
+
+Prefer capitals?
+\renewcommand{\acronymfont}[1]{\MakeTextUppercase{#1}}%
+\Acr{xml}. Next: \acr{xml}. Full: \gls{xml}.
+
+\section{Conditionals}
+
+You can test if a term has been defined using \verb|\iftermexists|.
+For example: \iftermexists{seal}{seal exists}{seal doesn't exist}.
+Another example: \iftermexists{jabberwocky}{jabberwocky
+exists}{jabberwocky doesn't exist}.
+
+You can test if a term has been used via \verb|ifentryused|.
+For example: \ifentryused{seal}{seal has been used}{seal hasn't been
+used.}
+Another example: \ifentryused{pglist}{pglist has been used}{pglist
+hasn't been used}.
+
+
+\section{Symbols}
+
+Terms may have an associated symbol. The symbol can be accessed
+using \verb|\glssym| or if you don't want to add information to the
+location list you can use \verb|\glsdispentry|. Here's the symbol
+associated with the \gls{cardinality} entry:
+\glsdispentry{cardinality}{Symbol}.
+
+A \gls{set} (denoted \glssym{set}) is a collection of objects.
+The \gls{universal} is the set of everything.
+The \gls{empty} contains no elements.
+The \gls{cardinality} of a set (denoted \glssym{cardinality}) is the
+number of elements in the set.
+
+\section{Location Ranges}
+
+A range is formed if a location sequence contains more than 2
+locations. Here's \gls{seal} again.
+
+\backmatter
+ % suppress section numbering
+\setcounter{secnumdepth}{-1}
+
+\chapter{Glossaries}
+
+\printterms
+ [
+ database=glossary,% 'glossary' database
+ columns=1,% one column page layout
+ postdesc=dot,% put a full stop after the description
+ style=gloss,% use 'gloss' style (sub-entries numbered)
+ namefont={\textbf},% put the name in bold
+ namecase=firstuc,% make the first letter of the name upper case
+ child=noname,% don't print sub item names
+ childsort=false,% don't sort the child lists
+% location=hide% hide the location list
+ ]
+
+\printterms
+ [
+ database=acronyms,% 'acronyms' database
+ postdesc=dot,% put a full stop after the description
+ columns=1,% one column page layout
+ namefont={\textbf},% put the name (i.e. the abbreviation) in bold
+ namecase=uc,% make the name upper case
+ style=align,% use the 'align' style
+% location=hide% hide the location list
+ ]
+
+\printterms
+ [
+ database=notation,% 'notation' database
+ postdesc=dot,% put a full stop after the description
+ columns=1,% one page column layout
+ namefont={\textbf},% make the name bold
+ style=indexalign,
+ namecase=firstuc,% make first letter of name a capital
+ symboldesc={desc (symbol)},% put symbol to the right of the description
+ sort={}% don't sort
+ ]
+
+\printterms
+ [
+ database=index,% 'index' database
+ prelocation=dotfill,% put a dotted line before the location list
+ columns=2,% page layout
+ style=index,% use 'index' style
+ %balance=false,% don't balance columns
+ postheading={Locations in bold indicate primary reference.
+ Locations in italic indicate definitions in the
+ glossaries.}
+ ]
+
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-glossary.pdf b/macros/latex/contrib/datatool/samples/sample-glossary.pdf
new file mode 100644
index 0000000000..59129431dd
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-glossary.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-glossary.tex b/macros/latex/contrib/datatool/samples/sample-glossary.tex
new file mode 100644
index 0000000000..1265fd9f4b
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-glossary.tex
@@ -0,0 +1,248 @@
+\documentclass{article}
+
+\usepackage{datagidx}
+
+\usepackage[colorlinks]{hyperref}
+
+ % Make a glossary database labelled 'glossary' with given title.
+
+\newgidx[heading=\section]{glossary}{Glossary}
+
+ % Make an acronym database labelled 'acronyms' with given title.
+ % A different heading for the table of contents is supplied.
+
+\newgidx[heading={\section[Acronyms]}]{acronyms}{List of Acronyms}
+
+ % Make a notation database labelled 'notation' with given title
+ % Make it an unnumbered section
+
+\newgidx[heading=\section*]{notation}{Notation}
+
+ % Define some terms for the glossary
+
+\DTLgidxSetDefaultDB{glossary}
+
+\newterm[description={sea mammal with flippers that eats
+fish}]{seal}
+\newterm[description={large seal}]{sea lion}
+
+\newterm{bravo}
+\newterm
+ [%
+ label=bravocry,
+ description={cry of approval (pl.\ bravos)},
+ parent=bravo
+ ]
+ {bravo}
+\newterm
+ [% options
+ label=bravokiller,
+ description={hired ruffian or killer (pl.\ bravoes)},
+ plural=bravoes,
+ parent=bravo
+ ]
+ {bravo}
+
+\newterm
+ [% options
+ plural={glossaries},
+ ]%
+ {glossary}
+
+\newterm
+ [% options
+ label=glossarycol,
+ plural={glossaries},
+ description={collection of glosses},
+ parent=glossary
+ ]
+ {glossary}
+
+\newterm
+ [% options
+ label=glossarylist,
+ plural={glossaries},
+ description={list of technical words},
+ parent=glossary
+ ]
+ {glossary}
+
+\newterm
+ [% options
+ % description contains commas so it must be grouped
+ description={a list of individual pages or page ranges
+ (e.g.\ 1,2,4,7--9)}
+ ]
+ {page list}
+
+\newterm
+ [%
+ plural={indices},
+ description={an alphabetical list of names or subjects with
+ references to their location in the document (pl.\ indices or
+ indexes)}
+ ]
+ {index}
+
+ % define some acronyms
+
+\DTLgidxSetDefaultDB{acronyms}
+
+\newacro{html}{hyper-text markup language}
+\newacro{css}{cascading style sheet}
+
+% override default description on this one:
+\newacro[description={eXtensible Markup Language}]{xml}{extensible markup language}
+
+% define some notation
+
+\DTLgidxSetDefaultDB{notation}
+
+\newterm
+ [%
+ symbol={\ensuremath{\mathcal{S}}},
+ description={a collection of distinct objects},
+ ]%
+ {set}
+
+\newterm
+ [%
+ symbol={\ensuremath{\mathcal{U}}},
+ description={the set containing everything}
+ ]%
+ {universal set}
+
+\newterm
+ [%
+ symbol={\ensuremath{\emptyset}},
+ description={the set with no elements}
+ ]%
+ {empty set}
+
+\newterm
+ [%
+ symbol={\ensuremath{|\mathcal{S}|}},
+ description={the number of elements in the set
+\ensuremath{\mathcal{S}}}
+ ]%
+ {cardinality}
+
+\title{Sample Document Using the datagidx Package}
+\author{Nicola L. C. Talbot}
+
+\begin{document}
+
+\maketitle
+
+Here's an acronym referenced using \verb|\acr|: \acr{html}.
+And here
+it is again: \acr{html}. If you're used to the \texttt{glossaries}
+package, note the difference in using \verb|\gls|: \gls{html}.
+And again (no difference): \gls{html}.
+
+Here are some more entries:
+
+\acr{xml} and \acr{css}.
+Next use:
+\acr{xml} and \acr{css}.
+Full form:
+\gls{xml} and \gls{css}.
+
+Reset again. \glsresetall{acronyms}%
+Start with a capital. \Acr{html}.
+Next: \Acr{html}. Full: \Gls{html}.
+
+Prefer capitals?
+\renewcommand{\acronymfont}[1]{\MakeTextUppercase{#1}}%
+\Acr{xml}. Next: \acr{xml}. Full: \gls{xml}.
+
+Prefer small-caps?
+\renewcommand{\acronymfont}[1]{\textsc{#1}}%
+\Acr{css}. Next: \acr{css}. Full: \gls{css}.
+
+A \gls{set} (denoted \glssym{set}) is a collection of objects.
+The \gls{universal set} is the set of everything.
+The \gls{empty set} contains no elements.
+The \gls{cardinality} of a set (denoted \glssym{cardinality}) is the
+number of elements in the set.
+
+A \gls{glossarylist} is a useful
+addition to any technical document,
+although a \gls{glossarycol} can also simply be a collection of
+glosses, which is another thing entirely. Some documents have
+multiple \glspl{glossarylist}. Entries in a \gls{glossarylist} or
+\gls{index} have an associated \gls{page list}.
+
+A \gls{bravocry} is a cry of approval (plural \glspl{bravocry}) but
+a
+\gls{bravokiller} can also be a hired ruffian or killer (plural
+\glspl{bravokiller}).
+
+\newpage
+
+Resetting all acronyms.\glsresetall{acronyms}
+
+Here are the acronyms again:
+
+\Acr{html}, \acr{xml} and \acr{css}.
+
+Next use:
+\Acr{html}, \acr{xml} and \acr{css}.
+
+Full form:
+\Gls{html}, \gls{xml} and \gls{css}.
+
+\newpage
+
+Provide your own link text: \glslink{[textbf]css}{style sheet}.
+
+\newpage
+
+\printterms
+ [
+ database=glossary,% 'glossary' database
+ columns=1,% one column page layout
+ postdesc=dot,% put a full stop after the description
+ style=gloss,% use 'gloss' style (sub-entries numbered)
+ namefont={\textbf},% put the name in bold
+ namecase=firstuc,% make the first letter of the name upper case
+ child=noname,% don't print sub item names
+ location=hide% hide the location list
+ ]
+
+\printterms
+ [
+ database=acronyms,% 'acronyms' database
+ postdesc=dot,% put a full stop after the description
+ columns=1,% one column page layout
+ namefont={\textbf},% put the name (i.e. the abbreviation) in bold
+ namecase=uc,% make the name upper case
+ style=align,% use the 'align' style
+ ]
+
+% Change the way the description is formatted (the argument to
+% \DTLgidxFormatDesc will always be a control sequence so
+% \xmakefirstuc is needed instead of \makefirstuc)
+\renewcommand{\DTLgidxFormatDesc}[1]{\xmakefirstuc{#1}}
+
+\printterms
+ [
+ database=notation,% 'notation' database
+ postdesc=dot,% put a full stop after the description
+ columns=1,% one page column layout
+ namefont={\textbf},% make the name bold
+ style=indexalign,
+ namecase=firstuc,% make first letter of name a capital
+ symboldesc={symbol desc},% put symbol to the left of description
+ %symboldesc={desc (symbol)},% put symbol to the right of the description
+ sort={},% don't sort
+% If the following widths are 0 (default) they take up their natural
+% amount of space. If the widths are greater than 0, those fields
+% are put in a box of the given width.
+ symbolwidth={2cm},% width taken up by symbol
+ locationwidth={1cm},% width taken up by location list
+ ]
+
+
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-index.pdf b/macros/latex/contrib/datatool/samples/sample-index.pdf
new file mode 100644
index 0000000000..16a363c58b
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-index.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-index.tex b/macros/latex/contrib/datatool/samples/sample-index.tex
new file mode 100644
index 0000000000..2a2673d0cc
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-index.tex
@@ -0,0 +1,735 @@
+\documentclass{article}
+
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+
+ % Two LaTeX runs are required to ensure this document is up-to-date
+
+ % It can take a long time to sort the index, so use the optimize
+ % option. This has values: off (no optimize, sorting is done every
+ % run), low (sort every second run) or high (write sorted database
+ % to file and read in next time round). Don't modify the
+ % index/glossary databases while the optimize option is set to
+ % high. Do the modifications while the optimize option is set to
+ % low or off. Alternatively, delete the .aux and .gidx files before rerunning
+ % LaTeX.
+
+%\usepackage[optimize=high]{datagidx}
+\usepackage[optimize=off]{datagidx}
+
+\usepackage[colorlinks]{hyperref}
+
+ % Define some convenient commands
+
+\newcommand*{\principleloc}[1]{\textbf{#1}}
+\newcommand*{\appname}[1]{\texttt{#1}}
+
+ % Later we'll switch to a fancy small caps Roman page numbering
+
+\newcommand*{\myscroman}[1]{%
+ \myscromannum{\value{#1}}%
+}
+
+\newcommand*{\myscromannum}[1]{%
+ \textsc{\romannumeral#1}%
+}
+
+ % Now we need to add this as a possible location type
+
+\DTLgidxAddLocationType{myscromannum}
+
+ % Don't let \appname interfere with the sorting and labelling of
+ % terms:
+
+\appto\newtermlabelhook{\let\appname\DTLgidxNoFormat}
+
+ % (datagidx also does this for \MakeUppercase, \MakeTextUppercase,
+ % \MakeLowercase, \MakeTextLowercase, \textsc and \acronymfont.)
+
+ % Make an index database labelled 'index' with given title.
+
+\newgidx{index}{Index}
+
+ % Define some terms for the index (entries must be defined in the
+ % preamble).
+
+ % Either use "database" key in optional argument
+ % or set the default database. It's less typing to set the default
+ % database, so let's do that:
+
+\DTLgidxSetDefaultDB{index}
+
+ % All the following definitions will add terms to the "index" database:
+
+ % accent commands get stripped from the default label and sort
+ % so the following gets both the label and sort set to 'macedoine'
+\newterm{mac\'edoine}
+
+ % The following gets both the label and sort set to 'macrame'
+ % (This is only tested with utf8. It most likely won't work with
+ % other encodings.)
+\newterm{macramé}
+
+ % Take care if the first letter starts with an accent.
+ % The initial accented letter must be grouped to ensure it works
+ % with \makefirstuc, but this will make the default label '{e}lite'
+ % rather than 'elite', so let's override the default:
+
+\newterm[label=elite]{{é}lite}
+
+ % Sometimes the default sort may not suit your requirements. In
+ % which case you can override it:
+
+\newterm
+[
+ sort={Ten Downing Street}
+]
+{10 Downing Street}
+
+\newterm{singular}
+\newterm{plural}
+\newterm{group}
+\newterm[see=group]{scope}
+\newterm[label={glossary}]{glossary}
+\newterm
+ [%
+ label={index},
+ seealso={glossary},
+ ]
+ {index}
+\newterm
+ [
+ seealso={glossary}
+ ]
+ {acronym}
+
+\newterm[parent=acronym]{reset}
+\newterm[parent=acronym]{unset}
+
+\newterm
+ [%
+ parent=acronym,
+ label={firstuse},
+ ]
+ {first use}
+\newterm
+ [%
+ parent=acronym,
+ label={acronymlist},
+ text={list of acronyms},
+ plural={lists of acronyms}
+ ]
+ {list}
+
+\newterm{reptile}
+
+\newterm
+ [%
+ seealso={reptile}
+ ]
+ {crocodylian}
+
+\newterm
+ [%
+ parent=crocodylian
+ ]
+ {crocodile}
+
+\newterm
+ [%
+ parent=crocodylian
+ ]
+ {caiman}
+
+\newterm
+ [%
+ parent=crocodylian
+ ]
+ {alligator}
+
+\newterm{seal}
+\newterm{sea lion}
+\newterm{sea}
+\newterm{sea anchor}
+\newterm{sea urchin}
+\newterm{seam bowler}
+\newterm{seam}
+
+ % Be careful if a value contains a comma or an equal sign. The
+ % entire value must be grouped.
+\newterm
+ [%
+ label={comma},
+ sort={,},
+ text={comma (,)},
+ plural={commas (,)}
+ ]%
+ {, (comma)}
+
+\newterm
+ [%
+ label={equals},
+ sort={=},
+ text={equal sign (=)},
+ plural={equal signs (=)},
+ ]%
+ {= (equal sign)}
+
+ % Don't need to worry about makeindex's special characters (since
+ % we're not using makeindex!)
+\newterm
+ [%
+ label={"},
+ sort={"},
+ text={double quote (")},
+ plural={double quotes (")},
+ ]%
+ {" (double quote)}
+
+\newterm
+ [%
+ label={!},
+ sort={!},
+ text={exclamation mark (!)},
+ plural={exclamation marks (!)},
+ ]%
+ {! (exclamation mark)}
+
+\newterm
+ [%
+ label={|},
+ sort={|},
+ text={vertical bar (\textbar)},
+ plural={vertical bars (\textbar)},
+ ]%
+ {\textbar\ (vertical bar)}
+
+
+ % Be careful of special characters
+
+\newterm
+ [%
+ label={amp},
+ sort={\DTLgidxStripBackslash{\&}},
+ text={ampersand (\&)},
+ plural={ampersands (\&)},
+ ]
+ {\& (ampersand)}
+
+\newterm
+ [%
+ label={underscore},
+ sort={\DTLgidxStripBackslash{\_}},
+ text={underscore (\_)},
+ plural={underscores (\_)},
+ ]
+ {\_ (underscore)}
+
+\newterm
+ [%
+ label={dollar},
+ sort={\DTLgidxStripBackslash{\$}},
+ text={dollar (\$)},
+ plural={dollars (\$)},
+ ]
+ {\$ (dollar)}
+
+\newterm
+ [%
+ label={circum},
+ sort={\DTLgidxStripBackslash{\^}},
+ text={circumflex (\textasciicircum)},
+ plural={circumflexes (\textasciicircum)},
+ ]
+ {\textasciicircum\ (circumflex)}
+
+\newterm
+ [%
+ label={tilde},
+ sort={\string~},
+ text={tilde (\textasciitilde)},
+ plural={tildes (\textasciitilde)},
+ ]
+ {\textasciitilde\ (tilde)}
+
+\newterm{0\DTLgidxParen{zero}}
+
+\newterm{1\DTLgidxParen{one}}
+
+\newterm{2\DTLgidxParen{two}}
+
+\newterm{3\DTLgidxParen{three}}
+
+\newterm{10\DTLgidxParen{ten}}
+
+\newterm{100\DTLgidxParen{one hundred}}
+
+\newterm{20\DTLgidxParen{twenty}}
+
+\newterm{alpine}
+
+ % Let's index a person
+ % The label is formed from the surname.
+ % If you are indexing more than one person with the same surname,
+ % you'll have to provide your own labels via the label key.
+
+\newterm{\DTLgidxName{Donald E.}{Knuth}}
+
+ % Let's have some examples from the Oxford Style Manual:
+
+\newterm{highwater}
+\newterm{highlights}
+\newterm{highbrow}
+\newterm{Highclere Castle}
+\newterm{highball}
+\newterm{high chair}
+\newterm{high heels}
+\newterm{high-fliers}
+
+ % parenthetical material
+\newterm{high\DTLgidxParen{light-headed}}
+
+\newterm
+[% label needed to distinguish from previous entry
+ label=highheight,
+]
+{high\DTLgidxParen{height}}
+
+\newterm{\emph{High Water}\DTLgidxParen{play}}
+
+\newterm{high water}
+
+\newterm{\emph{New York, New York}}
+
+ % Using \DTLgidxName allows the sort key to work with \dtlwordindexcompare
+
+\newterm{\DTLgidxName{J.}{High}}
+
+\newterm{\DTLgidxName{P.}{High-Smith}}
+
+\newterm{\DTLgidxName{A.}{Highsmith}}
+
+\newterm{\DTLgidxName{Earl of}{New York}}
+
+ % Some more examples from the Oxford Style Manual
+
+\newterm
+ [
+ label={DrMeynell}
+ ]
+ {\DTLgidxName{\DTLgidxRank{Dr}{A.}}{Meynell}}
+
+\newterm
+ [%
+ label={AliceMeynell}
+ ]
+ {\DTLgidxName{Alice}{Meynell}}
+
+\newterm
+ [%
+ label={AMeynell}
+ ]
+ {\DTLgidxName{A}{Meynell}}
+
+\newterm
+ [%
+ label={FMeynell}
+ ]
+ {\DTLgidxName{F.}{Meynell}}
+
+\newterm
+ [%
+ label={WGMeynell}
+ ]
+ {\DTLgidxName{W.~G.}{Meynell}}
+
+\newterm
+ [%
+ label={WMeynell}
+ ]
+ {\DTLgidxName{W.}{Meynell}}
+
+\newterm
+ [%
+ label={SirMeynell}
+ ]
+ {\DTLgidxName{\DTLgidxRank{Sir}{F.}}{Meynell}}
+
+
+ % Using \DTLgidxMac allows the sort key to sort on ``Mac'' rather
+ % than the argument to \DTLgidxMac
+
+\newterm{\DTLgidxName{Joe}{\DTLgidxMac{Mc}Cullers}}
+
+\newterm{\DTLgidxName{Bob}{\DTLgidxMac{M'}Fingal}}
+
+ % The labels need to be set here as we have identical surnames
+
+\newterm
+ [%
+ label={TomMacFarlane}
+ ]%
+ {\DTLgidxName{Tom}{\DTLgidxMac{Mac}Farlane}}
+
+\newterm
+ [%
+ label={DickMacFarlane}
+ ]%
+ {\DTLgidxName{Dick}{\DTLgidxMac{Mac}Farlane}}
+
+\newterm{\DTLgidxName{Harry}{\DTLgidxMac{Mc}Namee}}
+
+\newterm{\DTLgidxMac{Mc}Carthyism}
+\newterm{\DTLgidxMac{Mc}Guffin}
+\newterm{\DTLgidxMac{Mc}Coy}
+
+\newterm{macadam}
+\newterm{ma'am}
+\newterm{ma}
+\newterm{macabre}
+\newterm{machete}
+
+
+\newterm{deem}
+\newterm{demote}
+\newterm{deerstalker}
+\newterm{deface}
+\newterm{de facto}
+
+ % Don't let the hyphen be considered a word boundary:
+\newterm{de\DTLgidxIgnore{-}escalate}
+
+ % Ignore particles such as "de", "von", "of"
+ % The label defaults to deWinter but the name is displayed as
+ % de~Winter
+
+\newterm{\DTLgidxName{Fred}{\DTLgidxParticle{de}{Winter}}}
+
+\newterm{\DTLgidxName{Wilma}{Winter}}
+
+\newterm{\DTLgidxName{Betty}{Winters}}
+
+ % these all need labels added to ensure uniqueness:
+
+\newterm
+[
+ label={HenrySonJohn}
+]
+{\DTLgidxOffice{son \DTLgidxParticle{of}{John}}{Henry}}
+
+\newterm
+[
+ label={HenryBeaumont}
+]
+{\DTLgidxOffice{bishop \DTLgidxParticle{of}{Bayeux}}{Henry
+\DTLgidxParticle{de}{Beaumont}}}
+
+\newterm
+[
+ label={HenryScribe}
+]
+{\DTLgidxOffice{scribe \DTLgidxParticle{of}{Bury}
+ \DTLgidxSaint{St}~Edmunds}{Henry}}
+
+\newterm
+[
+ label={HenryKing}
+]
+{\DTLgidxOffice{king \DTLgidxParticle{of}{England}}{Henry}}
+
+\newterm
+[
+ label={HenryBlois}
+]
+{\DTLgidxOffice{bishop \DTLgidxParticle{of}{Winchester}}{Henry
+\DTLgidxParticle{of}{Blois}}}
+
+\newterm
+[
+ label={HenryBlund}
+]
+{Henry Blund}
+
+\newterm
+[
+ label={HenryEssex}
+]
+{Henry \DTLgidxParticle{of}{Essex}}
+
+\newterm
+[
+ label={HenryLittle}
+]
+{Henry \DTLgidxParticle{the}{Little}}
+
+\newterm
+[
+ label={HenryMowbray}
+]
+{Henry \DTLgidxParticle{de}{Mowbray}}
+
+\newterm
+[
+ label={HenryFitzRobert}
+]
+{Henry \DTLgidxParticle{Fitz}{Robert}}
+
+\newterm
+[
+ label={JBSaint}
+]
+{\DTLgidxName{J.~B.}{Saint}}
+
+\newterm
+[
+ label={StAndrews}
+]
+{\DTLgidxPlace{\DTLgidxSaint{St}~Andrews}{Fife}}
+
+\newterm
+[
+ label={StBenetsHall}
+]
+{\DTLgidxSaint{St}~Benet's Hall}
+
+\newterm
+[
+ label={StJamesInfirmary}
+]
+{\DTLgidxSaint{St}~James Infirmary}
+
+\newterm
+[
+ label={QStJohnSmythe}
+]
+{\DTLgidxName{Q.}{\DTLgidxSaint{St}~John-Smythe}}
+
+\newterm
+[
+ label={SaintJulian}
+]
+{\DTLgidxSaint{Saint}-Julian}
+
+\newterm
+[
+ label={StJustinRoseland}
+]
+{\DTLgidxSaint{St}~Just-in-Roseland}
+
+ % Names with an associated number
+
+ % The following gets the label 'James I' and sort 'James 01'
+
+\newterm{James~\DTLgidxNameNum{1}}
+
+ % The following gets the label 'James II' and sort 'James 02'
+
+\newterm{James~\DTLgidxNameNum{2}}
+
+ % etc
+\newterm{James~\DTLgidxNameNum{3}}
+\newterm{James~\DTLgidxNameNum{4}}
+\newterm{James~\DTLgidxNameNum{5}}
+
+ % In the following, the label and name default to 'New York, population'
+ % The text defaults to 'population'.
+ % Using \DTLgidxSubject allows the sort key to work with \dtlwordindexcompare
+ % Here both the label and the text have been changed from their
+ % defaults.
+\newterm
+[
+ label={popNY},% give it a short, easy to type label
+ text={population of New York}
+]
+{\DTLgidxSubject{population}{New York}}
+
+ % In the following, the label and name become 'New York, USA'
+ % The text becomes 'New York'.
+ % The sort key is adjusted to work with \dtlwordindexcompare
+\newterm{\DTLgidxPlace{USA}{New York}}
+
+\newterm{\ensuremath{\alpha}-iron}% gets label and sort keys 'alpha-iron'
+
+\newterm{\ensuremath{\alpha} chain}% label & sort -> 'alpha chain'
+
+\newterm{\ensuremath{\alpha} Centauri}% label & sort -> 'alpha Centauri'
+
+\newterm{alphabet}
+
+\newterm{\ensuremath{\Lambda} calculus}% label & sort -> 'Lambda calculus'
+
+ % and have a few more entries in the same letter group to test case
+ % ordering:
+\newterm{kite}
+\newterm{koala}
+
+ % Earlier I modified \newtermlabelhook so
+ % that \appname won't interfere with the sorting
+ % and labelling mechanism, so I don't need to specify separate sort
+ % and label keys here:
+
+\newterm{\appname{makeindex}}% label and sort both set to just 'makeindex'
+\newterm{\appname{xindy}}% label and sort both set to just 'xindy'
+
+\title{Sample Document Using the datagidx Package}
+\author{Nicola L. C. Talbot}
+
+\begin{document}
+\pagenumbering{roman}
+
+The datagidx package was developed to follow the word order indexing
+style described by the Oxford Style Manual. Many of the examples
+here are taken from that manual. Two \LaTeX\ runs are required. If
+you get a pdfTeX warning that a destination has been referenced but
+does not exist, this may mean the index is out-of-date and you need
+to do another \LaTeX\ run.
+
+With word ordering a word break (space or hyphen) comes before all
+other letters of the alphabet (\gls{sea lion} comes before \gls{seal}).
+With letter ordering word breaks are ignored (so \gls{seal} comes
+before \gls{sea lion}).
+
+Use a few terms here: \gls{index}, \gls{group}, \gls{singular}, \gls{plural}.
+
+\newpage
+
+\Gls{singular}, \glspl{plural}. \gls{glossary}.
+\Gls{acronym}: \gls{reset}, \gls{firstuse}.
+
+\newpage
+\pagenumbering{arabic}
+
+Switched page numbering style. \Gls{singular}, \gls{kite},
+\gls{koala}, \gls{crocodile}, \gls{seal}.
+
+\Gls{sea},
+\gls{sea anchor},
+\gls{sea urchin}.
+
+Some characters: \gls{comma}, \gls{equals}, \gls{"}, \gls{!}, \gls{|}
+\gls{amp}, \gls{underscore}, \gls{dollar}, \gls{circum},
+\gls{tilde}.
+
+Some numbers: \gls{0}, \gls{1}, \gls{2}, \gls{3}, \gls{20}, \gls{10}.
+
+\newpage
+
+Some numbers again: \gls{0}, \gls{1}, \gls{2}, \gls{3}, \gls{100},
+\gls{10}, \gls{20}.
+
+Case mixture: \gls{kite},
+\gls{Knuth} and
+\gls{[principleloc]koala}.
+
+\Gls{de-escalate}, \gls{deem}, \gls{demote}.
+
+We don't need to use \gls{makeindex} or \gls{xindy}!
+However, \TeX\ takes longer to sort and collate than either
+\gls{makeindex} or \gls{xindy}, so document compilation time will
+take longer.
+
+\newpage
+
+\Gls{kite}, \gls{highwater}, \gls{koala}, \gls{caiman}, \gls{sea
+lion}, \gls{high},
+\gls{highbrow}, \gls{high chair}, \gls{highball}, \gls{reptile},
+\gls{highlights}, \gls{high heels}, \gls{high-fliers}.
+\Gls{seam} and \gls{seam bowler}.
+
+\gls{New York, New York}. \gls{New York}.
+\Gls{popNY}. \gls{New York, USA}.
+\gls{Highclere Castle}.
+
+\gls{High}. \gls{High-Smith}, \gls{Highsmith}, \gls{High Water}
+as opposed to \gls{high water}. \Gls{alphabet}. \Gls{alpine}.
+
+Some terms with Greek letters: \gls{alpha-iron},
+\gls{Lambda calculus}, \gls{alpha chain}, \gls{alpha Centauri}.
+
+\newpage
+
+\renewcommand{\thepage}{\myscroman{page}}%
+Switching to small caps Roman page numbering.
+
+\Gls{kite}. \Glspl{alligator}. \Gls{highheight}.
+
+\gls{deWinter}.
+\gls{Winter}.
+\gls{Winters}.
+
+\gls{McCullers}.
+
+\gls{M'Fingal}.
+
+\gls{TomMacFarlane}.
+
+\gls{DickMacFarlane}.
+
+\gls{McNamee}.
+
+\gls{McCarthyism},
+\gls{McGuffin},
+\gls{McCoy}.
+
+\Gls{macadam},
+\gls{ma'am},
+\gls{ma},
+\gls{macabre},
+\gls{macrame},
+\gls{macedoine}.
+
+\Gls{elite},
+\gls{deem},
+\gls{demote},
+\gls{deerstalker},
+\gls{deface},
+\gls{de facto}.
+
+
+\gls{AliceMeynell}.
+\gls{AMeynell}.
+\gls{DrMeynell}.
+\gls{SirMeynell}.
+\gls{FMeynell}.
+\gls{WGMeynell}.
+\gls{WMeynell}.
+
+\gls{HenrySonJohn}. \gls{HenryBlois}.
+\gls{HenryBeaumont}. \gls{HenryBlund}.
+\gls{HenryLittle}. \gls{HenryEssex}. \gls{HenryMowbray}.
+\gls{HenryFitzRobert}.
+\gls{HenryKing}. \gls{HenryScribe}.
+
+\gls{James V}.
+\gls{James I}.
+\gls{James IV}.
+\gls{James III}.
+\gls{James II}.
+
+\gls{JBSaint}.
+\gls{StAndrews}.
+\gls{StBenetsHall}.
+\gls{StJamesInfirmary}.
+\gls{QStJohnSmythe}.
+\gls{SaintJulian}.
+\gls{StJustinRoseland}.
+
+\gls{10 Downing Street}.
+
+\newpage
+
+% This will take a while as the sorting algorithm is complex.
+
+\printterms
+ [
+ heading={\section[Word Sorted Index]},% make a numbered section
+ database=index,% 'index' database
+ prelocation=dotfill,% put a dotted line before the location list
+ columns=3,% page layout
+ style=index,% use 'index' style
+ %balance=false,% don't balance columns
+ postheading={Locations in bold indicate primary reference.
+ (Word sort.)}
+ ]
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-mail-merge.pdf b/macros/latex/contrib/datatool/samples/sample-mail-merge.pdf
new file mode 100644
index 0000000000..3e9fa49921
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-mail-merge.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-mail-merge.tex b/macros/latex/contrib/datatool/samples/sample-mail-merge.tex
new file mode 100644
index 0000000000..12566e4aba
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-mail-merge.tex
@@ -0,0 +1,21 @@
+ % This file is public domain.
+\documentclass{letter}
+
+\usepackage{datatool}
+
+\DTLloaddb{data}{sample-student-records.csv}
+
+\begin{document}
+\begin{DTLenvforeach*}{data}{\Title=Title,\FirstName=First Name,\Surname=Surname,\AssignmentI=Assignment 1,\AssignmentII=Assignment 2,\AssignmentIII=Assignment 3,\Address=Address}
+\begin{letter}{\Title\space\FirstName\space\Surname\\\Address}
+\opening{Dear \Title~\Surname}
+
+\DTLmeanforall{\Score}{\AssignmentI,\AssignmentII,\AssignmentIII}
+\DTLround{\Score}{\Score}{0}\DTLclip{\Score}{\Score}%
+You were awarded a mark of \Score\%.
+
+\closing{Yours Sincerely}
+\end{letter}
+
+\end{DTLenvforeach*}
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-piechart.pdf b/macros/latex/contrib/datatool/samples/sample-piechart.pdf
new file mode 100644
index 0000000000..0bce7fb05c
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-piechart.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-piechart.tex b/macros/latex/contrib/datatool/samples/sample-piechart.tex
new file mode 100644
index 0000000000..2bcd49dcf6
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-piechart.tex
@@ -0,0 +1,36 @@
+ % This file is public domain.
+\documentclass[captions=tableheading]{scrartcl}
+
+\usepackage{datapie}
+
+\DTLloaddb{marks}{sample-student-records.csv}
+
+\begin{document}
+
+% Compute average mark for each student:
+\DTLforeach{marks}{%
+\assignI=Assignment 1,%
+\assignII=Assignment 2,%
+\assignIII=Assignment 3}{%
+\DTLmeanforall{\theMean}{\assignI,\assignII,\assignIII}%
+\DTLround{\theMean}{\theMean}{0}\DTLclip{\theMean}{\theMean}%
+\DTLappendtorow{Average}{\theMean}}
+
+% Sort according to average mark
+\DTLsort{Average=descending}{marks}
+
+\begin{table}
+\caption{Student Marks}
+\centering
+\DTLdisplaydb[Address,RegNum,Title]{marks}
+\end{table}
+
+\begin{figure}
+\caption{Pie Chart}
+\centering
+\DTLpiechart{variable=\Average,outerlabel={\Surname, \FirstName},rotateouter}{marks}%
+ {\Average=Average,\Surname=Surname,\FirstName=First
+Name}
+\end{figure}
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-sort.pdf b/macros/latex/contrib/datatool/samples/sample-sort.pdf
new file mode 100644
index 0000000000..18eb0c79b4
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-sort.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-sort.tex b/macros/latex/contrib/datatool/samples/sample-sort.tex
new file mode 100644
index 0000000000..2c1f0b96f0
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-sort.tex
@@ -0,0 +1,133 @@
+% This file is public domain
+
+\documentclass{article}
+
+\usepackage[margin=1in]{geometry}
+
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{datatool}
+
+% Sample database
+
+\DTLnewdb{data}
+
+% Add a word to the database. (The Definition column is provided to
+% distinguish the entries when the database is displayed. The
+% Definition column is not used by the sort code.)
+
+% Syntax: \newword{string}
+
+\makeatletter
+\newcommand*{\newword}[1]{%
+ \DTLnewrow{data}%
+ \DTLnewdbentry{data}{Word}{#1}%
+% Convert word to its definition and add
+ {%
+ \def\thisword{#1}%
+ \@onelevel@sanitize\thisword
+ \dtlexpandnewvalue % ensure \thisword gets expanded
+ \DTLnewdbentry{data}{Definition}{\thisword}%
+ }%
+}
+\makeatother
+
+\newword{High Water}
+\newword{!}
+\newword{[}
+\newword{~}
+\newword{\#define}
+\newword{High water}
+\newword{highwater}
+\newword{1st Street}
+\newword{high water}
+\newword{1st~Street}
+\newword{10~Downing Street}
+\newword{10~Downing Avenue}
+\newword{10 Downing Road}
+\newword{\#include}
+\newword{1 (one)}
+\newword{1\datatoolparenstart(one)}
+\newword{10\datatoolparenstart(ten)}
+\newword{10 (ten)}
+\newword{42\datatoolparenstart(forty-two)}
+\newword{42 (forty-two)}
+\newword{100\datatoolparenstart(one hundred)}
+\newword{100 (one hundred)}
+\newword{4\datatoolparenstart(four)}
+\newword{4 (four)}
+\newword{The Ten Samurai}
+\newword{London, Jack}
+\newword{London}
+\newword{10 Samurai, The}
+\newword{10 Samurai}
+\newword{Ten Samurai, The}
+\newword{Ten Samurai}
+\newword{10 Samurai\datatoolsubjectcomma The}
+\newword{Ten Samurai\datatoolsubjectcomma The}
+\newword{London\datatoolpersoncomma Jack}
+\newword{London\datatoolplacecomma UK}
+\newword{London\datatoolsubjectcomma History of}
+\newword{Zebra}
+\newword{zebra}
+\newword{alpha}
+\newword{Alpha}
+\newword{seal}
+\newword{sea lion}
+\newword{elephant}
+\newword{Élite}
+
+\begin{document}
+This is a sample document testing datatool's comparison
+handlers. Note that UTF-8 characters are treated as two tokens
+(the first and second octets) with regular (pdf)\LaTeX, so the
+definition column on the following pages shows the two octets
+for the UTF-8 character É as ÃĽ, which is how \LaTeX\ sees them. XeLaTeX will treat it as a single
+token.
+
+\newpage
+
+\section{Unsorted data}
+
+\begin{tabular}{ll}
+\bfseries Word & \bfseries Definition
+\DTLforeach*{data}{\Word=Word,\Definition=Definition}{%
+\\\Word & \ttfamily \Definition
+}
+\end{tabular}
+
+\section{Case-Insensitive Sort}
+
+\DTLsort*{Word}{data}
+
+\begin{tabular}{ll}
+\bfseries Word & \bfseries Definition
+\DTLforeach*{data}{\Word=Word,\Definition=Definition}{%
+\\\Word & \ttfamily \Definition
+}
+\end{tabular}
+
+
+\section{Case-Sensitive Sort}
+
+\DTLsort{Word}{data}
+
+\begin{tabular}{ll}
+\bfseries Word & \bfseries Definition
+\DTLforeach*{data}{\Word=Word,\Definition=Definition}{%
+\\\Word & \ttfamily \Definition
+}
+\end{tabular}
+
+\section{Word-Order Sort}
+
+\dtlsort{Word}{data}{\dtlwordindexcompare}
+
+\begin{tabular}{ll}
+\bfseries Word & \bfseries Definition
+\DTLforeach*{data}{\Word=Word,\Definition=Definition}{%
+\\\Word & \ttfamily \Definition
+}
+\end{tabular}
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-student-records.csv b/macros/latex/contrib/datatool/samples/sample-student-records.csv
new file mode 100644
index 0000000000..b8d212d488
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-student-records.csv
@@ -0,0 +1,7 @@
+"Title","First Name","Surname","RegNum","Assignment 1","Assignment 2","Assignment 3","Address"
+"Miss","Jane","Brown",1234567891,75,84,80,"Flat 1a\\The Street\\The Town"
+"Mr","John","Smith, Jr",1234567892,68,57,72,"Flat 1b\\The Street\\The Town"
+"Mr","Zack","Watts",1234567893,32,43,49,"Flat 1c\\The Street\\The Town"
+"Mrs","Hillary","Rix",1234567894,87,88,86,"Flat 1d\\The Street\\The Town"
+"Miss","Z\""oe","Adams",1234567895,52,48,57,"Flat 1e\\The Street\\The Town"
+"Mr","Andy","Brown",1234567896,42,52,54,"Flat 1f\\The Street\\The Town"
diff --git a/macros/latex/contrib/datatool/samples/sample-student-scores.pdf b/macros/latex/contrib/datatool/samples/sample-student-scores.pdf
new file mode 100644
index 0000000000..9b85095fb1
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-student-scores.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-student-scores.tex b/macros/latex/contrib/datatool/samples/sample-student-scores.tex
new file mode 100644
index 0000000000..ff61d4dbbf
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-student-scores.tex
@@ -0,0 +1,34 @@
+ % This file is public domain.
+\documentclass[captions=tableheading]{scrartcl}
+
+\usepackage{datatool}
+\usepackage{longtable}
+
+\DTLloaddb{scores}{sample-student-records.csv}
+
+\begin{document}
+Sort by surname, then first name:
+\DTLsort{Surname,First Name}{scores}
+
+% omit Address column
+\DTLdisplaydb[Address]{scores}
+
+Sort by assignment 1 score in descending order:
+\DTLsort{Assignment 1=descending}{scores}
+
+% omit Address column
+\DTLdisplaydb[Address]{scores}
+
+Average score:
+\DTLmeanforcolumn{scores}{Assignment 1}{\averagescore}%
+\averagescore\%.
+Rounded to two decimal places: \DTLround{\averagescore}{\averagescore}{2}%
+\averagescore\%.
+
+A long list will require the longtable environment (supplied by
+longtable.sty). Example in Table~\ref{tab:records}.
+
+% Omit RegNum and Address columns
+\DTLdisplaylongdb[caption={Student Scores},label={tab:records},omit={RegNum,Address}]{scores}
+
+\end{document}
diff --git a/macros/latex/contrib/datatool/samples/sample-two-per-row.pdf b/macros/latex/contrib/datatool/samples/sample-two-per-row.pdf
new file mode 100644
index 0000000000..f22fea8cc6
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-two-per-row.pdf
Binary files differ
diff --git a/macros/latex/contrib/datatool/samples/sample-two-per-row.tex b/macros/latex/contrib/datatool/samples/sample-two-per-row.tex
new file mode 100644
index 0000000000..c8f266d739
--- /dev/null
+++ b/macros/latex/contrib/datatool/samples/sample-two-per-row.tex
@@ -0,0 +1,55 @@
+ % This file is public domain.
+\documentclass[captions=tableheading]{scrartcl}
+
+\usepackage{datatool}
+
+\DTLloaddb{scores}{sample-student-records.csv}
+% Sort by surname then first name
+\DTLsort{Surname,First Name}{scores}
+
+\begin{document}
+
+\begin{table}[htbp]
+ \caption{Two database rows per tabular row}
+ \centering
+ \begin{tabular}{llcllc}
+ \bfseries First Name &
+ \bfseries Surname &
+ \bfseries Assignment 1 (\%) &
+ \bfseries First Name &
+ \bfseries Surname &
+ \bfseries Assignment 1 (\%)%
+ \DTLforeach*{scores}{\firstname=First Name,\surname=Surname,\score=Assignment 1}{%
+ \DTLifoddrow{\\}{&}%
+ \firstname & \surname & \score}%
+ \end{tabular}
+\end{table}
+
+\begin{table}[htbp]
+ \caption{Two database rows per tabular row (column-wise)}
+ \centering
+ % store half number of rows
+ \edef\maxrows{\DTLrowcount{scores}}%
+ \DTLdiv{\halfrowidx}{\maxrows}{2}
+ \begin{tabular}{llcllc}
+ \bfseries First Name &
+ \bfseries Surname &
+ \bfseries Assignment 1 (\%) &
+ \bfseries First Name &
+ \bfseries Surname &
+ \bfseries Assignment 1 (\%)%
+ \DTLforeach*[\value{DTLrowi}<\halfrowidx]{scores}%
+ {\firstname=First Name,\surname=Surname,\score=Assignment 1}%
+ {%
+ \\%
+ \firstname & \surname & \score
+ &
+ \edef\currentrowidx{\arabic{DTLrowi}}%
+ \DTLadd{\rowidxII}{\halfrowidx}{\currentrowidx}%
+ \DTLassign{scores}{\rowidxII}{\firstnameII=First Name,\surnameII=Surname,\scoreII=Assignment 1}%
+ \firstnameII & \surnameII & \scoreII
+ }%
+ \end{tabular}
+\end{table}
+
+\end{document}