From 0277c756d795fc55be462f09b8e64487686c4781 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 9 Jan 2007 01:33:27 +0000 Subject: numprint 1.37 (8jan07) git-svn-id: svn://tug.org/texlive/trunk@3258 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/numprint/numprint.dtx | 239 ++++++++++++++++++--- .../texmf-dist/source/latex/numprint/numprint.ins | 2 +- .../source/latex/numprint/numprint032.dtx | 2 +- 3 files changed, 206 insertions(+), 37 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/numprint/numprint.dtx b/Master/texmf-dist/source/latex/numprint/numprint.dtx index 0889a36fa92..cc9fa5b29ef 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 Harald Harders +% File: numprint.dtx Copyright (C) 2000--2005, 2007 Harald Harders % \fi % % \iffalse @@ -72,13 +72,18 @@ \DoNotIndex{\string} \CodelineNumbered \RecordChanges -\CheckSum{2116} +\CheckSum{2220} \begin{document} \DocInput{numprint.dtx} \end{document} % % \fi % +% \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}% +% \changes{1.36}{2005/07/12}{Add support for Dutch}% +% \changes{1.36}{2005/07/12}{Improve documentation}% % \changes{1.35}{2005/07/11}{Support not to separate percent sign from % number}% % \changes{1.30}{2004/08/11}{Add the commands \cs{lenprint} and @@ -128,7 +133,7 @@ % \tableofcontents % % \section*{Copyright} -% Copyright 2000--2005 Harald Harders. +% Copyright 2000--2005, 2007 Harald Harders. % % This program can be redistributed and/or modified under the terms % of the LaTeX Project Public License Distributed from CTAN @@ -264,6 +269,11 @@ % Unfortunately, typing in the ``\texttt{\textdegree}'' sign directly % cannot be detected (any help welcome). % +% You can change the spacing between the number and units, percent +% signs, or degree symbols. +% Have a look to Section~\ref{sec:changing-output}. +% +% % \changes{1.32}{2004/09/13}{Improve documentation about % \texttt{textcomp} symbols}% % If you want to use one of the |textcomp| symbols \textcelsius\ @@ -521,10 +531,10 @@ % \begin{verbatim} %\renewcommand*\npunitcommand[1]{\ensuremath{\color{blue}\mathrm{#1}}}\end{verbatim} % And here is the result: -% \begingroup -% \renewcommand*\npunitcommand[1]{\ensuremath{\color{blue}\mathrm{#1}}}% -% \numprint[N/mm^2]{300} -% \endgroup +%\begingroup +%\renewcommand*\npunitcommand[1]{\ensuremath{\color{blue}\mathrm{#1}}}% +%\numprint[N/mm^2]{300} +%\endgroup % % % \section{Add more units to \cs{lenprint}}% @@ -584,10 +594,26 @@ % % Using the package option |autolanguage| this can be fixed. % If you are using this option without the |babel| package the -% settings are switched to English at \cs{begin\{document\}}: -% thousand separator ``\texttt{,}'', decimal sign ``\texttt{.}'', -% product sign ``\cs{times}'', unit separator \cs{,}, and no degree -% separator, +% settings are switched to English at \cs{begin\{document\}}. +% See Table~\ref{tab:defaults}. +% +% \begin{table}% +% \centering +% \caption{Default values for language settings}% +% \label{tab:defaults}% +% \begin{tabular}{lllllll} +% \toprule +% language& thousand& decimal& product& unit& percent& degree \\ +% & sep.& sign& sign& sep.& sep.& sep. \\ +% \midrule +% English& \texttt{,}& \texttt{.}& \cs{times}& \cs{,}& \cs{,}& none \\ +% German& \cs{,}& \texttt{,}& \cs{cdot}& \cs{,}& \cs{,}& none \\ +% Portuguese& \texttt{.}& \texttt{,}& \cs{cdot}& \cs{,}& \cs{,}& none \\ +% Dutch& \cs{,}& \texttt{,}& \cs{cdot}& \cs{,}& none& none \\ +% French& \texttt{\texttildelow}& \texttt{,}& \cs{cdot}& \cs{,}& \cs{,}& none \\ +% \bottomrule +% \end{tabular}% +% \end{table} % % \DescribeMacro{\selectlanguage} % If you are using the |babel| package in conjunction with the @@ -600,16 +626,24 @@ % If you then switch back to English, the English settings are active % again. % -% The current version supports English, German, and Portuguese. +% The current version supports English, German, Portuguese, Dutch, and +% French. % Unfortunately, I don't really know how to write numbers in other % languages than German. -% I am quite sure that the English version also is correct. +% I am quite sure that the English version also is +% correct.\footnote{Maybe, the percent sign separator \cs{,} is not +% common, but I will leave its value unchanged to preserve +% compatibility with older versions.} % But please help me to add other languages. % +% If you want other settings than the default ones, listed in +% Table~\ref{tab:defaults}, please refer to +% Section~\ref{sec:advanced:international}. +% % As long as |numprint| does not support your language you may add the % definitions by yourself. -% How this can be done is described in -% section~\ref{sec:advanced:international}. +% How this can be done is also described in +% Section~\ref{sec:advanced:international}. % % % \section{Print aligned numbers in tabulars}% @@ -1056,6 +1090,7 @@ % \label{sec:advanced}% % % \subsection{Changing the output}% +% \label{sec:changing-output}% % % Most of the things described in this section are not necessary to be % done by hand because the feature ``automatic language support'', @@ -1146,9 +1181,16 @@ % You may specify a separator for that using % \cs{npdegreeseparator\marg{Separator}}. % +% \DescribeMacro{\npcelsiusseparator}% +% By default, the same space as for normal units is added between the +% number an \textcelsius. +% You may specify a different separator for that using +% \cs{npcelsiusseparator\marg{Separator}}. +% Note that \cs{tccentigrade} is not supported by |numprint|. +% % \DescribeMacro{\nppercentseparator}% % By default, the same space as for normal units is added between the -% number an a percent sign. +% number and a percent sign. % You may specify a different separator for that using % \cs{nppercentseparator\marg{Separator}}. % @@ -1177,6 +1219,7 @@ % \npproductsign{\times}% % \npunitseparator{\,}% % \npdegreeseparator{}% +% \npcelsiusseparator{\nprt@unitsep}% % \nppercentseparator{\nprt@unitsep}% %}\end{verbatim} % @@ -1195,6 +1238,7 @@ % \npproductsign{\times}% % \npunitseparator{\,}% % \npdegreeseparator{}% +% \npcelsiusseparator{\nprt@unitsep}% % \nppercentseparator{\nprt@unitsep}% %}\end{verbatim} % \item @@ -1242,6 +1286,7 @@ % \npproductsign{*}% % \npunitseparator{~}% % \npdegreeseparator{}% +% \npcelsiusseparator{\nprt@unitsep}% % \nppercentseparator{\nprt@unitsep}% %}\end{verbatim} % In addition, append the call of this command to the @@ -1444,8 +1489,8 @@ % \begin{longtable}[l]{% % @{}>{\ttfamily}p{0.30\linewidth}@{}p{0.70\linewidth}@{}} % warning& Produce warnings rather than error messages. \\ -% error\default& Produce warnings rather than error -% messages. \\[\medskipamount] +% error\default& Produce error messages rather than +% warnings. \\[\medskipamount] % autolanguage& Switch the settings language dependent.\\ % noautolanguage\default& Fixed settings.\\[\medskipamount] % sepfour\default& Separator for four-digit numbers.\\ @@ -1455,7 +1500,8 @@ % noaddmissingzero& Don't do that.\\[\medskipamount] % addplus& Add a plus to a number without a sign.\\ % noaddplus\default& Don't do that.\\[\medskipamount] -% addplusexponent& Add a plus to a number without a sign.\\ +% addplusexponent& Add a plus to a number without a sign in +% exponents.\\ % noaddplusexponent\default& Don't do that.\\[\medskipamount] % oldcolumntypes& Define the old column types that need to use the % \cs{numprint} inside the tabular.\\ @@ -1496,6 +1542,8 @@ % unit.\\ % npdegreeseparator& Change the separator between a number and a % degree symbol.\\[\medskipamount] +% npcelsiusseparator& Change the separator between a number and +% \textcelsius.\\[\medskipamount] % nppercentseparator& Change the separator between a number and a % percent sign.\\[\medskipamount] % nprounddigits& Declare how many digits will be printed after the @@ -1538,6 +1586,9 @@ % \begin{itemize} % \item When aligning the exponent for tabulars, the distance between % the ``10'' and the exponent is too small. +% \item Printing negative numbers in red does not work. +% Only the minus sign is printed in red. +% When was this bug introduced? % \end{itemize} % % \section{To do} @@ -1562,6 +1613,10 @@ % This function has been slightly changed by me. % \item % Portuguese support by Vilar Camara Neto and Luis. +% \item +% Dutch support by Ralph Hendriks. +% \item +% French support by Daniel Flipo. % \end{itemize} % % \begin{thebibliography}{1} @@ -1589,7 +1644,7 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{numprint} - [2005/07/11 v1.35 Print numbers (HH)] + [2007/01/08 v1.37 Print numbers (HH)] % \end{macrocode} % % \subsection{Load packages} @@ -1786,21 +1841,28 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\npunitseparator} -% Change the separator between number an unit. +% Change the separator between number and unit. % Here again the additional \verb|{}| is used as above. % \begin{macrocode} \newcommand*\npunitseparator[1]{\def\nprt@unitsep{{#1}}} % \end{macrocode} % \end{macro} % \begin{macro}{\npdegreeseparator} -% Change the separator between number an unit. +% Change the separator between number and \textdegree. % Here again the additional \verb|{}| is used as above. % \begin{macrocode} \newcommand*\npdegreeseparator[1]{\def\nprt@degreesep{{#1}}} % \end{macrocode} % \end{macro} +% \begin{macro}{\npcelsiusseparator} +% Change the separator between number and \textcelsius. +% Here again the additional \verb|{}| is used as above. +% \begin{macrocode} +\newcommand*\npcelsiusseparator[1]{\def\nprt@celsiussep{{#1}}} +% \end{macrocode} +% \end{macro} % \begin{macro}{\nppercentseparator} -% Change the separator between number an unit. +% Change the separator between number and \%. % Here again the additional \verb|{}| is used as above. % \begin{macrocode} \newcommand*\nppercentseparator[1]{\def\nprt@percentsep{{#1}}} @@ -4224,18 +4286,84 @@ \ensuremath{\nprt@degreesep}% \else % \end{macrocode} -% If the unit is \cs{\%}, the unit is a percent sign. -% Then print the separator \cs{nprt@percentsep} instead of +% If the unit is \cs{tccelsius} from the \texttt{mathcomp} package, the +% unit is degree centigrade. +% Then print the separator \cs{nprt@celsiussep} instead of % \cs{nprt@unitsep}. % \begin{macrocode} - \def\nprt@tmpunit{\%}% + \def\nprt@tmpunit{\tccelsius}% \ifx\nprt@oarg\nprt@tmpunit - \ensuremath{\nprt@percentsep}% + \ensuremath{\nprt@celsiussep}% \else % \end{macrocode} +% If the unit is \cs{celsius} from the \texttt{gensymb} package, the +% unit is degree centigrade. +% Then print the separator \cs{nprt@celsiussep} instead of +% \cs{nprt@unitsep}. +% \begin{macrocode} + \def\nprt@tmpunit{\celsius}% + \ifx\nprt@oarg\nprt@tmpunit + \ensuremath{\nprt@celsiussep}% + \else +% \end{macrocode} +% If the unit is \cs{textcelsius} from the \texttt{textcomp} package, the +% unit is degree centigrade. +% Then print the separator \cs{nprt@celsiussep} instead of +% \cs{nprt@unitsep}. +% \begin{macrocode} + \def\nprt@tmpunit{\textcelsius}% + \ifx\nprt@oarg\nprt@tmpunit + \ensuremath{\nprt@celsiussep}% + \else +% \end{macrocode} +% If the unit is \cs{\%}, the unit is a percent sign. +% Then print the separator \cs{nprt@percentsep} instead of +% \cs{nprt@unitsep}. +% \begin{macrocode} + \def\nprt@tmpunit{\%}% + \ifx\nprt@oarg\nprt@tmpunit + \ensuremath{\nprt@percentsep}% + \else +% \end{macrocode} +% If the unit is \cs{tcperthousand} from the \texttt{mathcomp} package, the +% unit is a permil sign. +% Then print the separator \cs{nprt@percentsep} instead of +% \cs{nprt@unitsep}. +% \begin{macrocode} + \def\nprt@tmpunit{\tcperthousand}% + \ifx\nprt@oarg\nprt@tmpunit + \ensuremath{\nprt@percentsep}% + \else +% \end{macrocode} +% If the unit is \cs{perthousand} from the \texttt{gensymb} package, the +% unit is a permil sign. +% Then print the separator \cs{nprt@percentsep} instead of +% \cs{nprt@unitsep}. +% \begin{macrocode} + \def\nprt@tmpunit{\perthousand}% + \ifx\nprt@oarg\nprt@tmpunit + \ensuremath{\nprt@percentsep}% + \else +% \end{macrocode} +% If the unit is \cs{textperthousand} from the \texttt{textcomp} package, the +% unit is a permil sign. +% Then print the separator \cs{nprt@percentsep} instead of +% \cs{nprt@unitsep}. +% \begin{macrocode} + \def\nprt@tmpunit{\textperthousand}% + \ifx\nprt@oarg\nprt@tmpunit + \ensuremath{\nprt@percentsep}% + \else +% \end{macrocode} % Else, print \cs{nprt@unitsep}. % \begin{macrocode} - \ensuremath{\nprt@unitsep}% + \ensuremath{\nprt@unitsep}% + \fi + \fi + \fi + \fi + \fi + \fi \fi \fi \fi @@ -4443,6 +4571,7 @@ \npproductsign{\cdot}% \npunitseparator{\,}% \npdegreeseparator{}% + \npcelsiusseparator{\nprt@unitsep}% \nppercentseparator{\nprt@unitsep}% } % \end{macrocode} @@ -4460,6 +4589,7 @@ \npproductsign{\cdot}% \npunitseparator{\,}% \npdegreeseparator{}% + \npcelsiusseparator{\nprt@unitsep}% \nppercentseparator{\nprt@unitsep}% } % \end{macrocode} @@ -4473,19 +4603,51 @@ \npproductsign{\times}% \npunitseparator{\,}% \npdegreeseparator{}% + \npcelsiusseparator{\nprt@unitsep}% \nppercentseparator{\nprt@unitsep}% } % \end{macrocode} % \end{macro} % \begin{macro}{\npstyleportuguese} -% Sets the parameters to German habit. +% \changes{1.37}{2007/01/08}{Change thousand separator for Portuguese +% from ``\cs{,}'' to ``\texttt{.}''}% +% Sets the parameters to Portuguese habit. % \begin{macrocode} \newcommand*\npstyleportuguese{% + \npthousandsep{.}% + \npdecimalsign{,}% + \npproductsign{\cdot}% + \npunitseparator{\,}% + \npdegreeseparator{}% + \npcelsiusseparator{\nprt@unitsep}% + \nppercentseparator{\nprt@unitsep}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\npstyledutch} +% Sets the parameters to Dutch habit. +% \begin{macrocode} +\newcommand*\npstyledutch{% \npthousandsep{\,}% \npdecimalsign{,}% \npproductsign{\cdot}% \npunitseparator{\,}% \npdegreeseparator{}% + \npcelsiusseparator{\nprt@unitsep}% + \nppercentseparator{}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\npstylefrench} +% Sets the parameters to French habit. +% \begin{macrocode} +\newcommand*\npstylefrench{% + \npthousandsep{~}% + \npdecimalsign{,}% + \npproductsign{\cdot}% + \npunitseparator{\,}% + \npdegreeseparator{}% + \npcelsiusseparator{\nprt@unitsep}% \nppercentseparator{\nprt@unitsep}% } % \end{macrocode} @@ -4507,23 +4669,30 @@ % \end{macrocode} % Adds the language settings to the known languages if they are % provided by babel. -% The current version knows all German, English, and Portuguese -% dialects. +% The current version knows all German, English, Portuguese, Dutch, +% and French dialects. % \begin{macrocode} \npaddtolanguage{UKenglish}{english}% \npaddtolanguage{USenglish}{english}% + \npaddtolanguage{afrikaans}{dutch}% \npaddtolanguage{american}{english}% \npaddtolanguage{austrian}{german}% \npaddtolanguage{british}{english}% \npaddtolanguage{canadian}{english}% + \npaddtolanguage{dutch}{dutch}% \npaddtolanguage{english}{english}% \npaddtolanguage{german}{german}% \npaddtolanguage{naustrian}{german}% \npaddtolanguage{ngerman}{german}% - \npaddtolanguage{brazil}{portuguese} - \npaddtolanguage{brazilian}{portuguese} - \npaddtolanguage{portuges}{portuguese} - \npaddtolanguage{portuguese}{portuguese} + \npaddtolanguage{brazil}{portuguese}% + \npaddtolanguage{brazilian}{portuguese}% + \npaddtolanguage{portuges}{portuguese}% + \npaddtolanguage{portuguese}{portuguese}% + \npaddtolanguage{francais}{french}% + \npaddtolanguage{canadien}{french}% + \npaddtolanguage{acadian}{french}% + \npaddtolanguage{french}{french}% + \npaddtolanguage{frenchb}{french}% % \end{macrocode} % Set the active language again to activate the extras section. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/numprint/numprint.ins b/Master/texmf-dist/source/latex/numprint/numprint.ins index 01b79050be3..23922ff36e7 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 Harald Harders + Copyright 2000--2005, 2007 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/source/latex/numprint/numprint032.dtx b/Master/texmf-dist/source/latex/numprint/numprint032.dtx index 7458c7f7f06..486a26866a9 100644 --- a/Master/texmf-dist/source/latex/numprint/numprint032.dtx +++ b/Master/texmf-dist/source/latex/numprint/numprint032.dtx @@ -1,5 +1,5 @@ % \iffalse meta comment -% File: numprint.dtx Copyright (C) 2000--2004 Harald Harders +% File: numprint032.dtx Copyright (C) 2000--2004 Harald Harders % \fi % % \iffalse -- cgit v1.2.3