diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-26 22:30:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-26 22:30:53 +0000 |
commit | 23c31c37f42516ec286c308a8b7aabe4af68da61 (patch) | |
tree | c55a2b5883ae9172b5ba0ff1a7c182908191520b /Master/texmf-dist/source/latex/datatool | |
parent | 21d48443cf41d93582f2b299b10ed2edb65e5814 (diff) |
datatool (26sep12)
git-svn-id: svn://tug.org/texlive/trunk@27818 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, 220 insertions, 26 deletions
diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx index 48dbc515cb4..45457a7cdf2 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.dtx +++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx @@ -16,7 +16,7 @@ % -author "Nicola Talbot" % -codetitle "" % datatool -% Created on 2012/7/19 16:34 +% Created on 2012/9/25 22:56 %\fi %\iffalse %<*package> @@ -63,7 +63,7 @@ datatool.dtx \doxitem{Counter}{counter}{counters} \doxitem{Option}{option}{package options} -\CheckSum{16856} +\CheckSum{17022} \RecordChanges \PageIndex @@ -76,15 +76,11 @@ datatool.dtx %\fi %\MakeShortVerb{"} % -%\title{Documented Code for datatool v2.10} -%\author{Nicola L. C. Talbot\\[10pt] -%School of Computing Sciences\\ -%University of East Anglia\\ -%Norwich. Norfolk\\ -%NR4 7TJ. United Kingdom\\ -%\url{http://theoval.cmp.uea.ac.uk/~nlct/}} +%\title{Documented Code for datatool v2.11} +%\author{Nicola L. C. Talbot\\ +%\url{http://www.dickimaw-books.com/}} % -%\date{2012-07-18} +%\date{2012-09-25} %\maketitle % %\pagenumbering{roman} @@ -119,7 +115,7 @@ datatool.dtx % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{datatool-base}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -4381,7 +4377,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{fp} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{datatool-fp}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -4670,7 +4666,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{pgfmath} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -4910,7 +4906,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{datatool}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -5796,6 +5792,30 @@ datatool.dtx % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTLaddcolumn} +%\begin{definition} +%\cs{DTLaddcolumn}\marg{db}\marg{key} +%\end{definition} +% Adds a column with given key to given column. No data is added to +% the column. The starred version doesn't check for the existence of +% the database. +%\changes{2.11}{2012-09-25}{new} +% \begin{macrocode} +\newcommand*{\DTLaddcolumn}{% + \@ifstar\@sDTLaddcolumn\@DTLaddcolumn +} +\newcommand{\@DTLaddcolumn}[2]{% + \DTLifdbexists{#1}% + {\@dtl@updatekeys{#1}{#2}{}}% + {\PackageError{datatool}{Can't add new column to database `#1': + database doesn't exist}{}}% +} +\newcommand{\s@DTLaddcolumn}[2]{% + \@dtl@updatekeys{#1}{#2}{}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@dtl@updatekeys} %\begin{definition} %\cs{@dtl@updatekeys}\marg{db}\marg{key}\marg{value} @@ -5819,12 +5839,13 @@ datatool.dtx =\dtlcolumnindex{#1}{#2}\relax % \end{macrocode} % Get the properties for this column +%\changes{2.11}{2012-09-25}{remove unwanted space} % \begin{macrocode} \edef\@dtl@dogetprops{\noexpand\@dtl@getprops {\noexpand\@dtl@key}{\noexpand\@dtl@type}% {\noexpand\@dtl@colhead}{\noexpand\@dtl@before}% {\noexpand\@dtl@after}{\the\csname dtlkeys@#1\endcsname}% - {\number\dtlcolumnnum}} + {\number\dtlcolumnnum}}% \@dtl@dogetprops % \end{macrocode} % Is the value empty? @@ -6522,7 +6543,7 @@ datatool.dtx \newtoks\dtlafterrow % \end{macrocode} %\end{macro} -% + %\begin{macro}{\dtlgetrow} %\begin{definition} %\cs{dtlgetrow}\marg{db}\marg{row idx} @@ -6543,6 +6564,31 @@ datatool.dtx } % \end{macrocode} %\end{macro} +%\begin{macro}{\dtlgetrowforvalue} +%\begin{definition} +%\cs{dtlgetrowforvalue}\marg{db}\marg{column idx}\marg{value} +%\end{definition} +% Like \cs{dtlgetrow}, but gets the row where the entry in column +% \meta{column index} matches \meta{value}. Produces an error if row +% not found. +%\changes{2012-09-25}{2.11}{new} +% \begin{macrocode} +\newcommand*{\dtlgetrowforvalue}[3]{% + \dtlgetrowindex{\dtl@rowidx}{#1}{#2}{#3}% + \ifx\dtl@rowidx\dtlnovalue + \PackageError{datatool}{No row found in database `#1' for + column `\number#2' matching `#3'}{}% + \else + \dtlrownum=\dtl@rowidx\relax + \edef\dtldbname{#1}% + \expandafter\toks@\expandafter=\csname dtldb@#1\endcsname + \edef\@dtl@dogetrow{\noexpand\@dtlgetrow{\the\toks@}{\dtl@rowidx}}% + \@dtl@dogetrow + \fi +} +% \end{macrocode} +%\end{macro} +% % %\begin{macro}{\@dtlgetrow} %\begin{definition} @@ -6883,6 +6929,82 @@ datatool.dtx % \end{macrocode} %\end{macro} % +%\begin{macro}{\dtlupdateentryincurrentrow} +%\begin{definition} +%\cs{dtlupdateentryincurrentrow}\marg{key}\marg{value} +%\end{definition} +% Appends entry to \cs{dtlcurrentrow} if column with given key +% doesn't exist, otherwise updates the value. +%\changes{2.11}{2012-09-25}{new} +% \begin{macrocode} +\newcommand*{\dtlupdateentryincurrentrow}[2]{% +% \end{macrocode} +% Update information about this column (adding new column if +% necessary) +% \begin{macrocode} + \@dtl@updatekeys{\dtldbname}{#1}{#2}% +% \end{macrocode} +% Get column index and store in \cs{dtlcolumnnum} +% \begin{macrocode} + \expandafter\dtlcolumnnum\expandafter + =\dtlcolumnindex{\dtldbname}{#1}\relax +% \end{macrocode} +% Does this row already have an entry with this key? +% \begin{macrocode} + \edef\dtl@dogetentry{\noexpand\dtlgetentryfromcurrentrow + {\noexpand\dtl@entry}{\number\dtlcolumnnum}% + }% + \dtl@dogetentry + \ifx\dtl@entry\dtlnovalue +% \end{macrocode} +% There are no entries in this row for the given key. +% Expand entry value before storing. +% \begin{macrocode} + \protected@edef\@dtl@tmp{#2}% + \expandafter\@dtl@toks\expandafter{\@dtl@tmp}% +% \end{macrocode} +% Append this entry to the current row. +% \begin{macrocode} + \toks@gput@right@cx{dtlcurrentrow}% + {% +% \end{macrocode} +% Begin column index specs: +% \begin{macrocode} + \noexpand\db@col@id@w + \number\dtlcolumnnum + \noexpand\db@col@id@end@ +% \end{macrocode} +% New entry: +% \begin{macrocode} + \noexpand\db@col@elt@w + \the\@dtl@toks + \noexpand\db@col@elt@end@ +% \end{macrocode} +% End column index specs: +% \begin{macrocode} + \noexpand\db@col@id@w + \number\dtlcolumnnum + \noexpand\db@col@id@end@ + }% +% \end{macrocode} +% Print information to terminal and log file if in verbose mode. +% \begin{macrocode} + \dtl@message{Appended #1\space -> #2\space to database + `\dtldbname'}% + \else +% \end{macrocode} +% There is already an entry in this row for the given key +% \begin{macrocode} + \toks@{#2}% + \edef\do@dtlreplaceincurrentrow{% + \noexpand\dtlreplaceentryincurrentrow{\the\toks@}{\number\dtlcolumnnum}% + }% + \do@dtlreplaceincurrentrow + \fi +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTLgetvalue} %\begin{definition} %\cs{DTLgetvalue}\marg{cs}\marg{db}\marg{r}\marg{c} @@ -6915,7 +7037,7 @@ datatool.dtx \db@col@elt@w \@dtlnovalue\db@col@elt@end@% undefined value \q@nil \ifx#1\dtlnovalue - \PackageError{datatool}{There is no element at (row=#3, + \PackageError{datatool}{There is no element at (row=#3,\space column=#4) in database `#2'}{}% \fi } @@ -6945,12 +7067,76 @@ datatool.dtx \db@row@id@w \@dtlnovalue\db@row@id@end@% undefined row id \q@nil \ifx#1\dtlnovalue - \PackageError{datatool}{There is no element `#4' in - database `#3'}{}% + \PackageError{datatool}{There is no element `#4' in database `#3'}{}% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTLgetrowindex} +%\begin{definition} +%\cs{DTLgetrowindex}\marg{row cs}\marg{database}\marg{column index}% +%\marg{value} +%\end{definition} +% Assigns \meta{row cs} to the row index of the +% first entry in \meta{database} where the entry in \meta{column +% index} matches \meta{value}. +%\changes{2.11}{2012-09-25}{new} +% \begin{macrocode} +\newcommand*{\DTLgetrowindex}[4]{% + \toks@{#4}% + \edef\dtl@dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{\the\toks@}}% + \dtl@dogetrowindex + \ifx#1\dtlnovalue + \PackageError{datatool}{There is no element `#4' for column + \number#3\space in database `#2'}{}% \fi } % \end{macrocode} %\end{macro} +% +%\begin{macro}{\dtlgetrowindex} +%\begin{definition} +%\cs{dtlgetrowindex}\marg{row cs}\marg{database}\marg{column index}% +%\marg{value} +%\end{definition} +% As above but doesn't produce an error if not found. +%\changes{2.11}{2012-09-25}{new} +% \begin{macrocode} +\newcommand*{\dtlgetrowindex}[4]{% + \toks@{#4}% + \edef\dtl@dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{\the\toks@}}% + \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. +%\changes{2.11}{2012-09-25}{new} +% \begin{macrocode} +\newcommand*{\@dtlgetrowindex}[4]{% + \def\@dtl@getrowindex##1% stuff before value + \db@col@elt@w #4\db@col@elt@end@% value + \db@col@id@w #3\db@col@id@end@% column id + ##2% stuff after this column + \db@row@id@w ##3\db@row@id@end@% row id + ##4% stuff after row + \q@nil{\def#1{##3}}% + \toks@=\csname dtldb@#2\endcsname + \expandafter\@dtl@getrowindex\the\toks@% contents of data base + \db@col@elt@w #4\db@col@elt@end@% value + \db@col@id@w #3\db@col@id@end@% column id + \db@row@id@w \@dtlnovalue\db@row@id@end@% undefined row id + \q@nil +} +% \end{macrocode} +%\end{macro} + %\section{Iterating Through Databases} %\label{sec:code:loops} @@ -8644,6 +8830,14 @@ datatool.dtx \newcommand*{\dtldisplayafterhead}{} % \end{macrocode} %\end{macro} +%\begin{macro}{\dtldisplayvalign} +%\changes{2.11}{2012-09-25}{new} +% Stores the vertical alignment specifier for the tabular +% environment used in \cs{DTLdisplaydb} +% \begin{macrocode} +\newcommand*{\dtldisplayvalign}{c} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\dtldisplaystartrow} % Indicates what to do at the start of each row (not including @@ -8696,7 +8890,7 @@ datatool.dtx % \end{macrocode} % Begin tabular environment % \begin{macrocode} - \edef\@dtl@dobegintab{\noexpand\begin{tabular}{\@dtl@tabargs}}% + \edef\@dtl@dobegintab{\noexpand\begin{tabular}[\dtldisplayvalign]{\@dtl@tabargs}}% \@dtl@dobegintab % \end{macrocode} % Do start hook @@ -11534,7 +11728,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databib}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{databib}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -14241,7 +14435,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databar}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{databar}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -15542,7 +15736,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datapie}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{datapie}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -16220,7 +16414,7 @@ Try #2-#1 instead of #1-#2}% % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dataplot}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{dataplot}[2012/09/25 v2.11 (NLCT)] % \end{macrocode} % Required packages % \begin{macrocode} @@ -17649,7 +17843,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Package identification: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{person}[2012/07/18 v2.10 (NLCT)] +\ProvidesPackage{person}[2012/09/25 v2.11 (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 ace8870e0cc..8b90d4d9259 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.ins +++ b/Master/texmf-dist/source/latex/datatool/datatool.ins @@ -1,4 +1,4 @@ -% datatool.ins generated using makedtx version 0.94b 2012/7/19 16:34 +% datatool.ins generated using makedtx version 0.94b 2012/9/25 22:56 \input docstrip \preamble |