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 /Master/texmf-dist/source | |
parent | efeeb862227d6416e7450a72d6f37ebba3563b20 (diff) |
datatool (28jun13)
git-svn-id: svn://tug.org/texlive/trunk@31007 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/datatool/datatool.dtx | 1605 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/datatool/datatool.ins | 2 |
2 files changed, 952 insertions, 655 deletions
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 |