summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/siunitx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-26 23:59:21 +0000
committerKarl Berry <karl@freefriends.org>2011-12-26 23:59:21 +0000
commit9b2e09588997d0e4d70d4c7f8f805014168299e2 (patch)
tree84cd3e49f838950bb51dfb3e1d413f305bc8c386 /Master/texmf-dist/tex/latex/siunitx
parentf27085e9a87f91f5bf2b622668329e440d22919a (diff)
siunitx 2.4f (26dec11)
git-svn-id: svn://tug.org/texlive/trunk@24952 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/siunitx')
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg2
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg2
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg2
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/siunitx.sty145
4 files changed, 91 insertions, 60 deletions
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 e36c13f9e1a..ddfadeafad6 100644
--- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg
+++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ---------------------------------------------------------------
%%
-\ProvidesExplFile {siunitx-abbreviations.cfg} {2011/12/11} {2.4e}
+\ProvidesExplFile {siunitx-abbreviations.cfg} {2011/12/24} {2.4f}
{siunitx: Abbreviated units}
\DeclareSIUnit \A { \ampere }
\DeclareSIUnit \pA { \pico \ampere }
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 4be878d0aa5..caaf3c6d2dc 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/12/11} {2.4e}
+\ProvidesExplFile {siunitx-binary.cfg} {2011/12/24} {2.4f}
{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 199857e044f..20423fd68f4 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/12/11} {2.4e}
+\ProvidesExplFile {siunitx-version-1.cfg} {2011/12/24} {2.4f}
{siunitx: Version 1 settings}
\keys_define:nn { siunitx } {
addsign .choice: ,
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
index b7f6e5c4ccc..7b2fdf3c75c 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/12/11} {2.4e}
+\ProvidesExplPackage {siunitx} {2011/12/24} {2.4f}
{A comprehensive (SI) units package}
\@ifpackagelater { expl3 } { 2011/09/05 }
{ }
@@ -3987,18 +3987,21 @@
\siunitx_unit_output_print:
}
}
-\tl_new:N \l_siunitx_declare_list_tl
-\tl_set:Nn \l_siunitx_declare_list_tl
- { \of \highlight \per \raiseto \tothe }
+\seq_new:N \l_siunitx_declare_list_seq
+\seq_put_right:Nn \l_siunitx_declare_list_seq { \of }
+\seq_put_right:Nn \l_siunitx_declare_list_seq { \highlight }
+\seq_put_right:Nn \l_siunitx_declare_list_seq { \per }
+\seq_put_right:Nn \l_siunitx_declare_list_seq { \raiseto }
+\seq_put_right:Nn \l_siunitx_declare_list_seq { \tothe }
\cs_new_protected:Npn \siunitx_declare_power_after:Nn #1#2 {
- \tl_put_right:Nn \l_siunitx_declare_list_tl {#1}
+ \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
\cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w }
{ \siunitx_textsuperscript:n {#2} }
\cs_set:cpn { siunitx_ \token_to_str:N #1 _function:w }
{ \siunitx_unit_parse_power_after:n {#2} }
}
\cs_new_protected:Npn \siunitx_declare_power_before:Nn #1#2 {
- \tl_put_right:Nn \l_siunitx_declare_list_tl {#1}
+ \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
\cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w } ##1
{ ##1 \siunitx_textsuperscript:n {#2} }
\cs_set:cpn { siunitx_ \token_to_str:N #1 _function:w }
@@ -4006,7 +4009,7 @@
}
\cs_new_protected:Npn \siunitx_declare_prefix:Nnnn #1#2#3#4
{
- \tl_put_right:Nn \l_siunitx_declare_list_tl {#1}
+ \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
\prop_put:Nnn \l_siunitx_prefix_forward_prop {#1} {#4}
\prop_put:Nnn \l_siunitx_prefix_reverse_prop {#4} {#1}
\cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w } {#2}
@@ -4020,14 +4023,14 @@
\prop_new:N \l_siunitx_prefix_forward_prop
\prop_new:N \l_siunitx_prefix_reverse_prop
\cs_new_protected:Npn \siunitx_declare_qualifier:Nn #1#2 {
- \tl_put_right:Nn \l_siunitx_declare_list_tl {#1}
+ \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
\cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w }
{ \text { ~ } ( #2 ) }
\cs_set:cpn { siunitx_ \token_to_str:N #1 _function:w }
{ \siunitx_unit_parse_qualifier:n {#2} }
}
\cs_new_protected:Npn \siunitx_declare_unit:Nnn #1#2#3 {
- \tl_put_right:Nn \l_siunitx_declare_list_tl {#1}
+ \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
\cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w } {#2}
\cs_set_protected:cpn { siunitx_ \token_to_str:N #1 _function:w }
{
@@ -4075,7 +4078,7 @@
\cs_if_exist:NT \cancel
{
\cs_set_eq:NN \siunitx_cancel:n \cancel
- \tl_put_right:Nn \l_siunitx_declare_list_tl { \cancel }
+ \seq_put_right:Nn \l_siunitx_declare_list_seq { \cancel }
\cs_new_protected:cpn
{ siunitx_ \token_to_str:N \cancel _function:w }
{ \siunitx_unit_parse_special:n { \siunitx_cancel:n } }
@@ -4102,7 +4105,7 @@
use-xspace ,
}
\cs_new_protected:Npn \siunitx_unit_create_empty_functions: {
- \tl_map_function:NN \l_siunitx_declare_list_tl
+ \seq_map_function:NN \l_siunitx_declare_list_seq
\siunitx_unit_create_empty_functions_aux:N
}
\cs_new_protected:Npn
@@ -4111,14 +4114,14 @@
}
\cs_new_protected:Npn \siunitx_unit_create_functions: {
\bool_if:NT \l_siunitx_create_overwrite_bool
- { \tl_map_function:NN \l_siunitx_declare_list_tl \cs_undefine:N }
+ { \seq_map_function:NN \l_siunitx_declare_list_seq \cs_undefine:N }
\bool_if:NTF \l_siunitx_create_optional_bool
{
- \tl_map_function:NN \l_siunitx_declare_list_tl
+ \seq_map_function:NN \l_siunitx_declare_list_seq
\siunitx_unit_create_with_arg:N
}
{
- \tl_map_function:NN \l_siunitx_declare_list_tl
+ \seq_map_function:NN \l_siunitx_declare_list_seq
\siunitx_unit_create:N
}
\bool_if:NT \l_siunitx_create_xspace_bool
@@ -4251,22 +4254,32 @@
}
\cs_generate_variant:Nn \siunitx_unit_in:nn { V }
\cs_new:Npn \siunitx_pm: { }
-\cs_new_protected:Npn \siunitx_unit_if_literal:nTF #1#2#3 {
- \group_begin:
- \tl_map_function:NN \l_siunitx_declare_list_tl
- \siunitx_unit_if_literal_aux:N
- \cs_set_eq:NN \of \use_none:n
- \cs_set_eq:NN \highlight \use_none:n
- \cs_set_eq:NN \raiseto \use_none:n
- \cs_set_eq:NN \tothe \use_none:n
- \protected@edef \l_siunitx_tmpa_tl {#1}
- \exp_args:NNNV \group_end:
- \tl_set:Nn \l_siunitx_tmpa_tl \l_siunitx_tmpa_tl
- \tl_if_empty:NTF \l_siunitx_tmpa_tl {#3} {#2}
-}
-\cs_new_protected:Npn \siunitx_unit_if_literal_aux:N #1 {
- \cs_set_eq:NN #1 \prg_do_nothing:
-}
+\cs_new_protected:Npn \siunitx_unit_if_literal:nTF #1
+ {
+ \bool_set_false:N \l_siunitx_tmp_bool
+ \tl_map_function:nN {#1} \siunitx_unit_if_literal_aux:n
+ \bool_if:NTF \l_siunitx_tmp_bool
+ }
+\cs_new_protected:Npn \siunitx_unit_if_literal_aux_std:n #1
+ {
+ \cs_if_exist:cF { siunitx_ \tl_to_str:o { \token_to_str:N #1 } _function:w }
+ {
+ \bool_set_true:N \l_siunitx_tmp_bool
+ \tl_map_break:
+ }
+ \tl_if_in:nnT { \of \highlight \raiseto \tothe } {#1}
+ {
+ \cs_set_eq:NN \siunitx_unit_if_literal_aux:n
+ \siunitx_unit_if_literal_aux_skip:n
+ }
+ }
+\cs_new_protected:Npn \siunitx_unit_if_literal_aux_skip:n #1
+ {
+ \cs_set_eq:NN \siunitx_unit_if_literal_aux:n
+ \siunitx_unit_if_literal_aux_std:n
+ }
+\cs_new_eq:NN \siunitx_unit_if_literal_aux:n \siunitx_unit_if_literal_aux_std:n
+\cs_generate_variant:Nn \tl_to_str:n { o }
\int_new:N \l_siunitx_unit_int
\prop_new:N \l_siunitx_unit_prop
\prop_new:N \l_siunitx_unit_saved_prop
@@ -4283,16 +4296,14 @@
\siunitx_unit_parse_options:nn {#1} {#2}
#1
}
-\cs_new_protected:Npn \siunitx_unit_parse_init: {
- \prop_clear:N \l_siunitx_unit_prop
- \int_zero:N \l_siunitx_unit_int
- \bool_set_false:N \l_siunitx_per_bool
- \tl_map_function:NN \l_siunitx_declare_list_tl
- \siunitx_unit_parse_init_aux:N
-}
-\cs_new_protected:Npn \siunitx_unit_parse_init_aux:N #1 {
- \cs_set_eq:Nc #1 { siunitx_ \token_to_str:N #1 _function:w }
-}
+\cs_new_protected:Npn \siunitx_unit_parse_init:
+ {
+ \prop_clear:N \l_siunitx_unit_prop
+ \int_zero:N \l_siunitx_unit_int
+ \bool_set_false:N \l_siunitx_per_bool
+ \seq_map_inline:Nn \l_siunitx_declare_list_seq
+ { \cs_set_eq:Nc ##1 { siunitx_ \token_to_str:N ##1 _function:w } }
+ }
\cs_new_protected:Npn \siunitx_unit_parse_options:nn #1#2 {
\tl_if_single:nT {#1}
{
@@ -4653,15 +4664,15 @@
\int_zero:N \l_siunitx_unit_prefix_int
\int_zero:N \l_siunitx_unit_denominator_int
\int_zero:N \l_siunitx_unit_numerator_int
- \tl_map_function:NN \l_siunitx_declare_list_tl
- \siunitx_unit_print_literal_aux:N
+ \seq_map_inline:Nn \l_siunitx_declare_list_seq
+ { \siunitx_unit_print_literal_aux:N ##1 }
}
\char_set_catcode_active:N \~
\cs_new_protected:Npn \siunitx_unit_format_literal:n #1
{
\int_zero:N \l_siunitx_unit_prefix_int
- \tl_map_function:NN \l_siunitx_declare_list_tl
- \siunitx_unit_print_literal_aux:N
+ \seq_map_inline:Nn \l_siunitx_declare_list_seq
+ { \siunitx_unit_print_literal_aux:N ##1 }
\tl_set:Nn \l_siunitx_unit_tl {#1}
\tl_set:Nx \l_siunitx_tmpa_tl
{ \exp_not:N \ensuremath { \exp_not:V \l_siunitx_unit_product_tl } }
@@ -5407,7 +5418,7 @@
\siunitx_detect_font:
\bool_if:NTF \l_siunitx_number_parse_bool
{ \siunitx_table_collect_get: }
- { \siunitx_table_print_S_direct: }
+ { \siunitx_table_print_S_direct:N }
}
\cs_new_protected:Npn \siunitx_table_collect_braced:n #1 { }
\cs_new_protected:Npn \siunitx_table_collect_expand:N #1 {
@@ -5899,7 +5910,6 @@
}
{
\siunitx_table_column_begin:n { \l_siunitx_table_number_align_skip }
- \siunitx_detect_font:
\bool_if:NTF \l_siunitx_table_parse_only_bool
{ \siunitx_table_print_S_no_alignment: }
{ \siunitx_table_print_S_alignment: }
@@ -6009,7 +6019,10 @@
}
\dim_compare:nNnT
{ \box_wd:N \l_siunitx_table_pre_box } = \c_zero_skip
- { \l_siunitx_table_collect_pre_tl }
+ {
+ \l_siunitx_table_collect_pre_tl
+ \bool_set_false:N \l_siunitx_font_set_bool
+ }
\hbox_set:Nn \l_siunitx_table_post_box
{
\bool_if:NT \l_siunitx_table_math_bool
@@ -6111,10 +6124,10 @@
{ \siunitx_number_process_uncertainty: }
\siunitx_number_format:
\prop_get:NnNT \l_siunitx_table_model_prop { mantissa-decimal-raw }
- \l_siunitx_tmp_tl
+ \l_siunitx_tmpa_tl
{
\prop_put:NnV \l_siunitx_number_out_prop { mantissa-decimal-raw }
- \l_siunitx_tmp_tl
+ \l_siunitx_tmpa_tl
}
\prop_set_eq:NN \l_siunitx_table_model_prop \l_siunitx_number_out_prop
}
@@ -6133,7 +6146,10 @@
}
\dim_compare:nNnT
{ \box_wd:N \l_siunitx_table_pre_box } = \c_zero_skip
- { \l_siunitx_table_collect_pre_tl }
+ {
+ \l_siunitx_table_collect_pre_tl
+ \bool_set_false:N \l_siunitx_font_set_bool
+ }
\hbox_set:Nn \l_siunitx_tmp_box { { \l_siunitx_table_pre_tl } }
\hbox_set_to_wd:Nnn \l_siunitx_table_pre_box
{ \box_wd:N \l_siunitx_tmp_box }
@@ -6414,10 +6430,25 @@
- \box_wd:N \l_siunitx_tmp_box
}
}
-\cs_new_protected:Npn \siunitx_table_print_S_direct:
+\cs_new_protected:Npn \siunitx_table_print_S_direct:N #1
+ {
+ #1
+ \cs_set:Npn \peek_execute_branches:
+ {
+ \if_catcode:w \exp_not:N \l_peek_token \c_group_begin_token
+ \exp_after:wN \siunitx_table_print_S_direct_text:n
+ \else:
+ \m@th
+ \exp_after:wN \siunitx_table_print_S_direct_main:
+ \fi:
+ }
+ \peek_after:Nw \peek_ignore_spaces_execute_branches:
+ }
+\cs_new_protected:Npn \siunitx_table_print_S_direct_text:n #1
{
- \m@th
- \siunitx_table_print_S_direct_main:
+ \siunitx_table_column_begin:n { \l_siunitx_table_text_align_skip }
+ #1
+ \siunitx_table_column_end:n { \l_siunitx_table_text_align_skip }
}
\char_set_catcode_active:N \@
\cs_new_protected:Npn \siunitx_table_print_S_direct_centered:
@@ -7030,8 +7061,8 @@
\cs_set_eq:NN \label \use_none:n
\cs_set_eq:NN \index \use_none:n
\cs_set_eq:NN \glossary \use_none:n
- \tl_map_function:NN \l_siunitx_declare_list_tl
- \siunitx_contents_add:N
+ \seq_map_inline:Nn \l_siunitx_declare_list_seq
+ { \siunitx_contents_add:N ##1 }
}
{ \token_to_str:N \@writefile {#1} {#2} }
}
@@ -7046,8 +7077,8 @@
}
\cs_new_protected:Npn \siunitx_contents_bookmarks:
{
- \tl_map_function:NN \l_siunitx_declare_list_tl
- \siunitx_unit_print_literal_aux:N
+ \seq_map_inline:Nn \l_siunitx_declare_list_seq
+ { \siunitx_unit_print_literal_aux:N ##1 }
\msg_redirect_name:nnn { xparse } { redefine-command } { none }
\cs_set_eq:NN \num \siunitx_bookmark_num:w
\cs_set_eq:NN \numrange \siunitx_bookmark_numrange:w