diff options
author | Karl Berry <karl@freefriends.org> | 2016-07-21 21:17:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-07-21 21:17:50 +0000 |
commit | e8a6c5f6d758797dbff323e9d5e9012da75628d3 (patch) | |
tree | d014e2618393764a66d7d7548c687b11f131a86d /Master/texmf-dist/tex/latex | |
parent | 21e06c4cf543502d43e374b7ba6868a9e3b82406 (diff) |
datatool (21jul16)
git-svn-id: svn://tug.org/texlive/trunk@41744 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
10 files changed, 286 insertions, 123 deletions
diff --git a/Master/texmf-dist/tex/latex/datatool/databar.sty b/Master/texmf-dist/tex/latex/datatool/databar.sty index 47e049691e3..d0ef470fe52 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{databar}[2016/07/20 v2.26 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{dataplot} \newif\ifDTLcolorbarchart @@ -296,6 +296,23 @@ \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 diff --git a/Master/texmf-dist/tex/latex/datatool/databib.sty b/Master/texmf-dist/tex/latex/datatool/databib.sty index a26e6e422af..925c7c0fa84 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{databib}[2016/07/20 v2.26 (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 0d06f3a966e..eb7ba8b128e 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datagidx}[2016/07/20 v2.26 (NLCT)] \RequirePackage{datatool} \RequirePackage{etoolbox} \RequirePackage{xkeyval} diff --git a/Master/texmf-dist/tex/latex/datatool/datapie.sty b/Master/texmf-dist/tex/latex/datatool/datapie.sty index 7b139a17504..169941de50c 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datapie}[2016/07/20 v2.26 (NLCT)] \RequirePackage{xkeyval} \newif\ifDTLcolorpiechart \DTLcolorpiecharttrue @@ -165,24 +165,24 @@ \let\dtl@oldtotal=\dtl@total \expandafter\DTLconverttodecimal\expandafter {\DTLpievariable}{\dtl@variable}% - \FPadd{\dtl@total}{\dtl@variable}{\dtl@total}% + \dtladd{\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}% + \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}% + \csname c@DTLrow\romannumeral\dtlforeachlevel\endcsname% + \dtlmul{\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 + \dtldiv{\dtl@tmp}{\dtl@old}{\dtl@total}% + \expandafter\dtlround + \csname dtl@piepercent@\romannumeral\@dtl@seg\endcsname\dtl@tmp + \c@DTLpieroundvar }% \@for\dtl@row:=\dtl@piecutaways\do{% \expandafter\@dtl@set@off\dtl@row-\relax @@ -198,24 +198,22 @@ \csname dtl@sang@\romannumeral\@dtl@seg\endcsname}% \edef\dtl@extent{% \csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% - \FPadd{\dtl@endangle}{\dtl@start}{\dtl@extent}% + \dtladd{\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}% + \dtlsub{\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}% + \dtlmul{\dtl@angle}{\dtl@extent}{0.5}% + \dtladd{\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; @@ -227,10 +225,18 @@ \fi \dtl@truncatedecimal\dtl@midangle \ifDTLrotateinner - \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) - \TE@or \dtl@midangle < -90}% + \dtlifnumopenbetween{\dtl@midangle}{90}{270}% + {% + \let\@dtl@next\@firstoftwo + }% {% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtlifnumlt{\dtl@midangle}{-90}% + {\let\@dtl@next\@firstoftwo}% + {\let\@dtl@next\@secondoftwo}% + }% + \@dtl@next + {% + \dtlsub{\dtl@labelangle}{\dtl@midangle}{180}% \dtl@truncatedecimal\dtl@labelangle \edef\dtl@innernodeopt{anchor=east,rotate=\dtl@labelangle}% }% @@ -241,10 +247,18 @@ \edef\dtl@innernodeopt{anchor=center}% \fi \ifDTLrotateouter - \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) - \TE@or \dtl@midangle < -90}% + \dtlifnumopenbetween{\dtl@midangle}{90}{270}% {% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumlt{\dtl@midangle}{-90}% + {\let\@dtl@next\@firstoftwo}% + {\let\@dtl@next\@secondoftwo}% + }% + \@dtl@next + {% + \dtlsub{\dtl@labelangle}{\dtl@midangle}{180}% \dtl@truncatedecimal\dtl@labelangle \edef\dtl@outernodeopt{anchor=east,rotate=\dtl@labelangle}% }% @@ -252,23 +266,74 @@ \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}% + \dtlifnumeq{\dtl@midangle}{45} + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumgt{\dtl@midangle}{315} + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumopenbetween{\dtl@midangle}{-45}{45}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \let\@dtl@next\@secondoftwo + }% + }% + }% + \@dtl@next {% \edef\dtl@outernodeopt{anchor=west}% }% {% - \ifthenelse{\(\dtl@midangle<135\and\dtl@midangle>45\) - \TE@or \dtl@midangle=135}% + \dtlifnumopenbetween{\dtl@midangle}{45}{135}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumeq{\dtl@midangle}{135}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \let\@dtl@next\@secondoftwo + }% + }% + \@dtl@next {% \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}% + \dtlifnumopenbetween{\dtl@midangle}{135}{225}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumeq{\dtl@midangle}{225}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumeq{\dtl@midangle}{-135}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumlt{\dtl@midangle}{-135}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \let\@dtl@next\@secondoftwo + }% + }% + }% + }% + \@dtl@next {% \edef\dtl@outernodeopt{anchor=east}% }% @@ -298,71 +363,79 @@ \egroup } \newcommand*{\dtl@computeangles}[2]{% -\FPifgt{\@dtl@start}{180}% - \let\dtl@old=\@dtl@start - \FPsub{\@dtl@start}{\dtl@old}{360}% -\fi -\FPiflt{\@dtl@start}{-180}% + \dtlifnumgt{\@dtl@start}{180}% + {% + \let\dtl@old=\@dtl@start + \dtlsub{\@dtl@start}{\dtl@old}{360}% + }% + {}% + \dtlifnumlt{\@dtl@start}{-180}% + {% + \let\dtl@old=\@dtl@start + \dtladd{\@dtl@start}{\dtl@old}{360}% + }% + {}% + \expandafter\edef\csname dtl@sang@\romannumeral#1\endcsname{% + \@dtl@start}% + \dtlmul{\dtl@angle}{360}{#2}% + \let\dtl@old=\dtl@angle + \dtldiv{\dtl@angle}{\dtl@old}{\dtl@total}% + \expandafter\let\csname dtl@angle@\romannumeral#1\endcsname=\dtl@angle \let\dtl@old=\@dtl@start - \FPadd{\@dtl@start}{\dtl@old}{360}% -\fi -\expandafter\edef\csname dtl@sang@\romannumeral#1\endcsname{% -\@dtl@start}% -\FPmul{\dtl@angle}{360}{#2}% -\let\dtl@old=\dtl@angle -\FPdiv{\dtl@angle}{\dtl@old}{\dtl@total}% -\expandafter\let\csname dtl@angle@\romannumeral#1\endcsname=\dtl@angle -\let\dtl@old=\@dtl@start -\FPadd{\@dtl@start}{\dtl@old}{\dtl@angle}% -\expandafter\def\csname dtl@cut@angle@\romannumeral#1\endcsname{0}% -\expandafter\def\csname dtl@cut@len@\romannumeral#1\endcsname{0cm}% + \dtladd{\@dtl@start}{\dtl@old}{\dtl@angle}% + \expandafter\def\csname dtl@cut@angle@\romannumeral#1\endcsname{0}% + \expandafter\def\csname dtl@cut@len@\romannumeral#1\endcsname{0cm}% } \def\@dtl@set@off#1-#2\relax{% -\ifthenelse{\equal{#2}{}}{% -\@@dtl@set@off{#1}}{% -\@@dtl@set@offr#1-#2\relax}% + \ifstrempty{#2}% + {% + \@@dtl@set@off{#1}% + }% + {% + \@@dtl@set@offr#1-#2\relax + }% } \newcommand*{\@@dtl@set@off}[1]{% -\edef\dtl@old{\csname dtl@angle@\romannumeral#1\endcsname}% -\FPmul{\dtl@angle}{\dtl@old}{0.5}% -\let\dtl@old=\dtl@angle -\edef\dtl@sang{\csname dtl@sang@\romannumeral#1\endcsname}% -\FPadd{\dtl@angle}{\dtl@old}{\dtl@sang}% -\expandafter\edef\csname dtl@cut@angle@\romannumeral#1\endcsname{% -\dtl@angle}% -\expandafter\edef\csname dtl@cut@len@\romannumeral#1\endcsname{% - \the\dtl@cutawayoffset} + \edef\dtl@old{\csname dtl@angle@\romannumeral#1\endcsname}% + \dtlmul{\dtl@angle}{\dtl@old}{0.5}% + \let\dtl@old=\dtl@angle + \edef\dtl@sang{\csname dtl@sang@\romannumeral#1\endcsname}% + \dtladd{\dtl@angle}{\dtl@old}{\dtl@sang}% + \expandafter\edef\csname dtl@cut@angle@\romannumeral#1\endcsname{% + \dtl@angle}% + \expandafter\edef\csname dtl@cut@len@\romannumeral#1\endcsname{% + \the\dtl@cutawayoffset}% } \newcount\@dtl@seg \def\@@dtl@set@offr#1-#2-\relax{% -\ifnum#1>#2\relax - \PackageError{datapie}{Segment ranges must go in ascending order}{% -Try #2-#1 instead of #1-#2}% -\else - \def\dtl@angle{0}% - \@dtl@seg=#1\relax - \whiledo{\not\(\@dtl@seg > #2\)}{% - \let\dtl@old=\dtl@angle - \edef\dtl@segang{\csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% - \FPadd{\dtl@angle}{\dtl@old}{\dtl@segang}% - \advance\@dtl@seg by 1\relax - }% - \let\dtl@old=\dtl@angle - \FPmul{\dtl@angle}{\dtl@old}{0.5}% - \edef\dtl@sang{\csname dtl@sang@\romannumeral#1\endcsname}% - \let\dtl@old=\dtl@angle - \FPadd{\dtl@angle}{\dtl@old}{\dtl@sang}% - \@dtl@seg=#1\relax - \whiledo{\not\(\@dtl@seg > #2\)}{% - \expandafter - \let\csname dtl@cut@angle@\romannumeral\@dtl@seg\endcsname - =\dtl@angle - \expandafter - \edef\csname dtl@cut@len@\romannumeral\@dtl@seg\endcsname{% - \the\dtl@cutawayoffset} - \advance\@dtl@seg by 1\relax - }% -\fi + \ifnum#1>#2\relax + \PackageError{datapie}{Segment ranges must go in ascending order}{% + Try #2-#1 instead of #1-#2}% + \else + \def\dtl@angle{0}% + \@dtl@seg=#1\relax + \whiledo{\not\(\@dtl@seg > #2\)}{% + \let\dtl@old=\dtl@angle + \edef\dtl@segang{\csname dtl@angle@\romannumeral\@dtl@seg\endcsname}% + \dtladd{\dtl@angle}{\dtl@old}{\dtl@segang}% + \advance\@dtl@seg by 1\relax + }% + \let\dtl@old=\dtl@angle + \dtlmul{\dtl@angle}{\dtl@old}{0.5}% + \edef\dtl@sang{\csname dtl@sang@\romannumeral#1\endcsname}% + \let\dtl@old=\dtl@angle + \dtladd{\dtl@angle}{\dtl@old}{\dtl@sang}% + \@dtl@seg=#1\relax + \whiledo{\not\(\@dtl@seg > #2\)}{% + \expandafter + \let\csname dtl@cut@angle@\romannumeral\@dtl@seg\endcsname + =\dtl@angle + \expandafter + \edef\csname dtl@cut@len@\romannumeral\@dtl@seg\endcsname{% + \the\dtl@cutawayoffset} + \advance\@dtl@seg by 1\relax + }% + \fi } \endinput %% diff --git a/Master/texmf-dist/tex/latex/datatool/dataplot.sty b/Master/texmf-dist/tex/latex/datatool/dataplot.sty index c330c241de1..d1ed4d28549 100644 --- a/Master/texmf-dist/tex/latex/datatool/dataplot.sty +++ b/Master/texmf-dist/tex/latex/datatool/dataplot.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dataplot}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{dataplot}[2016/07/20 v2.26 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{tikz} \RequirePackage{datatool} diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty index ce4d6d7b64f..753f02324a0 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool-base}[2016/07/20 v2.26 (NLCT)] \RequirePackage{etoolbox} \RequirePackage{amsmath} \RequirePackage{xkeyval} @@ -235,19 +235,33 @@ \def\@dtl@newsortedlist{}% \@dtl@insertdonefalse \@for\dtl@srtelement:=#2\do{% - \if@dtl@insertdone + \expandafter\DTLifSubString\expandafter{\dtl@srtelement}{,} + {% \expandafter\toks@\expandafter{\dtl@srtelement}% - \edef\@dtl@newstuff{{\the\toks@}}% + \edef\dtl@srtelement{{\the\toks@}}% + }% + {% + } + \if@dtl@insertdone + \let\@dtl@newstuff\dtl@srtelement \else - \expandafter#3\expandafter{\dtl@srtelement}{#1}% - \ifnum\dtl@sortresult<0\relax + \expandafter#3\expandafter\dtl@sortresult\expandafter + {\dtl@srtelement}{#1}% + \ifnum\dtl@sortresult>0\relax + \DTLifSubString{#1}{,}% + {% + \@dtl@toks{{#1}}% + }% + {% + \@dtl@toks{#1}% + }% \expandafter\toks@\expandafter{\dtl@srtelement}% - \@dtl@toks{#1}% - \edef\@dtl@newstuff{{\the\@dtl@toks},{\the\toks@}}% + \edef\@dtl@newstuff{\the\@dtl@toks,\the\toks@}% \@dtl@insertdonetrue \else \expandafter\toks@\expandafter{\dtl@srtelement}% \edef\@dtl@newstuff{{\the\toks@}}% + \let\@dtl@newstuff\dtl@srtelement \fi \fi \ifdefempty{\@dtl@newsortedlist}% @@ -264,15 +278,27 @@ }% \ifdefempty{\@dtl@newsortedlist}% {% - \@dtl@toks{#1}% - \edef\@dtl@newsortedlist{{\the\@dtl@toks}}% + \DTLifSubString{#1}{,}% + {% + \@dtl@toks{{#1}}% + }% + {% + \@dtl@toks{#1}% + }% + \edef\@dtl@newsortedlist{\the\@dtl@toks}% }% {% \if@dtl@insertdone \else + \DTLifSubString{#1}{,}% + {% + \@dtl@toks{{#1}}% + }% + {% + \@dtl@toks{#1}% + }% \expandafter\toks@\expandafter{\@dtl@newsortedlist}% - \@dtl@toks{#1}% - \edef\@dtl@newsortedlist{\the\toks@,{\the\@dtl@toks}}% + \edef\@dtl@newsortedlist{\the\toks@,\the\@dtl@toks}% \fi }% \global\let#2=\@dtl@newsortedlist @@ -313,8 +339,8 @@ \noexpand\def\noexpand\@dtl@fracpart{0}% }% {% - \noexpand\@dtl@getfracpart##2\noexpand\relax - \noexpand\@dtl@choptrailingzeroes{\noexpand\@dtl@fracpart}% + \noexpand\@dtl@getfracpart##2\noexpand\relax + \noexpand\@dtl@choptrailingzeroes{\noexpand\@dtl@fracpart}% }% }% \noexpand\def\noexpand\@dtl@getfracpart##1#1\noexpand\relax{% diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty index 0e1bf825957..4280f6bf182 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool-fp}[2016/07/20 v2.26 (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 7d7608f9995..f588ec69d68 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2016/07/20 v2.26 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{pgfrcs,pgfkeys,pgfmath} \ProcessOptionsX @@ -47,33 +47,38 @@ \newcommand*{\dtlifnumeq}[4]{% \def\@dtl@truepart{#3}% \def\@dtl@falsepart{#4}% - \pgfmathifthenelse{0#1==0#2}{"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% + \pgfmathifthenelse{\number0#1==\number0#2}% + {"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% \pgfmathresult } \RequirePackage{datatool-base} \newcommand*{\dtlifnumlt}[4]{% \def\@dtl@truepart{#3}% \def\@dtl@falsepart{#4}% - \pgfmathifthenelse{0#1 < 0#2}{"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% + \pgfmathifthenelse{\number0#1 < \number0#2}% + {"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% \pgfmathresult } \newcommand*{\dtlifnumgt}[4]{% \def\@dtl@truepart{#3}% \def\@dtl@falsepart{#4}% - \pgfmathifthenelse{0#1 > 0#2}{"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% + \pgfmathifthenelse{\number0#1 > \number0#2}% + {"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% \pgfmathresult } \newcommand*{\dtlifnumopenbetween}[5]{% \def\@dtl@truepart{#4}% \def\@dtl@falsepart{#5}% - \pgfmathifthenelse{(0#2 < 0#1) && (0#1 < 0#3)} + \pgfmathifthenelse + {(\number0#2 < \number0#1) && (\number0#1 < \number0#3)}% {"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% \pgfmathresult } \newcommand*{\dtlifnumclosedbetween}[5]{% \def\@dtl@truepart{#4}% \def\@dtl@falsepart{#5}% - \pgfmathifthenelse{(0#2 <= #1) && (0#1 <= 0#3)} + \pgfmathifthenelse + {(\number0#2 <= \number0#1) && (\number0#1 <= \number0#3)} {"\noexpand\@dtl@truepart"}{"\noexpand\@dtl@falsepart"}% \pgfmathresult } @@ -98,16 +103,58 @@ \let#1\pgfmathresult } \newcommand*{\dtlround}[3]{% - \pgfmathparse{10^#3}% - \let\dtl@tmpshift\pgfmathresult - \pgfmathparse{round(#2 * \dtl@tmpshift) / \dtl@tmpshift}% - \let#1\pgfmathresult + \ifnum#3=0\relax + \pgfmathparse{int(round(#2))}% + \let#1\pgfmathresult + \else + \pgfmathparse{int(10^#3)}% + \let\dtl@tmpshift\pgfmathresult + \pgfmathparse{int(floor(#2))}% + \let\dtl@int@round\pgfmathresult + \pgfmathparse{int(round((#2-\dtl@int@round) * \dtl@tmpshift))}% + \@dtl@tmpcount=0\relax + \expandafter\@dtl@countdigits\pgfmathresult.\relax + \advance\@dtl@tmpcount by -#3\relax + \def\@dtl@intpart{}% + \def\@dtl@fracpart{}% + \expandafter\@dtl@gatherintfrac\pgfmathresult\relax + \edef\@dtl@intpart{\number\numexpr\dtl@int@round + +\number0\@dtl@intpart}% + \edef#1{\@dtl@intpart.\@dtl@fracpart}% + \fi +} +\newcommand*{\@dtl@gatherintfrac}[1]{% + \ifx\relax#1\relax + \else + \advance\@dtl@tmpcount by -1\relax + \ifnum\@dtl@tmpcount<0\relax + \edef\@dtl@fracpart{\@dtl@fracpart#1}% + \else + \edef\@dtl@intpart{\@dtl@intpart#1}% + \fi + \expandafter\@dtl@gatherintfrac + \fi } \newcommand*{\dtltrunc}[3]{% - \pgfmathparse{10^#3}% - \let\dtl@tmpshift\pgfmathresult - \pgfmathparse{floor(#2 * \dtl@tmpshift) / \dtl@tmpshift}% - \let#1\pgfmathresult + \ifnum#3=0\relax + \pgfmathparse{int(floor(#2))}% + \let#1\pgfmathresult + \else + \pgfmathparse{int(10^#3)}% + \let\dtl@tmpshift\pgfmathresult + \pgfmathparse{int(floor(#2))}% + \let\dtl@int@trunc\pgfmathresult + \pgfmathparse{int(floor((#2-\dtl@int@trunc) * \dtl@tmpshift))}% + \@dtl@tmpcount=0\relax + \expandafter\@dtl@countdigits\pgfmathresult.\relax + \advance\@dtl@tmpcount by -#3\relax + \def\@dtl@intpart{}% + \def\@dtl@fracpart{}% + \expandafter\@dtl@gatherintfrac\pgfmathresult\relax + \edef\@dtl@intpart{\number\numexpr\dtl@int@trunc + +\number0\@dtl@intpart}% + \edef#1{\@dtl@intpart.\@dtl@fracpart}% + \fi } \newcommand*{\dtlclip}[2]{% \edef#1{#2}% diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty index cd0535b89c2..19c0d34e553 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool}[2016/07/20 v2.26 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{ifthen} \RequirePackage{xfor} diff --git a/Master/texmf-dist/tex/latex/datatool/person.sty b/Master/texmf-dist/tex/latex/datatool/person.sty index 8159762b6c3..95605050413 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}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{person}[2016/07/20 v2.26 (NLCT)] \RequirePackage{ifthen} \RequirePackage{datatool} \newcounter{people} |