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