diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-22 23:08:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-22 23:08:41 +0000 |
commit | e3d1f837f5d50080c27e5f7880de2b7fb2c78ccb (patch) | |
tree | e3c6a18be60e5ecb7835d663096f8fd9970a8ca8 /Master/texmf-dist/source/latex/numprint/numprint.dtx | |
parent | 85f0c4bd18d5bdef009d8e78594cabf23d1df597 (diff) |
numprint (22aug12)
git-svn-id: svn://tug.org/texlive/trunk@27498 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/numprint/numprint.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/numprint/numprint.dtx | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/numprint/numprint.dtx b/Master/texmf-dist/source/latex/numprint/numprint.dtx index 4d387ecf7d1..c9ee3ea2485 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, 2008 Harald Harders +% File: numprint.dtx Copyright (C) 2000--2005, 2007, 2008, 2012 Harald Harders % \fi % % \iffalse @@ -42,7 +42,7 @@ } \GetFileInfo{numprint.sty} \title{The numprint package} -\author{Harald Harders\\\texttt{h.harders@tu-bs.de}} +\author{Harald Harders\\\texttt{harald.harders@gmx.de}} \date{Version \fileversion, \filedate; printed \today} \npdecimalsign{.}% \newlength{\tempdima}% @@ -140,7 +140,7 @@ % \tableofcontents % % \section*{Copyright} -% Copyright 2000--2005, 2007, 2008 Harald Harders. +% Copyright 2000--2005, 2007, 2008, 2012 Harald Harders. % % This program can be redistributed and/or modified under the terms % of the LaTeX Project Public License Distributed from CTAN @@ -1380,8 +1380,8 @@ % Since the sign might be arbitrary characters, you should define the % command as follows: % \begin{verbatim} -%\expandafter\newcommand\csname nprt@sign@*\endcsname{\ensuremath{*}}\end{verbatim} -% {\makeatletter\expandafter\def\csname nprt@sign@*\endcsname{\ensuremath{*}}% +%\expandafter\newcommand\csname nprt@sign@*\endcsname{{\ensuremath{*}}}\end{verbatim} +% {\makeatletter\expandafter\def\csname nprt@sign@*\endcsname{{\ensuremath{*}}}% % \def\nprt@signlist{+-\pm *}\makeatother % With this command, \cs{numprint\{*1234\}} occurs as % ``\numprint{*1234}'' in text mode and as ``$\numprint{*1234}$'' in @@ -1409,17 +1409,17 @@ % user signs, described in section~\ref{sec:custom-parsing}. % They are defined as follows: % \begin{verbatim} -%\expandafter\newcommand\csname nprt@sign@+\endcsname{\ensuremath{+}} -%\expandafter\newcommand\csname nprt@sign@-\endcsname{\ensuremath{-}} -%\expandafter\newcommand\csname nprt@sign@+-\endcsname{\ensuremath{\pm}}\end{verbatim} +%\expandafter\newcommand\csname nprt@sign@+\endcsname{{\ensuremath{+}}} +%\expandafter\newcommand\csname nprt@sign@-\endcsname{{\ensuremath{-}}} +%\expandafter\newcommand\csname nprt@sign@+-\endcsname{{\ensuremath{\pm}}}\end{verbatim} % If you, for instance, don't want to use the math minus for numbers % in text mode but another character, you may redefine % \cs{nprt@sign@-}: % \begin{verbatim} %\expandafter\renewcommand\csname nprt@sign@-\endcsname{% -% \ifmmode -\else ---\fi}\end{verbatim} +% \ifmmode {-}\else {---}\fi}\end{verbatim} %{\makeatletter\expandafter\def\csname nprt@sign@-\endcsname -% {\ifmmode -\else---\fi}\makeatother +% {\ifmmode {-}\else {---}\fi}\makeatother % With this definition, \cs{numprint\{-1234\}} leads to % ``\numprint{-1234}'' resp.\ ``$\numprint{-1234}$'' in text resp.\ % math mode.} @@ -1435,16 +1435,16 @@ %\usepackage{color} %\makeatletter %\expandafter\renewcommand\csname nprt@sign@-\endcsname{% -% \color{red}\ensuremath{-}} +% \color{red}{\ensuremath{-}}} %\makeatother\end{verbatim} % With this definition, % \begin{verbatim} %\numprint{1234}, \numprint{-1234}, %\numprint{1234e-123}, \numprint{-1234e123}.\end{verbatim} % {\makeatletter\expandafter\def\csname nprt@sign@-\endcsname -% {\color{red}\ensuremath{-}}\makeatother +% {\color{red}{\ensuremath{-}}}\makeatother % leads to ``\numprint{1234}, \numprint{-1234}, \numprint{1234e-123}, -% \numprint{-1234e123}.''}\footnote{Wheather you can see the effect in +% \numprint{-1234e123}.''}\footnote{Whether you can see the effect in % the output depends on the viewer; in PostScript and PDF the red % color works, in many dvi viewers, it doesn't.} % To avoid a negative exponent beeing printed in red for a positive @@ -1652,7 +1652,7 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{numprint} - [2008/02/17 v1.38 Print numbers (HH)] + [2012/08/20 v1.39 Print numbers (HH)] % \end{macrocode} % % \subsection{Load packages} @@ -2161,7 +2161,7 @@ % \end{macrocode} % \begin{macro}{\nprt@testsign} % Define \cs{nprt@testsign\marg{Number type}\marg{Number}} which tests -% wheather a sign is given and then starts \cs{nprt@testnumber} (the +% whether a sign is given and then starts \cs{nprt@testnumber} (the % call actually is done by \cs{nprt@@testsign}). % \begin{macrocode} \newcommand*\nprt@testsign[2]{% @@ -2211,7 +2211,7 @@ \setcounter{nprt@#1@digitsbefore}{0}% \setcounter{nprt@#1@digitsafter}{0}% % \end{macrocode} -% Test wheather the first character of the number, |#2|, contains a +% Test whether the first character of the number, |#2|, contains a % sign symbol which is listed in \cs{nprt@signlist}. % \begin{macrocode} \nprt@IfCharInString{#2}{\nprt@signlist}{% @@ -2309,7 +2309,7 @@ \edef\nprt@commandname{#1}% \edef\nprt@argthree{#3}% % \end{macrocode} -% Test wheather the current character is a valid character for a real +% Test whether the current character is a valid character for a real % number (say a digit or a decimal sign). % \begin{macrocode} \nprt@IfCharInString{#2}{\nprt@numberlist\nprt@dotlist}{% @@ -2384,14 +2384,14 @@ % \begin{macrocode} \edef\nprt@argtwo{#2}% % \end{macrocode} -% Test wheather the current character is a valid one. +% Test whether the current character is a valid one. % \begin{macrocode} \nprt@IfCharInString{#1}{% \nprt@numberlist\nprt@dotlist\nprt@explist\nprt@signlist\nprt@ignorelist}{% % \end{macrocode} % Yes, it is valid. % -% Now, test wheather it is one of the ignored characters. +% Now, test whether it is one of the ignored characters. % \begin{macrocode} \nprt@IfCharInString{#1}{\nprt@ignorelist}{% \nprt@debug{Character `\noexpand#1' ignored}% @@ -2399,7 +2399,7 @@ % \end{macrocode} % Yes, it is valid. % -% Now, test wheather it is one of the characters that start the +% Now, test whether it is one of the characters that start the % exponent. % If yes, set \cs{ifnprt@expfound} to ``true''. % If in addition, this has been done before, you have used more than @@ -2416,7 +2416,7 @@ % \end{macrocode} % If the current character is not an exponent-starting character it % is either a part of the mantissa or the exponent, depending on -% wheather the exponent has been started before. +% whether the exponent has been started before. % Add the current character to the corresponding command that stores % the mantissa resp.\ the exponent. % \begin{macrocode} @@ -2797,7 +2797,7 @@ % \begin{macrocode} \ifx\nprt@end#1% % \end{macrocode} -% Test wheather it is the normal or the star version of the +% Test whether it is the normal or the star version of the % environment. % Is this really necessary? % \begin{macrocode} @@ -3204,7 +3204,7 @@ \edef\nprt@argtwo{#2}% % \end{macrocode} % Do the recursion until the end of the number. -% This routine does not have to decide wheather the number has to be +% This routine does not have to decide whether the number has to be % rounded since it knows that by \cs{ifnprt@roundup}, set by % \cs{nprt@round@after}. % \begin{macrocode} @@ -3420,10 +3420,12 @@ % Define commands for printing the signs in math mode. This ensures % that the printed signs really are signs and not hyphens. Compare % ``-'' to ``\ensuremath{-}''. +% \changes{1.39}{2012/08/20}{Move group around sign into the specific +% sign macros in order to allow colour again}% % \begin{macrocode} -\expandafter\newcommand\csname nprt@sign@+\endcsname{\ensuremath{+}} -\expandafter\newcommand\csname nprt@sign@-\endcsname{\ensuremath{-}} -\expandafter\newcommand\csname nprt@sign@+-\endcsname{\ensuremath{\pm}} +\expandafter\newcommand\csname nprt@sign@+\endcsname{{\ensuremath{+}}} +\expandafter\newcommand\csname nprt@sign@-\endcsname{{\ensuremath{-}}} +\expandafter\newcommand\csname nprt@sign@+-\endcsname{{\ensuremath{\pm}}} % \end{macrocode} % \end{macro} % \end{macro} @@ -3462,13 +3464,15 @@ % e.g., \cs{nprt@sign@+}, print it; if not, print the sign itself. % \changes{1.22}{2004/08/08}{Print sign in a group to avoid additional space % for an operator (for nbaseprt)}% +% \changes{1.39}{2012/08/20}{Move group around sign into the specific +% sign macros in order to allow colour again}% % \begin{macrocode} \@ifundefined{nprt@sign@\nprt@marg}{% \PackageWarning{numprint}{% Unknown sign `\nprt@marg'. Print as typed in}% \nprt@marg }{% - {\csname nprt@sign@\nprt@marg\endcsname}% + \csname nprt@sign@\nprt@marg\endcsname% }% \fi } @@ -3487,7 +3491,7 @@ % Print the number before the decimal sign. % The argument is the Number type (``mantissa'' or ``exponent''). % When this macro is called, everything is parsed already. -% Thus, it is known wheather a decimal sign has been found, which and +% Thus, it is known whether a decimal sign has been found, which and % how many digits are before resp.\ after the decimal sign etc. % \begin{macrocode} \newcommand*\nprt@printbefore[1]{% @@ -3675,7 +3679,7 @@ \ifx\nprt@numbertoprint\@empty \else % \end{macrocode} -% Find out wheather separators have to be inserted. +% Find out whether separators have to be inserted. % \begin{macrocode} \ifnprt@numsepfour \else @@ -3803,7 +3807,7 @@ the argument of \string\numprint}% \fi % \end{macrocode} -% Test wheather only valid characters have been used and devide the +% Test whether only valid characters have been used and devide the % argument in the mantissa and the exponent. % \begin{macrocode} \expandafter\nprt@testcharacter\nprt@marg\@empty\@empty @@ -3860,7 +3864,7 @@ % \begin{macrocode} \ifnprt@expfound % \end{macrocode} -% Test wheather an exponent character was given but no exponent. +% Test whether an exponent character was given but no exponent. % \begin{macrocode} \ifx\nprt@exponent\@empty \nprt@error{Empty exponent}{If you specify an exponent @@ -4184,7 +4188,7 @@ \else % \end{macrocode} % All units expect the degree symbol are separated from the number. -% Detect wheather the degree symbol is used. +% Detect whether the degree symbol is used. % % \changes{1.22}{2004/08/08}{Produce a warning rather than an error % when using \cs{textdegree} as unit}% |