From 69ab11c38621bcb590b419847c10a89eaff7b281 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 18 Feb 2008 00:22:40 +0000 Subject: numprint 1.38 (17feb08) git-svn-id: svn://tug.org/texlive/trunk@6668 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/numprint/ChangeLog.numprint | 13 ++- Master/texmf-dist/doc/latex/numprint/README | 4 +- Master/texmf-dist/doc/latex/numprint/numprint.pdf | Bin 927897 -> 778272 bytes Master/texmf-dist/doc/latex/numprint/numprint.xml | 4 +- .../texmf-dist/source/latex/numprint/numprint.dtx | 87 +++++++++++++-------- .../texmf-dist/source/latex/numprint/numprint.ins | 2 +- Master/texmf-dist/tex/latex/numprint/nbaseprt.sty | 2 +- Master/texmf-dist/tex/latex/numprint/numprint.sty | 45 +++++------ .../texmf-dist/tex/latex/numprint/numprint032.sty | 2 +- 9 files changed, 94 insertions(+), 65 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/numprint/ChangeLog.numprint b/Master/texmf-dist/doc/latex/numprint/ChangeLog.numprint index 87d90a45b22..1d43b3027a5 100644 --- a/Master/texmf-dist/doc/latex/numprint/ChangeLog.numprint +++ b/Master/texmf-dist/doc/latex/numprint/ChangeLog.numprint @@ -1,8 +1,15 @@ +2007/05/18 v1.38 Harald Harders (h.harders@tu-bs.de) + - Moved counters \nprt@curpos and \nprt@rndpos outside the macro + definitions to avoid an overflow of counters + - Replaced \stepcounter and \addtocounter by \advance because + otherwhise, \numprint does not work inside + \ensuremath{\text{$...$}}. + 2007/01/08 v1.37 Harald Harders (h.harders@tu-bs.de) - - Add an own separator for degree centigrade - - Use separator for percent also for permil + - Add an own separator for degree centigrade. + - Use separator for percent also for permil. - Change thousand separator for Portuguese from "\," to ".". - - Add support for French + - Add support for French. 2005/07/12 v1.36 Harald Harders (h.harders@tu-bs.de) - Add support for Dutch. diff --git a/Master/texmf-dist/doc/latex/numprint/README b/Master/texmf-dist/doc/latex/numprint/README index f267d2d5d19..20669af7654 100644 --- a/Master/texmf-dist/doc/latex/numprint/README +++ b/Master/texmf-dist/doc/latex/numprint/README @@ -34,7 +34,7 @@ improved and if the abbreviations for the different number bases are correct. -Copyright 2000--2005, 2007 Harald Harders +Copyright 2000--2005, 2007, 2008 Harald Harders This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN @@ -72,6 +72,6 @@ by hand: - execute latex on numprint.ins again -2007/01/08 +2008/02/17 Harald Harders h.harders@tu-bs.de diff --git a/Master/texmf-dist/doc/latex/numprint/numprint.pdf b/Master/texmf-dist/doc/latex/numprint/numprint.pdf index 6f46a4f9b5f..b98a9266123 100644 Binary files a/Master/texmf-dist/doc/latex/numprint/numprint.pdf and b/Master/texmf-dist/doc/latex/numprint/numprint.pdf differ diff --git a/Master/texmf-dist/doc/latex/numprint/numprint.xml b/Master/texmf-dist/doc/latex/numprint/numprint.xml index 1ed4dd9f8ea..6aa3eca9d79 100644 --- a/Master/texmf-dist/doc/latex/numprint/numprint.xml +++ b/Master/texmf-dist/doc/latex/numprint/numprint.xml @@ -1,7 +1,7 @@ numprint @@ -12,7 +12,7 @@ - 1.36 + 1.38 diff --git a/Master/texmf-dist/source/latex/numprint/numprint.dtx b/Master/texmf-dist/source/latex/numprint/numprint.dtx index cc9fa5b29ef..4d387ecf7d1 100644 --- a/Master/texmf-dist/source/latex/numprint/numprint.dtx +++ b/Master/texmf-dist/source/latex/numprint/numprint.dtx @@ -1,5 +1,5 @@ % \iffalse meta comment -% File: numprint.dtx Copyright (C) 2000--2005, 2007 Harald Harders +% File: numprint.dtx Copyright (C) 2000--2005, 2007, 2008 Harald Harders % \fi % % \iffalse @@ -72,13 +72,20 @@ \DoNotIndex{\string} \CodelineNumbered \RecordChanges -\CheckSum{2220} +\CheckSum{2257} \begin{document} \DocInput{numprint.dtx} \end{document} % % \fi % +% \changes{1.38}{2008/02/17}{Replaced \cs{stepcounter} and +% \cs{addtocounter} by \cs{advance} +% because otherwhise, \cs{numprint} does not work inside +% \cs{ensuremath}\{\cs{text}\{\$\ldots\$\}\}.}% +% \changes{1.38}{2008/02/17}{Moved counters \cs{nprt@curpos} and +% \cs{nprt@rndpos} outside the macro definitions to avoid an overflow +% of counters}% % \changes{1.37}{2007/01/08}{Add support for French}% % \changes{1.37}{2007/01/08}{Add an own separator for \textcelsius}% % \changes{1.37}{2007/01/08}{Use separator for percent also for permil}% @@ -133,7 +140,7 @@ % \tableofcontents % % \section*{Copyright} -% Copyright 2000--2005, 2007 Harald Harders. +% Copyright 2000--2005, 2007, 2008 Harald Harders. % % This program can be redistributed and/or modified under the terms % of the LaTeX Project Public License Distributed from CTAN @@ -1535,7 +1542,7 @@ % npdecimalsign& Change the decimal sign.\\ % npthousandsep& Change the thousand separator (before and after the % decimal sign).\\ -% npthousandspartsep& Change the thousand separator (only after the +% npthousandthpartsep& Change the thousand separator (only after the % decimal sign).\\ % npproductsign& Change the product sign.\\ % npunitseparator& Change the separator between a number and a @@ -1605,11 +1612,9 @@ % % \begin{itemize} % \item -% Tilman Finke, tfinke@it-and-law.de, had the idea of rounding -% numbers. +% Tilman Finke, had the idea of rounding numbers. % \item -% Stephan Helma, s.p.helma@gmx.net, has implemented padding -% numbers on the left side. +% Stephan Helma has implemented padding numbers on the left side. % This function has been slightly changed by me. % \item % Portuguese support by Vilar Camara Neto and Luis. @@ -1617,6 +1622,9 @@ % Dutch support by Ralph Hendriks. % \item % French support by Daniel Flipo. +% \item +% Ignacio Fern\'andez Galv\'an has reported a couple of bugs and +% suggestions (which parly still have to be implemented\ldots) % \end{itemize} % % \begin{thebibliography}{1} @@ -1644,7 +1652,7 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{numprint} - [2007/01/08 v1.37 Print numbers (HH)] + [2008/02/17 v1.38 Print numbers (HH)] % \end{macrocode} % % \subsection{Load packages} @@ -2331,7 +2339,7 @@ % \begin{macrocode} \csname ifnprt@#1@decimalfound\endcsname \expandafter\g@addto@macro\csname nprt@#1@after\endcsname{#2}% - \stepcounter{nprt@#1@digitsafter}% + \advance\csname c@nprt@#1@digitsafter\endcsname by 1\relax \else % \end{macrocode} % If the decimal sign has not been found before, this digit is in the @@ -2339,7 +2347,7 @@ % Then, add it at the end of the before-decimal-sign part. % \begin{macrocode} \expandafter\g@addto@macro\csname nprt@#1@before\endcsname{#2}% - \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \fi }% % \end{macrocode} @@ -2571,7 +2579,7 @@ % Calculate how many separators are put into the number. % \begin{macrocode} \setcounter{nprt@blockcnt}{\csname nprt@#1@fixeddigits@#2\endcsname}% - \addtocounter{nprt@blockcnt}{-1}% + \advance\c@nprt@blockcnt by -1\relax \divide\c@nprt@blockcnt 3% % \end{macrocode} % If four-digit length numbers are not separated, delete the number of @@ -3072,12 +3080,13 @@ % \end{macrocode} % The column type \verb|n| aligns the base number but not the exponent. % \begin{macrocode} - \newcolumntype{n}[2]{>{\npdigits{#1}{#2}$}l<{$}} + \newcolumntype{n}[2]{>{\npdigits{#1}{#2}$}l<{$}} % \end{macrocode} % The column type \verb|N| aligns the base number as well as the exponent. % \begin{macrocode} - \newcolumntype{N}[3]{% - >{\npdigits{#1}{#2}\npexponentdigits{#3}$}l<{$}} + \newcolumntype{N}[3]{% + >{\npdigits{#1}{#2}\npexponentdigits{#3}$}l<{$}% + } % \end{macrocode} % End of column type section. % \begin{macrocode} @@ -3236,7 +3245,8 @@ % \begin{macrocode} \ifx\nprt@argone\@empty \xdef\nprt@newnum{\the\nprt@thisdigit}% - \stepcounter{nprt@\nprt@numname @digitsbefore}% +% \stepcounter{nprt@\nprt@numname @digitsbefore}% + \advance\csname c@nprt@\nprt@numname @digitsbefore\endcsname 1\relax \else % \end{macrocode} % Insert the current digit before the already stored digits in @@ -3248,6 +3258,12 @@ } % \end{macrocode} % \end{macro} +% Two new counters for the round position and the current postion in +% \cs{nprt@round@after}. +% \begin{macrocode} +\newcount\nprt@curpos +\newcount\nprt@rndpos +% \end{macrocode} % \begin{macro}{\nprt@round} % Round a number. % The first argument is the Number type (``mantissa'' resp.\ @@ -3284,12 +3300,6 @@ \expandafter\g@addto@macro\csname nprt@#1@after\endcsname{% \nprt@roundnull}% % \end{macrocode} -% Two new counters for the round position and the current postion in -% \cs{nprt@round@after}. -% \begin{macrocode} - \newcount\nprt@curpos - \newcount\nprt@rndpos -% \end{macrocode} % Set the number of digits after the decimal sign. % \begin{macrocode} \nprt@rndpos=#2 @@ -3337,7 +3347,8 @@ % \begin{macrocode} \ifnprt@roundup \expandafter\xdef\expandafter\nprt@newnum{1\nprt@newnum}% - \stepcounter{nprt@#1@digitsbefore}% +% \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \fi % \end{macrocode} % Copy the new number before the decimal sign to the ``official'' @@ -3391,7 +3402,8 @@ \ifnum\csname thenprt@#1@digitsbefore\endcsname<#2 \expandafter\xdef\csname nprt@#1@before\endcsname{% #3\csname nprt@#1@before\endcsname}% - \stepcounter{nprt@#1@digitsbefore}% +% \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \nprt@lpad{#1}{#2}{#3}% \fi \fi @@ -3488,7 +3500,8 @@ \ifnprt@addmissingzero \ifnum\csname thenprt@#1@digitsbefore\endcsname=0 \expandafter\edef\csname nprt@#1@before\endcsname{0}% - \stepcounter{nprt@#1@digitsbefore}% +% \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \fi \fi % \end{macrocode} @@ -3529,7 +3542,7 @@ % ganze Bloecke \setcounter{nprt@blockcnt}{% \csname thenprt@#1@digitsbefore\endcsname}% - \addtocounter{nprt@blockcnt}{-1}% + \advance\c@nprt@blockcnt by -1\relax \divide\c@nprt@blockcnt 3% % \end{macrocode} % Then, calculate how many digits are in the first block (one, two, or @@ -3540,7 +3553,7 @@ \csname thenprt@#1@digitsbefore\endcsname}% \setcounter{nprt@cntprint}{\thenprt@blockcnt}% \multiply \c@nprt@cntprint 3% - \addtocounter{nprt@digitsfirstblock}{-\thenprt@cntprint}% + \advance\c@nprt@digitsfirstblock by -\thenprt@cntprint\relax % \end{macrocode} % Depending on that number, call \cs{nprt@printone}, % \cs{nprt@printtwo}, resp.\ \cs{nprt@printthree} which do what you @@ -3572,10 +3585,16 @@ % If the command has not reached the end of the string, print a % separator \cs{nprt@separator@before} and call this routine % recursively. +% Surprisingly, this routine does not work if |#1#2#3| is the first +% command in some cases. +% Thus, \cs{def}cs{nprt@tmp} has been moved in front of it. +% Make sure that this works in all cases. +% Same applies for \cs{nprt@printtwo}, \cs{nprt@printone}, and +% \cs{nprt@printthreeafter}. % \begin{macrocode} \def\nprt@printthree#1#2#3#4\@empty{% - #1#2#3% \def\nprt@tmp{#4}% + #1#2#3% \ifx\nprt@tmp\empty \else \nprt@separator@before% @@ -3588,8 +3607,8 @@ % The same but start with two instead of three digits. % \begin{macrocode} \def\nprt@printtwo#1#2#3\@empty{% - #1#2% \def\nprt@tmp{#3}% + #1#2% \ifx\nprt@tmp\empty \else \nprt@separator@before% @@ -3602,8 +3621,8 @@ % The same but start with one instead of three digits. % \begin{macrocode} \def\nprt@printone#1#2\@empty{% - #1% \def\nprt@tmp{#2}% + #1% \ifx\nprt@tmp\empty \else \nprt@separator@before% @@ -3628,7 +3647,8 @@ \ifnprt@addmissingzero \ifnum\csname thenprt@#1@digitsafter\endcsname=0 \expandafter\edef\csname nprt@#1@after\endcsname{0}% - \stepcounter{nprt@#1@digitsafter}% +% \stepcounter{nprt@#1@digitsafter}% + \advance\csname c@nprt@#1@digitsafter\endcsname by 1\relax \fi \fi % \end{macrocode} @@ -3641,7 +3661,8 @@ \else \ifnum\csname thenprt@#1@digitsafter\endcsname=0 \expandafter\edef\csname nprt@#1@after\endcsname{0}% - \stepcounter{nprt@#1@digitsafter}% +% \stepcounter{nprt@#1@digitsafter}% + \advance\csname c@nprt@#1@digitsafter\endcsname by 1\relax \fi \fi \fi @@ -3700,8 +3721,8 @@ % The same as \cs{nprt@printthree} but with another separator. % \begin{macrocode} \def\nprt@printthree@after#1#2#3#4\@empty{% - #1#2#3% \def\nprt@tmp{#4}% + #1#2#3% \ifx\nprt@tmp\empty \else \nprt@separator@after diff --git a/Master/texmf-dist/source/latex/numprint/numprint.ins b/Master/texmf-dist/source/latex/numprint/numprint.ins index 23922ff36e7..aa28afd8f1a 100644 --- a/Master/texmf-dist/source/latex/numprint/numprint.ins +++ b/Master/texmf-dist/source/latex/numprint/numprint.ins @@ -3,7 +3,7 @@ numprint package - Copyright 2000--2005, 2007 Harald Harders + Copyright 2000--2005, 2007, 2008 Harald Harders This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN diff --git a/Master/texmf-dist/tex/latex/numprint/nbaseprt.sty b/Master/texmf-dist/tex/latex/numprint/nbaseprt.sty index 69477f2dcdb..62e9194cb38 100644 --- a/Master/texmf-dist/tex/latex/numprint/nbaseprt.sty +++ b/Master/texmf-dist/tex/latex/numprint/nbaseprt.sty @@ -8,7 +8,7 @@ %% %% numprint package %% -%% Copyright 2000--2005, 2007 Harald Harders +%% Copyright 2000--2005, 2007, 2008 Harald Harders %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN diff --git a/Master/texmf-dist/tex/latex/numprint/numprint.sty b/Master/texmf-dist/tex/latex/numprint/numprint.sty index e80c0a74b50..6cafa201ece 100644 --- a/Master/texmf-dist/tex/latex/numprint/numprint.sty +++ b/Master/texmf-dist/tex/latex/numprint/numprint.sty @@ -8,7 +8,7 @@ %% %% numprint package %% -%% Copyright 2000--2005, 2007 Harald Harders +%% Copyright 2000--2005, 2007, 2008 Harald Harders %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN @@ -19,7 +19,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{numprint} - [2007/01/08 v1.37 Print numbers (HH)] + [2008/02/17 v1.38 Print numbers (HH)] \RequirePackage{array} \newif\ifnprt@numsepfour \newif\ifnprt@errormessage @@ -230,10 +230,10 @@ }{% \csname ifnprt@#1@decimalfound\endcsname \expandafter\g@addto@macro\csname nprt@#1@after\endcsname{#2}% - \stepcounter{nprt@#1@digitsafter}% + \advance\csname c@nprt@#1@digitsafter\endcsname by 1\relax \else \expandafter\g@addto@macro\csname nprt@#1@before\endcsname{#2}% - \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \fi }% \ifx\nprt@argthree\@empty @@ -332,7 +332,7 @@ \setlength{\nprt@blockwidth}{% \csname nprt@#1@fixeddigits@#2\endcsname\nprt@digitwidth}% \setcounter{nprt@blockcnt}{\csname nprt@#1@fixeddigits@#2\endcsname}% - \addtocounter{nprt@blockcnt}{-1}% + \advance\c@nprt@blockcnt by -1\relax \divide\c@nprt@blockcnt 3% \ifnprt@numsepfour \else @@ -509,9 +509,10 @@ \NC@find } \else - \newcolumntype{n}[2]{>{\npdigits{#1}{#2}$}l<{$}} - \newcolumntype{N}[3]{% - >{\npdigits{#1}{#2}\npexponentdigits{#3}$}l<{$}} + \newcolumntype{n}[2]{>{\npdigits{#1}{#2}$}l<{$}} + \newcolumntype{N}[3]{% + >{\npdigits{#1}{#2}\npexponentdigits{#3}$}l<{$}% + } \fi \newif\ifnprt@roundup \newcount\nprt@thisdigit @@ -565,12 +566,14 @@ \fi \ifx\nprt@argone\@empty \xdef\nprt@newnum{\the\nprt@thisdigit}% - \stepcounter{nprt@\nprt@numname @digitsbefore}% + \advance\csname c@nprt@\nprt@numname @digitsbefore\endcsname 1\relax \else \expandafter\xdef\expandafter\nprt@newnum{% \the\nprt@thisdigit\nprt@newnum}% \fi } +\newcount\nprt@curpos +\newcount\nprt@rndpos \newcommand*\nprt@round[2]{% \begingroup \edef\nprt@numname{#1}% @@ -580,8 +583,6 @@ \setcounter{nprt@#1@digitsafter}{#2}% \expandafter\g@addto@macro\csname nprt@#1@after\endcsname{% \nprt@roundnull}% - \newcount\nprt@curpos - \newcount\nprt@rndpos \nprt@rndpos=#2 \nprt@roundupfalse \edef\nprt@tmpnum{\csname nprt@#1@after\endcsname}% @@ -594,7 +595,7 @@ \expandafter\nprt@round@before\nprt@tmpnum\@empty\@empty \ifnprt@roundup \expandafter\xdef\expandafter\nprt@newnum{1\nprt@newnum}% - \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \fi \expandafter\xdef\csname nprt@#1@before\endcsname{\nprt@newnum}% \fi @@ -616,7 +617,7 @@ \ifnum\csname thenprt@#1@digitsbefore\endcsname<#2 \expandafter\xdef\csname nprt@#1@before\endcsname{% #3\csname nprt@#1@before\endcsname}% - \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \nprt@lpad{#1}{#2}{#3}% \fi \fi @@ -650,7 +651,7 @@ \ifnprt@addmissingzero \ifnum\csname thenprt@#1@digitsbefore\endcsname=0 \expandafter\edef\csname nprt@#1@before\endcsname{0}% - \stepcounter{nprt@#1@digitsbefore}% + \advance\csname c@nprt@#1@digitsbefore\endcsname by 1\relax \fi \fi \begingroup @@ -669,13 +670,13 @@ % ganze Bloecke \setcounter{nprt@blockcnt}{% \csname thenprt@#1@digitsbefore\endcsname}% - \addtocounter{nprt@blockcnt}{-1}% + \advance\c@nprt@blockcnt by -1\relax \divide\c@nprt@blockcnt 3% \setcounter{nprt@digitsfirstblock}{% \csname thenprt@#1@digitsbefore\endcsname}% \setcounter{nprt@cntprint}{\thenprt@blockcnt}% \multiply \c@nprt@cntprint 3% - \addtocounter{nprt@digitsfirstblock}{-\thenprt@cntprint}% + \advance\c@nprt@digitsfirstblock by -\thenprt@cntprint\relax \ifnum\thenprt@digitsfirstblock=1 \expandafter\nprt@printone\nprt@numbertoprint\@empty \else @@ -696,8 +697,8 @@ \endgroup } \def\nprt@printthree#1#2#3#4\@empty{% - #1#2#3% \def\nprt@tmp{#4}% + #1#2#3% \ifx\nprt@tmp\empty \else \nprt@separator@before% @@ -705,8 +706,8 @@ \fi } \def\nprt@printtwo#1#2#3\@empty{% - #1#2% \def\nprt@tmp{#3}% + #1#2% \ifx\nprt@tmp\empty \else \nprt@separator@before% @@ -714,8 +715,8 @@ \fi } \def\nprt@printone#1#2\@empty{% - #1% \def\nprt@tmp{#2}% + #1% \ifx\nprt@tmp\empty \else \nprt@separator@before% @@ -727,14 +728,14 @@ \ifnprt@addmissingzero \ifnum\csname thenprt@#1@digitsafter\endcsname=0 \expandafter\edef\csname nprt@#1@after\endcsname{0}% - \stepcounter{nprt@#1@digitsafter}% + \advance\csname c@nprt@#1@digitsafter\endcsname by 1\relax \fi \fi \ifx\nprt@replacenull\@empty \else \ifnum\csname thenprt@#1@digitsafter\endcsname=0 \expandafter\edef\csname nprt@#1@after\endcsname{0}% - \stepcounter{nprt@#1@digitsafter}% + \advance\csname c@nprt@#1@digitsafter\endcsname by 1\relax \fi \fi \fi @@ -767,8 +768,8 @@ \endgroup } \def\nprt@printthree@after#1#2#3#4\@empty{% - #1#2#3% \def\nprt@tmp{#4}% + #1#2#3% \ifx\nprt@tmp\empty \else \nprt@separator@after diff --git a/Master/texmf-dist/tex/latex/numprint/numprint032.sty b/Master/texmf-dist/tex/latex/numprint/numprint032.sty index 64965191243..f9653be0ff2 100644 --- a/Master/texmf-dist/tex/latex/numprint/numprint032.sty +++ b/Master/texmf-dist/tex/latex/numprint/numprint032.sty @@ -8,7 +8,7 @@ %% %% numprint package %% -%% Copyright 2000--2005, 2007 Harald Harders +%% Copyright 2000--2005, 2007, 2008 Harald Harders %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN -- cgit v1.2.3