From 24c374f45330336f673cbaa3bb08401d0957489a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 20 Mar 2011 22:14:10 +0000 Subject: siunitx 2.1m (20mar11) git-svn-id: svn://tug.org/texlive/trunk@21772 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/siunitx/README | 14 +-- Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | Bin 520909 -> 522725 bytes Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 117 +++++++++++++-------- .../latex/siunitx/config/siunitx-abbreviations.cfg | 1 + .../tex/latex/siunitx/config/siunitx-binary.cfg | 2 +- .../tex/latex/siunitx/config/siunitx-version-1.cfg | 2 +- Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 22 ++-- 7 files changed, 100 insertions(+), 58 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/siunitx/README b/Master/texmf-dist/doc/latex/siunitx/README index 1230a473093..a104e81e305 100644 --- a/Master/texmf-dist/doc/latex/siunitx/README +++ b/Master/texmf-dist/doc/latex/siunitx/README @@ -6,15 +6,17 @@ Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt ---------------------------------------------------------------- -Typesetting values with units requires care to ensure that the -combined mathematical meaning of the value plus unit combination -is clear. In particular, the SI units system lays down a -consistent set of units with rules on how these are to be used. -However, different countries and publishers have differing +Physical quantities have both numbers and units, and each +physical quantity should be expressed as the product of a number +and a unit. Typesetting physical quantities requires care to +ensure that the combined mathematical meaning of the number-unit +combination is clear. In particular, the SI units system lays +down a consistent set of units with rules on how these are to be +used. However, different countries and publishers have differing conventions on the exact appearance of numbers (and units). The siunitx package provides a set of tools for authors to -typeset numbers and units in a consistent way. The package has +typeset quantities in a consistent way. The package has an extended set of configuration options which make it possible to follow varying typographic conventions with the same input syntax. The package includes automated processing of numbers diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf index f0f8cc1895a..85246f8eefa 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf differ diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index ca4756fb4a6..ef4d8b5653d 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -11,15 +11,17 @@ Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt ---------------------------------------------------------------- -Typesetting values with units requires care to ensure that the -combined mathematical meaning of the value plus unit combination -is clear. In particular, the SI units system lays down a -consistent set of units with rules on how these are to be used. -However, different countries and publishers have differing +Physical quantities have both numbers and units, and each +physical quantity should be expressed as the product of a number +and a unit. Typesetting physical quantities requires care to +ensure that the combined mathematical meaning of the number-unit +combination is clear. In particular, the SI units system lays +down a consistent set of units with rules on how these are to be +used. However, different countries and publishers have differing conventions on the exact appearance of numbers (and units). The siunitx package provides a set of tools for authors to -typeset numbers and units in a consistent way. The package has +typeset quantities in a consistent way. The package has an extended set of configuration options which make it possible to follow varying typographic conventions with the same input syntax. The package includes automated processing of numbers @@ -537,17 +539,24 @@ This work consists of the file siunitx.dtx % signs and using \pkg{fontspec} package} %\changes{v2.1l}{2011/02/10}{Error in font family detection introduced % in v2.1k corrected} +%\changes{v2.1m}{2011/03/18}{Avoid expansion of erroneous literal +% units when these are forbidden} +%\changes{v2.1m}{2011/03/20}{Ensure some output occurs in all cases +% when \opt{round-precision} is set to \opt{0} and \opt{round-mode} +% is set to \opt{places}} % %\begin{abstract} -% Typesetting values with units requires care to ensure that the -% combined mathematical meaning of the value plus unit combination is +% Physical quantities have both numbers and units, and each physical +% quantity should be expressed as the product of a number and a unit. +% Typesetting physical quantities requires care to ensure that the +% combined mathematical meaning of the number--unit combination is % clear. In particular, the SI units system lays down a consistent % set of units with rules on how these are to be used. However, % different countries and publishers have differing conventions on % the exact appearance of numbers (and units). % % The \pkg{siunitx} package provides a set of tools for authors -% to typeset numbers and units in a consistent way. The package has an +% to typeset quantities in a consistent way. The package has an % extended set of configuration options which make it possible to % follow varying typographic conventions with the same input syntax. % The package includes automated processing of numbers and units, and @@ -570,7 +579,7 @@ This work consists of the file siunitx.dtx % ensure that no loss of meaning occurs in printed matter. % % \pkg{siunitx} aims to provide a unified method for \LaTeX\ users to -% typeset units and values correctly and easily. The design +% typeset numbers and units correctly and easily. The design % philosophy of \pkg{siunitx} is to follow the agreed rules by % default, but to allow variation through option settings. In this way, % users can use \pkg{siunitx} to follow the requirements of @@ -621,7 +630,7 @@ This work consists of the file siunitx.dtx %\begin{itemize} % \item \cs{num}\oarg{options}\marg{number} % \item \cs{si}\oarg{options}\marg{unit} -% \item \cs{SI}\oarg{options}\marg{value}\oarg{pre-unit}\marg{unit} +% \item \cs{SI}\oarg{options}\marg{number}\oarg{pre-unit}\marg{unit} % \item \cs{numlist}\oarg{options}\marg{numbers} % \item \cs{numrange}\oarg{options}\marg{numbers}\marg{number2} % \item \cs{SIlist}\oarg{options}\marg{numbers}\marg{unit} @@ -632,7 +641,7 @@ This work consists of the file siunitx.dtx %\end{itemize} % plus the \texttt{S} and \texttt{s} column types for decimal % alignments and units in tables. These macros are designed for -% typesetting units and values with control of appearance and with +% typesetting numbers and units with control of appearance and with % intelligent processing. % % Numbers are processed with understanding of exponents, complex numbers @@ -795,7 +804,7 @@ This work consists of the file siunitx.dtx % it does use meaning rather than appearance for input. However, the % package allows you to define new unit macros; a large number of % pre-defined abbreviations are also supplied. More importantly, by -% defining macros for units, instead of literal values, new +% defining macros for units, instead of literal input, new % functionality is made available. By altering the settings used by the % package, the same input can yield a variety of different output % formats. For example, the \cs{per} macro can give reciprocal powers, @@ -805,9 +814,10 @@ This work consists of the file siunitx.dtx %\begin{syntax} % \cs{SI}\oarg{options}\marg{number}\oarg{preunit}\marg{unit} %\end{syntax} -% Very often, numbers and values are given together. Mathematically, -% these form a single entity, and should be separated by a non-breaking -% space. The \cs{SI} macro combines the functionality of \cs{num} and +% Very often, numbers and units are given together. Formally, the +% value of a quantity is the product of the number and the unit, the +% space being regarded as a multiplication sign \cite{SI:5.3.3}. The +% \cs{SI} macro combines the functionality of \cs{num} and % \cs{si}, and makes this both possible and easy. The \meta{number} and % \meta{unit} arguments work exactly like those for the \cs{num} and % \cs{si} macros, respectively. \meta{preunit} is a unit to be typeset @@ -1108,7 +1118,7 @@ This work consists of the file siunitx.dtx % \cs{DeclareSIUnitWithOptions}\marg{unit}\marg{symbol}\marg{options} %\end{syntax} % New units are produced using the \cs{DeclareSIUnit} macro. -% \meta{symbol} can contain literal values, other units, multiple +% \meta{symbol} can contain literal input, other units, multiple % prefixes, powers and \cs{per}, although literal text should not be % intermixed with unit macros. Units can be created with options % using the \cs{DeclareSIUnitWithOptions} function, where the @@ -1584,7 +1594,7 @@ This work consists of the file siunitx.dtx % %\DescribeOption{input-open-uncertainty} %\DescribeOption{input-close-uncertainty} -% In some fields, it is common to give the uncertainty in a value +% In some fields, it is common to give the uncertainty in a number % in brackets after the main part of the number, for example % \enquote{\num{1.234(5)}}. The opening and closing symbols used for % this type of input are set as \opt{input-open-uncertainty} and @@ -1695,11 +1705,12 @@ This work consists of the file siunitx.dtx % \num[round-mode = places]{1} %\end{LaTeXdemo} %\DescribeOption{round-minimum} -% There are cases in which rounding will result in a zero value. It -% may be desirable to show such results as below a threshold value. This -% can be achieved by setting \opt{round-minimum} to the threshold value. -% There will be no effect when rounding to a number of significant -% figures as it is not possible to obtain the value zero in these cases. +% There are cases in which rounding will result in the number reaching +% zero. It may be desirable to show such results as below a threshold +% value. This can be achieved by setting \opt{round-minimum} to the +% threshold value. There will be no effect when rounding to a number of +% significant figures as it is not possible to obtain the value zero in +% these cases. %\begin{LaTeXdemo} % \sisetup{round-mode = places} % \num{0.0055} \\ @@ -1905,11 +1916,11 @@ This work consists of the file siunitx.dtx %\DescribeOption{uncertainty-separator} %\DescribeOption{output-open-uncertainty} %\DescribeOption{output-close-uncertainty} -% When input is given including an uncertainty in a value, it can be +% When input is given including an uncertainty in a number, it can be % printed either with the uncertainty in brackets or as a separate % number. This behaviour is controlled by the % \opt{separate-uncertainty} choice. If the uncertainty is given in -% brackets, a space may be added between the main value and the +% brackets, a space may be added between the main number and the % uncertainty: this is stored using the \opt{uncertainty-separator} % option. The opening and closing brackets used are stored in % \opt{output-open-uncertainty} and @@ -2382,6 +2393,7 @@ This work consists of the file siunitx.dtx % \DescribeNamedUnit{kilowatt}{kW} \\ % \DescribeNamedUnit{megawatt}{MW} \\ % \DescribeNamedUnit{gigawatt}{GW} \\ +% \DescribeNamedUnit{joule}{J} \\ % \DescribeNamedUnit{kilojoule}{kJ} \\ % \DescribeNamedUnit{electronvolt}{eV} \\ % \DescribeNamedUnit{millielectronvolt}{meV} \\ @@ -2743,7 +2755,7 @@ This work consists of the file siunitx.dtx % when a unit is present. % %\DescribeOption{product-units} -% When a product of values is given, the resulting units can be +% When a product of quantities is given, the resulting units can be % displayed in a number of ways, set using the \opt{product-units} % option. The standard setting is \opt{repeat}, which prints one % unit symbol for each numbers. Alternatives are \opt{brackets}, @@ -4122,7 +4134,7 @@ This work consists of the file siunitx.dtx % % \pkg{siunitx} takes account of the information given here, so far as % is possible. Thus the package defaults follow the recommendations -% made for typesetting units and values. Spacing and so forth is +% made for typesetting numbers and units. Spacing and so forth is % handled in such a way as to make implementing the rules % (relatively) easy. % @@ -4196,7 +4208,7 @@ This work consists of the file siunitx.dtx % and the unit should be printed. Firstly, the two parts should not % be separated. With the exception of the symbols for plane angles % (\si{\degree}, \si{\arcminute} and \si{\arcsecond}), it is usual to -% have a space between the unit and the value. This should therefore +% have a space between the unit and the number. This should therefore % be a thin non-breaking space between the two. %\begin{LaTeXdemo} % A space for \SI{10}{\percent}\\ @@ -4252,7 +4264,7 @@ This work consists of the file siunitx.dtx % \si[per-mode = symbol]{\joule\per\mole\per\kelvin} %\end{LaTeXdemo} % -% Products and errors should show what unit applies to each value +% Products and errors should show what unit applies to each number % given. Thus \SI[product-units = brackets]{2x3}{\metre} is an % ordered set of lengths of a geometric area, whereas % \SI[product-units = single]{2x3}{\metre} is a length (and equal @@ -4265,10 +4277,10 @@ This work consists of the file siunitx.dtx % not encouraged. % % Care must be taken when writing ranges of numbers. For purely -% numerical values, it is common to use a en-dash between values, for -% example \enquote{see pages 1--5}. On the other hand, values with -% units could be misinterpret as negative values if written in this -% way. As the unit--value combination is a single mathematical entity, +% numerical values, it is common to use a en-dash to show a range, for +% example \enquote{see pages 1--5}. On the other hand, physical +% quantities could be misinterpret as negative values if written in this +% way. As the unit--number combination is a single mathematical entity, % writing the values with an en-dash followed by a single unit is also % incorrect. As a result, using the word \enquote{to} is strongly % recommended. @@ -4285,7 +4297,7 @@ This work consists of the file siunitx.dtx % poor.\footnote{For example, for an acceleration \(a\), the expression % \([a]\) is the dimensions of \(a\), \emph{i.e.}~length per time % squared in this case.} Much better is to show division of all -% values by the unit, which leaves the entries as unitless ratios. +% quantities by the unit, which leaves the entries as unitless ratios. % This is illustrated in \cref{tab:xmpl:unitless} and % \cref{fig:xmpl:unitless}. %\begin{LaTeXdemo}[code and float] @@ -4442,7 +4454,7 @@ This work consists of the file siunitx.dtx % % The usual preliminaries. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2011/02/10} {2.1l} +\ProvidesExplPackage {siunitx} {2011/03/20} {2.1m} {A comprehensive (SI) units package} % \end{macrocode} % @@ -6955,7 +6967,7 @@ This work consists of the file siunitx.dtx { \l_siunitx_round_int } > { \l_siunitx_process_precision_int } { - \siunitx_number_process_figures_round: + \siunitx_number_process_figures_round: \siunitx_number_process_round_tidy:n {#1} } { \siunitx_number_process_figures_pad:n {#1} } @@ -7339,7 +7351,7 @@ This work consists of the file siunitx.dtx \l_siunitx_tmpa_tl \quark_if_no_value:NF \l_siunitx_tmpa_tl { - \int_compare:nNnT + \int_compare:nNnTF { \tl_head:V \l_siunitx_tmpa_tl } > { 4 } { \prop_get:NnN \l_siunitx_number_in_prop { #1 -integer } @@ -7356,6 +7368,13 @@ This work consists of the file siunitx.dtx { #1 -integer } \l_siunitx_tmpa_tl } } + { + \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -integer } + { + \prop_put:Nnn \l_siunitx_number_in_prop + { #1 -integer } { 0 } + } + } } \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal } \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal-marker } @@ -7570,7 +7589,7 @@ This work consists of the file siunitx.dtx \l_siunitx_process_round_min_tl . . \q_stop {#1} } } - { + { \prop_put:NnV \l_siunitx_number_in_prop { #1 -integer } \l_siunitx_round_integer_out_tl \tl_if_empty:NTF \l_siunitx_round_decimal_out_tl @@ -10126,7 +10145,10 @@ This work consists of the file siunitx.dtx \siunitx_unit_if_literal:nTF {#1} { \bool_if:NTF \l_siunitx_unit_forbid_literal_bool - { \msg_error:nnx { siunitx } { literal-unit } {#1} } + { + \msg_error:nnx { siunitx } { literal-unit } + { \exp_not:n {#1} } + } { \siunitx_unit_format_literal:n {#1} } } { @@ -11946,11 +11968,11 @@ This work consists of the file siunitx.dtx \siunitx_table_collect_get: \cs_set_nopar:Npn \peek_execute_branches: { - \if_catcode:w \exp_not:N \l_peek_token \c_group_begin_token + \tex_ifcat:D \exp_not:N \l_peek_token \c_group_begin_token \exp_after:wN \siunitx_table_collect_braced:n - \else: + \tex_else:D \exp_after:wN \siunitx_table_collect_not_braced:N - \fi: + \tex_fi:D } \peek_after:NN \peek_ignore_spaces_execute_branches: } @@ -14588,7 +14610,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-version-1.cfg} {2011/02/10} {2.1l} +\ProvidesExplFile {siunitx-version-1.cfg} {2011/03/20} {2.1m} {siunitx: Version 1 settings} % \end{macrocode} % @@ -15721,6 +15743,7 @@ This work consists of the file siunitx.dtx %\begin{macro}{\MW} %\begin{macro}{\GW} %\begin{macro}{\kJ} +%\begin{macro}{\J} %\begin{macro}{\eV} %\begin{macro}{\meV} %\begin{macro}{\keV} @@ -15735,6 +15758,7 @@ This work consists of the file siunitx.dtx \DeclareSIUnit \kW { \kilo \watt } \DeclareSIUnit \MW { \mega \watt } \DeclareSIUnit \GW { \giga \watt } +\DeclareSIUnit \J { \joule } \DeclareSIUnit \kJ { \kilo \joule } \DeclareSIUnit \eV { \electronvolt } \DeclareSIUnit \meV { \milli \electronvolt } @@ -15758,6 +15782,7 @@ This work consists of the file siunitx.dtx %\end{macro} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\m} %\begin{macro}{\pm} %\begin{macro}{\nm} @@ -15869,7 +15894,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-binary.cfg} {2011/02/10} {2.1l} +\ProvidesExplFile {siunitx-binary.cfg} {2011/03/20} {2.1m} {siunitx: Binary units} % \end{macrocode} % @@ -15952,6 +15977,10 @@ This work consists of the file siunitx.dtx % \bibitem{SI:4.1.T8} % \emph{Other non-SI units}, % \url{http://www.bipm.org/en/si/si_brochure/chapter4/table8.html}. +% +% \bibitem{SI:5.3.3} +% \emph{Formatting the value of a quantity}, +% \url{http://www.bipm.org/en/si/si_brochure/chapter5/5-3-2.html#5-3-3}. % %\end{thebibliography} % diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg index 219f0305d0e..12c6de9e954 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg @@ -56,6 +56,7 @@ \DeclareSIUnit \kW { \kilo \watt } \DeclareSIUnit \MW { \mega \watt } \DeclareSIUnit \GW { \giga \watt } +\DeclareSIUnit \J { \joule } \DeclareSIUnit \kJ { \kilo \joule } \DeclareSIUnit \eV { \electronvolt } \DeclareSIUnit \meV { \milli \electronvolt } diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg index 7554e07dc88..a9cd286b580 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-binary.cfg} {2011/02/10} {2.1l} +\ProvidesExplFile {siunitx-binary.cfg} {2011/03/20} {2.1m} {siunitx: Binary units} \DeclareBinaryPrefix \kibi { Ki } { 10 } \DeclareBinaryPrefix \mebi { Mi } { 20 } diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg index d589b71592d..d5ac00dd786 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-version-1.cfg} {2011/02/10} {2.1l} +\ProvidesExplFile {siunitx-version-1.cfg} {2011/03/20} {2.1m} {siunitx: Version 1 settings} \keys_set:nn { siunitx } { load-configurations = { abbreviations , binary } } diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index becdaf64aac..66a3a598caf 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -14,7 +14,7 @@ %% --------------------------------------------------------------- %% \RequirePackage{expl3} -\ProvidesExplPackage {siunitx} {2011/02/10} {2.1l} +\ProvidesExplPackage {siunitx} {2011/03/20} {2.1m} {A comprehensive (SI) units package} \cs_if_exist:NTF \msg_set:nnnn { @@ -1913,7 +1913,7 @@ \l_siunitx_tmpa_tl \quark_if_no_value:NF \l_siunitx_tmpa_tl { - \int_compare:nNnT + \int_compare:nNnTF { \tl_head:V \l_siunitx_tmpa_tl } > { 4 } { \prop_get:NnN \l_siunitx_number_in_prop { #1 -integer } @@ -1930,6 +1930,13 @@ { #1 -integer } \l_siunitx_tmpa_tl } } + { + \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -integer } + { + \prop_put:Nnn \l_siunitx_number_in_prop + { #1 -integer } { 0 } + } + } } \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal } \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal-marker } @@ -3835,7 +3842,10 @@ \siunitx_unit_if_literal:nTF {#1} { \bool_if:NTF \l_siunitx_unit_forbid_literal_bool - { \msg_error:nnx { siunitx } { literal-unit } {#1} } + { + \msg_error:nnx { siunitx } { literal-unit } + { \exp_not:n {#1} } + } { \siunitx_unit_format_literal:n {#1} } } { @@ -4998,11 +5008,11 @@ \siunitx_table_collect_get: \cs_set_nopar:Npn \peek_execute_branches: { - \if_catcode:w \exp_not:N \l_peek_token \c_group_begin_token + \tex_ifcat:D \exp_not:N \l_peek_token \c_group_begin_token \exp_after:wN \siunitx_table_collect_braced:n - \else: + \tex_else:D \exp_after:wN \siunitx_table_collect_not_braced:N - \fi: + \tex_fi:D } \peek_after:NN \peek_ignore_spaces_execute_branches: } -- cgit v1.2.3