diff options
author | Karl Berry <karl@freefriends.org> | 2013-06-28 21:55:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-06-28 21:55:40 +0000 |
commit | 35f4733179fc116420810062bf3bd6891f86b5d9 (patch) | |
tree | 3b0927edac46e09d985b5a5253b08757858b7ee4 | |
parent | efeeb862227d6416e7450a72d6f37ebba3563b20 (diff) |
datatool (28jun13)
git-svn-id: svn://tug.org/texlive/trunk@31007 c570f23f-e606-0410-a88d-b1316a301751
29 files changed, 1762 insertions, 1311 deletions
diff --git a/Master/texmf-dist/doc/latex/datatool/CHANGES b/Master/texmf-dist/doc/latex/datatool/CHANGES index aafffbec6b0..657f9fc5724 100644 --- a/Master/texmf-dist/doc/latex/datatool/CHANGES +++ b/Master/texmf-dist/doc/latex/datatool/CHANGES @@ -1,3 +1,33 @@ +v2.14: + + * datatool: + + - fixed bug in \@dtl@updatekeys + (Bug report: http://www.dickimaw-books.com/cgi-bin/bugtracker.cgi?action=view&key=20) + + - fixed \DTLsaverawdb so that it works when there are fragile + commands in database entries + + + * dataplot: + + - refactored \DTLplot to help prevent large data values exceeding + TeX's maximum dimensions + + - aded tikz calc library as a requirement + + * datagidx: + + - added 'condition' key to \printterms + + - added \postnewtermhook, \newtermfield, \ifnewtermfield, + \datagidxdb + + - fixed bug in 'gloss' style that displayed multiple "see also" + lines for entries that have children. + + * Fixed minor typos in user manual + v2.13: * Added new package `datagidx' diff --git a/Master/texmf-dist/doc/latex/datatool/README b/Master/texmf-dist/doc/latex/datatool/README index b344b39a9bb..f9fa3ee5c74 100644 --- a/Master/texmf-dist/doc/latex/datatool/README +++ b/Master/texmf-dist/doc/latex/datatool/README @@ -1,6 +1,6 @@ -LaTeX Bundle : datatool v2.13 +LaTeX Bundle : datatool v2.14 -Last Modified : 2013-01-15 +Last Modified : 2013-06-28 Author : Nicola Talbot diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf b/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf Binary files differindex 38a648fb1f4..1925afd9794 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf +++ b/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf b/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf Binary files differindex cc86ab5d26e..ae0e4ce277e 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf +++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex index a38dc6c7060..d2cb0a0eb38 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex +++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex @@ -82,20 +82,20 @@ \newterm[see={caiman}]{cayman} - \begin{document} % Some of the commands are too long to produce nicely formatted % paragraphs so use ragged-right: \raggedright +\setlength{\parindent}{1em}% \MakeShortVerb{"} \DeleteShortVerb{\|} - \title{User Manual for datatool bundle version~2.13} + \title{User Manual for datatool bundle version~2.14} \author{Nicola L.C. Talbot\\ \url{http://www.dickimaw-books.com/}} - \date{2013-01-15} + \date{2013-06-28} \maketitle \pagenumbering{roman} @@ -110,7 +110,7 @@ The \styfmt{datatool} bundle comes with the following documentation: \item[\url{datatool-code.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.13} + read \qt{Documented Code for datatool v2.14} \item[INSTALL] Installation instructions. @@ -2004,8 +2004,8 @@ attempting to use it as such is like trying to fasten a screw with a knife instead of a screwdriver: it can be done, but requires great care and is more time consuming. Version 2.0 of the \sty{datatool} package uses a completely different method of storing -the data to previous versions.\footnote{Thanks to Morten H\o gholm -for the suggestion.} As a result, the code is much more efficient, +the data to previous versions.\footnote{Many thanks to Morten H\o gholm +for providing the new code.} As a result, the code is much more efficient, however, large databases and complex operations will still slow the time taken to process your document. Therefore, if you can, it is better to do the complex operations using whatever system created @@ -2017,6 +2017,15 @@ described in \autoref{sec:advanced}, but using \TeX\ is nowhere near as efficient as, say, using a SQL database, so don't expect too much from this package. + +I'm working on a Java helper application to accompany \sty{datatool} +called \app{datatooltk}. The source code is available on GitHub at +\url{https://github.com/nlct/datatooltk}. I'll upload it to CTAN +when it's ready for release. The application will allow you to edit +files saved using \ics{DTLsaverawdb} in a~graphical interface or +import data from a~SQL database, a~CSV file or a~\sty{probsoln} +dataset. + \section{Creating a New Database} \label{sec:newdb} @@ -5142,7 +5151,7 @@ Gets the value from \cs{dtlcurrentrow} for the column given by control sequence. \begin{definition}[\DescribeMacro{\dtlreplaceentryincurrentrow}] -\cs{dtlreplaceentryincurrentrow}\meta{new value}\marg{col idx} +\cs{dtlreplaceentryincurrentrow}\marg{new value}\marg{col idx} \end{definition} Replaces the value in \cs{dtlcurrentrow} for the column given by \meta{col idx} (an integer) with \meta{new value}. @@ -5170,7 +5179,7 @@ Appends \meta{value} to the current row for column given by \meta{key}. (Produces an error if there is already an entry for that column in the current row.) -\begin{definition}[\DescribeMacro{\dtlappendentrytocurrentrow}] +\begin{definition}[\DescribeMacro{\dtlupdateentryincurrentrow}] \cs{dtlupdateentryincurrentrow}\marg{key}\marg{value} \end{definition} Behaves like \cs{dtlappendentrytocurrentrow} if the current row @@ -6274,6 +6283,14 @@ If \textsf{true}, the columns are balanced. If \textsf{false}, the columns aren't balanced. If no value is specified, \textsf{true} is assumed. +\item[\csopt{printterms}{condition}] This specifies a boolean +condition (as used by \ics{DTLforeach}) so you can display only +those entries where the condition is met. For example, to only +display entries starting with ``H'' (not including any entry that is +just the letter ``H'') you can do: +\begin{verbatim} +\printterms[condition={\DTLisiopenbetween{\Name}{H}{I}}] +\end{verbatim} \end{description} \subsection{Index or Glossary Styles} @@ -7344,12 +7361,12 @@ Suppose you have a file called "groupa.csv" that contains the following: \DTLnewdb{groupa}\relax \DTLnewrow{groupa}\relax -\DTLnewdbentry{groupa}{Height}{1.55}\relax -\DTLnewdbentry{groupa}{Weight}{45.4}\relax -\DTLnewrow{groupa}\relax \DTLnewdbentry{groupa}{Height}{1.54}\relax \DTLnewdbentry{groupa}{Weight}{48.0}\relax \DTLnewrow{groupa}\relax +\DTLnewdbentry{groupa}{Height}{1.55}\relax +\DTLnewdbentry{groupa}{Weight}{45.4}\relax +\DTLnewrow{groupa}\relax \DTLnewdbentry{groupa}{Height}{1.56}\relax \DTLnewdbentry{groupa}{Weight}{58.0}\relax \DTLnewrow{groupa}\relax diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf Binary files differindex 60711b2cfcd..f577cf34278 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf Binary files differnew file mode 100644 index 00000000000..7cf69ccb5bb --- /dev/null +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex new file mode 100644 index 00000000000..dec5f1582bb --- /dev/null +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-datatooltk.tex @@ -0,0 +1,19 @@ +% 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} +\end{document} diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf Binary files differindex 90a504b882b..525cbcde12f 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf Binary files differindex eb3c2b9f78f..26100c2a282 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.tex b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.tex index e5c0d2eafb5..1bc51095389 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.tex +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.tex @@ -257,7 +257,7 @@ \DTLgidxSetDefaultDB{glossary} \newterm[description={sea mammal with flippers that eats fish}]{seal} -\newterm[description={large seal}]{sea lion} +\newterm[description={large seal},seealso={seal}]{sea lion} \newterm{bravo} \newterm @@ -277,9 +277,21 @@ {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}} @@ -304,17 +316,6 @@ {glossary\glsadd{[glossaryloc]ind-glossary}} \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 label=pglist, % description contains commas so it must be grouped diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf Binary files differindex df054ced862..241bf8295e3 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf Binary files differindex 03e95157250..b1acc29d28d 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf Binary files differindex bbc7a7dfb5f..ffe0f8ad7bc 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf Binary files differindex 99d2c261975..c8b3a8d3ebf 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf Binary files differindex 6e640ed055c..c8edaa3ee32 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf Binary files differindex 2f9b601552d..53785b034ce 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx index 2b0a0fe9044..abb64150269 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.dtx +++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx @@ -17,7 +17,7 @@ % -author "Nicola Talbot" % -codetitle "" % datatool -% Created on 2013/1/15 15:04 +% Created on 2013/6/28 15:53 %\fi %\iffalse %<*package> @@ -64,7 +64,7 @@ datatool.dtx \doxitem{Counter}{counter}{counters} \doxitem{Option}{option}{package options} -\CheckSum{22429} +\CheckSum{22657} \RecordChanges \PageIndex @@ -77,11 +77,11 @@ datatool.dtx %\fi %\MakeShortVerb{"} % -%\title{Documented Code for datatool v2.13} +%\title{Documented Code for datatool v2.14} %\author{Nicola L. C. Talbot\\ %\url{http://www.dickimaw-books.com/}} % -%\date{2013-01-15} +%\date{2013-06-28} %\maketitle % %\pagenumbering{roman} @@ -116,7 +116,7 @@ datatool.dtx % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool-base}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -5155,7 +5155,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{fp} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool-fp}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -5444,7 +5444,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{pgfmath} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -5701,7 +5701,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -5915,10 +5915,11 @@ datatool.dtx %\begin{macro}{\DTLpar} % Many of the commands used by this package are short commands. % This means that you can't use \cs{par} -% in the data. To get around this, define the robust command -% \cs{DTLpar} to use instead. +% in the data. To get around this, provide a synonym for \cs{@@par} +% that can be used instead +%\changes{2.14}{2013-06-28}{changed to \cs{let}} % \begin{macrocode} -\DeclareRobustCommand\DTLpar{\@par} +\let\DTLpar\@@par % \end{macrocode} %\end{macro} % @@ -6742,8 +6743,11 @@ datatool.dtx \@dtl@dogetprops % \end{macrocode} % Is the value empty? +%\changes{2.14}{2013-06-28}{expand value before testing if it's +%empty} % \begin{macrocode} - \ifstrempty{#3}% + \protected@edef\dtl@tmp{#3}% + \ifdefempty\dtl@tmp {% % \end{macrocode} % Leave data type as it is @@ -11990,7 +11994,7 @@ datatool.dtx }\expandafter\@gobble\string\% }% % \end{macrocode} -% Scope need to localise definitions: +% Scope needed to localise definitions: % \begin{macrocode} {% % \end{macrocode} @@ -12063,9 +12067,17 @@ datatool.dtx \string\expandafter \string\global^^J\string\csname\space dtldb@#1\string\endcsname =\expandafter\@gobble\string\{\expandafter\@gobble\string\%}% - \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{\the\csname dtldb@#1\endcsname}% +% \end{macrocode} +% Sanitize contents so we don't need to worry about fragile +% commands, but we need to substitute back the element tags so get +% it formatted correctly. +% \begin{macrocode} + \@dtl@fmt@bodytok{\csname dtldb@#1\endcsname}% + \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{% + \@dtl@contents}% \protected@write{\@dtl@write}{}{\csname dtl@rawwritedb@#1\endcsname}% - \protected@write{\@dtl@write}{}{\expandafter\@gobble\string\}\expandafter\@gobble\string\%}% + \protected@write{\@dtl@write}{}{% + \expandafter\@gobble\string\}\expandafter\@gobble\string\%}% % \end{macrocode} % Now for the count register that keeps track of the row count. % \begin{macrocode} @@ -12118,6 +12130,37 @@ datatool.dtx % \end{macrocode} %\end{macro} % +%\begin{macro}{\@dtl@fmt@bodytok} +% Format token contents for writing to file. +%\changes{2.14}{2013-06-28}{new} +% \begin{macrocode} +\newcommand*{\@dtl@fmt@bodytok}[1]{% + \edef\@dtl@contents{\the#1}% + \@onelevel@sanitize\@dtl@contents + \@dtl@replace@elt{\@dtl@contents}{db@row@elt@w}% + \@dtl@replace@elt{\@dtl@contents}{db@row@elt@end@}% + \@dtl@replace@elt{\@dtl@contents}{db@row@id@w}% + \@dtl@replace@elt{\@dtl@contents}{db@row@id@end@}% + \@dtl@replace@elt{\@dtl@contents}{db@col@id@w}% + \@dtl@replace@elt{\@dtl@contents}{db@col@id@end@}% + \@dtl@replace@elt{\@dtl@contents}{db@col@elt@w}% + \@dtl@replace@elt{\@dtl@contents}{db@col@elt@end@}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@dlt@replace@elt} +% Replace element tag. +%\changes{2.14}{2013-06-28}{new} +% \begin{macrocode} +\newcommand*{\@dtl@replace@elt}[2]{% + \expandafter\def\expandafter\dtl@tmp\expandafter{\csname#2\endcsname }% + \@onelevel@sanitize\dtl@tmp + \expandafter\DTLsubstituteall\expandafter#1\expandafter{\dtl@tmp}% + {\csname#2\endcsname}% +} +% \end{macrocode} +%\end{macro} +% %\section{Loading a database from an external file} % %\begin{macro}{\@dtl@read} @@ -12842,7 +12885,7 @@ datatool.dtx % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datagidx}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datagidx}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -15347,7 +15390,9 @@ datatool.dtx \if@tempswa \DTLgidxSymbolDescription \DTLgidxDoSeeOrLocation - \DTLgidxSeeAlso +% \end{macrocode} +%\changes{2.14}{2013-06-28}{removed spurious see also line} +% \begin{macrocode} \else \mbox{}% \fi @@ -16907,9 +16952,46 @@ datatool.dtx % term: % \begin{macrocode} \global\let\datagidxlastlabel\newterm@label +% \end{macrocode} +%\changes{2.14}{2013-06-28}{added \cs{postnewtermhook}} +% Allow user to hook in here +% \begin{macrocode} + \postnewtermhook }% %\end{macro} % +%\begin{macro}{\postnewtermhook} +%\changes{2.14}{2013-06-28}{new} +% \begin{macrocode} +\newcommand*{\postnewtermhook}{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\newtermfield} +%\changes{2.14}{2013-06-28}{new} +% Expandable access to field name. (No check for existence of the +% field. Uses \sty{etoolbox's} \cs{csuse}, so expands to an empty +% string if the field is undefined.) +% \begin{macrocode} +\newcommand*{\newtermfield}[1]{\csuse{newterm@#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ifnewtermfield} +%\changes{2.14}{2013-06-28}{new} +% If the named field (given in first argument) is empty or undefined do third argument, +% otherwise do second argument. +% \begin{macrocode} +\newcommand{\ifnewtermfield}[3]{% + \ifcsdef{newterm@#1} + {% + \ifcsempty{newterm@#1}{#3}{#2}% + }% + {% + #3% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\datagidx@newterm} % Normal behaviour for \cs{newterm} % \begin{macrocode} @@ -17092,6 +17174,18 @@ datatool.dtx % \end{macrocode} %\end{macro} % +%\begin{macro}{\datagidxdb} +%\changes{2.14}{2013-06-28}{new} +% Gets the label of database containing the given entry. No check is +% made for the existence of the entry. Expands to empty if label is +% undefined. +% \begin{macrocode} +\newcommand*{\datagidxdb}[1]{% + \csuse{datagidxentry@#1}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\ifentryused} %\begin{definition} % \cs{ifentryused}\marg{label}\marg{true part}\marg{false part} @@ -18229,6 +18323,13 @@ datatool.dtx \fi } % \end{macrocode} +%\begin{macro}{\printterms@condition} +%\changes{2.14}{2013-06-28}{new} +% \begin{macrocode} +\newcommand*{\printterms@condition}{\boolean{true}} +\define@key{printterms}{condition}{\renewcommand*{\printterms@condition}{#1}} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\printterms} %\begin{definition} @@ -18399,11 +18500,13 @@ datatool.dtx %\end{definition} % Iterate through the current database, but only do \meta{body} % if there is a location or cross-reference. +%\changes{2.14}{2013-06-28}{Added optional argument when using +%\cs{DTLforeach}} % \begin{macrocode} \newcommand{\DTLgidxForeachEntry}[1]{% \def\datagidxprevgroup{}% \edef\datagidx@doforeachentry{% - \noexpand\DTLforeach*{\DTLgidxCurrentdb}% + \noexpand\DTLforeach*[\expandonce\printterms@condition]{\DTLgidxCurrentdb}% {\expandonce\DTLgidxAssignList} }% \datagidx@doforeachentry @@ -18555,7 +18658,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databib}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{databib}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -21262,7 +21365,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databar}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{databar}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -21779,8 +21882,11 @@ already exists}{}}}} \ifDTLbarytics \ifx\dtlbar@yticlist\relax \ifx\dtlbar@yticgap\relax + \@dtl@tmpcount=\DTLmintickgap + \divide\@dtl@tmpcount by 65536\relax + \dtldiv{\dtl@mingap}{\number\@dtl@tmpcount}{\dtl@unit}% \dtl@constructticklist\DTLnegextent\DTLbarmax - \dtl@unit\dtlbar@yticlist + \dtl@mingap\dtlbar@yticlist \else \dtl@constructticklistwithgapz \DTLnegextent\DTLbarmax\dtlbar@yticlist\dtlbar@yticgap @@ -21809,23 +21915,23 @@ already exists}{}}}} \fi }% \else - \@for\dtl@thislabel:=\dtlbar@yticlabels\do{% - \ifDTLverticalbars - \settowidth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \else - \settoheight{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \edef\@dtl@h{\the\dtl@tmplength}% - \settodepth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \addtolength{\dtl@tmplength}{\@dtl@h}% - \addtolength{\dtl@tmplength}{\baselineskip}% - \fi - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% - \fi - }% +% \@for\dtl@thislabel:=\dtlbar@yticlabels\do{% +% \ifDTLverticalbars +% \settowidth{\dtl@tmplength}{% +% \DTLbardisplayYticklabel{\dtl@thislabel}}% +% \else +% \settoheight{\dtl@tmplength}{% +% \DTLbardisplayYticklabel{\dtl@thislabel}}% +% \edef\@dtl@h{\the\dtl@tmplength}% +% \settodepth{\dtl@tmplength}{% +% \DTLbardisplayYticklabel{\dtl@thislabel}}% +% \addtolength{\dtl@tmplength}{\@dtl@h}% +% \addtolength{\dtl@tmplength}{\baselineskip}% +% \fi +% \ifdim\dtl@tmplength>\dtl@yticlabelwidth +% \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% +% \fi +% }% \fi \fi \fi @@ -22173,8 +22279,11 @@ already exists}{}}}} \ifDTLbarytics \ifx\dtlbar@yticlist\relax \ifx\dtlbar@yticgap\relax + \@dtl@tmpcount=\DTLmintickgap + \divide\@dtl@tmpcount by 65536\relax + \dtldiv{\dtl@mingap}{\number\@dtl@tmpcount}{\dtl@unit}% \dtl@constructticklist\DTLnegextent\DTLbarmax - \dtl@unit\dtlbar@yticlist + \dtl@mingap\dtlbar@yticlist \else \dtl@constructticklistwithgapz \DTLnegextent\DTLbarmax\dtlbar@yticlist\dtlbar@yticgap @@ -22563,7 +22672,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datapie}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datapie}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -22927,199 +23036,226 @@ already exists}{}}}} % \meta{conditions} is the same as that for \cs{DTLforeach}. % \begin{macrocode} \newcommand*{\DTLpiechart}[4][\boolean{true}]{% -{\let\DTLpievariable=\relax -\setkeys{datapie}{#2}% -\ifx\DTLpievariable\relax - \PackageError{datapie}{\string\DTLpiechart\space missing variable}{}% -\else +\bgroup + \let\DTLpievariable=\relax + \setkeys{datapie}{#2}% + \ifx\DTLpievariable\relax + \PackageError{datapie}% + {\string\DTLpiechart\space missing variable}{}% + \else % \end{macrocode} % Compute the total. %\changes{1.01}{2007 Aug 17}{uses \cs{@sDTLforeach} instead of %\cs{DTLforeach}} % \begin{macrocode} -\def\dtl@total{0}% -\@sDTLforeach[#1]{#3}{#4}{% -\let\dtl@oldtotal=\dtl@total -\expandafter\DTLconverttodecimal\expandafter - {\DTLpievariable}{\dtl@variable}% -\FPadd{\dtl@total}{\dtl@variable}{\dtl@total}% -}% + \def\dtl@total{0}% + \@sDTLforeach[#1]{#3}{#4}{% + \let\dtl@oldtotal=\dtl@total + \expandafter\DTLconverttodecimal\expandafter + {\DTLpievariable}{\dtl@variable}% + \FPadd{\dtl@total}{\dtl@variable}{\dtl@total}% + }% % \end{macrocode} % Compute the angles % \begin{macrocode} -\expandafter\DTLconverttodecimal\expandafter - {\DTLstartangle}{\@dtl@start}% -\@sDTLforeach[#1]{#3}{#4}{% -\expandafter\DTLconverttodecimal\expandafter - {\DTLpievariable}{\dtl@variable}% -\dtl@computeangles{% -\csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname}{% -\dtl@variable}% -\expandafter\@dtl@seg\expandafter= -\csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% -\FPmul{\dtl@tmp}{\dtl@variable}{100}% -\let\dtl@old=\dtl@tmp -\FPdiv{\dtl@tmp}{\dtl@old}{\dtl@total}% -\expandafter\FPround -\csname dtl@piepercent@\romannumeral\@dtl@seg\endcsname\dtl@tmp -\c@DTLpieroundvar -}% + \expandafter\DTLconverttodecimal\expandafter + {\DTLstartangle}{\@dtl@start}% + \@sDTLforeach[#1]{#3}{#4}{% + \expandafter\DTLconverttodecimal\expandafter + {\DTLpievariable}{\dtl@variable}% + \dtl@computeangles{% + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname}{% + \dtl@variable}% + \expandafter\@dtl@seg\expandafter= + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% + \FPmul{\dtl@tmp}{\dtl@variable}{100}% + \let\dtl@old=\dtl@tmp + \FPdiv{\dtl@tmp}{\dtl@old}{\dtl@total}% + \expandafter\FPround + \csname dtl@piepercent@\romannumeral\@dtl@seg\endcsname\dtl@tmp + \c@DTLpieroundvar + }% % \end{macrocode} % Compute the offsets for each cut away segment % \begin{macrocode} -\@for\dtl@row:=\dtl@piecutaways\do{% -\expandafter\@dtl@set@off\dtl@row-\relax -}% + \@for\dtl@row:=\dtl@piecutaways\do{% + \expandafter\@dtl@set@off\dtl@row-\relax + }% % \end{macrocode} % Set the starting angle % \begin{macrocode} -\let\dtl@start=\DTLstartangle + \let\dtl@start=\DTLstartangle % \end{macrocode} % Do the pie chart % \begin{macrocode} -\begin{tikzpicture} -\DTLpieatbegintikz -\@sDTLforeach[#1]{#3}{#4}{% + \begin{tikzpicture} + \DTLpieatbegintikz + \@sDTLforeach[#1]{#3}{#4}% + {% % \end{macrocode} % Store the segment number in \cs{@dtl@seg} % \begin{macrocode} -\expandafter\@dtl@seg\expandafter= -\csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% + \expandafter\@dtl@seg\expandafter= + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% % \end{macrocode} % Set the start angle. % \begin{macrocode} -\edef\dtl@start{\csname dtl@sang@\romannumeral\@dtl@seg\endcsname}% + \edef\dtl@start{% + \csname dtl@sang@\romannumeral\@dtl@seg\endcsname}% % \end{macrocode} % Set the extent % \begin{macrocode} -\edef\dtl@extent{\csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% + \edef\dtl@extent{% + \csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% % \end{macrocode} % Compute the end angle % \begin{macrocode} -\FPadd{\dtl@endangle}{\dtl@start}{\dtl@extent}% + \FPadd{\dtl@endangle}{\dtl@start}{\dtl@extent}% % \end{macrocode} % Compute the shift. % \begin{macrocode} -\edef\dtl@angle{\csname dtl@cut@angle@\romannumeral\@dtl@seg\endcsname}% -\let\dtl@old=\dtl@angle -\dtl@truncatedecimal\dtl@angle -\ifnum\dtl@angle>180 - \FPsub{\dtl@angle}{\dtl@old}{360}% - \dtl@truncatedecimal\dtl@angle -\fi -\edef\dtl@cutlen{% -\csname dtl@cut@len@\romannumeral\@dtl@seg\endcsname} -\edef\@dtl@shift{(\dtl@angle:\dtl@cutlen)}% + \edef\dtl@angle{% + \csname dtl@cut@angle@\romannumeral\@dtl@seg\endcsname}% + \let\dtl@old=\dtl@angle + \dtl@truncatedecimal\dtl@angle + \ifnum\dtl@angle>180\relax + \FPsub{\dtl@angle}{\dtl@old}{360}% + \dtl@truncatedecimal\dtl@angle + \fi + \edef\dtl@cutlen{% + \csname dtl@cut@len@\romannumeral\@dtl@seg\endcsname + }% + \edef\@dtl@shift{(\dtl@angle:\dtl@cutlen)}% % \end{macrocode} % Compute the mid way angle. % \begin{macrocode} -\FPmul{\dtl@angle}{\dtl@extent}{0.5}% -\FPadd{\dtl@midangle}{\dtl@angle}{\dtl@start}% + \FPmul{\dtl@angle}{\dtl@extent}{0.5}% + \FPadd{\dtl@midangle}{\dtl@angle}{\dtl@start}% % \end{macrocode} % Draw the segment. % \begin{macrocode} -\begin{scope}[shift={\@dtl@shift}]% -\dtl@truncatedecimal\dtl@start -\dtl@truncatedecimal\dtl@endangle -\fill[color=\DTLgetpiesegmentcolor\@dtl@seg] (0,0) -- -(\dtl@start:\DTLradius) -arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; + \begin{scope}[shift={\@dtl@shift}]% + \dtl@truncatedecimal\dtl@start + \dtl@truncatedecimal\dtl@endangle + \fill[color=\DTLgetpiesegmentcolor\@dtl@seg] (0,0) -- + (\dtl@start:\DTLradius) + arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; % \end{macrocode} % Draw the outline if required: % \begin{macrocode} -\ifdim\DTLpieoutlinewidth>0pt\relax -\draw[color=\DTLpieoutlinecolor,line width=\DTLpieoutlinewidth] -(0,0) -- (\dtl@start:\DTLradius) -arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; -\fi + \ifdim\DTLpieoutlinewidth>0pt\relax + \draw[color=\DTLpieoutlinecolor,% + line width=\DTLpieoutlinewidth] + (0,0) -- (\dtl@start:\DTLradius) + arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; + \fi % \end{macrocode} % Convert decimal to an integer % \begin{macrocode} -\dtl@truncatedecimal\dtl@midangle + \dtl@truncatedecimal\dtl@midangle % \end{macrocode} % Determine whether to rotate inner labels % \begin{macrocode} -\ifDTLrotateinner + \ifDTLrotateinner % \end{macrocode} % If the mid way angle is between 90 and 270, the text will look % upside-down, so adjust accordingly. % \begin{macrocode} -\ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) -\TE@or \dtl@midangle < -90}{% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% - \dtl@truncatedecimal\dtl@labelangle - \edef\dtl@innernodeopt{anchor=east,rotate=\dtl@labelangle}% -}{% - \edef\dtl@innernodeopt{anchor=west,rotate=\dtl@midangle}% -}% + \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) + \TE@or \dtl@midangle < -90}% + {% + \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtl@truncatedecimal\dtl@labelangle + \edef\dtl@innernodeopt{anchor=east,rotate=\dtl@labelangle}% + }% + {% + \edef\dtl@innernodeopt{anchor=west,rotate=\dtl@midangle}% + }% % \end{macrocode} % Don't rotate inner labels % \begin{macrocode} -\else - \edef\dtl@innernodeopt{anchor=center}% -\fi + \else + \edef\dtl@innernodeopt{anchor=center}% + \fi % \end{macrocode} % Determine whether to rotate outer labels % \begin{macrocode} -\ifDTLrotateouter + \ifDTLrotateouter % \end{macrocode} % If the mid way angle is between 90 and 270, the text will look % upside-down, so adjust accordingly. % \begin{macrocode} -\ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) -\TE@or \dtl@midangle < -90}{% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% - \dtl@truncatedecimal\dtl@labelangle - \edef\dtl@outernodeopt{anchor=east,rotate=\dtl@labelangle}% -}{% - \edef\dtl@outernodeopt{anchor=west,rotate=\dtl@midangle}% -}% + \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) + \TE@or \dtl@midangle < -90}% + {% + \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtl@truncatedecimal\dtl@labelangle + \edef\dtl@outernodeopt{anchor=east,rotate=\dtl@labelangle}% + }% + {% + \edef\dtl@outernodeopt{anchor=west,rotate=\dtl@midangle}% + }% % \end{macrocode} % Don't rotate outer labels % \begin{macrocode} -\else - \ifthenelse{\(\dtl@midangle<45\and\dtl@midangle>-45\) - \TE@or \dtl@midangle=45 - \TE@or \dtl@midangle>315}{% - % east quadrant - \edef\dtl@outernodeopt{anchor=west}% - }{% - \ifthenelse{\(\dtl@midangle<135\and\dtl@midangle>45\) - \TE@or \dtl@midangle=135}{% - % north quadrant - \edef\dtl@outernodeopt{anchor=south}% - }{% - \ifthenelse{\(\dtl@midangle<225\and\dtl@midangle>135\) - \TE@or \dtl@midangle=225 - \TE@or \dtl@midangle=-135 - \TE@or \dtl@midangle<-135}{% - % west quadrant - \edef\dtl@outernodeopt{anchor=east}% - }{% - \edef\dtl@outernodeopt{anchor=north}% - }% - } - } -\fi + \else + \ifthenelse{\(\dtl@midangle<45\and\dtl@midangle>-45\) + \TE@or \dtl@midangle=45 + \TE@or \dtl@midangle>315}% + {% +% \end{macrocode} +% East quadrant +% \begin{macrocode} + \edef\dtl@outernodeopt{anchor=west}% + }% + {% + \ifthenelse{\(\dtl@midangle<135\and\dtl@midangle>45\) + \TE@or \dtl@midangle=135}% + {% +% \end{macrocode} +% North quadrant +% \begin{macrocode} + \edef\dtl@outernodeopt{anchor=south}% + }% + {% + \ifthenelse{\(\dtl@midangle<225\and\dtl@midangle>135\) + \TE@or \dtl@midangle=225 + \TE@or \dtl@midangle=-135 + \TE@or \dtl@midangle<-135}% + {% +% \end{macrocode} +% West quadrant +% \begin{macrocode} + \edef\dtl@outernodeopt{anchor=east}% + }% + {% + \edef\dtl@outernodeopt{anchor=north}% + }% + }% + }% + \fi % \end{macrocode} % Draw inner and outer labels % \begin{macrocode} -\edef\@dtl@dolabel{% -\noexpand\draw (\dtl@midangle:\the\dtl@inneroffset) -node[\dtl@innernodeopt]{% -\noexpand\DTLdisplayinnerlabel{\noexpand\dtl@innerlabel}};}% -\@dtl@dolabel -\edef\@dtl@dolabel{% -\noexpand\draw (\dtl@midangle:\the\dtl@outeroffset) -node[\dtl@outernodeopt]{% -\noexpand\DTLdisplayouterlabel{\noexpand\dtl@outerlabel}};}% -\@dtl@dolabel -\end{scope} -}% -\DTLpieatendtikz -\end{tikzpicture} -\fi -}} + \edef\@dtl@dolabel{% + \noexpand\draw (\dtl@midangle:\the\dtl@inneroffset) + node[\dtl@innernodeopt]{% + \noexpand\DTLdisplayinnerlabel{\noexpand\dtl@innerlabel}}; + }% + \@dtl@dolabel + \edef\@dtl@dolabel{% + \noexpand\draw (\dtl@midangle:\the\dtl@outeroffset) + node[\dtl@outernodeopt]{% + \noexpand\DTLdisplayouterlabel{\noexpand\dtl@outerlabel}}; + }% + \@dtl@dolabel + \end{scope}% + }% + \DTLpieatendtikz + \end{tikzpicture}% + \fi +\egroup +} % \end{macrocode} %\end{macro} % @@ -23241,7 +23377,7 @@ Try #2-#1 instead of #1-#2}% % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dataplot}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{dataplot}[2013/06/28 v2.14 (NLCT)] % \end{macrocode} % Required packages % \begin{macrocode} @@ -23254,6 +23390,11 @@ Try #2-#1 instead of #1-#2}% \usetikzlibrary{plotmarks} \usetikzlibrary{plothandlers} % \end{macrocode} +% Load calc library +%\changes{2.14}{2013-06-28}{added calc library requirement} +% \begin{macrocode} +\usetikzlibrary{calc} +% \end{macrocode} % %\begin{macro}{\DTLplotstream} %\begin{definition} @@ -23268,10 +23409,12 @@ Try #2-#1 instead of #1-#2}% %\cs{DTLforeach}} % \begin{macrocode} \newcommand*{\DTLplotstream}[4][\boolean{true}]{% -\@sDTLforeach[#1]{#2}{\dtl@x=#3,\dtl@y=#4}{% -\DTLconverttodecimal{\dtl@x}{\dtl@decx}% -\DTLconverttodecimal{\dtl@y}{\dtl@decy}% -\pgfplotstreampoint{\pgfpointxy{\dtl@decx}{\dtl@decy}}}} + \@sDTLforeach[#1]{#2}{\dtl@x=#3,\dtl@y=#4}{% + \DTLconverttodecimal{\dtl@x}{\dtl@decx}% + \DTLconverttodecimal{\dtl@y}{\dtl@decy}% + \pgfplotstreampoint{\pgfpointxy{\dtl@decx}{\dtl@decy}}% + }% +} % \end{macrocode} %\end{macro} % @@ -23832,457 +23975,541 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Creates a plot (inside a \env{tikzpicture} environment) of all % the data given in the databases listed in \meta{db list}. % \begin{macrocode} -\newcommand*{\DTLplot}[3][\boolean{true}]{{% -\let\dtl@xkey=\relax -\let\dtl@ykey=\relax -\let\dtl@legendlabels=\relax -\setkeys{dataplot}{#3}% -\let\dtl@plotmarklist=\DTLplotmarks -\let\dtl@plotlinelist=\DTLplotlines -\let\dtl@plotmarkcolorlist=\DTLplotmarkcolors -\let\dtl@plotlinecolorlist=\DTLplotlinecolors -\def\dtl@legend{}% -\ifx\dtl@legendlabels\relax - \edef\dtl@legendlabels{#2}% -\fi -\ifx\dtl@xkey\relax - \PackageError{dataplot}{Missing x setting for - \string\DTLplot}{}% -\else - \ifx\dtl@ykey\relax - \PackageError{dataplot}{Missing y setting for +\newcommand*{\DTLplot}[3][\boolean{true}]{% +\bgroup + \let\dtl@xkey=\relax + \let\dtl@ykey=\relax + \let\dtl@legendlabels=\relax + \setkeys{dataplot}{#3}% + \let\dtl@plotmarklist=\DTLplotmarks + \let\dtl@plotlinelist=\DTLplotlines + \let\dtl@plotmarkcolorlist=\DTLplotmarkcolors + \let\dtl@plotlinecolorlist=\DTLplotlinecolors + \def\dtl@legend{}% + \ifx\dtl@legendlabels\relax + \edef\dtl@legendlabels{#2}% + \fi + \ifx\dtl@xkey\relax + \PackageError{dataplot}{Missing x setting for \string\DTLplot}{}% \else + \ifx\dtl@ykey\relax + \PackageError{dataplot}{Missing y setting for + \string\DTLplot}{}% + \else % \end{macrocode} % If user didn't specified bounds, % compute the maximum and minimum $x$ and $y$ values over % all the databases listed. % \begin{macrocode} - \ifx\dtl@bounds\relax - \DTLcomputebounds[#1]{#2}{\dtl@xkey}{\dtl@ykey} - {\DTLminX}{\DTLminY}{\DTLmaxX}{\DTLmaxY}% - \ifx\dtl@minx\relax - \else - \let\DTLminX=\dtl@minx - \fi - \ifx\dtl@maxx\relax - \else - \let\DTLmaxX=\dtl@maxx - \fi - \ifx\dtl@miny\relax - \else - \let\DTLminY=\dtl@miny - \fi - \ifx\dtl@maxy\relax - \else - \let\DTLmaxY=\dtl@maxy - \fi + \ifx\dtl@bounds\relax + \DTLcomputebounds[#1]{#2}{\dtl@xkey}{\dtl@ykey} + {\DTLminX}{\DTLminY}{\DTLmaxX}{\DTLmaxY}% + \ifx\dtl@minx\relax + \else + \let\DTLminX=\dtl@minx + \fi + \ifx\dtl@maxx\relax + \else + \let\DTLmaxX=\dtl@maxx + \fi + \ifx\dtl@miny\relax + \else + \let\DTLminY=\dtl@miny + \fi + \ifx\dtl@maxy\relax + \else + \let\DTLmaxY=\dtl@maxy + \fi % \end{macrocode} % Otherwise extract information from \cs{dtl@bounds} % \begin{macrocode} - \else - \expandafter\dtl@getbounds\dtl@bounds\@nil - \fi + \else + \expandafter\dtl@getbounds\dtl@bounds\@nil + \fi % \end{macrocode} -% Determine scaling factors. -% \begin{macrocode} - \@dtl@tmpcount=\DTLplotwidth - \FPsub{\dtl@dx}{\DTLmaxX}{\DTLminX}% - \FPdiv{\dtl@unit@x}{\number\@dtl@tmpcount}{\dtl@dx}% - \@dtl@tmpcount=\DTLplotheight - \FPsub{\dtl@dy}{\DTLmaxY}{\DTLminY}% - \FPdiv{\dtl@unit@y}{\number\@dtl@tmpcount}{\dtl@dy}% +% Determine scaling factors and offsets. The $x$-scale factor is +% given by: +%\[ +% s_x = \frac{W}{x_{\max}-x_{\min}} +%\] +% where $W$ is the plot width. The $x$ offset is $-s_x x_{\min}$. +% Similarly for $y$. +%\changes{2.14}{2013-06-28}{replaced \cs{FPsub} etc with \cs{dtlsub} etc} +% \begin{macrocode} + \@dtl@tmpcount=\DTLplotwidth + \divide\@dtl@tmpcount by 65536\relax + \dtlsub{\dtl@dx}{\DTLmaxX}{\DTLminX}% + \dtldiv{\dtl@scale@x}{\number\@dtl@tmpcount}{\dtl@dx}% + \dtlmul{\dtl@offset@x}{-\dtl@scale@x}{\DTLminX}% + \@dtl@tmpcount=\DTLplotheight + \divide\@dtl@tmpcount by 65536\relax + \dtlsub{\dtl@dy}{\DTLmaxY}{\DTLminY}% + \dtldiv{\dtl@scale@y}{\number\@dtl@tmpcount}{\dtl@dy}% + \dtlmul{\dtl@offset@y}{-\dtl@scale@y}{\DTLminY}% % \end{macrocode} % If x tics specified, construct a list of x tic points if not % already specified. % \begin{macrocode} - \ifDTLxtics - \ifx\dtl@xticlist\relax - \ifx\dtl@xticgap\relax - \dtl@constructticklist\DTLminX\DTLmaxX - \dtl@unit@x\dtl@xticlist - \else - \DTLifFPopenbetween{0}{\DTLminX}{\DTLmaxX}{% - \dtl@constructticklistwithgapz - \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}{% - \dtl@constructticklistwithgap - \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}% - \fi - \fi + \ifDTLxtics + \ifx\dtl@xticlist\relax + \ifx\dtl@xticgap\relax % \end{macrocode} -% Construct a list of $x$ minor tick points if required +% Get the min tick gap in data co-ordinates % \begin{macrocode} - \let\dtl@xminorticlist\@empty - \ifDTLxminortics - \let\dtl@prevtick=\relax - \@for\dtl@nexttick:=\dtl@xticlist\do{% - \ifx\dtl@prevtick\relax + \dtlsub{\dtl@mingap}{\number\DTLmintickgap}{\dtl@offset@x}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{\dtl@scale@x}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{65536}% +% \end{macrocode} +% construct tick list +% \begin{macrocode} + \dtl@constructticklist\DTLminX\DTLmaxX + \dtl@mingap\dtl@xticlist \else - \dtl@constructminorticklist - \dtl@prevtick\dtl@nexttick\dtl@unit@x\dtl@xminorticlist + \DTLifFPopenbetween{0}{\DTLminX}{\DTLmaxX}{% + \dtl@constructticklistwithgapz + \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}{% + \dtl@constructticklistwithgap + \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}% \fi - \let\dtl@prevtick=\dtl@nexttick - }% - \fi + \fi +% \end{macrocode} +% Construct a list of $x$ minor tick points if required +% \begin{macrocode} + \let\dtl@xminorticlist\@empty + \ifDTLxminortics + \let\dtl@prevtick=\relax + \@for\dtl@nexttick:=\dtl@xticlist\do{% + \ifx\dtl@prevtick\relax + \else + \dtl@constructminorticklist + \dtl@prevtick\dtl@nexttick\dtl@scale@x\dtl@xminorticlist + \fi + \let\dtl@prevtick=\dtl@nexttick + }% + \fi % \end{macrocode} % Determine the height of the $x$ tick labels. % \begin{macrocode} - \ifx\dtl@xticlabels\relax - \settoheight{\dtl@xticlabelheight}{\dtl@xticlist}% + \ifx\dtl@xticlabels\relax + \settoheight{\dtl@xticlabelheight}{\dtl@xticlist}% + \else + \settoheight{\dtl@xticlabelheight}{\dtl@xticlabels}% + \fi \else - \settoheight{\dtl@xticlabelheight}{\dtl@xticlabels}% - \fi - \else - \setlength{\dtl@xticlabelheight}{0pt}% - \fi + \setlength{\dtl@xticlabelheight}{0pt}% + \fi % \end{macrocode} % If y tics specified, construct a list of y tic points if not % already specified. % \begin{macrocode} - \setlength{\dtl@yticlabelwidth}{0pt}% - \ifDTLytics - \ifx\dtl@yticlist\relax - \ifx\dtl@yticgap\relax - \dtl@constructticklist\DTLminY\DTLmaxY - \dtl@unit@y\dtl@yticlist - \else - \DTLifFPopenbetween{0}{\DTLminY}{\DTLmaxY}{% - \dtl@constructticklistwithgapz - \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}{% - \dtl@constructticklistwithgap - \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}% - \fi - \fi + \setlength{\dtl@yticlabelwidth}{0pt}% + \ifDTLytics + \ifx\dtl@yticlist\relax + \ifx\dtl@yticgap\relax % \end{macrocode} -% Construct a list of $y$ minor tick points if required +% Get the min tick gap in data co-ordinates % \begin{macrocode} - \let\dtl@yminorticlist\@empty - \ifDTLyminortics - \let\dtl@prevtick=\relax - \@for\dtl@nexttick:=\dtl@yticlist\do{% - \ifx\dtl@prevtick\relax + \dtlsub{\dtl@mingap}{\number\DTLmintickgap}{\dtl@offset@y}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{\dtl@scale@y}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{65536}% +% \end{macrocode} +% construct tick list +% \begin{macrocode} + \dtl@constructticklist\DTLminY\DTLmaxY + \dtl@mingap\dtl@yticlist \else - \dtl@constructminorticklist - \dtl@prevtick\dtl@nexttick\dtl@unit@y\dtl@yminorticlist + \DTLifFPopenbetween{0}{\DTLminY}{\DTLmaxY}{% + \dtl@constructticklistwithgapz + \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}{% + \dtl@constructticklistwithgap + \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}% \fi - \let\dtl@prevtick=\dtl@nexttick - }% - \fi + \fi % \end{macrocode} -% Determine the width of the $y$ tick labels. +% Construct a list of $y$ minor tick points if required % \begin{macrocode} - \ifx\dtl@ylabel\relax - \else - \ifx\dtl@yticlabels\relax - \@for\dtl@thislabel:=\dtl@yticlist\do{% - \FPround{\dtl@thislabel}{\dtl@thislabel} - {\c@DTLplotroundYvar}% - \settowidth{\dtl@tmplength}{\dtl@thislabel}% - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \let\dtl@yminorticlist\@empty + \ifDTLyminortics + \let\dtl@prevtick=\relax + \@for\dtl@nexttick:=\dtl@yticlist\do{% + \ifx\dtl@prevtick\relax + \else + \dtl@constructminorticklist + \dtl@prevtick\dtl@nexttick\dtl@scale@y\dtl@yminorticlist \fi + \let\dtl@prevtick=\dtl@nexttick }% + \fi +% \end{macrocode} +% Determine the width of the $y$ tick labels. +%\changes{2.14}{2013-06-28}{replaced \cs{FPround} with \cs{dtlround}} +% \begin{macrocode} + \ifx\dtl@ylabel\relax \else - \@for\dtl@thislabel:=\dtl@yticlabels\do{% - \settowidth{\dtl@tmplength}{\dtl@thislabel}% - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% - \fi - }% + \ifx\dtl@yticlabels\relax + \@for\dtl@thislabel:=\dtl@yticlist\do{% + \dtlround{\dtl@thislabel}{\dtl@thislabel} + {\c@DTLplotroundYvar}% + \settowidth{\dtl@tmplength}{\dtl@thislabel}% + \ifdim\dtl@tmplength>\dtl@yticlabelwidth + \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + }% + \else + \@for\dtl@thislabel:=\dtl@yticlabels\do{% + \settowidth{\dtl@tmplength}{\dtl@thislabel}% + \ifdim\dtl@tmplength>\dtl@yticlabelwidth + \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + }% + \fi \fi \fi % \end{macrocode} % Start the picture. % \begin{macrocode} - \begin{tikzpicture} + \begin{tikzpicture} % \end{macrocode} % Set the $x$ and $y$ unit vectors. % \begin{macrocode} - \pgfsetxvec{\pgfpoint{\dtl@unit@x sp}{0pt}}% - \pgfsetyvec{\pgfpoint{0pt}{\dtl@unit@y sp}}% + \pgfsetxvec{\pgfpoint{1pt}{0pt}}% + \pgfsetyvec{\pgfpoint{0pt}{1pt}}% +% \end{macrocode} +% Set the transformation matrix, so user can plot things using the +% data co-ordinate space, but scope it, so it doesn't affect any plot +% marks later +% \begin{macrocode} + \begin{scope} + \pgftransformcm{\dtl@scale@x}{0}{0}{\dtl@scale@y}% + {\pgfpoint{\dtl@offset@x pt}{\dtl@offset@y pt}}% % \end{macrocode} % Add any extra information the user requires % \begin{macrocode} - \DTLplotatbegintikz + \DTLplotatbegintikz % \end{macrocode} % Determine whether to put a box around the plot % \begin{macrocode} - \ifDTLbox - \draw (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY) -- + \ifDTLbox + \draw (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY) -- (\DTLmaxX,\DTLmaxY) -- (\DTLminX,\DTLmaxY) -- - cycle; - \else + cycle; + \else % \end{macrocode} % Plot $x$ axis if required. % \begin{macrocode} - \ifDTLxaxis - \expandafter\draw\expandafter[\DTLXAxisStyle] + \ifDTLxaxis + \expandafter\draw\expandafter[\DTLXAxisStyle] (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY); - \fi + \fi % \end{macrocode} % Plot $y$ axis if required. % \begin{macrocode} - \ifDTLyaxis - \expandafter\draw\expandafter[\DTLYAxisStyle] + \ifDTLyaxis + \expandafter\draw\expandafter[\DTLYAxisStyle] (\DTLminX,\DTLminY) -- (\DTLminX,\DTLmaxY); - \fi - \fi + \fi + \fi % \end{macrocode} % Plot grid if required % \begin{macrocode} - \ifDTLgrid - \ifDTLxminortics - \@for\dtl@thistick:=\dtl@xminorticlist\do{% - \expandafter\draw\expandafter[\DTLminorgridstyle] + \ifDTLgrid + \ifDTLxminortics + \@for\dtl@thistick:=\dtl@xminorticlist\do{% + \expandafter\draw\expandafter[\DTLminorgridstyle] (\dtl@thistick,\DTLminY) -- (\dtl@thistick,\DTLmaxY); - }% - \fi - \ifDTLyminortics - \@for\dtl@thistick:=\dtl@yminorticlist\do{% - \expandafter\draw\expandafter[\DTLminorgridstyle] + }% + \fi + \ifDTLyminortics + \@for\dtl@thistick:=\dtl@yminorticlist\do{% + \expandafter\draw\expandafter[\DTLminorgridstyle] (\DTLminX,\dtl@thistick) -- (\DTLmaxX,\dtl@thistick); - }% - \fi - \@for\dtl@thistick:=\dtl@xticlist\do{% - \expandafter\draw\expandafter[\DTLmajorgridstyle] + }% + \fi + \@for\dtl@thistick:=\dtl@xticlist\do{% + \expandafter\draw\expandafter[\DTLmajorgridstyle] (\dtl@thistick,\DTLminY) -- (\dtl@thistick,\DTLmaxY); - }% - \@for\dtl@thistick:=\dtl@yticlist\do{% - \expandafter\draw\expandafter[\DTLmajorgridstyle] + }% + \@for\dtl@thistick:=\dtl@yticlist\do{% + \expandafter\draw\expandafter[\DTLmajorgridstyle] (\DTLminX,\dtl@thistick) -- (\DTLmaxX,\dtl@thistick); - }% - \fi + }% + \fi % \end{macrocode} % Plot $x$ tics if required. % \begin{macrocode} - \ifDTLxtics - \addtolength\dtl@xticlabelheight{\DTLticklabeloffset}% - \@for\dtl@thistick:=\dtl@xticlist\do{% - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLminY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{\DTLticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{-\DTLticklength}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{-\DTLticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{\DTLticklength}}} - \fi - \fi - \pgfusepath{stroke}% + \ifDTLxtics +% \end{macrocode} +% Get tick length in terms of canvas co-ordinates +% \begin{macrocode} + \dtlsub{\dtl@ticklength}{\number\DTLticklength}{-\dtl@offset@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% +% \end{macrocode} +% Get tick label offset in terms of canvas co-ordinates +% \begin{macrocode} + \addtolength\dtl@xticlabelheight{\DTLticklabeloffset}% + \dtlsub{\dtl@ticlabeloffset}{\number\dtl@xticlabelheight}{-\dtl@offset@y}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@scale@y}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{65536}% % \end{macrocode} -% Plot the tick labels +% Iterate through tick list. % \begin{macrocode} - \ifx\dtl@xticlabels\relax - \FPround{\dtl@thislabel}{\dtl@thistick} + \@for\dtl@thistick:=\dtl@xticlist\do{% +% \end{macrocode} +% Store tick label in \cs{dtl@thislabel} +% \begin{macrocode} + \let\dtl@thisticklabel\dtl@thistick + \ifx\dtl@xticlabels\relax + \dtlround{\dtl@thislabel}{\dtl@thistick} {\c@DTLplotroundXvar}% - \else + \else \dtl@chopfirst\dtl@xticlabels\dtl@thislabel\dtl@rest \let\dtl@xticlabels=\dtl@rest - \fi - \pgftext[base,center,at={\pgfpointadd - {\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{-\dtl@xticlabelheight}}}] - {\dtl@thislabel} - }% - \fi + \fi +% \end{macrocode} +% Draw tick. +% \begin{macrocode} + \ifDTLxticsin + \draw (\dtl@thistick,\DTLminY) -- ++(0,\dtl@ticklength); + \draw (\dtl@thistick,\DTLminY) + ++ (0,-\dtl@ticlabeloffset) node {\dtl@thislabel}; + \else + \draw (\dtl@thistick,\DTLminY) -- ++(0,-\dtl@ticklength) + ++ (0,-\dtl@ticlabeloffset) node {\dtl@thislabel}; + \fi +% \end{macrocode} +% Draw opposite tick, if box setting is on. +% \begin{macrocode} + \ifDTLbox + \ifDTLxticsin + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,-\dtl@ticklength); + \else + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,\dtl@ticklength); + \fi + \fi + }% + \fi % \end{macrocode} % Plot $x$ label if required. % \begin{macrocode} - \ifx\dtl@xlabel\relax - \else - \addtolength{\dtl@xticlabelheight}{\baselineskip}% - \setlength{\dtl@tmplength}{0.5\DTLplotwidth} - \pgftext[base,center,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}}% - {\pgfpoint{\dtl@tmplength}{-\dtl@xticlabelheight}}}]{% - \dtl@xlabel} - \fi + \ifx\dtl@xlabel\relax + \else +% \end{macrocode} +% Get baseline in terms of canvas co-ordinates +% \begin{macrocode} + \dtladd{\dtl@x}{\number\baselineskip}{\dtl@offset@y}% + \dtldiv{\dtl@x}{\dtl@x}{\dtl@scale@y}% + \dtldiv{\dtl@x}{\dtl@x}{65536}% + \dtladd{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@x}% +% \end{macrocode} +% Get halfway position +% \begin{macrocode} + \dtlmul{\dtl@x}{\dtl@dx}{0.5}% + \draw (\DTLminX,\DTLminY) ++(\dtl@x,-\dtl@ticlabeloffset) + node[anchor=north] {\dtl@xlabel}; + \fi % \end{macrocode} % Plot the $x$ minor ticks if required % \begin{macrocode} - \ifDTLxminortics - \@for\dtl@thistick:=\dtl@xminorticlist\do{% - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLminY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{\DTLminorticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{-\DTLminorticklength}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{-\DTLminorticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{\DTLminorticklength}}} - \fi - \fi + \ifDTLxminortics +% \end{macrocode} +% Get tick length in terms of canvas co-ordinates +% \begin{macrocode} + \dtlsub{\dtl@ticklength}{\number\DTLminorticklength}{-\dtl@offset@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% +% \end{macrocode} +% Iterate through minor ticks. +% \begin{macrocode} + \@for\dtl@thistick:=\dtl@xminorticlist\do{% + \ifDTLxticsin + \draw (\dtl@thistick,\DTLminY) -- ++(0,\dtl@ticklength); + \draw (\dtl@thistick,\DTLminY) + ++ (0,-\dtl@ticlabeloffset) node[anchor=north] {\dtl@thislabel}; + \else + \draw (\dtl@thistick,\DTLminY) -- ++(0,-\dtl@ticklength) + ++ (0,-\dtl@ticlabeloffset) node[anchor=north] {\dtl@thislabel}; + \fi +% \end{macrocode} +% Draw opposite tick, if box setting is on. +% \begin{macrocode} + \ifDTLbox + \ifDTLxticsin + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,-\dtl@ticklength); + \else + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,\dtl@ticklength); + \fi + \fi }% - \fi + \fi % \end{macrocode} % Plot $y$ tics if required. % \begin{macrocode} \ifDTLytics - \@for\dtl@thistick:=\dtl@yticlist\do{% - \pgfpathmoveto{\pgfpointxy{\DTLminX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{\DTLticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{-\DTLticklength}{0pt}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{-\DTLticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{\DTLticklength}{0pt}}} - \fi - \fi - \pgfusepath{stroke} % \end{macrocode} -% Plot the $y$ tick labels if required +% Get tick length in terms of canvas co-ordinates % \begin{macrocode} - \ifx\dtl@yticlabels\relax - \FPround{\dtl@thislabel}{\dtl@thistick} - {\c@DTLplotroundYvar}% - \else + \dtlsub{\dtl@ticklength}{\number\DTLticklength}{-\dtl@offset@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% +% \end{macrocode} +% Get tick label offset in terms of canvas co-ordinates +% \begin{macrocode} + \dtladd{\dtl@ticlabeloffset}{\number\DTLticklabeloffset}{0}% + \dtlsub{\dtl@ticlabeloffset}{\number\DTLticklabeloffset}{-\dtl@offset@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@scale@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{65536}% +% \end{macrocode} +% Iterate through tick list. +% \begin{macrocode} + \@for\dtl@thistick:=\dtl@yticlist\do{% +% \end{macrocode} +% Store tick label in \cs{dtl@thislabel} +% \begin{macrocode} + \let\dtl@thisticklabel\dtl@thistick + \ifx\dtl@yticlabels\relax + \dtlround{\dtl@thislabel}{\dtl@thistick} + {\c@DTLplotroundXvar}% + \else \dtl@chopfirst\dtl@yticlabels\dtl@thislabel\dtl@rest \let\dtl@yticlabels=\dtl@rest - \fi - \pgftext[right,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{-\DTLticklabeloffset}{0pt}}}] - {\dtl@thislabel} - }% + \fi +% \end{macrocode} +% Draw tick. +% \begin{macrocode} + \ifDTLyticsin + \draw (\DTLminX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \draw (\DTLminX,\dtl@thistick) + ++ (-\dtl@ticlabeloffset,0) node[anchor=east] {\dtl@thislabel}; + \else + \draw (\DTLminX,\dtl@thistick) -- ++(-\dtl@ticklength,0) + ++ (-\dtl@ticlabeloffset,0) node[anchor=east] {\dtl@thislabel}; + \fi +% \end{macrocode} +% Draw opposite tick, if box setting is on. +% \begin{macrocode} + \ifDTLbox + \ifDTLyticsin + \draw (\DTLmaxX,\dtl@thistick) -- ++(-\dtl@ticklength,0); + \else + \draw (\DTLmaxX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \fi + \fi + }% \fi % \end{macrocode} % Plot $y$ label if required. % \begin{macrocode} - \ifx\dtl@ylabel\relax - \else - \addtolength{\dtl@yticlabelwidth}{\baselineskip}% - \setlength{\dtl@tmplength}{0.5\DTLplotheight} - \pgftext[bottom,center,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}}% - {\pgfpoint{-\dtl@yticlabelwidth}{\dtl@tmplength}}}, - rotate=90]{% - \dtl@ylabel} - \fi + \ifx\dtl@ylabel\relax + \else + \setlength{\dtl@tmplength}{\baselineskip}% + \addtolength{\dtl@tmplength}{\dtl@yticlabelwidth}% + \addtolength{\dtl@tmplength}{\DTLticklabeloffset}% + \dtlsub{\dtl@ticlabeloffset}{\number\dtl@tmplength}{-\dtl@offset@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@scale@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{65536}% +% \end{macrocode} +% Get halfway position +% \begin{macrocode} + \dtlmul{\dtl@y}{\dtl@dy}{0.5}% + \draw (\DTLminX,\DTLminY) ++(-\dtl@ticlabeloffset,\dtl@y) + node[rotate=90,anchor=south] {\dtl@ylabel}; + \fi % \end{macrocode} % Plot the $y$ minor ticks if required % \begin{macrocode} - \ifDTLyminortics - \@for\dtl@thistick:=\dtl@yminorticlist\do{% - \pgfpathmoveto{\pgfpointxy{\DTLminX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{\DTLminorticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{-\DTLminorticklength}{0pt}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{-\DTLminorticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{\DTLminorticklength}{0pt}}} - \fi - \fi - \pgfusepath{stroke} + \ifDTLyminortics +% \end{macrocode} +% Get tick length in terms of canvas co-ordinates +% \begin{macrocode} + \dtlsub{\dtl@ticklength}{\number\DTLminorticklength}{-\dtl@offset@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% +% \end{macrocode} +% Iterate through minor ticks. +% \begin{macrocode} + \@for\dtl@thistick:=\dtl@yminorticlist\do{% + \ifDTLyticsin + \draw (\DTLminX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \else + \draw (\DTLminX,\dtl@thistick) -- ++(-\dtl@ticklength,0); + \fi +% \end{macrocode} +% Draw opposite tick, if box setting is on. +% \begin{macrocode} + \ifDTLbox + \ifDTLyticsin + \draw (\DTLmaxX,\dtl@thistick) -- ++(-\dtl@ticklength,0); + \else + \draw (\DTLmaxX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \fi + \fi }% - \fi + \fi +% \end{macrocode} +% End the transformation scope. (Don't want marker shapes to be +% scaled or skewed.) +% \begin{macrocode} + \end{scope} % \end{macrocode} % Iterate through each database % \begin{macrocode} - \@for\dtl@thisdb:=#2\do{% + \@for\dtl@thisdb:=#2\do{% % \end{macrocode} % Get the current plot mark colour. % \begin{macrocode} - \ifx\dtl@plotmarkcolorlist\@empty - \let\dtl@plotmarkcolorlist=\DTLplotmarkcolors - \fi - \dtl@chopfirst\dtl@plotmarkcolorlist\dtl@thisplotmarkcolor - \dtl@remainder - \let\dtl@plotmarkcolorlist=\dtl@remainder + \ifx\dtl@plotmarkcolorlist\@empty + \let\dtl@plotmarkcolorlist=\DTLplotmarkcolors + \fi + \dtl@chopfirst\dtl@plotmarkcolorlist\dtl@thisplotmarkcolor + \dtl@remainder + \let\dtl@plotmarkcolorlist=\dtl@remainder % \end{macrocode} % Get the current plot mark, and store in \cs{dtl@mark} % \begin{macrocode} - \ifDTLshowmarkers - \ifx\dtl@plotmarklist\@empty - \let\dtl@plotmarklist=\DTLplotmarks - \fi - \dtl@chopfirst\dtl@plotmarklist\dtl@thisplotmark - \dtl@remainder - \let\dtl@plotmarklist=\dtl@remainder - \ifx\dtl@thisplotmark\relax - \let\dtl@mark=\relax - \else - \expandafter\toks@\expandafter{\dtl@thisplotmark}% - \ifx\dtl@thisplotmarkcolor\@empty - \edef\dtl@mark{\the\toks@}% + \ifDTLshowmarkers + \ifx\dtl@plotmarklist\@empty + \let\dtl@plotmarklist=\DTLplotmarks + \fi + \dtl@chopfirst\dtl@plotmarklist\dtl@thisplotmark + \dtl@remainder + \let\dtl@plotmarklist=\dtl@remainder + \ifx\dtl@thisplotmark\relax + \let\dtl@mark=\relax \else - \edef\dtl@mark{% - \noexpand\color{\dtl@thisplotmarkcolor}% - \the\toks@}% + \expandafter\toks@\expandafter{\dtl@thisplotmark}% + \ifx\dtl@thisplotmarkcolor\@empty + \edef\dtl@mark{\the\toks@}% + \else + \edef\dtl@mark{% + \noexpand\color{\dtl@thisplotmarkcolor}% + \the\toks@}% + \fi \fi + \else + \let\dtl@mark=\relax \fi - \else - \let\dtl@mark=\relax - \fi % \end{macrocode} % Get the current plot line colour. % \begin{macrocode} - \ifx\dtl@plotlinecolorlist\@empty - \let\dtl@plotlinecolorlist=\DTLplotlinecolors - \fi - \dtl@chopfirst\dtl@plotlinecolorlist\dtl@thisplotlinecolor - \dtl@remainder - \let\dtl@plotlinecolorlist=\dtl@remainder + \ifx\dtl@plotlinecolorlist\@empty + \let\dtl@plotlinecolorlist=\DTLplotlinecolors + \fi + \dtl@chopfirst\dtl@plotlinecolorlist\dtl@thisplotlinecolor + \dtl@remainder + \let\dtl@plotlinecolorlist=\dtl@remainder % \end{macrocode} % Get the current line style, and store in \cs{dtl@linestyle} % \begin{macrocode} - \ifDTLshowlines - \ifx\dtl@plotlinelist\@empty - \let\dtl@plotlinelist=\DTLplotlines - \fi - \dtl@chopfirst\dtl@plotlinelist\dtl@thisplotline - \dtl@remainder - \let\dtl@plotlinelist=\dtl@remainder - \expandafter\ifx\dtl@thisplotline\relax + \ifDTLshowlines + \ifx\dtl@plotlinelist\@empty + \let\dtl@plotlinelist=\DTLplotlines + \fi + \dtl@chopfirst\dtl@plotlinelist\dtl@thisplotline + \dtl@remainder + \let\dtl@plotlinelist=\dtl@remainder + \expandafter\ifx\dtl@thisplotline\relax \let\dtl@linestyle=\relax \else \expandafter\toks@\expandafter{\dtl@thisplotline}% @@ -24326,11 +24553,21 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \DTLisclosedbetween{\dtl@x}{\DTLminX}{\DTLmaxX}% \and \DTLisclosedbetween{\dtl@y}{\DTLminY}{\DTLmaxY}% - }{% - \expandafter\toks@\expandafter{\dtl@stream}% - \edef\dtl@stream{\the\toks@ - \noexpand\pgfplotstreampoint - {\noexpand\pgfpointxy{\dtl@decx}{\dtl@decy}}}% + }% + {% + \expandafter\toks@\expandafter{\dtl@stream}% +% \end{macrocode} +% Apply transformation to co-ordinates +% \begin{macrocode} + \dtlmul{\dtl@decx}{\dtl@decx}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlround{\dtl@decx}{\dtl@decx}{1}% + \dtlmul{\dtl@decy}{\dtl@decy}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \dtlround{\dtl@decy}{\dtl@decy}{1}% + \edef\dtl@stream{\the\toks@ + \noexpand\pgfplotstreampoint + {\noexpand\pgfpointxy{\dtl@decx}{\dtl@decy}}}% }{}% }% \expandafter\toks@\expandafter{\dtl@stream}% @@ -24355,150 +24592,202 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \pgfusepath{stroke} \end{scope} \fi - }% + }% % \end{macrocode} % Plot legend if required. % \begin{macrocode} - \ifcase\dtl@legendsetting + \ifcase\dtl@legendsetting % none - \or % north - \pgftext[top,center,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLmaxY}} - {\pgfpoint{0.5\DTLplotwidth}{-\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % north east - \pgftext[top,right,at={\pgfpointadd - {\pgfpointxy{\DTLmaxX}{\DTLmaxY}} - {\pgfpoint{-\DTLlegendxoffset}{-\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % east - \pgftext[center,right,at={\pgfpointadd - {\pgfpointxy{\DTLmaxX}{\DTLminY}} - {\pgfpoint{-\DTLlegendxoffset}{0.5\DTLplotheight}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % south east - \pgftext[bottom,right,at={\pgfpointadd - {\pgfpointxy{\DTLmaxX}{\DTLminY}} - {\pgfpoint{-\DTLlegendxoffset}{\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % south - \pgftext[center,bottom,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}} - {\pgfpoint{0.5\DTLplotwidth}{\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % south west - \pgftext[bottom,left,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}} - {\pgfpoint{\DTLlegendxoffset}{\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % west - \pgftext[center,left,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}} - {\pgfpoint{\DTLlegendxoffset}{0.5\DTLplotheight}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % north west - \pgftext[top,left,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLmaxY}} - {\pgfpoint{\DTLlegendxoffset}{-\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \fi - \DTLplotatendtikz - \end{tikzpicture} + \or % north + \dtlmul{\dtl@decx}{\dtl@dx}{0.5}% + \dtladd{\dtl@decx}{\DTLminX}{\dtl@decx}% + \dtlmul{\dtl@decx}{\dtl@decx}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLmaxY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(0,-\DTLlegendyoffset) + node[anchor=north] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % north east + \dtlmul{\dtl@decx}{\DTLmaxX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLmaxY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(-\DTLlegendxoffset,-\DTLlegendyoffset) + node[anchor=north east] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % east + \dtlmul{\dtl@decy}{\dtl@dy}{0.5}% + \dtladd{\dtl@decy}{\DTLminY}{\dtl@decy}% + \dtlmul{\dtl@decy}{\dtl@decy}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \dtlmul{\dtl@decx}{\DTLmaxX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \draw (\dtl@decx,\dtl@decy) ++(-\DTLlegendxoffset,0) + node[anchor=east] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % south east + \dtlmul{\dtl@decx}{\DTLmaxX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLminY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(-\DTLlegendxoffset,\DTLlegendyoffset) + node[anchor=south east] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % south + \dtlmul{\dtl@decx}{\dtl@dx}{0.5}% + \dtladd{\dtl@decx}{\DTLminX}{\dtl@decx}% + \dtlmul{\dtl@decx}{\dtl@decx}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLminY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(0,\DTLlegendyoffset) + node[anchor=south] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % south west + \dtlmul{\dtl@decx}{\DTLminX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLminY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(\DTLlegendxoffset,\DTLlegendyoffset) + node[anchor=south west] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % west + \dtlmul{\dtl@decy}{\dtl@dy}{0.5}% + \dtladd{\dtl@decy}{\DTLminY}{\dtl@decy}% + \dtlmul{\dtl@decy}{\dtl@decy}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \dtlmul{\dtl@decx}{\DTLminX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \draw (\dtl@decx,\dtl@decy) ++(\DTLlegendxoffset,0) + node[anchor=west] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % north west + \dtlmul{\dtl@decx}{\DTLminX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLmaxY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(\DTLlegendxoffset,-\DTLlegendyoffset) + node[anchor=north west] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \fi +% \end{macrocode} +% Set the transformation matrix, so user can plot things using the +% data co-ordinate space +% \begin{macrocode} + \pgftransformcm{\dtl@scale@x}{0}{0}{\dtl@scale@y}% + {\pgfpoint{\dtl@offset@x pt}{\dtl@offset@y pt}}% +% \end{macrocode} +% End hook +% \begin{macrocode} + \DTLplotatendtikz + \end{tikzpicture} \fi \fi -\fi -}} +\egroup +} % \end{macrocode} %\end{macro} % %\begin{macro}{\dtl@getbounds} % Extract bounds: +%\changes{2.14}{2013-06-28}{changed \cs{FPifgt} to \cs{dtlifnumgt}} % \begin{macrocode} \def\dtl@getbounds#1,#2,#3,#4\@nil{% \def\DTLminX{#1}% \def\DTLminY{#2}% \def\DTLmaxX{#3}% \def\DTLmaxY{#4}% -\FPifgt{\DTLminX}{\DTLmaxX} +\dtlifnumgt{\DTLminX}{\DTLmaxX} +{% \PackageError{dataplot}{Min X > Max X in bounds #1,#2,#3,#4}{% The bounds must be specified as minX,minY,maxX,maxY}% -\fi -\FPifgt{\DTLminY}{\DTLmaxY} +}{}% +\dtlifnumgt{\DTLminY}{\DTLmaxY} +{% \PackageError{dataplot}{Min Y > Max Y in bounds #1,#2,#3,#4}{% The bounds must be specified as minX,minY,maxX,maxY}% -\fi +}{}% } % \end{macrocode} %\end{macro} % %\begin{macro}{\dtl@constructticklist} %\begin{definition} -%\cs{dtl@constructticklist}\marg{min}\marg{max}\marg{scale factor}\marg{list} +%\cs{dtl@constructticklist}\marg{min}\marg{max}\marg{min gap}\marg{list} %\end{definition} % Constructs a list of tick points between \meta{min} and \meta{max} % and store in \meta{list} (a control sequence.) +%\changes{2.14}{2013-06-28}{replaced \cs{FPsub} with \cs{dtlsub} etc} % \begin{macrocode} \newcommand*{\dtl@constructticklist}[4]{% -\DTLifFPopenbetween{0}{#1}{#2}{% - \FPsub{\@dtl@width}{0}{#1}% - \FPmul{\@dtl@width}{\@dtl@width}{#3}% - \FPdiv{\@dtl@neggap}{\@dtl@width}{10}% - \setlength\dtl@tmplength{\@dtl@neggap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@neggap}{\@dtl@width}{4}% - \setlength\dtl@tmplength{\@dtl@neggap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@neggap}{\@dtl@width}{2}% - \setlength\dtl@tmplength{\@dtl@neggap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \let\@dtl@neggap=\@dtl@width - \fi - \fi - \fi - \FPmul{\@dtl@width}{#2}{#3}% - \FPdiv{\@dtl@posgap}{\@dtl@width}{10}% - \setlength\dtl@tmplength{\@dtl@posgap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@posgap}{\@dtl@width}{4}% - \setlength\dtl@tmplength{\@dtl@posgap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@posgap}{\@dtl@width}{2}% - \setlength\dtl@tmplength{\@dtl@posgap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \let\@dtl@posgap=\@dtl@width - \fi - \fi - \fi - \FPmax{\@dtl@gap}{\@dtl@neggap}{\@dtl@posgap}% - \FPdiv{\@dtl@gap}{\@dtl@gap}{#3}% - \dtl@constructticklistwithgapz{#1}{#2}{#4}{\@dtl@gap}% -}{% - \FPsub{\@dtl@width}{#2}{#1}% - \FPmul{\@dtl@width}{\@dtl@width}{#3}% - \FPdiv{\@dtl@gap}{\@dtl@width}{10}% - \setlength\dtl@tmplength{\@dtl@gap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{4}% - \setlength\dtl@tmplength{\@dtl@gap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{2}% - \setlength\dtl@tmplength{\@dtl@gap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \let\@dtl@gap=\@dtl@width - \fi - \fi - \fi - \FPdiv{\@dtl@gap}{\@dtl@gap}{#3}% - \dtl@constructticklistwithgap{#1}{#2}{#4}{\@dtl@gap}% -}% + \DTLifFPopenbetween{0}{#1}{#2}% + {% +% \end{macrocode} +% Tick list straddles the origin. +% \begin{macrocode} + \dtlsub{\@dtl@width}{0}{#1}% + \dtldiv{\@dtl@neggap}{\@dtl@width}{10}% + \dtlifnumlt{\@dtl@neggap}{#3}% + {% + \edef\@dtl@neggap{#3}% + }% + {}% + \dtldiv{\@dtl@posgap}{#2}{10}% + \dtlifnumlt{\@dtl@posgap}{#3}% + {% + \edef\@dtl@posgap{#3}% + }% + {}% + \dtlmax{\@dtl@gap}{\@dtl@neggap}{\@dtl@posgap}% +% \end{macrocode} +% Don't construct a list if minimum gap is greater than plot width +% \begin{macrocode} + \dtlifnumgt{\@dtl@gap}{\@dtl@width}% + {}% + {% + \dtl@constructticklistwithgapz{#1}{#2}{#4}{\@dtl@gap}% + }% + }% + {% +% \end{macrocode} +% Tick list doesn't straddle the origin. +% \begin{macrocode} + \dtlsub{\@dtl@width}{#2}{#1}% + \dtldiv{\@dtl@gap}{\@dtl@width}{10}% + \dtlifnumlt{\@dtl@gap}{#3}% + {% +% \end{macrocode} +% Don't construct a list if minimum gap is greater than plot width +% \begin{macrocode} + \dtlifnumgt{#3}{\@dtl@width}% + {% + \def#4{#1,#2}% + }% + {% + \dtl@constructticklistwithgap{#1}{#2}{#4}{#3}% + } + }% + {% + \dtl@constructticklistwithgap{#1}{#2}{#4}{\@dtl@gap}% + }% + }% } % \end{macrocode} %\end{macro} @@ -24510,15 +24799,16 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Constructs a list of tick points between \meta{min} and \meta{max} % and store in \meta{list} (a control sequence) using the gap given % by \meta{gap} where the gap is given in user co-ordinates. +%\changes{2.14}{2013-06-28}{replaced \cs{FPadd} with \cs{dtladd}} % \begin{macrocode} \newcommand*{\dtl@constructticklistwithgap}[4]{% \edef\@dtl@thistick{#1}% \edef#3{#1}% -\FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% +\dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{#2}}{% \expandafter\toks@\expandafter{\@dtl@thistick}% \edef#3{#3,\the\toks@}% - \FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% }% \expandafter\toks@\expandafter{#2}% \edef#3{#3,\the\toks@}% @@ -24533,30 +24823,34 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Constructs a list of tick points between \meta{min} and \meta{max} % and store in \meta{list} (a control sequence) using the gap given % by \meta{gap} where the tick list straddles zero. +%\changes{2.14}{2013-06-28}{replaced \cs{FPadd} with \cs{dtladd} etc} % \begin{macrocode} \newcommand*{\dtl@constructticklistwithgapz}[4]{% -\edef\@dtl@thistick{0}% -\edef#3{0}% -\FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% -\whiledo{\DTLisFPopenbetween{\@dtl@thistick}{0}{#2}}{% - \expandafter\toks@\expandafter{\@dtl@thistick}% - \edef#3{#3,\the\toks@}% - \FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% -}% -\expandafter\toks@\expandafter{#2}% -\edef#3{#3,\the\toks@}% -\FPifeq{#1}{0}% -\else -\edef\@dtl@thistick{0}% - \FPsub{\@dtl@thistick}{\@dtl@thistick}{#4}% - \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{0}}{% + \edef\@dtl@thistick{0}% + \edef#3{0}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% + \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{0}{#2}}% + {% \expandafter\toks@\expandafter{\@dtl@thistick}% + \edef#3{#3,\the\toks@}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% + }% + \expandafter\toks@\expandafter{#2}% + \edef#3{#3,\the\toks@}% + \dtlifnumeq{#1}{0}% + {}% + {% + \edef\@dtl@thistick{0}% + \dtlsub{\@dtl@thistick}{\@dtl@thistick}{#4}% + \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{0}}% + {% + \expandafter\toks@\expandafter{\@dtl@thistick}% + \edef#3{\the\toks@,#3}% + \dtlsub{\@dtl@thistick}{\@dtl@thistick}{#4}% + }% + \expandafter\toks@\expandafter{#1}% \edef#3{\the\toks@,#3}% - \FPsub{\@dtl@thistick}{\@dtl@thistick}{#4}% }% - \expandafter\toks@\expandafter{#1}% - \edef#3{\the\toks@,#3}% -\fi } % \end{macrocode} %\end{macro} @@ -24567,24 +24861,25 @@ east,southeast,south,southwest,west,northwest}[northeast]{% %\end{definition} % Constructs a list of minor tick points between \meta{min} and \meta{max} % and append to \meta{list} (a control sequence.) +%\changes{2.14}{2013-06-28}{replaced \cs{FPsub} with \cs{dtlsub} etc} % \begin{macrocode} \newcommand*{\dtl@constructminorticklist}[4]{% - \FPsub{\@dtl@width}{#2}{#1}% - \FPmul{\@dtl@width}{\@dtl@width}{#3}% - \FPdiv{\@dtl@gap}{\@dtl@width}{10}% + \dtlsub{\@dtl@width}{#2}{#1}% + \dtlmul{\@dtl@width}{\@dtl@width}{#3}% + \dtldiv{\@dtl@gap}{\@dtl@width}{10}% \setlength\dtl@tmplength{\@dtl@gap sp}% \ifdim\dtl@tmplength<\DTLminminortickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{4}% + \dtldiv{\@dtl@gap}{\@dtl@width}{4}% \setlength\dtl@tmplength{\@dtl@gap sp}% \ifdim\dtl@tmplength<\DTLminminortickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{2}% + \dtldiv{\@dtl@gap}{\@dtl@width}{2}% \setlength\dtl@tmplength{\@dtl@gap sp}% \ifdim\dtl@tmplength<\DTLminminortickgap \let\@dtl@gap=\@dtl@width \fi \fi \fi - \FPdiv{\@dtl@gap}{\@dtl@gap}{#3}% + \dtldiv{\@dtl@gap}{\@dtl@gap}{#3}% \dtl@constructticklistwithgapex{#1}{#2}{\dtl@tmp}{\@dtl@gap}% \ifx#4\@empty \let#4=\dtl@tmp @@ -24604,11 +24899,13 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % and store in \meta{list} (a control sequence) using the gap given % by \meta{gap} where the gap is given in user co-ordinates. % The end points are excluded from the list. +%\changes{2.14}{2013-06-28}{replaced \cs{FPadd} with \cs{dtladd} and +%changed third argument to minimum gap width (in data co-ordinates)} % \begin{macrocode} \newcommand*{\dtl@constructticklistwithgapex}[4]{% \edef\@dtl@thistick{#1}% \let#3=\@empty -\FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% +\dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{#2}}{% \expandafter\toks@\expandafter{\@dtl@thistick}% \ifx#3\@empty @@ -24616,7 +24913,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \else \edef#3{#3,\the\toks@}% \fi - \FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% }% } % \end{macrocode} @@ -24670,7 +24967,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Package identification: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{person}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{person}[2013/06/28 v2.14 (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 bb4789b5e04..fc054a86ee0 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 2013/1/15 15:04 +% datatool.ins generated using makedtx version 0.94b 2013/6/28 15:53 \input docstrip \preamble diff --git a/Master/texmf-dist/tex/latex/datatool/databar.sty b/Master/texmf-dist/tex/latex/datatool/databar.sty index e0ab21dfffc..2cfbae3f740 100644 --- a/Master/texmf-dist/tex/latex/datatool/databar.sty +++ b/Master/texmf-dist/tex/latex/datatool/databar.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databar}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{databar}[2013/06/28 v2.14 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{dataplot} \newif\ifDTLcolorbarchart @@ -263,8 +263,11 @@ \ifDTLbarytics \ifx\dtlbar@yticlist\relax \ifx\dtlbar@yticgap\relax + \@dtl@tmpcount=\DTLmintickgap + \divide\@dtl@tmpcount by 65536\relax + \dtldiv{\dtl@mingap}{\number\@dtl@tmpcount}{\dtl@unit}% \dtl@constructticklist\DTLnegextent\DTLbarmax - \dtl@unit\dtlbar@yticlist + \dtl@mingap\dtlbar@yticlist \else \dtl@constructticklistwithgapz \DTLnegextent\DTLbarmax\dtlbar@yticlist\dtlbar@yticgap @@ -293,23 +296,6 @@ \fi }% \else - \@for\dtl@thislabel:=\dtlbar@yticlabels\do{% - \ifDTLverticalbars - \settowidth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \else - \settoheight{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \edef\@dtl@h{\the\dtl@tmplength}% - \settodepth{\dtl@tmplength}{% - \DTLbardisplayYticklabel{\dtl@thislabel}}% - \addtolength{\dtl@tmplength}{\@dtl@h}% - \addtolength{\dtl@tmplength}{\baselineskip}% - \fi - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% - \fi - }% \fi \fi \fi @@ -547,8 +533,11 @@ \ifDTLbarytics \ifx\dtlbar@yticlist\relax \ifx\dtlbar@yticgap\relax + \@dtl@tmpcount=\DTLmintickgap + \divide\@dtl@tmpcount by 65536\relax + \dtldiv{\dtl@mingap}{\number\@dtl@tmpcount}{\dtl@unit}% \dtl@constructticklist\DTLnegextent\DTLbarmax - \dtl@unit\dtlbar@yticlist + \dtl@mingap\dtlbar@yticlist \else \dtl@constructticklistwithgapz \DTLnegextent\DTLbarmax\dtlbar@yticlist\dtlbar@yticgap diff --git a/Master/texmf-dist/tex/latex/datatool/databib.sty b/Master/texmf-dist/tex/latex/datatool/databib.sty index 3ebe84cea78..2e67913e4b5 100644 --- a/Master/texmf-dist/tex/latex/datatool/databib.sty +++ b/Master/texmf-dist/tex/latex/datatool/databib.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databib}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{databib}[2013/06/28 v2.14 (NLCT)] \RequirePackage{datatool} \newcommand*{\dtlbib@style}{plain} \define@choicekey{databib.sty}{style}{plain,abbrv,alpha}{% diff --git a/Master/texmf-dist/tex/latex/datatool/datagidx.sty b/Master/texmf-dist/tex/latex/datatool/datagidx.sty index 63b778f0cff..b9cd631badb 100644 --- a/Master/texmf-dist/tex/latex/datatool/datagidx.sty +++ b/Master/texmf-dist/tex/latex/datatool/datagidx.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datagidx}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datagidx}[2013/06/28 v2.14 (NLCT)] \RequirePackage{datatool} \RequirePackage{etoolbox} \RequirePackage{xkeyval} @@ -1515,7 +1515,6 @@ \if@tempswa \DTLgidxSymbolDescription \DTLgidxDoSeeOrLocation - \DTLgidxSeeAlso \else \mbox{}% \fi @@ -2317,7 +2316,19 @@ }% }% \global\let\datagidxlastlabel\newterm@label + \postnewtermhook }% +\newcommand*{\postnewtermhook}{} +\newcommand*{\newtermfield}[1]{\csuse{newterm@#1}} +\newcommand{\ifnewtermfield}[3]{% + \ifcsdef{newterm@#1} + {% + \ifcsempty{newterm@#1}{#3}{#2}% + }% + {% + #3% + }% +} \newcommand{\datagidx@newterm}[2][]{% \datagidx@setfieldvalues{#1}{#2}% \DTLifdbexists{\newterm@database}% @@ -2410,6 +2421,9 @@ \newcommand{\iftermexists}[3]{% \ifcsdef{datagidxentry@#1}{#2}{#3}% } +\newcommand*{\datagidxdb}[1]{% + \csuse{datagidxentry@#1}% +} \newcommand*{\ifentryused}[3]{% \letcs{\newterm@database}{datagidxentry@#1}% \edef\dtl@dogetrow{% @@ -2950,6 +2964,8 @@ \appto\newterm@styles{balance=false,}% \fi } +\newcommand*{\printterms@condition}{\boolean{true}} +\define@key{printterms}{condition}{\renewcommand*{\printterms@condition}{#1}} \newcommand{\printterms}[1][]{% \bgroup \let\newterm@database\datagidx@defaultdatabase @@ -3063,7 +3079,7 @@ \newcommand{\DTLgidxForeachEntry}[1]{% \def\datagidxprevgroup{}% \edef\datagidx@doforeachentry{% - \noexpand\DTLforeach*{\DTLgidxCurrentdb}% + \noexpand\DTLforeach*[\expandonce\printterms@condition]{\DTLgidxCurrentdb}% {\expandonce\DTLgidxAssignList} }% \datagidx@doforeachentry diff --git a/Master/texmf-dist/tex/latex/datatool/datapie.sty b/Master/texmf-dist/tex/latex/datatool/datapie.sty index b585b5456c3..c48d051638e 100644 --- a/Master/texmf-dist/tex/latex/datatool/datapie.sty +++ b/Master/texmf-dist/tex/latex/datatool/datapie.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datapie}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datapie}[2013/06/28 v2.14 (NLCT)] \RequirePackage{xkeyval} \newif\ifDTLcolorpiechart \DTLcolorpiecharttrue @@ -153,132 +153,150 @@ \define@key{datapie}{outerlabel}{% \def\dtl@outerlabel{#1}} \newcommand*{\DTLpiechart}[4][\boolean{true}]{% -{\let\DTLpievariable=\relax -\setkeys{datapie}{#2}% -\ifx\DTLpievariable\relax - \PackageError{datapie}{\string\DTLpiechart\space missing variable}{}% -\else -\def\dtl@total{0}% -\@sDTLforeach[#1]{#3}{#4}{% -\let\dtl@oldtotal=\dtl@total -\expandafter\DTLconverttodecimal\expandafter - {\DTLpievariable}{\dtl@variable}% -\FPadd{\dtl@total}{\dtl@variable}{\dtl@total}% -}% -\expandafter\DTLconverttodecimal\expandafter - {\DTLstartangle}{\@dtl@start}% -\@sDTLforeach[#1]{#3}{#4}{% -\expandafter\DTLconverttodecimal\expandafter - {\DTLpievariable}{\dtl@variable}% -\dtl@computeangles{% -\csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname}{% -\dtl@variable}% -\expandafter\@dtl@seg\expandafter= -\csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% -\FPmul{\dtl@tmp}{\dtl@variable}{100}% -\let\dtl@old=\dtl@tmp -\FPdiv{\dtl@tmp}{\dtl@old}{\dtl@total}% -\expandafter\FPround -\csname dtl@piepercent@\romannumeral\@dtl@seg\endcsname\dtl@tmp -\c@DTLpieroundvar -}% -\@for\dtl@row:=\dtl@piecutaways\do{% -\expandafter\@dtl@set@off\dtl@row-\relax -}% -\let\dtl@start=\DTLstartangle -\begin{tikzpicture} -\DTLpieatbegintikz -\@sDTLforeach[#1]{#3}{#4}{% -\expandafter\@dtl@seg\expandafter= -\csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% -\edef\dtl@start{\csname dtl@sang@\romannumeral\@dtl@seg\endcsname}% -\edef\dtl@extent{\csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% -\FPadd{\dtl@endangle}{\dtl@start}{\dtl@extent}% -\edef\dtl@angle{\csname dtl@cut@angle@\romannumeral\@dtl@seg\endcsname}% -\let\dtl@old=\dtl@angle -\dtl@truncatedecimal\dtl@angle -\ifnum\dtl@angle>180 - \FPsub{\dtl@angle}{\dtl@old}{360}% - \dtl@truncatedecimal\dtl@angle -\fi -\edef\dtl@cutlen{% -\csname dtl@cut@len@\romannumeral\@dtl@seg\endcsname} -\edef\@dtl@shift{(\dtl@angle:\dtl@cutlen)}% -\FPmul{\dtl@angle}{\dtl@extent}{0.5}% -\FPadd{\dtl@midangle}{\dtl@angle}{\dtl@start}% -\begin{scope}[shift={\@dtl@shift}]% -\dtl@truncatedecimal\dtl@start -\dtl@truncatedecimal\dtl@endangle -\fill[color=\DTLgetpiesegmentcolor\@dtl@seg] (0,0) -- -(\dtl@start:\DTLradius) -arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; -\ifdim\DTLpieoutlinewidth>0pt\relax -\draw[color=\DTLpieoutlinecolor,line width=\DTLpieoutlinewidth] -(0,0) -- (\dtl@start:\DTLradius) -arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; -\fi -\dtl@truncatedecimal\dtl@midangle -\ifDTLrotateinner -\ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) -\TE@or \dtl@midangle < -90}{% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% - \dtl@truncatedecimal\dtl@labelangle - \edef\dtl@innernodeopt{anchor=east,rotate=\dtl@labelangle}% -}{% - \edef\dtl@innernodeopt{anchor=west,rotate=\dtl@midangle}% -}% -\else - \edef\dtl@innernodeopt{anchor=center}% -\fi -\ifDTLrotateouter -\ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) -\TE@or \dtl@midangle < -90}{% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% - \dtl@truncatedecimal\dtl@labelangle - \edef\dtl@outernodeopt{anchor=east,rotate=\dtl@labelangle}% -}{% - \edef\dtl@outernodeopt{anchor=west,rotate=\dtl@midangle}% -}% -\else - \ifthenelse{\(\dtl@midangle<45\and\dtl@midangle>-45\) - \TE@or \dtl@midangle=45 - \TE@or \dtl@midangle>315}{% - % east quadrant - \edef\dtl@outernodeopt{anchor=west}% - }{% - \ifthenelse{\(\dtl@midangle<135\and\dtl@midangle>45\) - \TE@or \dtl@midangle=135}{% - % north quadrant - \edef\dtl@outernodeopt{anchor=south}% - }{% - \ifthenelse{\(\dtl@midangle<225\and\dtl@midangle>135\) - \TE@or \dtl@midangle=225 - \TE@or \dtl@midangle=-135 - \TE@or \dtl@midangle<-135}{% - % west quadrant - \edef\dtl@outernodeopt{anchor=east}% - }{% - \edef\dtl@outernodeopt{anchor=north}% - }% - } - } -\fi -\edef\@dtl@dolabel{% -\noexpand\draw (\dtl@midangle:\the\dtl@inneroffset) -node[\dtl@innernodeopt]{% -\noexpand\DTLdisplayinnerlabel{\noexpand\dtl@innerlabel}};}% -\@dtl@dolabel -\edef\@dtl@dolabel{% -\noexpand\draw (\dtl@midangle:\the\dtl@outeroffset) -node[\dtl@outernodeopt]{% -\noexpand\DTLdisplayouterlabel{\noexpand\dtl@outerlabel}};}% -\@dtl@dolabel -\end{scope} -}% -\DTLpieatendtikz -\end{tikzpicture} -\fi -}} +\bgroup + \let\DTLpievariable=\relax + \setkeys{datapie}{#2}% + \ifx\DTLpievariable\relax + \PackageError{datapie}% + {\string\DTLpiechart\space missing variable}{}% + \else + \def\dtl@total{0}% + \@sDTLforeach[#1]{#3}{#4}{% + \let\dtl@oldtotal=\dtl@total + \expandafter\DTLconverttodecimal\expandafter + {\DTLpievariable}{\dtl@variable}% + \FPadd{\dtl@total}{\dtl@variable}{\dtl@total}% + }% + \expandafter\DTLconverttodecimal\expandafter + {\DTLstartangle}{\@dtl@start}% + \@sDTLforeach[#1]{#3}{#4}{% + \expandafter\DTLconverttodecimal\expandafter + {\DTLpievariable}{\dtl@variable}% + \dtl@computeangles{% + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname}{% + \dtl@variable}% + \expandafter\@dtl@seg\expandafter= + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% + \FPmul{\dtl@tmp}{\dtl@variable}{100}% + \let\dtl@old=\dtl@tmp + \FPdiv{\dtl@tmp}{\dtl@old}{\dtl@total}% + \expandafter\FPround + \csname dtl@piepercent@\romannumeral\@dtl@seg\endcsname\dtl@tmp + \c@DTLpieroundvar + }% + \@for\dtl@row:=\dtl@piecutaways\do{% + \expandafter\@dtl@set@off\dtl@row-\relax + }% + \let\dtl@start=\DTLstartangle + \begin{tikzpicture} + \DTLpieatbegintikz + \@sDTLforeach[#1]{#3}{#4}% + {% + \expandafter\@dtl@seg\expandafter= + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% + \edef\dtl@start{% + \csname dtl@sang@\romannumeral\@dtl@seg\endcsname}% + \edef\dtl@extent{% + \csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% + \FPadd{\dtl@endangle}{\dtl@start}{\dtl@extent}% + \edef\dtl@angle{% + \csname dtl@cut@angle@\romannumeral\@dtl@seg\endcsname}% + \let\dtl@old=\dtl@angle + \dtl@truncatedecimal\dtl@angle + \ifnum\dtl@angle>180\relax + \FPsub{\dtl@angle}{\dtl@old}{360}% + \dtl@truncatedecimal\dtl@angle + \fi + \edef\dtl@cutlen{% + \csname dtl@cut@len@\romannumeral\@dtl@seg\endcsname + }% + \edef\@dtl@shift{(\dtl@angle:\dtl@cutlen)}% + \FPmul{\dtl@angle}{\dtl@extent}{0.5}% + \FPadd{\dtl@midangle}{\dtl@angle}{\dtl@start}% + \begin{scope}[shift={\@dtl@shift}]% + \dtl@truncatedecimal\dtl@start + \dtl@truncatedecimal\dtl@endangle + \fill[color=\DTLgetpiesegmentcolor\@dtl@seg] (0,0) -- + (\dtl@start:\DTLradius) + arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; + \ifdim\DTLpieoutlinewidth>0pt\relax + \draw[color=\DTLpieoutlinecolor,% + line width=\DTLpieoutlinewidth] + (0,0) -- (\dtl@start:\DTLradius) + arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; + \fi + \dtl@truncatedecimal\dtl@midangle + \ifDTLrotateinner + \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) + \TE@or \dtl@midangle < -90}% + {% + \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtl@truncatedecimal\dtl@labelangle + \edef\dtl@innernodeopt{anchor=east,rotate=\dtl@labelangle}% + }% + {% + \edef\dtl@innernodeopt{anchor=west,rotate=\dtl@midangle}% + }% + \else + \edef\dtl@innernodeopt{anchor=center}% + \fi + \ifDTLrotateouter + \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) + \TE@or \dtl@midangle < -90}% + {% + \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtl@truncatedecimal\dtl@labelangle + \edef\dtl@outernodeopt{anchor=east,rotate=\dtl@labelangle}% + }% + {% + \edef\dtl@outernodeopt{anchor=west,rotate=\dtl@midangle}% + }% + \else + \ifthenelse{\(\dtl@midangle<45\and\dtl@midangle>-45\) + \TE@or \dtl@midangle=45 + \TE@or \dtl@midangle>315}% + {% + \edef\dtl@outernodeopt{anchor=west}% + }% + {% + \ifthenelse{\(\dtl@midangle<135\and\dtl@midangle>45\) + \TE@or \dtl@midangle=135}% + {% + \edef\dtl@outernodeopt{anchor=south}% + }% + {% + \ifthenelse{\(\dtl@midangle<225\and\dtl@midangle>135\) + \TE@or \dtl@midangle=225 + \TE@or \dtl@midangle=-135 + \TE@or \dtl@midangle<-135}% + {% + \edef\dtl@outernodeopt{anchor=east}% + }% + {% + \edef\dtl@outernodeopt{anchor=north}% + }% + }% + }% + \fi + \edef\@dtl@dolabel{% + \noexpand\draw (\dtl@midangle:\the\dtl@inneroffset) + node[\dtl@innernodeopt]{% + \noexpand\DTLdisplayinnerlabel{\noexpand\dtl@innerlabel}}; + }% + \@dtl@dolabel + \edef\@dtl@dolabel{% + \noexpand\draw (\dtl@midangle:\the\dtl@outeroffset) + node[\dtl@outernodeopt]{% + \noexpand\DTLdisplayouterlabel{\noexpand\dtl@outerlabel}}; + }% + \@dtl@dolabel + \end{scope}% + }% + \DTLpieatendtikz + \end{tikzpicture}% + \fi +\egroup +} \newcommand*{\dtl@computeangles}[2]{% \FPifgt{\@dtl@start}{180}% \let\dtl@old=\@dtl@start diff --git a/Master/texmf-dist/tex/latex/datatool/dataplot.sty b/Master/texmf-dist/tex/latex/datatool/dataplot.sty index 8da1b86d9d6..564cc58d12b 100644 --- a/Master/texmf-dist/tex/latex/datatool/dataplot.sty +++ b/Master/texmf-dist/tex/latex/datatool/dataplot.sty @@ -39,17 +39,20 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dataplot}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{dataplot}[2013/06/28 v2.14 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{tikz} \RequirePackage{datatool} \usetikzlibrary{plotmarks} \usetikzlibrary{plothandlers} +\usetikzlibrary{calc} \newcommand*{\DTLplotstream}[4][\boolean{true}]{% -\@sDTLforeach[#1]{#2}{\dtl@x=#3,\dtl@y=#4}{% -\DTLconverttodecimal{\dtl@x}{\dtl@decx}% -\DTLconverttodecimal{\dtl@y}{\dtl@decy}% -\pgfplotstreampoint{\pgfpointxy{\dtl@decx}{\dtl@decy}}}} + \@sDTLforeach[#1]{#2}{\dtl@x=#3,\dtl@y=#4}{% + \DTLconverttodecimal{\dtl@x}{\dtl@decx}% + \DTLconverttodecimal{\dtl@y}{\dtl@decy}% + \pgfplotstreampoint{\pgfpointxy{\dtl@decx}{\dtl@decy}}% + }% +} \newcommand*{\DTLplotmarks}{% \pgfuseplotmark{o},% \pgfuseplotmark{x},% @@ -269,366 +272,364 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \dtl@legendsetting=\nr\relax } \define@key{dataplot}{legendlabels}{\def\dtl@legendlabels{#1}} -\newcommand*{\DTLplot}[3][\boolean{true}]{{% -\let\dtl@xkey=\relax -\let\dtl@ykey=\relax -\let\dtl@legendlabels=\relax -\setkeys{dataplot}{#3}% -\let\dtl@plotmarklist=\DTLplotmarks -\let\dtl@plotlinelist=\DTLplotlines -\let\dtl@plotmarkcolorlist=\DTLplotmarkcolors -\let\dtl@plotlinecolorlist=\DTLplotlinecolors -\def\dtl@legend{}% -\ifx\dtl@legendlabels\relax - \edef\dtl@legendlabels{#2}% -\fi -\ifx\dtl@xkey\relax - \PackageError{dataplot}{Missing x setting for - \string\DTLplot}{}% -\else - \ifx\dtl@ykey\relax - \PackageError{dataplot}{Missing y setting for +\newcommand*{\DTLplot}[3][\boolean{true}]{% +\bgroup + \let\dtl@xkey=\relax + \let\dtl@ykey=\relax + \let\dtl@legendlabels=\relax + \setkeys{dataplot}{#3}% + \let\dtl@plotmarklist=\DTLplotmarks + \let\dtl@plotlinelist=\DTLplotlines + \let\dtl@plotmarkcolorlist=\DTLplotmarkcolors + \let\dtl@plotlinecolorlist=\DTLplotlinecolors + \def\dtl@legend{}% + \ifx\dtl@legendlabels\relax + \edef\dtl@legendlabels{#2}% + \fi + \ifx\dtl@xkey\relax + \PackageError{dataplot}{Missing x setting for \string\DTLplot}{}% \else - \ifx\dtl@bounds\relax - \DTLcomputebounds[#1]{#2}{\dtl@xkey}{\dtl@ykey} - {\DTLminX}{\DTLminY}{\DTLmaxX}{\DTLmaxY}% - \ifx\dtl@minx\relax - \else - \let\DTLminX=\dtl@minx - \fi - \ifx\dtl@maxx\relax - \else - \let\DTLmaxX=\dtl@maxx - \fi - \ifx\dtl@miny\relax - \else - \let\DTLminY=\dtl@miny - \fi - \ifx\dtl@maxy\relax + \ifx\dtl@ykey\relax + \PackageError{dataplot}{Missing y setting for + \string\DTLplot}{}% + \else + \ifx\dtl@bounds\relax + \DTLcomputebounds[#1]{#2}{\dtl@xkey}{\dtl@ykey} + {\DTLminX}{\DTLminY}{\DTLmaxX}{\DTLmaxY}% + \ifx\dtl@minx\relax + \else + \let\DTLminX=\dtl@minx + \fi + \ifx\dtl@maxx\relax + \else + \let\DTLmaxX=\dtl@maxx + \fi + \ifx\dtl@miny\relax + \else + \let\DTLminY=\dtl@miny + \fi + \ifx\dtl@maxy\relax + \else + \let\DTLmaxY=\dtl@maxy + \fi \else - \let\DTLmaxY=\dtl@maxy + \expandafter\dtl@getbounds\dtl@bounds\@nil \fi - \else - \expandafter\dtl@getbounds\dtl@bounds\@nil - \fi - \@dtl@tmpcount=\DTLplotwidth - \FPsub{\dtl@dx}{\DTLmaxX}{\DTLminX}% - \FPdiv{\dtl@unit@x}{\number\@dtl@tmpcount}{\dtl@dx}% - \@dtl@tmpcount=\DTLplotheight - \FPsub{\dtl@dy}{\DTLmaxY}{\DTLminY}% - \FPdiv{\dtl@unit@y}{\number\@dtl@tmpcount}{\dtl@dy}% - \ifDTLxtics - \ifx\dtl@xticlist\relax - \ifx\dtl@xticgap\relax - \dtl@constructticklist\DTLminX\DTLmaxX - \dtl@unit@x\dtl@xticlist - \else - \DTLifFPopenbetween{0}{\DTLminX}{\DTLmaxX}{% - \dtl@constructticklistwithgapz - \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}{% - \dtl@constructticklistwithgap - \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}% - \fi - \fi - \let\dtl@xminorticlist\@empty - \ifDTLxminortics - \let\dtl@prevtick=\relax - \@for\dtl@nexttick:=\dtl@xticlist\do{% - \ifx\dtl@prevtick\relax + \@dtl@tmpcount=\DTLplotwidth + \divide\@dtl@tmpcount by 65536\relax + \dtlsub{\dtl@dx}{\DTLmaxX}{\DTLminX}% + \dtldiv{\dtl@scale@x}{\number\@dtl@tmpcount}{\dtl@dx}% + \dtlmul{\dtl@offset@x}{-\dtl@scale@x}{\DTLminX}% + \@dtl@tmpcount=\DTLplotheight + \divide\@dtl@tmpcount by 65536\relax + \dtlsub{\dtl@dy}{\DTLmaxY}{\DTLminY}% + \dtldiv{\dtl@scale@y}{\number\@dtl@tmpcount}{\dtl@dy}% + \dtlmul{\dtl@offset@y}{-\dtl@scale@y}{\DTLminY}% + \ifDTLxtics + \ifx\dtl@xticlist\relax + \ifx\dtl@xticgap\relax + \dtlsub{\dtl@mingap}{\number\DTLmintickgap}{\dtl@offset@x}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{\dtl@scale@x}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{65536}% + \dtl@constructticklist\DTLminX\DTLmaxX + \dtl@mingap\dtl@xticlist \else - \dtl@constructminorticklist - \dtl@prevtick\dtl@nexttick\dtl@unit@x\dtl@xminorticlist + \DTLifFPopenbetween{0}{\DTLminX}{\DTLmaxX}{% + \dtl@constructticklistwithgapz + \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}{% + \dtl@constructticklistwithgap + \DTLminX\DTLmaxX\dtl@xticlist\dtl@xticgap}% \fi - \let\dtl@prevtick=\dtl@nexttick - }% - \fi - \ifx\dtl@xticlabels\relax - \settoheight{\dtl@xticlabelheight}{\dtl@xticlist}% - \else - \settoheight{\dtl@xticlabelheight}{\dtl@xticlabels}% - \fi - \else - \setlength{\dtl@xticlabelheight}{0pt}% - \fi - \setlength{\dtl@yticlabelwidth}{0pt}% - \ifDTLytics - \ifx\dtl@yticlist\relax - \ifx\dtl@yticgap\relax - \dtl@constructticklist\DTLminY\DTLmaxY - \dtl@unit@y\dtl@yticlist - \else - \DTLifFPopenbetween{0}{\DTLminY}{\DTLmaxY}{% - \dtl@constructticklistwithgapz - \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}{% - \dtl@constructticklistwithgap - \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}% \fi + \let\dtl@xminorticlist\@empty + \ifDTLxminortics + \let\dtl@prevtick=\relax + \@for\dtl@nexttick:=\dtl@xticlist\do{% + \ifx\dtl@prevtick\relax + \else + \dtl@constructminorticklist + \dtl@prevtick\dtl@nexttick\dtl@scale@x\dtl@xminorticlist + \fi + \let\dtl@prevtick=\dtl@nexttick + }% + \fi + \ifx\dtl@xticlabels\relax + \settoheight{\dtl@xticlabelheight}{\dtl@xticlist}% + \else + \settoheight{\dtl@xticlabelheight}{\dtl@xticlabels}% + \fi + \else + \setlength{\dtl@xticlabelheight}{0pt}% \fi - \let\dtl@yminorticlist\@empty - \ifDTLyminortics - \let\dtl@prevtick=\relax - \@for\dtl@nexttick:=\dtl@yticlist\do{% - \ifx\dtl@prevtick\relax + \setlength{\dtl@yticlabelwidth}{0pt}% + \ifDTLytics + \ifx\dtl@yticlist\relax + \ifx\dtl@yticgap\relax + \dtlsub{\dtl@mingap}{\number\DTLmintickgap}{\dtl@offset@y}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{\dtl@scale@y}% + \dtldiv{\dtl@mingap}{\dtl@mingap}{65536}% + \dtl@constructticklist\DTLminY\DTLmaxY + \dtl@mingap\dtl@yticlist \else - \dtl@constructminorticklist - \dtl@prevtick\dtl@nexttick\dtl@unit@y\dtl@yminorticlist + \DTLifFPopenbetween{0}{\DTLminY}{\DTLmaxY}{% + \dtl@constructticklistwithgapz + \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}{% + \dtl@constructticklistwithgap + \DTLminY\DTLmaxY\dtl@yticlist\dtl@yticgap}% \fi - \let\dtl@prevtick=\dtl@nexttick - }% - \fi - \ifx\dtl@ylabel\relax - \else - \ifx\dtl@yticlabels\relax - \@for\dtl@thislabel:=\dtl@yticlist\do{% - \FPround{\dtl@thislabel}{\dtl@thislabel} - {\c@DTLplotroundYvar}% - \settowidth{\dtl@tmplength}{\dtl@thislabel}% - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + \let\dtl@yminorticlist\@empty + \ifDTLyminortics + \let\dtl@prevtick=\relax + \@for\dtl@nexttick:=\dtl@yticlist\do{% + \ifx\dtl@prevtick\relax + \else + \dtl@constructminorticklist + \dtl@prevtick\dtl@nexttick\dtl@scale@y\dtl@yminorticlist \fi + \let\dtl@prevtick=\dtl@nexttick }% + \fi + \ifx\dtl@ylabel\relax \else - \@for\dtl@thislabel:=\dtl@yticlabels\do{% - \settowidth{\dtl@tmplength}{\dtl@thislabel}% - \ifdim\dtl@tmplength>\dtl@yticlabelwidth - \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% - \fi - }% + \ifx\dtl@yticlabels\relax + \@for\dtl@thislabel:=\dtl@yticlist\do{% + \dtlround{\dtl@thislabel}{\dtl@thislabel} + {\c@DTLplotroundYvar}% + \settowidth{\dtl@tmplength}{\dtl@thislabel}% + \ifdim\dtl@tmplength>\dtl@yticlabelwidth + \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + }% + \else + \@for\dtl@thislabel:=\dtl@yticlabels\do{% + \settowidth{\dtl@tmplength}{\dtl@thislabel}% + \ifdim\dtl@tmplength>\dtl@yticlabelwidth + \setlength{\dtl@yticlabelwidth}{\dtl@tmplength}% + \fi + }% + \fi \fi \fi - \begin{tikzpicture} - \pgfsetxvec{\pgfpoint{\dtl@unit@x sp}{0pt}}% - \pgfsetyvec{\pgfpoint{0pt}{\dtl@unit@y sp}}% - \DTLplotatbegintikz - \ifDTLbox - \draw (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY) -- + \begin{tikzpicture} + \pgfsetxvec{\pgfpoint{1pt}{0pt}}% + \pgfsetyvec{\pgfpoint{0pt}{1pt}}% + \begin{scope} + \pgftransformcm{\dtl@scale@x}{0}{0}{\dtl@scale@y}% + {\pgfpoint{\dtl@offset@x pt}{\dtl@offset@y pt}}% + \DTLplotatbegintikz + \ifDTLbox + \draw (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY) -- (\DTLmaxX,\DTLmaxY) -- (\DTLminX,\DTLmaxY) -- - cycle; - \else - \ifDTLxaxis - \expandafter\draw\expandafter[\DTLXAxisStyle] + cycle; + \else + \ifDTLxaxis + \expandafter\draw\expandafter[\DTLXAxisStyle] (\DTLminX,\DTLminY) -- (\DTLmaxX,\DTLminY); - \fi - \ifDTLyaxis - \expandafter\draw\expandafter[\DTLYAxisStyle] + \fi + \ifDTLyaxis + \expandafter\draw\expandafter[\DTLYAxisStyle] (\DTLminX,\DTLminY) -- (\DTLminX,\DTLmaxY); - \fi - \fi - \ifDTLgrid - \ifDTLxminortics - \@for\dtl@thistick:=\dtl@xminorticlist\do{% - \expandafter\draw\expandafter[\DTLminorgridstyle] + \fi + \fi + \ifDTLgrid + \ifDTLxminortics + \@for\dtl@thistick:=\dtl@xminorticlist\do{% + \expandafter\draw\expandafter[\DTLminorgridstyle] (\dtl@thistick,\DTLminY) -- (\dtl@thistick,\DTLmaxY); - }% - \fi - \ifDTLyminortics - \@for\dtl@thistick:=\dtl@yminorticlist\do{% - \expandafter\draw\expandafter[\DTLminorgridstyle] + }% + \fi + \ifDTLyminortics + \@for\dtl@thistick:=\dtl@yminorticlist\do{% + \expandafter\draw\expandafter[\DTLminorgridstyle] (\DTLminX,\dtl@thistick) -- (\DTLmaxX,\dtl@thistick); - }% - \fi - \@for\dtl@thistick:=\dtl@xticlist\do{% - \expandafter\draw\expandafter[\DTLmajorgridstyle] + }% + \fi + \@for\dtl@thistick:=\dtl@xticlist\do{% + \expandafter\draw\expandafter[\DTLmajorgridstyle] (\dtl@thistick,\DTLminY) -- (\dtl@thistick,\DTLmaxY); - }% - \@for\dtl@thistick:=\dtl@yticlist\do{% - \expandafter\draw\expandafter[\DTLmajorgridstyle] + }% + \@for\dtl@thistick:=\dtl@yticlist\do{% + \expandafter\draw\expandafter[\DTLmajorgridstyle] (\DTLminX,\dtl@thistick) -- (\DTLmaxX,\dtl@thistick); - }% - \fi - \ifDTLxtics - \addtolength\dtl@xticlabelheight{\DTLticklabeloffset}% - \@for\dtl@thistick:=\dtl@xticlist\do{% - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLminY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{\DTLticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{-\DTLticklength}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{-\DTLticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{\DTLticklength}}} - \fi - \fi - \pgfusepath{stroke}% - \ifx\dtl@xticlabels\relax - \FPround{\dtl@thislabel}{\dtl@thistick} + }% + \fi + \ifDTLxtics + \dtlsub{\dtl@ticklength}{\number\DTLticklength}{-\dtl@offset@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% + \addtolength\dtl@xticlabelheight{\DTLticklabeloffset}% + \dtlsub{\dtl@ticlabeloffset}{\number\dtl@xticlabelheight}{-\dtl@offset@y}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@scale@y}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{65536}% + \@for\dtl@thistick:=\dtl@xticlist\do{% + \let\dtl@thisticklabel\dtl@thistick + \ifx\dtl@xticlabels\relax + \dtlround{\dtl@thislabel}{\dtl@thistick} {\c@DTLplotroundXvar}% - \else + \else \dtl@chopfirst\dtl@xticlabels\dtl@thislabel\dtl@rest \let\dtl@xticlabels=\dtl@rest - \fi - \pgftext[base,center,at={\pgfpointadd - {\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{-\dtl@xticlabelheight}}}] - {\dtl@thislabel} - }% + \fi + \ifDTLxticsin + \draw (\dtl@thistick,\DTLminY) -- ++(0,\dtl@ticklength); + \draw (\dtl@thistick,\DTLminY) + ++ (0,-\dtl@ticlabeloffset) node {\dtl@thislabel}; + \else + \draw (\dtl@thistick,\DTLminY) -- ++(0,-\dtl@ticklength) + ++ (0,-\dtl@ticlabeloffset) node {\dtl@thislabel}; + \fi + \ifDTLbox + \ifDTLxticsin + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,-\dtl@ticklength); + \else + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,\dtl@ticklength); + \fi + \fi + }% + \fi + \ifx\dtl@xlabel\relax + \else + \dtladd{\dtl@x}{\number\baselineskip}{\dtl@offset@y}% + \dtldiv{\dtl@x}{\dtl@x}{\dtl@scale@y}% + \dtldiv{\dtl@x}{\dtl@x}{65536}% + \dtladd{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@x}% + \dtlmul{\dtl@x}{\dtl@dx}{0.5}% + \draw (\DTLminX,\DTLminY) ++(\dtl@x,-\dtl@ticlabeloffset) + node[anchor=north] {\dtl@xlabel}; \fi - \ifx\dtl@xlabel\relax - \else - \addtolength{\dtl@xticlabelheight}{\baselineskip}% - \setlength{\dtl@tmplength}{0.5\DTLplotwidth} - \pgftext[base,center,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}}% - {\pgfpoint{\dtl@tmplength}{-\dtl@xticlabelheight}}}]{% - \dtl@xlabel} - \fi - \ifDTLxminortics - \@for\dtl@thistick:=\dtl@xminorticlist\do{% - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLminY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{\DTLminorticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLminY}} - {\pgfpoint{0pt}{-\DTLminorticklength}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - \ifDTLxticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{-\DTLminorticklength}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\dtl@thistick}{\DTLmaxY}} - {\pgfpoint{0pt}{\DTLminorticklength}}} - \fi - \fi + \ifDTLxminortics + \dtlsub{\dtl@ticklength}{\number\DTLminorticklength}{-\dtl@offset@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@y}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% + \@for\dtl@thistick:=\dtl@xminorticlist\do{% + \ifDTLxticsin + \draw (\dtl@thistick,\DTLminY) -- ++(0,\dtl@ticklength); + \draw (\dtl@thistick,\DTLminY) + ++ (0,-\dtl@ticlabeloffset) node[anchor=north] {\dtl@thislabel}; + \else + \draw (\dtl@thistick,\DTLminY) -- ++(0,-\dtl@ticklength) + ++ (0,-\dtl@ticlabeloffset) node[anchor=north] {\dtl@thislabel}; + \fi + \ifDTLbox + \ifDTLxticsin + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,-\dtl@ticklength); + \else + \draw (\dtl@thistick,\DTLmaxY) -- ++(0,\dtl@ticklength); + \fi + \fi }% - \fi + \fi \ifDTLytics - \@for\dtl@thistick:=\dtl@yticlist\do{% - \pgfpathmoveto{\pgfpointxy{\DTLminX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{\DTLticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{-\DTLticklength}{0pt}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{-\DTLticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{\DTLticklength}{0pt}}} - \fi - \fi - \pgfusepath{stroke} - \ifx\dtl@yticlabels\relax - \FPround{\dtl@thislabel}{\dtl@thistick} - {\c@DTLplotroundYvar}% - \else + \dtlsub{\dtl@ticklength}{\number\DTLticklength}{-\dtl@offset@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% + \dtladd{\dtl@ticlabeloffset}{\number\DTLticklabeloffset}{0}% + \dtlsub{\dtl@ticlabeloffset}{\number\DTLticklabeloffset}{-\dtl@offset@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@scale@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{65536}% + \@for\dtl@thistick:=\dtl@yticlist\do{% + \let\dtl@thisticklabel\dtl@thistick + \ifx\dtl@yticlabels\relax + \dtlround{\dtl@thislabel}{\dtl@thistick} + {\c@DTLplotroundXvar}% + \else \dtl@chopfirst\dtl@yticlabels\dtl@thislabel\dtl@rest \let\dtl@yticlabels=\dtl@rest - \fi - \pgftext[right,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{-\DTLticklabeloffset}{0pt}}}] - {\dtl@thislabel} - }% + \fi + \ifDTLyticsin + \draw (\DTLminX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \draw (\DTLminX,\dtl@thistick) + ++ (-\dtl@ticlabeloffset,0) node[anchor=east] {\dtl@thislabel}; + \else + \draw (\DTLminX,\dtl@thistick) -- ++(-\dtl@ticklength,0) + ++ (-\dtl@ticlabeloffset,0) node[anchor=east] {\dtl@thislabel}; + \fi + \ifDTLbox + \ifDTLyticsin + \draw (\DTLmaxX,\dtl@thistick) -- ++(-\dtl@ticklength,0); + \else + \draw (\DTLmaxX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \fi + \fi + }% \fi - \ifx\dtl@ylabel\relax - \else - \addtolength{\dtl@yticlabelwidth}{\baselineskip}% - \setlength{\dtl@tmplength}{0.5\DTLplotheight} - \pgftext[bottom,center,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}}% - {\pgfpoint{-\dtl@yticlabelwidth}{\dtl@tmplength}}}, - rotate=90]{% - \dtl@ylabel} - \fi - \ifDTLyminortics - \@for\dtl@thistick:=\dtl@yminorticlist\do{% - \pgfpathmoveto{\pgfpointxy{\DTLminX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{\DTLminorticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLminX}{\dtl@thistick}} - {\pgfpoint{-\DTLminorticklength}{0pt}}} - \fi - \ifDTLbox - \pgfpathmoveto{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - \ifDTLyticsin - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{-\DTLminorticklength}{0pt}}} - \else - \pgfpathlineto{ - \pgfpointadd{\pgfpointxy{\DTLmaxX}{\dtl@thistick}} - {\pgfpoint{\DTLminorticklength}{0pt}}} - \fi - \fi - \pgfusepath{stroke} + \ifx\dtl@ylabel\relax + \else + \setlength{\dtl@tmplength}{\baselineskip}% + \addtolength{\dtl@tmplength}{\dtl@yticlabelwidth}% + \addtolength{\dtl@tmplength}{\DTLticklabeloffset}% + \dtlsub{\dtl@ticlabeloffset}{\number\dtl@tmplength}{-\dtl@offset@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{\dtl@scale@x}% + \dtldiv{\dtl@ticlabeloffset}{\dtl@ticlabeloffset}{65536}% + \dtlmul{\dtl@y}{\dtl@dy}{0.5}% + \draw (\DTLminX,\DTLminY) ++(-\dtl@ticlabeloffset,\dtl@y) + node[rotate=90,anchor=south] {\dtl@ylabel}; + \fi + \ifDTLyminortics + \dtlsub{\dtl@ticklength}{\number\DTLminorticklength}{-\dtl@offset@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{\dtl@scale@x}% + \dtldiv{\dtl@ticklength}{\dtl@ticklength}{65536}% + \@for\dtl@thistick:=\dtl@yminorticlist\do{% + \ifDTLyticsin + \draw (\DTLminX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \else + \draw (\DTLminX,\dtl@thistick) -- ++(-\dtl@ticklength,0); + \fi + \ifDTLbox + \ifDTLyticsin + \draw (\DTLmaxX,\dtl@thistick) -- ++(-\dtl@ticklength,0); + \else + \draw (\DTLmaxX,\dtl@thistick) -- ++(\dtl@ticklength,0); + \fi + \fi }% - \fi - \@for\dtl@thisdb:=#2\do{% - \ifx\dtl@plotmarkcolorlist\@empty - \let\dtl@plotmarkcolorlist=\DTLplotmarkcolors - \fi - \dtl@chopfirst\dtl@plotmarkcolorlist\dtl@thisplotmarkcolor - \dtl@remainder - \let\dtl@plotmarkcolorlist=\dtl@remainder - \ifDTLshowmarkers - \ifx\dtl@plotmarklist\@empty - \let\dtl@plotmarklist=\DTLplotmarks + \fi + \end{scope} + \@for\dtl@thisdb:=#2\do{% + \ifx\dtl@plotmarkcolorlist\@empty + \let\dtl@plotmarkcolorlist=\DTLplotmarkcolors \fi - \dtl@chopfirst\dtl@plotmarklist\dtl@thisplotmark + \dtl@chopfirst\dtl@plotmarkcolorlist\dtl@thisplotmarkcolor \dtl@remainder - \let\dtl@plotmarklist=\dtl@remainder - \ifx\dtl@thisplotmark\relax - \let\dtl@mark=\relax - \else - \expandafter\toks@\expandafter{\dtl@thisplotmark}% - \ifx\dtl@thisplotmarkcolor\@empty - \edef\dtl@mark{\the\toks@}% + \let\dtl@plotmarkcolorlist=\dtl@remainder + \ifDTLshowmarkers + \ifx\dtl@plotmarklist\@empty + \let\dtl@plotmarklist=\DTLplotmarks + \fi + \dtl@chopfirst\dtl@plotmarklist\dtl@thisplotmark + \dtl@remainder + \let\dtl@plotmarklist=\dtl@remainder + \ifx\dtl@thisplotmark\relax + \let\dtl@mark=\relax \else - \edef\dtl@mark{% - \noexpand\color{\dtl@thisplotmarkcolor}% - \the\toks@}% + \expandafter\toks@\expandafter{\dtl@thisplotmark}% + \ifx\dtl@thisplotmarkcolor\@empty + \edef\dtl@mark{\the\toks@}% + \else + \edef\dtl@mark{% + \noexpand\color{\dtl@thisplotmarkcolor}% + \the\toks@}% + \fi \fi + \else + \let\dtl@mark=\relax \fi - \else - \let\dtl@mark=\relax - \fi - \ifx\dtl@plotlinecolorlist\@empty - \let\dtl@plotlinecolorlist=\DTLplotlinecolors - \fi - \dtl@chopfirst\dtl@plotlinecolorlist\dtl@thisplotlinecolor - \dtl@remainder - \let\dtl@plotlinecolorlist=\dtl@remainder - \ifDTLshowlines - \ifx\dtl@plotlinelist\@empty - \let\dtl@plotlinelist=\DTLplotlines + \ifx\dtl@plotlinecolorlist\@empty + \let\dtl@plotlinecolorlist=\DTLplotlinecolors \fi - \dtl@chopfirst\dtl@plotlinelist\dtl@thisplotline + \dtl@chopfirst\dtl@plotlinecolorlist\dtl@thisplotlinecolor \dtl@remainder - \let\dtl@plotlinelist=\dtl@remainder - \expandafter\ifx\dtl@thisplotline\relax + \let\dtl@plotlinecolorlist=\dtl@remainder + \ifDTLshowlines + \ifx\dtl@plotlinelist\@empty + \let\dtl@plotlinelist=\DTLplotlines + \fi + \dtl@chopfirst\dtl@plotlinelist\dtl@thisplotline + \dtl@remainder + \let\dtl@plotlinelist=\dtl@remainder + \expandafter\ifx\dtl@thisplotline\relax \let\dtl@linestyle=\relax \else \expandafter\toks@\expandafter{\dtl@thisplotline}% @@ -661,11 +662,18 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \DTLisclosedbetween{\dtl@x}{\DTLminX}{\DTLmaxX}% \and \DTLisclosedbetween{\dtl@y}{\DTLminY}{\DTLmaxY}% - }{% - \expandafter\toks@\expandafter{\dtl@stream}% - \edef\dtl@stream{\the\toks@ - \noexpand\pgfplotstreampoint - {\noexpand\pgfpointxy{\dtl@decx}{\dtl@decy}}}% + }% + {% + \expandafter\toks@\expandafter{\dtl@stream}% + \dtlmul{\dtl@decx}{\dtl@decx}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlround{\dtl@decx}{\dtl@decx}{1}% + \dtlmul{\dtl@decy}{\dtl@decy}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \dtlround{\dtl@decy}{\dtl@decy}{1}% + \edef\dtl@stream{\the\toks@ + \noexpand\pgfplotstreampoint + {\noexpand\pgfpointxy{\dtl@decx}{\dtl@decy}}}% }{}% }% \expandafter\toks@\expandafter{\dtl@stream}% @@ -687,185 +695,219 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \pgfusepath{stroke} \end{scope} \fi - }% - \ifcase\dtl@legendsetting + }% + \ifcase\dtl@legendsetting % none - \or % north - \pgftext[top,center,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLmaxY}} - {\pgfpoint{0.5\DTLplotwidth}{-\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % north east - \pgftext[top,right,at={\pgfpointadd - {\pgfpointxy{\DTLmaxX}{\DTLmaxY}} - {\pgfpoint{-\DTLlegendxoffset}{-\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % east - \pgftext[center,right,at={\pgfpointadd - {\pgfpointxy{\DTLmaxX}{\DTLminY}} - {\pgfpoint{-\DTLlegendxoffset}{0.5\DTLplotheight}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % south east - \pgftext[bottom,right,at={\pgfpointadd - {\pgfpointxy{\DTLmaxX}{\DTLminY}} - {\pgfpoint{-\DTLlegendxoffset}{\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % south - \pgftext[center,bottom,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}} - {\pgfpoint{0.5\DTLplotwidth}{\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % south west - \pgftext[bottom,left,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}} - {\pgfpoint{\DTLlegendxoffset}{\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % west - \pgftext[center,left,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLminY}} - {\pgfpoint{\DTLlegendxoffset}{0.5\DTLplotheight}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \or % north west - \pgftext[top,left,at={\pgfpointadd - {\pgfpointxy{\DTLminX}{\DTLmaxY}} - {\pgfpoint{\DTLlegendxoffset}{-\DTLlegendyoffset}}}] - {\DTLformatlegend - {\begin{tabular}{cl}\dtl@legend\end{tabular}}} - \fi - \DTLplotatendtikz - \end{tikzpicture} + \or % north + \dtlmul{\dtl@decx}{\dtl@dx}{0.5}% + \dtladd{\dtl@decx}{\DTLminX}{\dtl@decx}% + \dtlmul{\dtl@decx}{\dtl@decx}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLmaxY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(0,-\DTLlegendyoffset) + node[anchor=north] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % north east + \dtlmul{\dtl@decx}{\DTLmaxX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLmaxY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(-\DTLlegendxoffset,-\DTLlegendyoffset) + node[anchor=north east] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % east + \dtlmul{\dtl@decy}{\dtl@dy}{0.5}% + \dtladd{\dtl@decy}{\DTLminY}{\dtl@decy}% + \dtlmul{\dtl@decy}{\dtl@decy}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \dtlmul{\dtl@decx}{\DTLmaxX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \draw (\dtl@decx,\dtl@decy) ++(-\DTLlegendxoffset,0) + node[anchor=east] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % south east + \dtlmul{\dtl@decx}{\DTLmaxX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLminY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(-\DTLlegendxoffset,\DTLlegendyoffset) + node[anchor=south east] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % south + \dtlmul{\dtl@decx}{\dtl@dx}{0.5}% + \dtladd{\dtl@decx}{\DTLminX}{\dtl@decx}% + \dtlmul{\dtl@decx}{\dtl@decx}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLminY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(0,\DTLlegendyoffset) + node[anchor=south] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % south west + \dtlmul{\dtl@decx}{\DTLminX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLminY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(\DTLlegendxoffset,\DTLlegendyoffset) + node[anchor=south west] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % west + \dtlmul{\dtl@decy}{\dtl@dy}{0.5}% + \dtladd{\dtl@decy}{\DTLminY}{\dtl@decy}% + \dtlmul{\dtl@decy}{\dtl@decy}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \dtlmul{\dtl@decx}{\DTLminX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \draw (\dtl@decx,\dtl@decy) ++(\DTLlegendxoffset,0) + node[anchor=west] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \or % north west + \dtlmul{\dtl@decx}{\DTLminX}{\dtl@scale@x}% + \dtladd{\dtl@decx}{\dtl@decx}{\dtl@offset@x}% + \dtlmul{\dtl@decy}{\DTLmaxY}{\dtl@scale@y}% + \dtladd{\dtl@decy}{\dtl@decy}{\dtl@offset@y}% + \draw (\dtl@decx,\dtl@decy) ++(\DTLlegendxoffset,-\DTLlegendyoffset) + node[anchor=north west] + {\DTLformatlegend + {\begin{tabular}{cl}\dtl@legend\end{tabular}}% + }; + \fi + \pgftransformcm{\dtl@scale@x}{0}{0}{\dtl@scale@y}% + {\pgfpoint{\dtl@offset@x pt}{\dtl@offset@y pt}}% + \DTLplotatendtikz + \end{tikzpicture} \fi \fi -\fi -}} +\egroup +} \def\dtl@getbounds#1,#2,#3,#4\@nil{% \def\DTLminX{#1}% \def\DTLminY{#2}% \def\DTLmaxX{#3}% \def\DTLmaxY{#4}% -\FPifgt{\DTLminX}{\DTLmaxX} +\dtlifnumgt{\DTLminX}{\DTLmaxX} +{% \PackageError{dataplot}{Min X > Max X in bounds #1,#2,#3,#4}{% The bounds must be specified as minX,minY,maxX,maxY}% -\fi -\FPifgt{\DTLminY}{\DTLmaxY} +}{}% +\dtlifnumgt{\DTLminY}{\DTLmaxY} +{% \PackageError{dataplot}{Min Y > Max Y in bounds #1,#2,#3,#4}{% The bounds must be specified as minX,minY,maxX,maxY}% -\fi +}{}% } \newcommand*{\dtl@constructticklist}[4]{% -\DTLifFPopenbetween{0}{#1}{#2}{% - \FPsub{\@dtl@width}{0}{#1}% - \FPmul{\@dtl@width}{\@dtl@width}{#3}% - \FPdiv{\@dtl@neggap}{\@dtl@width}{10}% - \setlength\dtl@tmplength{\@dtl@neggap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@neggap}{\@dtl@width}{4}% - \setlength\dtl@tmplength{\@dtl@neggap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@neggap}{\@dtl@width}{2}% - \setlength\dtl@tmplength{\@dtl@neggap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \let\@dtl@neggap=\@dtl@width - \fi - \fi - \fi - \FPmul{\@dtl@width}{#2}{#3}% - \FPdiv{\@dtl@posgap}{\@dtl@width}{10}% - \setlength\dtl@tmplength{\@dtl@posgap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@posgap}{\@dtl@width}{4}% - \setlength\dtl@tmplength{\@dtl@posgap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@posgap}{\@dtl@width}{2}% - \setlength\dtl@tmplength{\@dtl@posgap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \let\@dtl@posgap=\@dtl@width - \fi - \fi - \fi - \FPmax{\@dtl@gap}{\@dtl@neggap}{\@dtl@posgap}% - \FPdiv{\@dtl@gap}{\@dtl@gap}{#3}% - \dtl@constructticklistwithgapz{#1}{#2}{#4}{\@dtl@gap}% -}{% - \FPsub{\@dtl@width}{#2}{#1}% - \FPmul{\@dtl@width}{\@dtl@width}{#3}% - \FPdiv{\@dtl@gap}{\@dtl@width}{10}% - \setlength\dtl@tmplength{\@dtl@gap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{4}% - \setlength\dtl@tmplength{\@dtl@gap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{2}% - \setlength\dtl@tmplength{\@dtl@gap sp}% - \ifdim\dtl@tmplength<\DTLmintickgap - \let\@dtl@gap=\@dtl@width - \fi - \fi - \fi - \FPdiv{\@dtl@gap}{\@dtl@gap}{#3}% - \dtl@constructticklistwithgap{#1}{#2}{#4}{\@dtl@gap}% -}% + \DTLifFPopenbetween{0}{#1}{#2}% + {% + \dtlsub{\@dtl@width}{0}{#1}% + \dtldiv{\@dtl@neggap}{\@dtl@width}{10}% + \dtlifnumlt{\@dtl@neggap}{#3}% + {% + \edef\@dtl@neggap{#3}% + }% + {}% + \dtldiv{\@dtl@posgap}{#2}{10}% + \dtlifnumlt{\@dtl@posgap}{#3}% + {% + \edef\@dtl@posgap{#3}% + }% + {}% + \dtlmax{\@dtl@gap}{\@dtl@neggap}{\@dtl@posgap}% + \dtlifnumgt{\@dtl@gap}{\@dtl@width}% + {}% + {% + \dtl@constructticklistwithgapz{#1}{#2}{#4}{\@dtl@gap}% + }% + }% + {% + \dtlsub{\@dtl@width}{#2}{#1}% + \dtldiv{\@dtl@gap}{\@dtl@width}{10}% + \dtlifnumlt{\@dtl@gap}{#3}% + {% + \dtlifnumgt{#3}{\@dtl@width}% + {% + \def#4{#1,#2}% + }% + {% + \dtl@constructticklistwithgap{#1}{#2}{#4}{#3}% + } + }% + {% + \dtl@constructticklistwithgap{#1}{#2}{#4}{\@dtl@gap}% + }% + }% } \newcommand*{\dtl@constructticklistwithgap}[4]{% \edef\@dtl@thistick{#1}% \edef#3{#1}% -\FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% +\dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{#2}}{% \expandafter\toks@\expandafter{\@dtl@thistick}% \edef#3{#3,\the\toks@}% - \FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% }% \expandafter\toks@\expandafter{#2}% \edef#3{#3,\the\toks@}% } \newcommand*{\dtl@constructticklistwithgapz}[4]{% -\edef\@dtl@thistick{0}% -\edef#3{0}% -\FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% -\whiledo{\DTLisFPopenbetween{\@dtl@thistick}{0}{#2}}{% - \expandafter\toks@\expandafter{\@dtl@thistick}% - \edef#3{#3,\the\toks@}% - \FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% -}% -\expandafter\toks@\expandafter{#2}% -\edef#3{#3,\the\toks@}% -\FPifeq{#1}{0}% -\else -\edef\@dtl@thistick{0}% - \FPsub{\@dtl@thistick}{\@dtl@thistick}{#4}% - \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{0}}{% + \edef\@dtl@thistick{0}% + \edef#3{0}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% + \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{0}{#2}}% + {% \expandafter\toks@\expandafter{\@dtl@thistick}% + \edef#3{#3,\the\toks@}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% + }% + \expandafter\toks@\expandafter{#2}% + \edef#3{#3,\the\toks@}% + \dtlifnumeq{#1}{0}% + {}% + {% + \edef\@dtl@thistick{0}% + \dtlsub{\@dtl@thistick}{\@dtl@thistick}{#4}% + \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{0}}% + {% + \expandafter\toks@\expandafter{\@dtl@thistick}% + \edef#3{\the\toks@,#3}% + \dtlsub{\@dtl@thistick}{\@dtl@thistick}{#4}% + }% + \expandafter\toks@\expandafter{#1}% \edef#3{\the\toks@,#3}% - \FPsub{\@dtl@thistick}{\@dtl@thistick}{#4}% }% - \expandafter\toks@\expandafter{#1}% - \edef#3{\the\toks@,#3}% -\fi } \newcommand*{\dtl@constructminorticklist}[4]{% - \FPsub{\@dtl@width}{#2}{#1}% - \FPmul{\@dtl@width}{\@dtl@width}{#3}% - \FPdiv{\@dtl@gap}{\@dtl@width}{10}% + \dtlsub{\@dtl@width}{#2}{#1}% + \dtlmul{\@dtl@width}{\@dtl@width}{#3}% + \dtldiv{\@dtl@gap}{\@dtl@width}{10}% \setlength\dtl@tmplength{\@dtl@gap sp}% \ifdim\dtl@tmplength<\DTLminminortickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{4}% + \dtldiv{\@dtl@gap}{\@dtl@width}{4}% \setlength\dtl@tmplength{\@dtl@gap sp}% \ifdim\dtl@tmplength<\DTLminminortickgap - \FPdiv{\@dtl@gap}{\@dtl@width}{2}% + \dtldiv{\@dtl@gap}{\@dtl@width}{2}% \setlength\dtl@tmplength{\@dtl@gap sp}% \ifdim\dtl@tmplength<\DTLminminortickgap \let\@dtl@gap=\@dtl@width \fi \fi \fi - \FPdiv{\@dtl@gap}{\@dtl@gap}{#3}% + \dtldiv{\@dtl@gap}{\@dtl@gap}{#3}% \dtl@constructticklistwithgapex{#1}{#2}{\dtl@tmp}{\@dtl@gap}% \ifx#4\@empty \let#4=\dtl@tmp @@ -877,7 +919,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \newcommand*{\dtl@constructticklistwithgapex}[4]{% \edef\@dtl@thistick{#1}% \let#3=\@empty -\FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% +\dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% \whiledo{\DTLisFPopenbetween{\@dtl@thistick}{#1}{#2}}{% \expandafter\toks@\expandafter{\@dtl@thistick}% \ifx#3\@empty @@ -885,7 +927,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% \else \edef#3{#3,\the\toks@}% \fi - \FPadd{\@dtl@thistick}{\@dtl@thistick}{#4}% + \dtladd{\@dtl@thistick}{\@dtl@thistick}{#4}% }% } \newcommand*{\DTLaddtoplotlegend}[3]{% diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty index 8f617ec0e77..ccbc209a9ca 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool-base}[2013/06/28 v2.14 (NLCT)] \RequirePackage{etoolbox} \RequirePackage{amsmath} \RequirePackage{xkeyval} diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty index aac031ce169..787053268c7 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool-fp}[2013/06/28 v2.14 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{fp} \RequirePackage{datatool-base} diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty b/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty index 3ce27652288..2daeb4c6fa1 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2013/06/28 v2.14 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{pgfrcs,pgfkeys,pgfmath} \ProcessOptionsX diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty index 5101274b157..35300a8d2c1 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{datatool}[2013/06/28 v2.14 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{ifthen} \RequirePackage{xfor} @@ -116,7 +116,7 @@ \ProcessOptionsX \@dtl@construct@lopoffs \RequirePackage{datatool-base} -\DeclareRobustCommand\DTLpar{\@par} +\let\DTLpar\@@par \newcommand*{\DTLnewdb}[1]{% \DTLifdbexists{#1}% {% @@ -433,7 +433,8 @@ {\noexpand\@dtl@after}{\the\csname dtlkeys@#1\endcsname}% {\number\dtlcolumnnum}}% \@dtl@dogetprops - \ifstrempty{#3}% + \protected@edef\dtl@tmp{#3}% + \ifdefempty\dtl@tmp {% }% {% @@ -2824,9 +2825,12 @@ \string\expandafter \string\global^^J\string\csname\space dtldb@#1\string\endcsname =\expandafter\@gobble\string\{\expandafter\@gobble\string\%}% - \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{\the\csname dtldb@#1\endcsname}% + \@dtl@fmt@bodytok{\csname dtldb@#1\endcsname}% + \expandafter\protected@xdef\csname dtl@rawwritedb@#1\endcsname{% + \@dtl@contents}% \protected@write{\@dtl@write}{}{\csname dtl@rawwritedb@#1\endcsname}% - \protected@write{\@dtl@write}{}{\expandafter\@gobble\string\}\expandafter\@gobble\string\%}% + \protected@write{\@dtl@write}{}{% + \expandafter\@gobble\string\}\expandafter\@gobble\string\%}% \protected@write{\@dtl@write}{}{\string\expandafter\string\global^^J \string\expandafter\string\newcount \string\csname\space dtlrows@#1\string\endcsname}% @@ -2858,6 +2862,24 @@ database}{}% }% } +\newcommand*{\@dtl@fmt@bodytok}[1]{% + \edef\@dtl@contents{\the#1}% + \@onelevel@sanitize\@dtl@contents + \@dtl@replace@elt{\@dtl@contents}{db@row@elt@w}% + \@dtl@replace@elt{\@dtl@contents}{db@row@elt@end@}% + \@dtl@replace@elt{\@dtl@contents}{db@row@id@w}% + \@dtl@replace@elt{\@dtl@contents}{db@row@id@end@}% + \@dtl@replace@elt{\@dtl@contents}{db@col@id@w}% + \@dtl@replace@elt{\@dtl@contents}{db@col@id@end@}% + \@dtl@replace@elt{\@dtl@contents}{db@col@elt@w}% + \@dtl@replace@elt{\@dtl@contents}{db@col@elt@end@}% +} +\newcommand*{\@dtl@replace@elt}[2]{% + \expandafter\def\expandafter\dtl@tmp\expandafter{\csname#2\endcsname }% + \@onelevel@sanitize\dtl@tmp + \expandafter\DTLsubstituteall\expandafter#1\expandafter{\dtl@tmp}% + {\csname#2\endcsname}% +} \newread\@dtl@read \newcount\dtl@entrycr \define@boolkey{loaddb}[dtl]{noheader}[true]{} diff --git a/Master/texmf-dist/tex/latex/datatool/person.sty b/Master/texmf-dist/tex/latex/datatool/person.sty index 6dcc72366b5..6578c5a8a9e 100644 --- a/Master/texmf-dist/tex/latex/datatool/person.sty +++ b/Master/texmf-dist/tex/latex/datatool/person.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{person}[2013/01/15 v2.13 (NLCT)] +\ProvidesPackage{person}[2013/06/28 v2.14 (NLCT)] \RequirePackage{ifthen} \RequirePackage{datatool} \newcounter{people} |