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.sty62
1 files changed, 35 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
index 852b51f7677..73ed6ae89e4 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,xparse}
-\ProvidesExplPackage {siunitx} {2012/11/13} {2.5k}
+\ProvidesExplPackage {siunitx} {2012/11/27} {2.5m}
{A comprehensive (SI) units package}
\@ifpackagelater { expl3 } { 2012/11/21 }
{ }
@@ -351,6 +351,16 @@
}
{ }
}
+\cs_new_eq:NN \__siunitx_ensure_ltr:n \use:n
+\AtBeginDocument
+ {
+ \@ifpackageloaded { bidi }
+ {
+ \xetex_if_engine:T
+ { \cs_set_protected:Npn \__siunitx_ensure_ltr:n #1 { \LRE {#1} } }
+ }
+ { }
+ }
\cs_new_eq:NN \__siunitx_textsuperscript:n \textsuperscript
\bool_new:N \l__siunitx_display_math_bool
\tex_everydisplay:D \exp_after:wN
@@ -749,22 +759,26 @@
\group_end:
}
\cs_generate_variant:Nn \__siunitx_print:nn { nV }
-\cs_new_protected:Npn \__siunitx_print_aux: {
- \text
- {
- \__siunitx_print_color:
- \__siunitx_font_shape:
- \__siunitx_font_weight:
- \use:c
- {
- __siunitx_ \l__siunitx_print_type_tl _
- text \l__siunitx_font_family_tl :
- }
- \bool_if:NTF \l__siunitx_font_math_mode_bool
- { \__siunitx_print_math: }
- { \__siunitx_print_text: }
- }
-}
+\cs_new_protected:Npn \__siunitx_print_aux:
+ {
+ \text
+ {
+ \__siunitx_ensure_ltr:n
+ {
+ \__siunitx_print_color:
+ \__siunitx_font_shape:
+ \__siunitx_font_weight:
+ \use:c
+ {
+ __siunitx_ \l__siunitx_print_type_tl _
+ text \l__siunitx_font_family_tl :
+ }
+ \bool_if:NTF \l__siunitx_font_math_mode_bool
+ { \__siunitx_print_math: }
+ { \__siunitx_print_text: }
+ }
+ }
+ }
\cs_new_protected:Npn \__siunitx_print_color: {
\tl_if_empty:cF { l__siunitx_ \l__siunitx_print_type_tl _color_tl }
{
@@ -4794,10 +4808,7 @@
\__siunitx_unit_format_literal_extras_aux:nN #1#2 {
\char_set_lccode:nn { `\@ } {#1}
\tl_to_lowercase:n
- {
- \tl_replace_all:NnV \l__siunitx_unit_tl { @ }
- \l__siunitx_unit_tl
- }
+ { \tl_replace_all:NnV \l__siunitx_unit_tl { @ } #2 }
}
\pdftex_if_engine:T
{
@@ -7214,6 +7225,7 @@
\cs_set_eq:NN \SI \__siunitx_bookmark_SI:w
\cs_set_eq:NN \SIrange \__siunitx_bookmark_SIrange:w
\cs_set_eq:NN \si \__siunitx_bookmark_si:w
+ \cs_set_eq:NN \highlight \use_ii:nn
\cs_set_eq:NN \__siunitx_textsuperscript:n \use:n
\cs_set:Npn \SIUnitSymbolAngstrom { \AA }
\cs_set:Npn \SIUnitSymbolArcminute { ' }
@@ -7470,7 +7482,7 @@
abbreviations .default:n = true ,
binary-units .choice:,
binary-units /
- true .code:n = { \__siunitx_load_binary: },
+ true .code:n = { \AtBeginDocument { \__siunitx_load_binary: } },
binary-units /
false .code:n =
{ \cs_set_eq:NN \__siunitx_load_binary: \prg_do_nothing: } ,
@@ -7486,11 +7498,7 @@
\@onefilewithoptions { siunitx-binary } [ ] [ ]
\c__siunitx_configuration_ext_tl
}
-\AtBeginDocument
- {
- \__siunitx_load_abbreviations:
- \__siunitx_load_binary:
- }
+\AtBeginDocument { \__siunitx_load_abbreviations: }
\__siunitx_option_deactivate:n { abbreviations , binary }
\keys_define:nn { siunitx }
{