diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-06-30 12:33:26 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-06-30 12:33:26 +0000 |
commit | 8aee5ca2ac80642f6a7017501d3d15bdbef01440 (patch) | |
tree | 084f1d4eb884295d54726d6e95586e3de635f919 /Master/texmf-dist/source/latex/siunitx/siunitx.dtx | |
parent | f8a3c29fe384820da1741b8a6e1089832b7089f0 (diff) |
siunitx update {v2.0f}{2010/06/27}
git-svn-id: svn://tug.org/texlive/trunk@19196 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx/siunitx.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 142 |
1 files changed, 120 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 5cb6011f5a8..ad26d43d3c9 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -140,10 +140,10 @@ This work consists of the file siunitx.dtx \RequirePackage{expl3} %</driver|package> %<*driver> -\documentclass[full]{l3doc} +\documentclass[german,french,english,UKenglish]{l3doc} -\usepackage{amsmath,booktabs,caption,csquotes,datatool,helvet,pgfplots} -\usepackage{siunitx,xcolor,xtab} +\usepackage{amsmath,babel,booktabs,caption,csquotes,datatool,helvet} +\usepackage{pgfplots,siunitx,xcolor,xtab} \IfFileExists{xfrac.sty} {\usepackage{xfrac}} {% @@ -295,6 +295,7 @@ This work consists of the file siunitx.dtx % raiseto, % robustify, % second, +% selectlanguage, % SendSettingsToPgf, % si, % SI, @@ -310,6 +311,7 @@ This work consists of the file siunitx.dtx % text, % toprule, % tothe, +% translate, % volt, % kWh, % } @@ -425,6 +427,18 @@ This work consists of the file siunitx.dtx %\changes{v2.0e}{2010/06/20}{Correct behaviour of \cs{pm} in numbers % when \texttt{abbreviations} configuration is loaded: problem % introduced in v2.0c} +%\changes{v2.0f}{2010/06/27}{Fix issue with spacing of multiplication +% sign in text mode} +%\changes{v2.0g}{2010/06/28}{Fix issue with complex numbers in +% quotients} +%\changes{v2.0g}{2010/06/28}{Repair broken \opt{bracket-numbers} +% option} +%\changes{v2.0g}{2010/06/28}{Improve handling of complex root token} +%\changes{v2.0g}{2010/06/28}{Introduce localisation for text values} +%\changes{v2.0h}{2010/06/29}{Actually get localisation into the +% code} +%\changes{v2.0i}{2010/06/29}{Correct behaviour of \cs{of} function +% so it actually works (bug introduced in v2.0d)} % %\begin{abstract} % Typesetting values with units requires care to ensure that the @@ -1591,7 +1605,7 @@ This work consists of the file siunitx.dtx % Type & % \multicolumn{1}{l}{Default} \\ % \midrule -% brackets-numbers & Switch & true \\ ^^A ( +% bracket-numbers & Switch & true \\ ^^A ( % close-bracket & Literal & ) \\ % complex-root-position & Choice & after-number \\ % copy-decimal-marker & Choice & false \\ @@ -1609,7 +1623,6 @@ This work consists of the file siunitx.dtx % output-complex-root & Math & \verb=\mathrm{i}= \\ % output-decimal-marker & Math & . \\ % output-open-uncertainty & Literal & ( \\ ^^A ) -% range-phrase & Literal & \verb*= to = \\ % separate-uncertainty & Switch & false \\ % tight-spacing & Switch & false \\ % uncertainty-separator & Math & \meta{none} \\ @@ -3077,6 +3090,40 @@ This work consists of the file siunitx.dtx % units may safely be created in the configuration file even when also % included in individual LaTeX document headers. % +%\section{Localisation} +% +% The \pkg{translator} package provides a structured framework for +% localisation of words and phrases, and is part of the larger +% \pkg{beamer} bundle. The \pkg{translator} package provides the +% \cs{translate} macro, which will provide appropriate translations +% based on the current \pkg{babel} or \pkg{polyglossia} language +% setting. +% +% If \pkg{translator} is available, \pkg{siunitx} will load it and alter +% the standard settings for the \opt{list-final-separator} and +% \opt{range-phrase} options to read: +%\begin{LaTeXdemo}[code only] +% \sisetup{ +% list-final-separator = { \translate{and} }, +% range-phrase = { \translate{to (numerical range)} }, +% } +%\end{LaTeXdemo} +% If the current language is known to the \pkg{translator} package +% then the result will be localised text. The preamble for this manual +% loads English, French and German as options, and also loads the +% \pkg{babel} package: +%\begin{LaTeXdemo} +% % In English by default +% \SIlist{1;2;3}{\metre} \\ +% \SIrange{1}{10}{\degreeCelsius} \\ +% \selectlanguage{french}% +% \SIlist{1;2;3}{\metre} \\ +% \SIrange{1}{10}{\degreeCelsius} \\ +% \selectlanguage{german}% +% \SIlist{1;2;3}{\metre} \\ +% \SIrange{1}{10}{\degreeCelsius} \\ +%\end{LaTeXdemo} +% %\section{Hints for using \pkg{siunitx}} % %\subsection{Ensuring text or math output} @@ -3922,7 +3969,7 @@ This work consists of the file siunitx.dtx % % The usual preliminaries. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2010/06/20} {2.0e} +\ProvidesExplPackage {siunitx} {2010/06/29} {2.0i} {A comprehensive (SI) units package} % \end{macrocode} % @@ -6986,7 +7033,17 @@ This work consists of the file siunitx.dtx open-bracket .tl_set:N = \l_siunitx_bracket_open_tl, output-close-uncertainty .tl_set:N = \l_siunitx_output_uncert_close_tl, - output-complex-root .tl_set:N = \l_siunitx_output_complex_tl, + output-complex-root .code:n = + { + \tl_set:Nn \l_siunitx_output_complex_tl + { + \use:c + { + siunitx_ \l_siunitx_print_type_tl _ + math \l_siunitx_font_family_tl :n + } {#1} + } + }, output-decimal-marker .code:n = { \tl_set:Nn \l_siunitx_output_decimal_tl { {#1} } @@ -7143,6 +7200,7 @@ This work consists of the file siunitx.dtx \prop_put:NnV \l_siunitx_number_out_prop { complex } \l_siunitx_tmpa_tl } + \siunitx_number_format_join_complex: } } @@ -7151,7 +7209,7 @@ This work consists of the file siunitx.dtx \bool_if:NTF \l_siunitx_complex_after_bool { \siunitx_tl_put_right_math:NV \l_siunitx_tmpa_tl - \l_siunitx_output_complex_tl + \l_siunitx_output_complex_tl } { \siunitx_tl_put_left_math:NV \l_siunitx_tmpa_tl @@ -7224,12 +7282,15 @@ This work consists of the file siunitx.dtx \siunitx_number_format_brackets:n { mantissa } \prop_get:NnN \l_siunitx_number_out_prop { mantissa-result } \l_siunitx_tmpa_tl - \tl_set_eq:NN \l_siunitx_tmpb_tl \l_siunitx_exponent_product_tl - \bool_if:NT \l_siunitx_tight_bool + \bool_if:NTF \l_siunitx_tight_bool { \tl_set:Nx \l_siunitx_tmpb_tl { { \exp_not:V \l_siunitx_tmpb_tl } } } + { + \tl_set:Nx \l_siunitx_tmpb_tl + { { } \exp_not:V \l_siunitx_exponent_product_tl { } } + } \siunitx_tl_put_right_math:NV \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl \prop_get:NnN \l_siunitx_number_out_prop { exponent-result } @@ -7832,14 +7893,12 @@ This work consists of the file siunitx.dtx % an exponent. The test for an exponent is needed as this must force % the units to come at the end of the number, and there then have to % be brackets in the output if there are any separate parts. -% \begin{macrocode} +% \begin{macrocode} \cs_new_protected_nopar:Npn \siunitx_number_output_parse_aux: { \siunitx_number_in_parse:V \l_siunitx_number_arg_tl \bool_if:NF \l_siunitx_error_bool { \siunitx_number_process: - \prop_if_in:NnT \l_siunitx_number_in_prop { exponent } - { \bool_set_true:N \l_siunitx_brackets_bool } \siunitx_number_format: \siunitx_number_output_color: \bool_if:NTF \l_siunitx_brackets_bool @@ -7888,12 +7947,16 @@ This work consists of the file siunitx.dtx { \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa-result } { - \tl_set_eq:NN \l_siunitx_tmpb_tl - \l_siunitx_exponent_product_tl - \bool_if:NT \l_siunitx_tight_bool + \bool_if:NTF \l_siunitx_tight_bool + { + \tl_set:Nx \l_siunitx_tmpb_tl + { { \exp_not:V \l_siunitx_exponent_product_tl } } + } { \tl_set:Nx \l_siunitx_tmpb_tl - { { \exp_not:V \l_siunitx_tmpb_tl } } + { + { } \exp_not:V \l_siunitx_exponent_product_tl { } + } } \siunitx_tl_put_left_math:NV \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl @@ -8081,6 +8144,15 @@ This work consists of the file siunitx.dtx \siunitx_number_in_parse:V \l_siunitx_number_numerator_tl \siunitx_number_output_quotient_aux_ii: \siunitx_number_output_color: + \prop_if_in:NnT \l_siunitx_number_out_prop { complex } + { + \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa } + { + \prop_put:Nnn \l_siunitx_number_out_prop + { result-bracket } { true } + \siunitx_number_format_brackets:n { result } + } + } \prop_get:NnN \l_siunitx_number_out_prop { result } \l_siunitx_number_numerator_tl \siunitx_number_in_parse:V \l_siunitx_number_denominator_tl @@ -9874,7 +9946,7 @@ This work consists of the file siunitx.dtx { \use:c { - _siunitx_unit_format_qualifier_ + siunitx_unit_format_qualifier_ \l_siunitx_qualifier_mode_tl : } } @@ -10314,7 +10386,7 @@ This work consists of the file siunitx.dtx %\begin{macro}{\siunitx_list_numbers_aux_ii:n} % Lists of numbers are handled in a very simple fashion. The input % list is traversed, and the items are simply placed on a list for -% output. This uses the internal function \cs{_siunitx_number_output:n} +% output. This uses the internal function \cs{siunitx_number_output:n} % for speed, but does not make any other optimisation. The output list % also adds the relevant separators. % \begin{macrocode} @@ -13028,6 +13100,32 @@ This work consists of the file siunitx.dtx %\end{macro} %\end{macro} % + + +%\subsection{Localisation} +% +% Localisation makes use of the \pkg{translator} package. This only +% happens if it is available, and is transparent to the user. +% \begin{macrocode} +\file_if_exist:nT { translator.sty } + { + \RequirePackage { translator } + \usedictionary { translator-basic-dictionary } + \providetranslation [ to = English ] + { to~(numerical~range) } { to } + \providetranslation [ to = French ] + { to~(numerical~range) } { \`a } + \providetranslation [ to = German ] + { to~(numerical~range) } { bis } + \sisetup + { + list-final-separator = { ~ \translate { and } ~ }, + range-phrase = + { ~ \translate { to~(numerical~range) } ~ }, + } + } +% \end{macrocode} +% %\subsection{Loading additional configurations} % % There is only only option for loading files: keeps things simple. @@ -13099,7 +13197,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-version-1.cfg} {2010/06/20} {2.0e} +\ProvidesExplFile {siunitx-version-1.cfg} {2010/06/29} {2.0i} {siunitx: Version 1 settings} % \end{macrocode} % @@ -14089,7 +14187,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-abbreviations.cfg} {2010/06/20} {2.0e} +\ProvidesExplFile {siunitx-abbreviations.cfg} {2010/06/29} {2.0i} {siunitx: Abbreviated units} % \end{macrocode} % @@ -14297,7 +14395,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-binary.cfg} {2010/06/20} {2.0e} +\ProvidesExplFile {siunitx-binary.cfg} {2010/06/29} {2.0i} {siunitx: Binary units} % \end{macrocode} % |