diff options
author | Karl Berry <karl@freefriends.org> | 2011-02-11 01:14:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-02-11 01:14:49 +0000 |
commit | b59c5fb47c6e19fbe71f5aa475c3ad48987f0d98 (patch) | |
tree | eae896ae301de12c13e082ddd98afccd432d1f5d /Master/texmf-dist/source/latex/siunitx | |
parent | 7d8547203e1cd6d407319542be05abe39a7ee1de (diff) |
siunitx 2.1l (10feb11)
git-svn-id: svn://tug.org/texlive/trunk@21364 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 111 |
1 files changed, 69 insertions, 42 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index ddac2e30e8f..ca4756fb4a6 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -530,6 +530,13 @@ This work consists of the file siunitx.dtx % \opt{per-mode} setting \opt{symbol-or-fraction}} %\changes{v2.1j}{2011/02/01}{Allow for loading of \pkg{inputenc} package % with no options} +%\changes{v2.1k}{2011/02/09}{Remove \opt{combined} choice for option +% \opt{detect-inline-weight}} +%\changes{v2.1k}{2011/02/09}{New option \opt{detect-inline-family}} +%\changes{v2.1k}{2011/02/09}{Bug fix when printing superscript minus +% signs and using \pkg{fontspec} package} +%\changes{v2.1l}{2011/02/10}{Error in font family detection introduced +% in v2.1k corrected} % %\begin{abstract} % Typesetting values with units requires care to ensure that the @@ -1331,6 +1338,7 @@ This work consists of the file siunitx.dtx % detect-all & Meta & \meta{none} \\ % detect-display-math & Switch & false \\ % detect-family & Switch & false \\ +% detect-inline-family & Choice & text \\ % detect-inline-weight & Choice & text \\ % detect-mode & Switch & false \\ % detect-none & Meta & \meta{none} \\ @@ -1362,24 +1370,33 @@ This work consists of the file siunitx.dtx % and \opt{detect-mode} to \texttt{true}, while \opt{detect-none} % sets all of them to \texttt{false}. % +%\DescribeOption{detect-inline-family} %\DescribeOption{detect-inline-weight} -% Font weight detection is influenced by the value of -% \opt{detect-inline-weight}, which takes values \opt{text}, \opt{math} -% and \opt{combined}. The package can detect the local value of font -% weight for either the surrounding text, or the surrounding inline -% ("$" \ldots "$") math. The \opt{combined} option checks both and uses -% the prevailing weight if either test is true. +% When \pkg{siunitx} macros are used in in-line math, the detection +% of font weight and font family can be tuned using the +% \opt{detect-inline-family} and \opt{detect-inline-weight} options. +% Both of these take the choices \opt{text} and \opt{math}. %\begin{LaTeXdemo} % \sisetup{ +% detect-family = true, +% detect-inline-family = math +% }% +% $\num{1234}$ \\ +% { \sffamily $\num{1234}$ } \\ +% $ \mathsf { \num{1234}} $ \\ +% \sisetup{detect-inline-family = text} +% { \sffamily $\num{1234}$ } \\ +% $ \mathsf { \num{1234} } $ \\ +% \sisetup{ % detect-weight = true, % detect-inline-weight = math % }% -% $\num{1234}$ \\ -% { \boldmath $\num{1234}$ } \\ -% { \bfseries $\num{1234}$ } \\ +% $\num{5678}$ \\ +% { \boldmath $\num{5678}$ } \\ +% { \bfseries $\num{5678}$ } \\ % \sisetup{detect-inline-weight = text} -% { \boldmath $\num{1234}$ } \\ -% { \bfseries $\num{1234}$ } +% { \boldmath $\num{5678}$ } \\ +% { \bfseries $\num{5678}$ } %\end{LaTeXdemo} % %\DescribeOption{detect-display-math} @@ -4425,7 +4442,7 @@ This work consists of the file siunitx.dtx % % The usual preliminaries. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2011/02/01} {2.1j} +\ProvidesExplPackage {siunitx} {2011/02/10} {2.1l} {A comprehensive (SI) units package} % \end{macrocode} % @@ -4564,6 +4581,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % %\begin{macro}{\c_siunitx_minus_tl} +%\begin{macro}{\c_siunitx_minus_int} % To allow the correct symbol to appear in text mode: this is the same % as \cs{textminus} from \pkg{textcomp}. If \pkg{fontspec} is loaded % then the real character can be used. @@ -4572,13 +4590,16 @@ This work consists of the file siunitx.dtx \DeclareTextSymbol \c_siunitx_minus_tl { TS1 } { 61 } \AtBeginDocument { \@ifpackageloaded { fontspec } - { - \tl_set:Nx \c_siunitx_minus_tl { \char 8722 } + { + \int_const:Nn \c_siunitx_minus_int { 8722 } + \tl_set:Nn \c_siunitx_minus_tl { \char \c_siunitx_minus_int } } { } } % \end{macrocode} %\end{macro} +%\end{macro} +% % %\begin{macro}{\c_siunitx_mu_tl} % The lack of an upright mu has to be sorted out. The same consideration @@ -4588,9 +4609,7 @@ This work consists of the file siunitx.dtx \DeclareTextSymbolDefault \c_siunitx_mu_tl { TS1 } \AtBeginDocument { \@ifpackageloaded { fontspec } - { - \tl_set:Nx \c_siunitx_mu_tl { \char 181 } - } + { \tl_set:Nx \c_siunitx_mu_tl { \char 181 } } { } } % \end{macrocode} @@ -5014,7 +5033,8 @@ This work consists of the file siunitx.dtx % %\begin{macro}{\l_siunitx_detect_display_math_bool} %\begin{macro}{\l_siunitx_detect_family_bool} -%\begin{macro}{\l_siunitx_detect_inline_weight_bool} +%\begin{macro}{\l_siunitx_detect_inline_family_tl} +%\begin{macro}{\l_siunitx_detect_inline_weight_tl} %\begin{macro}{\l_siunitx_detect_shape_bool} %\begin{macro}{\l_siunitx_detect_mode_bool} %\begin{macro}{\l_siunitx_detect_weight_bool} @@ -5041,12 +5061,17 @@ This work consists of the file siunitx.dtx detect-display-math .bool_set:N = \l_siunitx_detect_display_math_bool, detect-family .bool_set:N = \l_siunitx_detect_family_bool, + detect-inline-family .choice:, + detect-inline-family .value_required:, + detect-inline-family / + math .code:n = + { \tl_set:Nn \l_siunitx_detect_inline_family_tl { math } }, + detect-inline-family / + text .code:n = + { \tl_set:Nn \l_siunitx_detect_inline_family_tl { text } }, detect-inline-weight .choice:, detect-inline-weight .value_required:, detect-inline-weight / - combined .code:n = - { \tl_set:Nn \l_siunitx_detect_inline_weight_tl { combined } }, - detect-inline-weight / math .code:n = { \tl_set:Nn \l_siunitx_detect_inline_weight_tl { math } }, detect-inline-weight / @@ -5073,6 +5098,10 @@ This work consists of the file siunitx.dtx detect-shape .bool_set:N = \l_siunitx_detect_shape_bool, detect-weight .bool_set:N = \l_siunitx_detect_weight_bool } +\keys_set:nn { siunitx } { + detect-inline-family = text , + detect-inline-weight = text , +} % \end{macrocode} %\end{macro} %\end{macro} @@ -5080,6 +5109,7 @@ This work consists of the file siunitx.dtx %\end{macro} %\end{macro} %\end{macro} +%\end{macro} % %\begin{macro}{\l_siunitx_font_set_bool} %\begin{macro}{\l_siunitx_font_math_mode_bool} @@ -5175,16 +5205,11 @@ This work consists of the file siunitx.dtx } % \end{macrocode} %\end{macro} -%\begin{macro}{\siunitx_detect_font_weight_combined:} %\begin{macro}{\siunitx_detect_font_weight_math:} %\begin{macro}{\siunitx_detect_font_weight_text:} % The tests for font weight depend on whether the module is testing % text or math content. % \begin{macrocode} -\cs_new_protected_nopar:Npn \siunitx_detect_font_weight_combined: { - \siunitx_detect_font_weight_math: - \siunitx_detect_font_weight_text: -} \cs_new_protected_nopar:Npn \siunitx_detect_font_weight_math: { \str_if_eq:VnT \math@version { bold } { @@ -5195,10 +5220,7 @@ This work consists of the file siunitx.dtx } } \str_if_eq:VnT \math@version { light } - { - \cs_set:Npn \siunitx_font_weight: - { \lseries } - } + { \cs_set:Npn \siunitx_font_weight: { \lseries } } } \cs_new_protected_nopar:Npn \siunitx_detect_font_weight_text: { \tl_set:Nx \l_siunitx_tmpa_tl { \tl_head:V \f@series } @@ -5211,30 +5233,35 @@ This work consists of the file siunitx.dtx } } \str_if_eq:VnT \l_siunitx_tmpa_tl { l } - { - \cs_set:Npn \siunitx_font_weight: - { \lseries } - } + { \cs_set:Npn \siunitx_font_weight: { \lseries } } } % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} % %\begin{macro}{\siunitx_detect_font_family:} % Family detection usually picks up the surrounding text. However, for % display math there are two options, and so a second test may be made. % \begin{macrocode} \cs_new_protected_nopar:Npn \siunitx_detect_font_family: { - \siunitx_detect_font_family_text: - \mode_if_math:T + \mode_if_math:TF { - \bool_if:NT \l_siunitx_display_math_bool + \bool_if:NTF \l_siunitx_display_math_bool { - \bool_if:NT \l_siunitx_detect_display_math_bool + \bool_if:NTF \l_siunitx_detect_display_math_bool { \siunitx_detect_font_family_math: } + { \siunitx_detect_font_family_text: } + } + { + \use:c + { + siunitx_detect_font_family_ + \l_siunitx_detect_inline_family_tl + : + } } } + { \siunitx_detect_font_family_text: } } % \end{macrocode} %\end{macro} @@ -10764,7 +10791,7 @@ This work consists of the file siunitx.dtx \l_siunitx_tmpa_tl \tl_replace_all_in:NnV \l_siunitx_unit_tl { ~ } \l_siunitx_tmpa_tl - \siunitx_unit_format_literal_extras: + \siunitx_unit_format_literal_extras: } \cs_new_protected:Npn \siunitx_unit_print_literal_aux:N #1 { \cs_set_eq:Nc #1 { siunitx_ \token_to_str:N #1 _literal:w } @@ -14561,7 +14588,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-version-1.cfg} {2011/02/01} {2.1j} +\ProvidesExplFile {siunitx-version-1.cfg} {2011/02/10} {2.1l} {siunitx: Version 1 settings} % \end{macrocode} % @@ -15842,7 +15869,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-binary.cfg} {2011/02/01} {2.1j} +\ProvidesExplFile {siunitx-binary.cfg} {2011/02/10} {2.1l} {siunitx: Binary units} % \end{macrocode} % |