summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/datatool/datatool-user.tex')
-rw-r--r--Master/texmf-dist/doc/latex/datatool/datatool-user.tex79
1 files changed, 64 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
index 86ac37d6af7..6560eb60c0c 100644
--- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
+++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex
@@ -56,15 +56,11 @@
\MakeShortVerb{"}
\DeleteShortVerb{\|}
- \title{User Manual for datatool bundle version~2.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/}}
-
- \date{2012-07-18}
+ \title{User Manual for datatool bundle version~2.11}
+ \author{Nicola L.C. Talbot\\
+\url{http://www.dickimaw-books.com/}}
+
+ \date{2012-09-25}
\maketitle
\pagenumbering{roman}
@@ -79,7 +75,7 @@ The \styfmt{datatool} bundle comes with the following documentation:
\item[\url{datatool.pdf}]
Advanced users wishing to know more about the inner workings of
all the packages provided in the \styfmt{datatool} bundle should
- read \qt{Documented Code for datatool v2.10}
+ read \qt{Documented Code for datatool v2.11}
\item[INSTALL] Installation instructions.
@@ -2119,6 +2115,14 @@ For example:
\DTLsetheader{mydata}{Price}{Price (\$)}
\end{verbatim}
+\begin{definition}[\DescribeMacro{\DTLaddcolumn}]
+\cs{DTLaddcolumn}\marg{db}\marg{key}
+\end{definition}
+Adds a new column with the given key to the database \meta{db}. This
+doesn't add any data to the column, just identifies it as an
+available column. The starred version doesn't check if the database
+exists.
+
\section{Loading a Database from an External ASCII File}
\label{sec:loaddb}
@@ -2570,6 +2574,13 @@ This specifies how to format each entry in the columns that contain
only currency or currency mixed with real numbers and/or integers.
This defaults to just displaying \meta{text}.
+\begin{definition}[\DescribeMacro{\dtldisplayvalign}]
+\cs{dtldisplayvalign}
+\end{definition}
+Specifies the vertical alignment of the \env{tabular} environment
+used by \cs{DTLdisplaydb}. Defaults to \texttt{c} (centred). May be redefined
+to \texttt{t} (top) or \texttt{b} (bottom).
+
\begin{definition}[\DescribeMacro{\dtldisplaystarttab}]%
\cs{dtldisplaystarttab}
\end{definition}
@@ -4584,8 +4595,8 @@ iteration, \meta{cs} (which must be a control sequence) is set to
the current element in the column and may be used in \meta{body}.
Alternatively, if you want to identify the column by its index
rather than its key, use:
-\begin{definition}[\DescribeMacro{\dtlforcolumnindex}]%
-\cs{dtlforcolumnindex}\marg{cs}\marg{db}\marg{col index}\marg{body}
+\begin{definition}[\DescribeMacro{\dtlforcolumnidx}]%
+\cs{dtlforcolumnidx}\marg{cs}\marg{db}\marg{col index}\marg{body}
\end{definition}
\begin{definition}[\DescribeMacro{\DTLifdbexists}]
@@ -4765,11 +4776,35 @@ If you want to select from or edit a particular row in a database without having
to iterate through the database using \cs{DTLforeach}, you can use
the commands described in this section.
+\begin{definition}[\DescribeMacro{\DTLgetrowindex}]
+\cs{DTLgetrowindex}\marg{row cs}\marg{db name}\marg{col
+idx}\marg{value}
+\end{definition}
+Gets the row index of the first row in database \meta{db name} where
+the value for column \meta{col idx} matches \meta{value} and stores
+the result in \meta{row cs}, which must be a control sequence.
+An error message is given if not found.
+\begin{definition}[\DescribeMacro{\dtlgetrowindex}]
+\cs{dtlgetrowindex}\marg{row cs}\marg{db name}\marg{col
+idx}\marg{value}
+\end{definition}
+Similar to \cs{DTLgetrowindex} but doesn't produce an error if no match is
+found. You can test the result by using \cs{ifx}\meta{row
+cs}\cs{dtlnovalue}. For example:
+\begin{verbatim}
+\dtlgetrowindex{\myrowidx}{data}{\dtlcolumnindex{data}{Surname}}{Smith}
+\ifx\myrowidx\dtlnovalue
+ Not Found
+\else
+ Found in row \myrowidx.
+\fi
+\end{verbatim}
+
\begin{definition}[\DescribeMacro{\dtlgetrow}]
\cs{dtlgetrow}\marg{db name}\marg{row idx}
\end{definition}
Gets the row with index \meta{row idx} from the database \meta{db
-name}. The required row is stored in the token register
+name}. The required row is stored in the token register
\begin{definition}[\DescribeMacro{\dtlcurrentrow}]
\cs{dtlcurrentrow}
\end{definition}
@@ -4796,6 +4831,13 @@ inserted} error if you misspell the database name and a \qt{Runaway
argument} error if you specify a row index that is out of range.
\end{important}
+\begin{definition}[\DescribeMacro{\dtlgetrowforvalue}]
+\cs{dtlgetrowforvalue}\marg{db name}\marg{column index}\marg{value}
+\end{definition}
+Like \cs{dtlgetrow}, but this gets the row where the entry in column
+\meta{column index} matches \meta{value}. This command produces an
+error if no match is found.
+
You can use the commands below to access or edit \cs{dtlcurrentrow}, but
they won't change the database. Instead, once you've finished
editing \cs{dtlcurrentrow}, you need to reconstruct the database
@@ -4853,8 +4895,15 @@ the column indices).
\cs{dtlappendentrytocurrentrow}\marg{key}\marg{value}
\end{definition}
Appends \meta{value} to the current row for column given by
-\meta{key}. (Note this is the only command in this section to
-reference by key rather than by index.)
+\meta{key}. (Produces an error if there is already an entry for that
+column in the current row.)
+
+\begin{definition}[\DescribeMacro{\dtlappendentrytocurrentrow}]
+\cs{dtlupdateentryincurrentrow}\marg{key}\marg{value}
+\end{definition}
+Behaves like \cs{dtlappendentrytocurrentrow} if the current row
+doesn't contain an entry for the column given by \meta{key},
+otherwise behaves like \cs{dtlreplaceentryincurrentrow}.
\chapter{Pie Charts (\texorpdfstring{\sty{datapie}}{datapie} package)}
\label{sec:datapie}