diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-17 23:01:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-17 23:01:45 +0000 |
commit | cbd4018bd78f522ae48bf07d66256fcc09fd2436 (patch) | |
tree | 817ae1f3928a4e3317ad2dee3703dd72e6d926e0 /Master/texmf-dist/tex/latex/acro/acro.sty | |
parent | 504fe273e928d794b6d3f78a106116142faca8f7 (diff) |
acro (17feb19)
git-svn-id: svn://tug.org/texlive/trunk@50045 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/acro/acro.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/acro/acro.sty | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty index acd2c62150b..21f721615e9 100644 --- a/Master/texmf-dist/tex/latex/acro/acro.sty +++ b/Master/texmf-dist/tex/latex/acro/acro.sty @@ -8,7 +8,7 @@ % Web: https://bitbucket.org/cgnieder/acro/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2011--2018 Clemens Niederberger +% Copyright 2011--2019 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -31,8 +31,8 @@ \RequirePackage{expl3,xparse,l3keys2e,xtemplate,etoolbox} \ProvidesExplPackage {acro} - {2017/01/30} - {2.8} + {2019/02/17} + {2.9} {Typeset Acronyms} % -------------------------------------------------------------------------- @@ -144,6 +144,8 @@ | \__acro_write_log_property:nnn {#1} {long-#2-form} {long_#2_form} \\ | \__acro_write_log_property:nnn {#1} {alt-#2} {alt_#2} \\ | \__acro_write_log_property:nnn {#1} {alt-#2-form} {alt_#2_form} \\ + | \__acro_write_log_property:nnn {#1} {foreign-#2} {foreign_#2} \\ + | \__acro_write_log_property:nnn {#1} {foreign-#2-form} {foreign_#2_form} \\ } \msg_new:nnn {acro} {log-acronym-verbose} @@ -309,6 +311,7 @@ \bool_new:N \l__acro_use_hyperref_bool \bool_new:N \l__acro_xspace_bool \bool_new:N \l__acro_custom_format_bool +\bool_new:N \l__acro_custom_long_format_bool \bool_new:N \l__acro_strict_bool \bool_new:N \l__acro_create_macros_bool \bool_new:N \l__acro_first_upper_bool @@ -814,7 +817,10 @@ !\l__acro_first_only_short_bool && !\l__acro_first_only_long_bool } - { \acro_write_foreign:n {#1} } + { + \acro_write_foreign:n {#1} + \acro_endings:nn {#1} {foreign} + } } \cs_new_protected:Npn \__acro_print_citation:n #1 @@ -2033,6 +2039,7 @@ \__acro_set_ending_for:nnn {#1} {#2} {short} \__acro_set_ending_for:nnn {#1} {#2} {alt} \__acro_set_ending_for:nnn {#1} {#2} {long} + \__acro_set_ending_for:nnn {#1} {#2} {foreign} % XXX } } @@ -2152,6 +2159,8 @@ \acro_set_ending_variables:nnn {alt} {#1} {#2} % long variables \acro_set_ending_variables:nnn {long} {#1} {#3} + % foreign variables % XXX + \acro_set_ending_variables:nnn {foreign} {#1} {#3} } { % registering: @@ -2165,6 +2174,8 @@ \acro_define_and_set_ending_variables:nnn {alt} {#1} {#2} % long variables \acro_define_and_set_ending_variables:nnn {long} {#1} {#3} + % foreign variables % XXX + \acro_define_and_set_ending_variables:nnn {foreign} {#1} {#3} % define setup command: \tl_set:Nn \l__acro_tmpa_tl {#1} \tl_replace_all:Nnn \l__acro_tmpa_tl {-} {_} @@ -2211,10 +2222,21 @@ \prop_put:cnn {l__acro_long_#1_form_prop} {##1} { \c_true_bool } \prop_put:cnn {l__acro_long_#1_prop} {##1} {##2} } + % foreign-<ending>: % XXX + \acro_declare_property:nnn {foreign_#1} {foreign-#1} + { \prop_put:cnn {l__acro_foreign_#1_form_prop} {##1} { \c_false_bool } } + % foreign-<ending>-form: % XXX + \acro_declare_property_generic:nnn {foreign_#1_form} {foreign-#1-form} + { + \__acro_property_check:nn {##1} {foreign-#1-form} + \prop_put:cnn {l__acro_foreign_#1_form_prop} {##1} { \c_true_bool } + \prop_put:cnn {l__acro_foreign_#1_prop} {##1} {##2} + } % options: % short-<ending>-ending % alt-<ending>-ending % long-<ending>-ending + % foreign-<ending>-ending % XXX % <ending>-ending \keys_define:nn {acro} { @@ -2229,7 +2251,11 @@ long-#1-ending .code:n = \bool_if:NT \g__acro_first_acronym_declared_bool { \acro_serious_message:n {ending-before-acronyms} } - \tl_set:cn {l__acro_default_long_#1_tl} {##1}, + \tl_set:cn {l__acro_default_long_#1_tl} {##1} , + foreign-#1-ending .code:n = + \bool_if:NT \g__acro_first_acronym_declared_bool + { \acro_serious_message:n {ending-before-acronyms} } + \tl_set:cn {l__acro_default_foreign_#1_tl} {##1} , #1-ending .code:n = \bool_if:NT \g__acro_first_acronym_declared_bool { \acro_serious_message:n {ending-before-acronyms} } @@ -2289,8 +2315,14 @@ \acro_set_ending_variables:nnn {short} {#1} {#2} \acro_set_ending_variables:nnn {alt} {#1} {#2} \tl_if_blank:nTF {#4} - { \acro_set_ending_variables:nnn {long} {#1} {#3} } - { \acro_set_ending_variables:nnn {long} {#1} {#2} } + { + \acro_set_ending_variables:nnn {long} {#1} {#3} + \acro_set_ending_variables:nnn {foreign} {#1} {#3} % XXX + } + { + \acro_set_ending_variables:nnn {long} {#1} {#2} + \acro_set_ending_variables:nnn {foreign} {#1} {#2} + } } \NewDocumentCommand \ProvideAcroEnding {mmm} @@ -2553,9 +2585,10 @@ \cs_new_protected:Npn \acro_get_foreign:n #1 { - \prop_get:NnNT \l__acro_foreign_prop {#1} \l__acro_foreign_tl + \prop_if_in:NnT \l__acro_foreign_prop {#1} { \tl_use:N \l__acro_foreign_sep_tl + \prop_get:NnN \l__acro_foreign_prop {#1} \l__acro_foreign_tl \group_begin: \tl_use:N \l__acro_foreign_list_format_tl { @@ -2962,7 +2995,7 @@ \acro_strcmp:nn { \str_fold_case:n {##1} } { \str_fold_case:n {##2} } - = \c_minus_one + = - \c_one } { \sort_return_same: } { \sort_return_swapped: } @@ -3627,15 +3660,17 @@ % long: \acro_declare_property:nnn {long} {long} { - \acro_for_endings_do:n - { \prop_put:cnn {l__acro_long_##1_form_prop} {#1} { \c_false_bool } } \prop_put:NnV \l__acro_long_indefinite_prop {#1} \l__acro_default_indefinite_tl \acro_for_endings_do:n { + \prop_put:cnn {l__acro_long_##1_form_prop} {#1} { \c_false_bool } \bool_if:cF {l__acro_#1_long-##1_set_bool} { \prop_put:cnv {l__acro_long_##1_prop} {#1} {l__acro_default_long_##1_tl} } + \prop_put:cnn {l__acro_foreign_##1_form_prop} {#1} { \c_false_bool } + \bool_if:cF {l__acro_#1_foreign-##1_set_bool} + { \prop_put:cnv {l__acro_foreign_##1_prop} {#1} {l__acro_default_foreign_##1_tl} } } } @@ -3690,7 +3725,7 @@ % foreign: \acro_declare_simple_property:n {foreign} -% foreign: +% foreign-lang: \acro_declare_simple_property:n {foreign-lang} % format: @@ -4651,6 +4686,10 @@ - new property `post' - \aciffirst - resolve issue #95 +2019/02/17 v2.9 - small redefinition of \acro_get_foreign:n which allows + `foreign-sep' to be a & + - fix issue #116 + - implemented issue #112 % -------------------------------------------------------------------------- % TODO: |