diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-07 22:50:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-07 22:50:44 +0000 |
commit | 8ea05b291a97fc98c330f2c40922932a0c460398 (patch) | |
tree | 9be62aed6a7172fe0f52fac4297b19b5e95dfdc3 /Master/texmf-dist/source/latex/datatool | |
parent | 5d57c7c06864a08c811765622587b93af1d8cd23 (diff) |
datatool (7dec18)
git-svn-id: svn://tug.org/texlive/trunk@49344 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/datatool')
-rw-r--r-- | Master/texmf-dist/source/latex/datatool/datatool.dtx | 244 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/datatool/datatool.ins | 2 |
2 files changed, 188 insertions, 58 deletions
diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx index a95ce9f9c1f..9115c37a69d 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.dtx +++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx @@ -1,11 +1,9 @@ %\iffalse % datatool.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: +% -macrocode "databib\.bst" % -codetitle "" % -setambles "databib\.bst=>\nopreamble\nopostamble" -% -doc "datatool-manual.tex" -% -macrocode "databib\.bst" -% -comment "databib\.bst" % -src "datatool-base.sty\Z=>datatool-base.sty" % -src "datatool-fp.sty\Z=>datatool-fp.sty" % -src "datatool-pgfmath.sty\Z=>datatool-pgfmath.sty" @@ -17,9 +15,11 @@ % -src "dataplot.sty\Z=>dataplot.sty" % -src "person.sty\Z=>person.sty" % -src "databib.bst\Z=>databib.bst" +% -doc "datatool-manual.tex" % -author "Nicola Talbot" +% -comment "databib\.bst" % datatool -% Created on 2018/4/16 11:49 +% Created on 2018/12/7 15:44 %\fi %\iffalse %<*package> @@ -68,7 +68,7 @@ datatool.dtx \doxitem{Counter}{counter}{counters} \doxitem{Option}{option}{package options} -\CheckSum{23963} +\CheckSum{24081} \RecordChanges \PageIndex @@ -81,11 +81,11 @@ datatool.dtx %\fi %\MakeShortVerb{"} % -%\title{Documented Code for datatool v2.30} +%\title{Documented Code for datatool v2.31} %\author{Nicola L. C. Talbot\\ %\url{http://www.dickimaw-books.com/}} % -%\date{2018-04-16} +%\date{2018-12-07} %\maketitle % %\pagenumbering{roman} @@ -121,7 +121,7 @@ datatool.dtx % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{datatool-base}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -399,7 +399,7 @@ datatool.dtx % \end{macrocode} %\end{macro} %\begin{macro}{\long@push@begins} -%\changes{2.10}{2012-07-16}{new} +%\changes{2.10}{2012-07-18}{new} %Adapted from \isty{amsmath}'s \cs{push@begins} % \begin{macrocode} \long\def\long@push@begins#1\begin#2{% @@ -437,22 +437,114 @@ datatool.dtx % \end{macrocode} %\end{macro} % +%\begin{macro}{\ifDTLlistskipempty} +%\changes{2.31}{2018-12-07}{new} +%If true, skip empty elements in the list-related commands below. +% \begin{macrocode} +\newif\ifDTLlistskipempty +\DTLlistskipemptytrue +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTLlistelement} +%\begin{definition} +%\cs{DTLlistelement}\marg{list}\marg{idx} +%\end{definition} +%Does the \meta{idx}th element in the list. The index +%should start from 1 for the first element. +% \begin{macrocode} +\newrobustcmd{\DTLlistelement}[2]{% +% \end{macrocode} +%The \cs{@for}-loop is scoped in case it's nested. +% \begin{macrocode} + \begingroup + \@dtl@tmpcount=0\relax + \@for\@dtl@element:=#1\do{% + \ifDTLlistskipempty + \ifdefempty{\@dtl@element}% + {}% + {% + \advance\@dtl@tmpcount by 1\relax% + \ifnum\@dtl@tmpcount=#2 \@dtl@element\@endfortrue\fi + }% + \else + \advance\@dtl@tmpcount by 1\relax% + \ifnum\@dtl@tmpcount=#2 \@dtl@element\@endfortrue\fi + \fi + }% + \if@endfor \else\@dtl@listelement@outofrange{#2}\fi + \endgroup +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTLfetchlistelement} +%\begin{definition} +%\cs{DTLfetchlistelement}\marg{list}\marg{idx}\marg{cs} +%\end{definition} +%Fetches the \meta{idx}th element in the list and stores in \meta{cs}. The index +%should start from 1 for the first element. +% \begin{macrocode} +\newrobustcmd{\DTLfetchlistelement}[3]{% +% \end{macrocode} +%The \cs{@for}-loop is scoped in case it's nested. +% \begin{macrocode} + \begingroup + \@dtl@tmpcount=0\relax + \@for\@dtl@element:=#1\do{% + \ifDTLlistskipempty + \ifdefempty{\@dtl@element}% + {}% + {% + \advance\@dtl@tmpcount by 1\relax% + \ifnum\@dtl@tmpcount=#2 \@endfortrue\fi + }% + \else + \advance\@dtl@tmpcount by 1\relax% + \ifnum\@dtl@tmpcount=#2 \@endfortrue\fi + \fi + }% + \if@endfor \else\def\@dtl@element{\@dtl@listelement@outofrange{#2}}\fi + \edef\x{% + \endgroup + \noexpand\def\noexpand#3{\expandonce\@dtl@element}% + }\x +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dtl@listelement@outofrange} +%\changes{2.31}{2018-12-07}{new} +% \begin{macrocode} +\newcommand{\@dtl@listelement@outofrange}[1]{% + \PackageWarning{datatool-base}{List index `\number#1' out of range}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTLnumitemsinlist} +%\begin{definition} %\cs{DTLnumitemsinlist}\marg{list}\marg{cmd} -%\end{macro} +%\end{definition} % Counts number of non-empty elements in list and stores result in control % sequence \meta{cmd}. +%\changes{2.31}{2018-12-07}{made robust} % \begin{macrocode} -\newcommand*{\DTLnumitemsinlist}[2]{% +\newrobustcmd{\DTLnumitemsinlist}[2]{% \@dtl@tmpcount=0\relax \@for\@dtl@element:=#1\do{% - \ifdefempty{\@dtl@element}% - {}% - {\advance\@dtl@tmpcount by 1\relax}% + \ifDTLlistskipempty + \ifdefempty{\@dtl@element}% + {}% + {\advance\@dtl@tmpcount by 1\relax}% + \else + \advance\@dtl@tmpcount by 1\relax + \fi }% \edef#2{\number\@dtl@tmpcount}% } % \end{macrocode} +%\end{macro} % %\begin{macro}{\dtl@choplast} %\begin{definition} @@ -634,7 +726,7 @@ datatool.dtx %\end{macro} % %\begin{macro}{\dtlsortlist} -%\changes{2.27}{2016/07/28}{new} +%\changes{2.27}{2016-07-28}{new} %\begin{definition} % \cs{dtlsortlist}\marg{list}\marg{criteria cmd} %\end{definition} @@ -653,7 +745,7 @@ datatool.dtx %\end{macro} % %\begin{macro}{\dtlinsertinto} -%\changes{2.27}{2016/07/28}{new} +%\changes{2.27}{2016-07-28}{new} %\begin{definition} % \cs{dtlinsertinto}\marg{element}\marg{sorted-list}\marg{criteria cmd} %\end{definition} @@ -740,7 +832,7 @@ datatool.dtx %\end{macro} % %\begin{macro}{\edtlinsertinto} -%\changes{2.27}{2016/07/28}{new} +%\changes{2.27}{2016-07-28}{new} %\begin{definition} % \cs{edtlinsertinto}\marg{element}\marg{sorted-list}\marg{criteria cmd} %\end{definition} @@ -851,7 +943,13 @@ datatool.dtx \def\@dtl@formatlist@prelastitem{}% \def\@dtl@formatlist@prelastitemsep{}% \@for\@dtl@formatlist@item:=#1\do{% - \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}% + \ifDTLlistskipempty + \ifdefempty{\@dtl@formatlist@item}% + {}% + {\expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}}% + \else + \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}% + \fi }% \@dtl@formatlist@prelastitem\@dtl@formatlist@lastitem } @@ -961,7 +1059,7 @@ datatool.dtx % number is stored in \meta{cmd}. This command has to be redefined % whenever the decimal and number group characters are changed % as they form part of the command definitions. -%\changes{2.12}{2012-10-06}{switched to \cs{ifdefempty}} +%\changes{2.12}{2012-11-30}{switched to \cs{ifdefempty}} % \begin{macrocode} \edef\@dtl@construct@getintfrac#1{% \noexpand\def\noexpand\@dtl@getintfrac##1#1##2\noexpand\relax{% @@ -2653,28 +2751,40 @@ datatool.dtx } % \end{macrocode} %\end{macro} +%\begin{macro}{\@dtl@protect} +%\changes{2.31}{2018-12-07}{new} +% \begin{macrocode} +\newcommand*{\@dtl@protect}{\protect} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@dtl@minus} +%\changes{2.31}{2018-12-07}{new} +% \begin{macrocode} +\newcommand*{\@dtl@minus}{-} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@dtl@plus} +%\changes{2.31}{2018-12-07}{new} +% \begin{macrocode} +\newcommand*{\@dtl@plus}{+} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@dtl@dollar} +%\changes{2.31}{2018-12-07}{new} +% \begin{macrocode} +\newcommand*{\@dtl@dollar}{\$} +% \end{macrocode} +%\end{macro} %\begin{macro}{\@dtl@checknumericalstart} % Check first character for checknumerical process to see if % it's a plus or minus sign. % \begin{macrocode} \def\@dtl@checknumericalstart#1#2\@nil\@nil{% -\ifx#1\protect\relax - \@dtl@checknumericalstart#2\@nil\@nil\relax -\else - \ifx-#1\relax - \def\@dtl@tmp{#2}% - \ifdefempty{\@dtl@tmp}% - {% - \@dtl@datatype=0\relax - }% - {% - \ifnum\@dtl@datatype=0\relax - \@dtl@datatype=1\relax - \fi - \@dtl@checknumericalstart#2\@nil\@nil\relax - }% + \def\@dtl@tmp{#1}% + \ifx\@dtl@tmp\@dtl@protect + \@dtl@checknumericalstart#2\@nil\@nil\relax \else - \ifx+#1\relax + \ifx\@dtl@tmp\@dtl@minus \def\@dtl@tmp{#2}% \ifdefempty{\@dtl@tmp}% {% @@ -2687,11 +2797,8 @@ datatool.dtx \@dtl@checknumericalstart#2\@nil\@nil\relax }% \else - \def\@dtl@tmp{#1}% - \ifx#1\$\relax - \@dtl@datatype=3\relax - \@dtl@checknumericalstart#2\@nil\@nil\relax - \else + \ifx\@dtl@tmp\@dtl@plus + \def\@dtl@tmp{#2}% \ifdefempty{\@dtl@tmp}% {% \@dtl@datatype=0\relax @@ -2700,12 +2807,35 @@ datatool.dtx \ifnum\@dtl@datatype=0\relax \@dtl@datatype=1\relax \fi - \@dtl@checknumericalloop#1#2\@nil\@nil\relax + \@dtl@checknumericalstart#2\@nil\@nil\relax }% + \else + \def\@dtl@tmp{#1}% + \ifx\@dtl@tmp\@dtl@dollar + \def\@dtl@tmp{#2}% + \ifdefempty{\@dtl@tmp}% + {% + \@dtl@datatype=0\relax + }% + {% + \@dtl@datatype=3\relax + \@dtl@checknumericalstart#2\@nil\@nil\relax + }% + \else + \ifdefempty{\@dtl@tmp}% + {% + \@dtl@datatype=0\relax + }% + {% + \ifnum\@dtl@datatype=0\relax + \@dtl@datatype=1\relax + \fi + \@dtl@checknumericalloop#1#2\@nil\@nil\relax + }% + \fi \fi \fi \fi -\fi } % \end{macrocode} %\end{macro} @@ -6008,7 +6138,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{fp} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{datatool-fp}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -6297,7 +6427,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{pgfmath} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -6325,7 +6455,7 @@ datatool.dtx % character and no number group separator. The \verb|\number0| part % allows an empty argument to be treated as zero. (\cs{number} % required to prevent a zero prefix indicating an octal number.) -%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion} %\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \newcommand*{\dtlifnumeq}[4]{% @@ -6352,7 +6482,7 @@ datatool.dtx % Does \meta{true part} if \meta{num1} \textless \meta{num2}, otherwise does % \meta{false part}. The numbers must use a full stop as the decimal % character and no number group separator. -%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion} %\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \newcommand*{\dtlifnumlt}[4]{% @@ -6373,7 +6503,7 @@ datatool.dtx % Does \meta{true part} if \meta{num1} \textgreater \meta{num2}, otherwise does % \meta{false part}. The numbers must use a full stop as the decimal % character and no number group separator. -%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion} %\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \newcommand*{\dtlifnumgt}[4]{% @@ -6392,7 +6522,7 @@ datatool.dtx %\end{definition} % Determines if \meta{min} $<$ \meta{num} $<$ \meta{max} where % all numerical arguments are in standard fixed point notation. -%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion} %\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \newcommand*{\dtlifnumopenbetween}[5]{% @@ -6412,7 +6542,7 @@ datatool.dtx %\end{definition} % Determines if \meta{min} $\leq$ \meta{num} $\leq$ \meta{max} where % all numerical arguments are in standard fixed point notation. -%\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.12}{2012-11-30}{fixed bug causing premature expansion} %\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \newcommand*{\dtlifnumclosedbetween}[5]{% @@ -6638,7 +6768,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{datatool}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -13891,7 +14021,7 @@ datatool.dtx % Check if the line is empty. %\changes{2.0}{2009 February 27}{changed \cs{ifthenelse} to %\cs{ifx} to improve efficiency} -%\changes{2.10}{2012-07-16}{changed \cs{ifx} to \cs{ifdefempty}} +%\changes{2.10}{2012-07-18}{changed \cs{ifx} to \cs{ifdefempty}} % \begin{macrocode} \ifdefempty{\@dtl@line}% {% @@ -14233,7 +14363,7 @@ datatool.dtx % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datagidx}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{datagidx}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -20283,7 +20413,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databib}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{databib}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -23206,7 +23336,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databar}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{databar}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -24513,7 +24643,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datapie}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{datapie}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -25315,7 +25445,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dataplot}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{dataplot}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Required packages % \begin{macrocode} @@ -26937,7 +27067,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Package identification: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{person}[2018/04/16 v2.30 (NLCT)] +\ProvidesPackage{person}[2018/12/07 v2.31 (NLCT)] % \end{macrocode} % Requires the \sty{ifthen} package. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/datatool/datatool.ins b/Master/texmf-dist/source/latex/datatool/datatool.ins index 2420ca733c1..512f5a07a63 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.ins +++ b/Master/texmf-dist/source/latex/datatool/datatool.ins @@ -1,4 +1,4 @@ -% datatool.ins generated using makedtx version 1.2 2018/4/16 11:49 +% datatool.ins generated using makedtx version 1.2 2018/12/7 15:44 \input docstrip \preamble |