From e8a6c5f6d758797dbff323e9d5e9012da75628d3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 21 Jul 2016 21:17:50 +0000 Subject: datatool (21jul16) git-svn-id: svn://tug.org/texlive/trunk@41744 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/datatool/datatool.dtx | 521 +++++++++++++++------ .../texmf-dist/source/latex/datatool/datatool.ins | 2 +- 2 files changed, 369 insertions(+), 154 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx index 9998682babb..54027354f9f 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.dtx +++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx @@ -3,7 +3,10 @@ % Command line args: % -macrocode "databib\.bst" % -codetitle "" +% -comment "databib\.bst" % -author "Nicola Talbot" +% -setambles "databib\.bst=>\nopreamble\nopostamble" +% -doc "datatool-manual.tex" % -src "datatool-base.sty\Z=>datatool-base.sty" % -src "datatool-fp.sty\Z=>datatool-fp.sty" % -src "datatool-pgfmath.sty\Z=>datatool-pgfmath.sty" @@ -15,11 +18,8 @@ % -src "dataplot.sty\Z=>dataplot.sty" % -src "person.sty\Z=>person.sty" % -src "databib.bst\Z=>databib.bst" -% -comment "databib\.bst" -% -setambles "databib\.bst=>\nopreamble\nopostamble" -% -doc "datatool-manual.tex" % datatool -% Created on 2016/1/18 9:48 +% Created on 2016/7/20 19:31 %\fi %\iffalse %<*package> @@ -66,7 +66,7 @@ datatool.dtx \doxitem{Counter}{counter}{counters} \doxitem{Option}{option}{package options} -\CheckSum{23461} +\CheckSum{23620} \RecordChanges \PageIndex @@ -79,11 +79,11 @@ datatool.dtx %\fi %\MakeShortVerb{"} % -%\title{Documented Code for datatool v2.25} +%\title{Documented Code for datatool v2.26} %\author{Nicola L. C. Talbot\\ %\url{http://www.dickimaw-books.com/}} % -%\date{2016-01-18} +%\date{2016-07-20} %\maketitle % %\pagenumbering{roman} @@ -98,6 +98,8 @@ datatool.dtx %\pagenumbering{arabic} % %\StopEventually{% +% \clearpage\phantomsection +% \addcontentsline{toc}{chapter}{Index}% % \PrintIndex % \clearpage\phantomsection % \addcontentsline{toc}{chapter}{History}\PrintChanges @@ -117,7 +119,7 @@ datatool.dtx % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool-base}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -563,19 +565,39 @@ datatool.dtx \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 +% \end{macrocode} +%\changes{2.26}{2016-07-20}{fixed bug (missing \cs{dtl@sortresult})} +% \begin{macrocode} + \expandafter#3\expandafter\dtl@sortresult\expandafter + {\dtl@srtelement}{#1}% +% \end{macrocode} +%\changes{2.26}{2016-07-20}{fixed bug (incorrect inequality sign)} +% \begin{macrocode} + \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}% @@ -592,15 +614,27 @@ datatool.dtx }% \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 @@ -725,8 +759,8 @@ datatool.dtx \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{% @@ -5761,7 +5795,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{fp} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool-fp}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -6050,7 +6084,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{pgfmath} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -6075,13 +6109,17 @@ datatool.dtx %\end{definition} % Does \meta{true part} if \meta{num1}=\meta{num2}, otherwise does % \meta{false part}. The numbers must use a full stop as the decimal -% character and no number group separator. +% character and no number group separator. The \verb|\number0| part +% allows an empty argument to be treated as zero. (\cs{number} +% required to prevent a zero prefix indicating an octal number.) %\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \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 } % \end{macrocode} @@ -6102,11 +6140,13 @@ datatool.dtx % \meta{false part}. The numbers must use a full stop as the decimal % character and no number group separator. %\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \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 } % \end{macrocode} @@ -6121,11 +6161,13 @@ datatool.dtx % \meta{false part}. The numbers must use a full stop as the decimal % character and no number group separator. %\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \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 } % \end{macrocode} @@ -6138,11 +6180,13 @@ datatool.dtx % Determines if \meta{min} $<$ \meta{num} $<$ \meta{max} where % all numerical arguments are in standard fixed point notation. %\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \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 } @@ -6156,11 +6200,13 @@ datatool.dtx % Determines if \meta{min} $\leq$ \meta{num} $\leq$ \meta{max} where % all numerical arguments are in standard fixed point notation. %\changes{2.12}{2012/10/06}{fixed bug causing premature expansion} +%\changes{2.26}{2016-07-20}{added \cs{number}} % \begin{macrocode} \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 } @@ -6220,12 +6266,56 @@ datatool.dtx % %\begin{macro}{\dtlround} % Rounds using PGF math engine. +%\changes{2.26}{2016-07-20}{fixed bug cause by rounding} % \begin{macrocode} \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 +% \end{macrocode} +%Need to be careful not to trigger the dimension too large error, +%so this is a bit convoluted. +% \begin{macrocode} + \pgfmathparse{int(floor(#2))}% + \let\dtl@int@round\pgfmathresult + \pgfmathparse{int(round((#2-\dtl@int@round) * \dtl@tmpshift))}% +% \end{macrocode} +%\changes{2.26}{2016-07-20}{fixed bug caused by rounding errors} +% This bit is awkward because simply dividing by multiples +% of 10 in pgfmath can cause rounding errors, so need to +% employ another method. +% \begin{macrocode} + \@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 +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@dtl@gatherintfrac} +%\changes{2.26}{2016-07-20}{new} +% \begin{macrocode} +\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 } % \end{macrocode} %\end{macro} @@ -6233,12 +6323,40 @@ datatool.dtx %\begin{macro}{\dtltrunc} % Truncates using PGF math engine. % (Third argument is the number of digits.) +%\changes{2.26}{2016-07-20}{new} +%This suffers from the same problems as \cs{dtlround}. Can +% cause dimension too large error or rounding errors. % \begin{macrocode} \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 +% \end{macrocode} +%Need to be careful not to trigger the dimension too large error, +%so this is a bit convoluted. +% \begin{macrocode} + \pgfmathparse{int(floor(#2))}% + \let\dtl@int@trunc\pgfmathresult + \pgfmathparse{int(floor((#2-\dtl@int@trunc) * \dtl@tmpshift))}% +% \end{macrocode} +%\changes{2.26}{2016-07-20}{fixed bug caused by rounding errors} +% This bit is awkward because simply dividing by multiples +% of 10 in pgfmath can cause rounding errors, so need to +% employ another method. +% \begin{macrocode} + \@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 } % \end{macrocode} %\end{macro} @@ -6307,7 +6425,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datatool}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -6318,7 +6436,7 @@ datatool.dtx \RequirePackage{etoolbox} % \end{macrocode} %\changes{2.0}{2009 February 27}{added etex as a required package} -%\changes{??}{??}{removed etex as a required package} +%\changes{2.23}{2015-07-11}{removed etex as a required package} % %\section{Package Options} %\begin{macro}{\@dtl@separator} @@ -13900,7 +14018,7 @@ datatool.dtx % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datagidx}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datagidx}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -19809,7 +19927,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databib}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{databib}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -22732,7 +22850,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{databar}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{databar}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -23282,23 +23400,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 @@ -24039,7 +24157,7 @@ already exists}{}}}} % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datapie}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{datapie}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Require \sty{xkeyval} package % \begin{macrocode} @@ -24401,6 +24519,7 @@ already exists}{}}}} % include \texttt{variable}\texttt{=}\meta{cmd}, where \meta{cmd} % is included in \meta{assign list}. The optional argument % \meta{conditions} is the same as that for \cs{DTLforeach}. +%\changes{2.26}{2016-07-20}{replaced fp commands} % \begin{macrocode} \newcommand*{\DTLpiechart}[4][\boolean{true}]{% \bgroup @@ -24420,7 +24539,7 @@ already exists}{}}}} \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}% }% % \end{macrocode} % Compute the angles @@ -24430,17 +24549,17 @@ already exists}{}}}} \@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 }% % \end{macrocode} % Compute the offsets for each cut away segment @@ -24477,7 +24596,7 @@ already exists}{}}}} % \end{macrocode} % Compute the end angle % \begin{macrocode} - \FPadd{\dtl@endangle}{\dtl@start}{\dtl@extent}% + \dtladd{\dtl@endangle}{\dtl@start}{\dtl@extent}% % \end{macrocode} % Compute the shift. % \begin{macrocode} @@ -24486,7 +24605,7 @@ already exists}{}}}} \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{% @@ -24496,14 +24615,16 @@ already exists}{}}}} % \end{macrocode} % Compute the mid way angle. % \begin{macrocode} - \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}% % \end{macrocode} % Draw the segment. % \begin{macrocode} \begin{scope}[shift={\@dtl@shift}]% - \dtl@truncatedecimal\dtl@start - \dtl@truncatedecimal\dtl@endangle +% \end{macrocode} +%\changes{2.26}{2016-07-20}{removed truncation (caused minor gap between +%first and last segments)} +% \begin{macrocode} \fill[color=\DTLgetpiesegmentcolor\@dtl@seg] (0,0) -- (\dtl@start:\DTLradius) arc (\dtl@start:\dtl@endangle:\DTLradius) -- cycle; @@ -24527,11 +24648,20 @@ already exists}{}}}} % \end{macrocode} % If the mid way angle is between 90 and 270, the text will look % upside-down, so adjust accordingly. +%\changes{2.26}{2016-07-20}{replaced \cs{ifthen}} % \begin{macrocode} - \ifthenelse{\(\dtl@midangle > 90 \and \dtl@midangle < 270\) - \TE@or \dtl@midangle < -90}% + \dtlifnumopenbetween{\dtl@midangle}{90}{270}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumlt{\dtl@midangle}{-90}% + {\let\@dtl@next\@firstoftwo}% + {\let\@dtl@next\@secondoftwo}% + }% + \@dtl@next {% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtlsub{\dtl@labelangle}{\dtl@midangle}{180}% \dtl@truncatedecimal\dtl@labelangle \edef\dtl@innernodeopt{anchor=east,rotate=\dtl@labelangle}% }% @@ -24552,10 +24682,18 @@ already exists}{}}}} % 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}% + \dtlifnumopenbetween{\dtl@midangle}{90}{270}% + {% + \let\@dtl@next\@firstoftwo + }% + {% + \dtlifnumlt{\dtl@midangle}{-90}% + {\let\@dtl@next\@firstoftwo}% + {\let\@dtl@next\@secondoftwo}% + }% + \@dtl@next {% - \FPsub{\dtl@labelangle}{\dtl@midangle}{180}% + \dtlsub{\dtl@labelangle}{\dtl@midangle}{180}% \dtl@truncatedecimal\dtl@labelangle \edef\dtl@outernodeopt{anchor=east,rotate=\dtl@labelangle}% }% @@ -24566,9 +24704,29 @@ already exists}{}}}} % 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}% +% \end{macrocode} +% If ($\theta>-45$ and $\theta < 45$) or $\theta=45$ or $\theta>315$ +% \begin{macrocode} + \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 {% % \end{macrocode} % East quadrant @@ -24576,8 +24734,20 @@ already exists}{}}}} \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 {% % \end{macrocode} % North quadrant @@ -24585,10 +24755,36 @@ already exists}{}}}} \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} +%If ($\theta>135$ and $\theta<225$) or $\theta=225$ or $\theta=-135$ +%or $\theta<-135$ +% \begin{macrocode} + \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 {% % \end{macrocode} % West quadrant @@ -24635,30 +24831,43 @@ already exists}{}}}} % \cs{dtl@angle@}\meta{n} (extent angle), % \cs{dtl@cut@angle@}\meta{n} (cut away angle) and % \cs{dtl@cut@len@}\meta{n} (cut away length). +%\changes{2.26}{2016-07-20}{replaced fp commands} % \begin{macrocode} \newcommand*{\dtl@computeangles}[2]{% -\FPifgt{\@dtl@start}{180}% -% if startangle > 180 - \let\dtl@old=\@dtl@start -% startangle = startangle - 360 - \FPsub{\@dtl@start}{\dtl@old}{360}% -\fi -\FPiflt{\@dtl@start}{-180}% -% if startangle < -180 + \dtlifnumgt{\@dtl@start}{180}% + {% +% \end{macrocode} +% if $\mathrm{startangle} > 180$ +% \begin{macrocode} + \let\dtl@old=\@dtl@start +% \end{macrocode} +% $\mathrm{startangle} := \mathrm{startangle} - 360$ +% \begin{macrocode} + \dtlsub{\@dtl@start}{\dtl@old}{360}% + }% + {}% + \dtlifnumlt{\@dtl@start}{-180}% + {% +% \end{macrocode} +% if $\mathrm{startangle} < -180$ +% \begin{macrocode} + \let\dtl@old=\@dtl@start +% \end{macrocode} +% $\mathrm{startangle} = \mathrm{startangle} + 360$ +% \begin{macrocode} + \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 -% startangle = startangle + 360 - \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}% } % \end{macrocode} %\end{macro} @@ -24667,25 +24876,30 @@ already exists}{}}}} %\begin{macro}{\@dtl@set@off} % \begin{macrocode} \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 + }% } % \end{macrocode} %\end{macro} % Set offset for individual segment: %\begin{macro}{\@@dtl@set@off} +%\changes{2.26}{2016-07-20}{replaced fp commands} % \begin{macrocode} \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}% } % \end{macrocode} %\end{macro} @@ -24697,36 +24911,37 @@ already exists}{}}}} %\end{macro} %\begin{macro}{\@@dtl@setoffr} % Set offset for a range of segments +%\changes{2.26}{2016-07-20}{replaced fp commands} % \begin{macrocode} \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 } % \end{macrocode} %\end{macro} @@ -24744,7 +24959,7 @@ Try #2-#1 instead of #1-#2}% % Declare package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{dataplot}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{dataplot}[2016/07/20 v2.26 (NLCT)] % \end{macrocode} % Required packages % \begin{macrocode} @@ -26366,7 +26581,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% % Package identification: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{person}[2016/01/18 v2.25 (NLCT)] +\ProvidesPackage{person}[2016/07/20 v2.26 (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 08b21f870ab..97634e61b8d 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 1.1 2016/1/18 9:48 +% datatool.ins generated using makedtx version 1.1 2016/7/20 19:31 \input docstrip \preamble -- cgit v1.2.3