From 76534433cda538adf8d373d5ccae7f28d9072f8f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 4 Sep 2016 20:47:41 +0000 Subject: acro (4sep16) git-svn-id: svn://tug.org/texlive/trunk@41990 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/acro/acro.sty | 58 +++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 18 deletions(-) (limited to 'Master/texmf-dist/tex/latex/acro') diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty index 0e4549ea47c..70437125d2a 100644 --- a/Master/texmf-dist/tex/latex/acro/acro.sty +++ b/Master/texmf-dist/tex/latex/acro/acro.sty @@ -31,8 +31,8 @@ \RequirePackage{expl3,l3sort,xparse,l3keys2e,xtemplate,etoolbox} \ProvidesExplPackage {acro} - {2016/08/13} - {2.6a} + {2016/09/04} + {2.6e} {Typeset Acronyms} % -------------------------------------------------------------------------- @@ -581,9 +581,6 @@ \cs_new_eq:NN \acro_xspace: \xspace } { \cs_new:Npn \acro_xspace: {} } - \@ifpackageloaded {biblatex} - { \acro_reset_all: } - { } } % -------------------------------------------------------------------------- @@ -1628,25 +1625,40 @@ { \prg_return_false: } } -% this macro is used in templates for fetching all items to be printed: +\tl_new:N \l__acro_list_entries_tl + +% this macro is used in templates for fetching all items to be printed; it +% collects all entries in a tl which then is used where needed % -% #1: included classes -% #2: excluded classes -\cs_new_protected:Npn \acro_list_items:nn #1#2 +% #1: tl containing the entries +% #2: included classes +% #3: excluded classes +\cs_new_protected:Npn \acro_build_list_entries:Nnn #1#2#3 { + \tl_clear:N #1 \acro_for_all_acronyms_do:n {% ##1: id; ##2: short form \acro_get:n {##1} - \acro_if_entry:nnnT {##1} {#1} {#2} + \acro_if_entry:nnnT {##1} {#2} {#3} { - \acro_print_list_entry:nnnn - { \acro_list_entry:nn {short} {##1} } - { \acro_list_entry:nn {long} {##1} } - { \acro_list_entry:nn {extra} {##1} } - { \acro_list_entry:nn {page} {##1} } + \tl_put_right:Nn #1 + { + \acro_print_list_entry:nnnn + { \acro_list_entry:nn {short} {##1} } + { \acro_list_entry:nn {long} {##1} } + { \acro_list_entry:nn {extra} {##1} } + { \acro_list_entry:nn {page} {##1} } + } } } } + +% this macro is used in templates for fetching all items to be printed: +\cs_new_protected:Npn \acro_list_items:nn #1#2 + { + \acro_build_list_entries:Nnn \l__acro_list_entries_tl {#1} {#2} + \tl_use:N \l__acro_list_entries_tl + } % -------------------------------------------------------------------------- % declare templates for the list: @@ -1812,12 +1824,13 @@ \cs_set_protected:Npn \acro_print_list_entry:nnnn ##1##2##3##4 { ##1 & ##2 ##3 ##4 \tabularnewline } } + \acro_build_list_entries:Nnn \l__acro_list_entries_tl {#1} {#2} \use:x { \exp_not:V \l__acro_list_before_tl \exp_not:N \begin { \exp_not:V \l__acro_list_table_tl } { \exp_not:V \l__acro_list_table_spec_tl } - \exp_not:n { \acro_list_items:nn {#1} {#2} } + \exp_not:V \l__acro_list_entries_tl \exp_not:N \end { \exp_not:V \l__acro_list_table_tl } \exp_not:V \l__acro_list_after_tl } @@ -1855,12 +1868,13 @@ \cs_set_protected:Npn \acro_print_list_entry:nnnn ##1##2##3##4 { ##1 & ##2 & ##3 & ##4 \tabularnewline } } + \acro_build_list_entries:Nnn \l__acro_list_entries_tl {#1} {#2} \use:x { \exp_not:V \l__acro_list_before_tl \exp_not:N \begin { \exp_not:V \l__acro_list_table_tl } { \exp_not:V \l__acro_list_table_spec_tl } - \exp_not:n { \acro_list_items:nn {#1} {#2} } + \exp_not:V \l__acro_list_entries_tl \exp_not:N \end { \exp_not:V \l__acro_list_table_tl } \exp_not:V \l__acro_list_after_tl } @@ -3171,6 +3185,10 @@ \cs_new_protected:Npn \acro_reset_all: { \acro_for_all_acronyms_do:n { \acro_reset:n {##1} } } +% make sure that no acronym is used at the beginning of the document, see +% issue #81 for reasons why this may be necessary: +\AfterEndPreamble { \acro_reset_all: } + \cs_new_protected:Npn \acro_mark_all_as_used: { \acro_for_all_acronyms_do:n { \acro_mark_as_used:n {##1} } } @@ -3297,7 +3315,7 @@ \bool_set_false:N \l__acro_upper_indefinite_bool % \bool_set_false:N \l__acro_citation_all_bool % \bool_set_false:N \l__acro_citation_first_bool - \bool_set_false:N \l__acro_addto_index_bool + % \bool_set_false:N \l__acro_addto_index_bool \acro_for_endings_do:n { \bool_set_false:c {l__acro_##1_bool} } } @@ -4473,6 +4491,10 @@ - fix error: acronyms with same sort entry are not overwritten any more in the list of acronyms 2016/08/13 v2.6a - fix issues #80 and #81 +2016/08/13 v2.6b - version stepped by accident +2016/08/16 v2.6c - really fixes issue #81 +2016/08/30 v2.6d - fix issue #82 +2016/09/04 v2.6e - fix issue in http://tex.stackexchange.com/q/270034/ % -------------------------------------------------------------------------- % TODO: -- cgit v1.2.3