summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/siunitx/siunitx.sty')
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/siunitx.sty53
1 files changed, 40 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
index 272ca6f6e03..c018305d3b2 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} {2010/11/24} {2.1f}
+\ProvidesExplPackage {siunitx} {2011/01/18} {2.1h}
{A comprehensive (SI) units package}
\cs_if_exist:NTF \msg_set:nnnn
{
@@ -365,6 +365,30 @@
}
{ }
}
+\prg_new_conditional:Npnn \siunitx_if_display_math: { T , F , TF , p }
+ {
+ \mode_if_inner:TF
+ { \prg_return_false: }
+ { \prg_return_true: }
+}
+\AtBeginDocument {
+ \cs_if_exist:NT \if@display
+ {
+ \prg_set_conditional:Npnn \siunitx_if_display_math:
+ { T , F , TF , p }
+ {
+ \mode_if_inner:TF
+ {
+ \if@display
+ \prg_return_true:
+ \tex_else:D
+ \prg_return_false:
+ \tex_fi:D
+ }
+ { \prg_return_true: }
+ }
+ }
+}
\cs_new_protected_nopar:Npn \siunitx_set_math_fam:n #1 {
\int_new:c { c_siunitx_math #1 _int }
\group_begin:
@@ -478,7 +502,12 @@
\cs_new_protected_nopar:Npn \siunitx_detect_font_weight: {
\mode_if_math:TF
{
- \mode_if_inner:TF
+ \siunitx_if_display_math:TF
+ {
+ \bool_if:NTF \l_siunitx_detect_display_math_bool
+ { \siunitx_detect_font_weight_math: }
+ { \siunitx_detect_font_weight_text: }
+ }
{
\use:c
{
@@ -487,11 +516,6 @@
:
}
}
- {
- \bool_if:NTF \l_siunitx_detect_display_math_bool
- { \siunitx_detect_font_weight_math: }
- { \siunitx_detect_font_weight_text: }
- }
}
{ \siunitx_detect_font_weight_text: }
}
@@ -532,10 +556,13 @@
}
\cs_new_protected_nopar:Npn \siunitx_detect_font_family: {
\siunitx_detect_font_family_text:
- \bool_if:NT \l_siunitx_detect_display_math_bool
+ \mode_if_math:T
{
- \mode_if_math:T
- { \mode_if_inner:F { \siunitx_detect_font_family_math: } }
+ \bool_if:NT \l_siunitx_detect_display_math_bool
+ {
+ \siunitx_if_display_math:T
+ { \siunitx_detect_font_family_math: }
+ }
}
}
\cs_new_protected_nopar:Npn \siunitx_detect_font_family_math: {
@@ -3829,9 +3856,9 @@
\bool_if:NT \l_siunitx_per_auto_bool
{
\tl_set:Nn \l_siunitx_per_mode_tl { symbol }
- \mode_if_inner:F
+ \mode_if_math:T
{
- \mode_if_math:T
+ \siunitx_if_display_math:T
{
\tl_set:Nn \l_siunitx_per_mode_tl
{ fraction }
@@ -6592,7 +6619,7 @@
}
\ProcessKeysOptions { siunitx }
%%
-%% Copyright (C) 2008-2010 by
+%% Copyright (C) 2008-2011 by
%% Joseph Wright <joseph.wright@morningstar2.co.uk>
%%
%% It may be distributed and/or modified under the conditions of