From d5709428a00f6f927914e8afd574594ea4456a14 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 22 Nov 2020 22:16:23 +0000 Subject: acro (22nov20) git-svn-id: svn://tug.org/texlive/trunk@56982 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/acro/acro.sty | 99 +++++++++++++++++++----------- Master/texmf-dist/tex/latex/acro/acro2.sty | 6 +- 2 files changed, 64 insertions(+), 41 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty index 1e1bfb4baaf..d3ab51cf9b5 100644 --- a/Master/texmf-dist/tex/latex/acro/acro.sty +++ b/Master/texmf-dist/tex/latex/acro/acro.sty @@ -27,10 +27,10 @@ % setup package: \tl_const:Nn \c_acro_package_name_tl {acro} -\tl_const:Nn \c_acro_date_tl {2020/11/08} +\tl_const:Nn \c_acro_date_tl {2020/11/21} \tl_const:Nn \c_acro_version_major_number_tl {3} -\tl_const:Nn \c_acro_version_minor_number_tl {2} -\tl_const:Nn \c_acro_version_subrelease_tl {a} +\tl_const:Nn \c_acro_version_minor_number_tl {3} +\tl_const:Nn \c_acro_version_subrelease_tl {} \tl_const:Nx \c_acro_version_number_tl { \c_acro_version_major_number_tl . @@ -656,7 +656,7 @@ \clist_map_inline:nn {#1} { \acro_package_if_loaded:nF {##1} - { \msg_error:nnen {acro} {package-needed} { \TemplateName } {##1} } + { \msg_error:nnen {acro} {package-needed} { \AcroTemplateName } {##1} } } } @@ -921,7 +921,7 @@ { \acro_print_pages:enn { \AcronymID } {#1} {#2} } \NewDocumentCommand \acronopagerange {} - { \acro_no_page_ranges:e { \TemplateName } } + { \acro_no_page_ranges:e { \AcroTemplateName } } \NewDocumentCommand \acropagefill {} { \acro_if_pages:eT { \AcronymID } { \tl_use:N \l__acro_pages_fill_tl } } @@ -1718,7 +1718,7 @@ \DeclareAcroProperty {foreign-locale} % additional properties: -\DeclareAcroPropertyAlias {single} {long} +\DeclareAcroProperty {single} \DeclareAcroPropertyAlias {list} {long} \DeclareAcroPropertyAlias {first-long} {long} \DeclareAcroProperty {extra} @@ -1734,7 +1734,7 @@ \DeclareAcroPropertyAlias {long-format} {format} \DeclareAcroPropertyAlias {first-long-format} {long-format} \DeclareAcroProperty {foreign-format} -\DeclareAcroProperty {single-format} +% \DeclareAcroProperty {single-format} \DeclareAcroProperty {list-format} \DeclareAcroProperty {extra-format} @@ -1745,7 +1745,6 @@ \acro_list_add:nn {short} {#1-acc} } -\DeclareAcroPropertyAlias {single-acc} {long-acc} \acro_list_map:nn {long} { \DeclareAcroPropertyAlias {#1-acc} {#1} @@ -2008,10 +2007,7 @@ \cs_new_protected:Npn \acro_new_format:n #1 { \tl_new:c {l__acro_format_#1_tl} - \keys_define:nn {acro/format} - { - #1 .tl_set:c = l__acro_format_#1_tl - } + \keys_define:nn {acro/format} { #1 .tl_set:c = l__acro_format_#1_tl } } \acro_new_format:n {short} @@ -2026,7 +2022,7 @@ { format .meta:n = { format/short = #1 , format/long = #1 } , format / replace .bool_set:N = \l__acro_format_replace_bool , - format / replace .initial:n = false + format / replace .initial:n = true } % ---------------------------------------------------------------------------- @@ -2413,8 +2409,9 @@ \str_case:nnTF {#1} { {true} {} {false} {} } { \use:c {bool_set_#1:N} \l__acro_cite_group_bool } - { \msg_error:nnn {kernel} {boolean-values-only} {group} } , + { \msg_error:nnn {acro} {boolean-values-only} {cite/group} } , group .initial:n = false , + group .default:n = true , display .choice: , display/all .code:n = \bool_set_true:N \l__acro_cite_bool @@ -2432,6 +2429,12 @@ group / cmd .initial:n = \cite } +\msg_new:nnn {acro} {boolean-values-only} + { + The~ option~ `#1'~ can~ only~ receive~ boolean~ values,~ i.e.~ either~ + `true'~ or~ `false'. + } + % -------------------------------------------------------------------------- % indexing \bool_new:N \l__acro_index_bool @@ -3273,6 +3276,7 @@ \cs_new_protected:Npn \acro_template_use:nnn #1#2#3 { \bool_set_false:N \l__acro_tmpa_bool + \bool_set_false:N \l__acro_tmpb_bool \bool_lazy_and:nnT { \l__acro_use_only_first_bool } { \l__acro_use_bool } @@ -3289,12 +3293,16 @@ { !\l__acro_first_bool } { \acro_if_single_p:V \l_acro_id_tl } { - \acro_property_if_set:VnTF \l_acro_id_tl {single-style} + \acro_property_if_set:VnTF \l_acro_id_tl {single} + { \bool_set_true:N \l__acro_tmpb_bool } { - \tl_set:Ne \l__acro_tmpa_tl - { \acro_property_get:Vn \l_acro_id_tl {single-style} } + \acro_property_if_set:VnTF \l_acro_id_tl {single-style} + { + \tl_set:Ne \l__acro_tmpa_tl + { \acro_property_get:Vn \l_acro_id_tl {single-style} } + } + { \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_single_tl } } - { \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_single_tl } } { \acro_if_first:VTF \l_acro_id_tl @@ -3310,12 +3318,16 @@ } } {single} { - \acro_property_if_set:VnTF \l_acro_id_tl {single-style} + \acro_property_if_set:VnTF \l_acro_id_tl {single} + { \bool_set_true:N \l__acro_tmpb_bool } { - \tl_set:Ne \l__acro_tmpa_tl - { \acro_property_get:Vn \l_acro_id_tl {single-style} } + \acro_property_if_set:VnTF \l_acro_id_tl {single-style} + { + \tl_set:Ne \l__acro_tmpa_tl + { \acro_property_get:Vn \l_acro_id_tl {single-style} } + } + { \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_single_tl } } - { \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_single_tl } } } { \tl_set:Nn \l__acro_tmpa_tl {#3} } @@ -3328,7 +3340,9 @@ } { \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_first_style_tl } } - \__acro_template_use:nnV {#1} {#2} \l__acro_tmpa_tl + \bool_if:NTF \l__acro_tmpb_bool + { \__acro_template_use:nnn {#1} {#2} {single} } + { \__acro_template_use:nnV {#1} {#2} \l__acro_tmpa_tl } } \cs_generate_variant:Nn \acro_template_use:nnn {nnV} @@ -3589,7 +3603,8 @@ postamble .tl_set:N = \l__acro_postamble_tl , postamble .initial:n = , name .tl_set:N = \l__acro_list_name_tl , - name .initial:n = \acro_translate:n {list-name} + name .initial:n = \acro_translate:n {list-name} , + pages .meta:nn = {acro/pages} {#1} } \acro_if_komascript:TF @@ -3670,12 +3685,21 @@ } { \bool_if:NT \l__acro_pages_name_display_bool {#2} - \pageref { \l_acro_label_prefix_tl #1 } + \acro_print_first_page:n {#1} } } } \cs_generate_variant:Nn \acro_print_pages:nnn {e} +% #1: id +\cs_set_protected:Npn \acro_print_first_page:n #1 + { + \seq_set_split:Nnx \l__acro_tmpa_seq {|} + { \acro_property_get:nn {#1} {pages} } + \exp_last_unbraced:Ne + \__acro_page_name:w { \seq_item:Nn \l__acro_tmpa_seq {1} } \q_stop + } + % #1: id % #2: one page % #3: more than one page @@ -3769,6 +3793,7 @@ } } } + \int_compare:nNnTF { \seq_count:N \l__acro_tmpb_seq } = 1 {#2} {#3} \seq_use:Nn \l__acro_tmpb_seq { \l__acro_pages_sep_tl } } @@ -3838,13 +3863,13 @@ } \prg_generate_conditional_variant:Nnn \acro_if_pages:n {e} {p,T,F,TF} -\acro_at_begin_document:n - { - \bool_lazy_and:nnT - { \l__acro_pages_display_bool } - { !\l__acro_pages_all_bool } - { \bool_set_true:N \l__acro_label_bool } - } +% \acro_at_begin_document:n +% { +% \bool_lazy_and:nnT +% { \l__acro_pages_display_bool } +% { !\l__acro_pages_all_bool } +% { \bool_set_true:N \l__acro_label_bool } +% } % #1: style name \cs_new_protected:Npn \acro_no_page_ranges:n #1 @@ -4945,11 +4970,10 @@ } \NewAcroTemplate {long} - { - \acroifTF {single} - { \acrowrite {single} } - { \acrowrite {long} } - } + { \acrowrite {long} } + +\NewAcroTemplate {single} + { \acrowrite {single} } \NewAcroTemplate {short} { \acrowrite {short} } @@ -5491,6 +5515,7 @@ \acro_removed_property:n {long-pre} \acro_removed_property:n {after-citation} \acro_removed_property:n {index-cmd} +\acro_removed_property:n {single-format} % ---------------------------------------------------------------------------- % old functions diff --git a/Master/texmf-dist/tex/latex/acro/acro2.sty b/Master/texmf-dist/tex/latex/acro/acro2.sty index bed07791229..d5c7d0b59f8 100644 --- a/Master/texmf-dist/tex/latex/acro/acro2.sty +++ b/Master/texmf-dist/tex/latex/acro/acro2.sty @@ -11,12 +11,12 @@ % Copyright 2011--2020 Clemens Niederberger % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% version 2008/05/04 or later. % % This work has the LPPL maintenance status `maintained'. % @@ -2481,8 +2481,6 @@ \cs_new_protected:Npn \acro@pages #1#2 { \tl_gset:cn {g__acro_#1_recorded_pages_tl} {#2} } - -\bool_new:N \g__acro_rerun_bool \cs_new_protected:Npn \acro@rerun@check { -- cgit v1.2.3