From 35f4733179fc116420810062bf3bd6891f86b5d9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 28 Jun 2013 21:55:40 +0000 Subject: datatool (28jun13) git-svn-id: svn://tug.org/texlive/trunk@31007 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/datatool/databar.sty | 29 +- Master/texmf-dist/tex/latex/datatool/databib.sty | 2 +- Master/texmf-dist/tex/latex/datatool/datagidx.sty | 22 +- Master/texmf-dist/tex/latex/datatool/datapie.sty | 272 +++--- Master/texmf-dist/tex/latex/datatool/dataplot.sty | 984 +++++++++++---------- .../tex/latex/datatool/datatool-base.sty | 2 +- .../texmf-dist/tex/latex/datatool/datatool-fp.sty | 2 +- .../tex/latex/datatool/datatool-pgfmath.sty | 2 +- Master/texmf-dist/tex/latex/datatool/datatool.sty | 32 +- Master/texmf-dist/tex/latex/datatool/person.sty | 2 +- 10 files changed, 718 insertions(+), 631 deletions(-) (limited to 'Master/texmf-dist/tex/latex/datatool') 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} -- cgit v1.2.3