Skip to content

Commit

Permalink
v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Dec 25, 2020
1 parent b954fff commit 420e252
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 65 deletions.
6 changes: 6 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ The Current Maintainer of this work is Clemens Niederberger.
- fix issue #175
- fix issue #176
- fix issue #180
- add `patch' options
2020/11/21 v3.3 - fix issue #183
- fix issue #184
- fix issue #188
Expand All @@ -328,3 +329,8 @@ The Current Maintainer of this work is Clemens Niederberger.
- fix bug in \acro_print_pages:nnn
- allow page option setting in the argument of
\printacronyms (implements issue #189)
2020/12/25 v3.4 - fix issue #194
- new option `list/add'
- new: \acroneedpages
- add option `subsequent-style'
- add property `subsequent-style'
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
the ACRO package v3.3 2020/11/21
the ACRO package v3.4 2020/12/25

Typeset Acronyms

Expand Down
7 changes: 5 additions & 2 deletions code/acro.acronyms.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
\DeclareAcroProperty {post}
\DeclareAcroProperty {long-post}
\DeclareAcroProperty {first-style}
\DeclareAcroProperty {subsequent-style}
\DeclareAcroProperty {single-style}

% formatting:
Expand Down Expand Up @@ -139,8 +140,10 @@

\keys_define:nn {acro}
{
first-style .tl_set:N = \l__acro_first_style_tl ,
first-style .initial:n = long-short
first-style .tl_set:N = \l__acro_first_style_tl ,
first-style .initial:n = long-short ,
subsequent-style .tl_set:N = \l__acro_subsequent_tl ,
subsequent-style .initial:n = short
}

\cs_new_protected:Npn \acro_declare_acronym:nn #1#2
Expand Down
5 changes: 4 additions & 1 deletion code/acro.definitions.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,15 @@
\AcronymTable
\end {supertabular}
}

\let\l@acro\l@figure

\NewAcroTemplate [list] {lof}
{
\acroheading
\acropreamble
\acronopagerange
\let\l@acro\l@figure
\acroneedpages
\acronymsmapF
{
\contentsline {acro}
Expand All @@ -368,6 +370,7 @@
\acroheading
\acropreamble
\acronopagerange
\acroneedpages
\acronymsmapF
{
\contentsline { \acroifchapterTF {chapter} {section} }
Expand Down
3 changes: 3 additions & 0 deletions code/acro.interface.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@
\NewDocumentCommand \acronopagerange {}
{ \acro_no_page_ranges:e { \AcroTemplateName } }

\NewDocumentCommand \acroneedpages {}
{ \acro_need_pages: }

\NewDocumentCommand \acropagefill {}
{ \acro_if_pages:eT { \AcronymID } { \tl_use:N \l__acro_pages_fill_tl } }

Expand Down
21 changes: 9 additions & 12 deletions code/acro.pages.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
% record page numbers:
\RequirePackage {zref-abspage}

\msg_new:nnn {acro} {label}
{ The~ list~ template~ `#1'~ needs~ the~ option~ `labels'~ activated. }
\msg_new:nnn {acro} {no-page-range}
{
The~ list~ template~ `#1'~ cannot~ display~ a~ page~ range.
}

\msg_new:nnn {acro} {threshold}
{ The~ sequentes~ threshold~ needs~ to~ be~ at~ least~ 3. }
Expand Down Expand Up @@ -240,23 +242,18 @@
}
\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 }
% }

% #1: style name
\cs_new_protected:Npn \acro_no_page_ranges:n #1
{
\bool_if:NF \l__acro_label_bool
{ \msg_warning:nnn {acro} {label} {#1} }
\bool_if:NT \l__acro_pages_all_bool
{ \msg_warning:nnn {acro} {no-page-range} {#1} }
\bool_set_false:N \l__acro_pages_all_bool
}
\cs_generate_variant:Nn \acro_no_page_ranges:n {e}

\cs_new_protected:Npn \acro_need_pages:
{ \bool_set_true:N \l__acro_pages_display_bool }

\tl_new:N \l__acro_pages_fill_tl
\tl_new:N \l__acro_pages_sep_tl
\tl_new:N \l__acro_pages_seq_pre_tl
Expand Down
16 changes: 5 additions & 11 deletions code/acro.start.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\RequirePackage{expl3,xparse,l3keys2e}
\RequirePackage{l3keys2e}
\ExplSyntaxOn

% setup package:
\tl_const:Nn \c_acro_package_name_tl {acro}
\tl_const:Nn \c_acro_date_tl {2020/11/21}
\tl_const:Nn \c_acro_date_tl {2020/12/25}
\tl_const:Nn \c_acro_version_major_number_tl {3}
\tl_const:Nn \c_acro_version_minor_number_tl {3}
\tl_const:Nn \c_acro_version_minor_number_tl {4}
\tl_const:Nn \c_acro_version_subrelease_tl {}
\tl_const:Nx \c_acro_version_number_tl
{
Expand All @@ -54,14 +54,8 @@
\tl_new:N \g_acro_end_document_hook_tl
\tl_new:N \g_acro_begin_document_hook_tl

\AtBeginDocument { \tl_use:N \g_acro_begin_document_hook_tl }
\AtEndDocument { \tl_use:N \g_acro_end_document_hook_tl }

% \cs_new_protected:Npn \acro_at_begin_document:n #1
% { \hook_gput_code:nnn {begindocument} {acro} {#1} }

% \cs_new_protected:Npn \acro_at_end_document:n #1
% { \hook_gput_code:nnn {enddocument} {acro} {#1} }
\hook_gput_code:nnn {begindocument} {acro} { \tl_use:N \g_acro_begin_document_hook_tl }
\hook_gput_code:nnn {enddocument} {acro} { \tl_use:N \g_acro_end_document_hook_tl }

\cs_new_protected:Npn \acro_at_begin_document:n #1
{ \tl_gput_right:Nn \g_acro_begin_document_hook_tl {#1} }
Expand Down
64 changes: 36 additions & 28 deletions code/acro.sty
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\RequirePackage{expl3,xparse,l3keys2e}
\RequirePackage{l3keys2e}
\ExplSyntaxOn

% setup package:
\tl_const:Nn \c_acro_package_name_tl {acro}
\tl_const:Nn \c_acro_date_tl {2020/11/21}
\tl_const:Nn \c_acro_date_tl {2020/12/25}
\tl_const:Nn \c_acro_version_major_number_tl {3}
\tl_const:Nn \c_acro_version_minor_number_tl {3}
\tl_const:Nn \c_acro_version_minor_number_tl {4}
\tl_const:Nn \c_acro_version_subrelease_tl {}
\tl_const:Nx \c_acro_version_number_tl
{
Expand All @@ -54,14 +54,8 @@
\tl_new:N \g_acro_end_document_hook_tl
\tl_new:N \g_acro_begin_document_hook_tl

\AtBeginDocument { \tl_use:N \g_acro_begin_document_hook_tl }
\AtEndDocument { \tl_use:N \g_acro_end_document_hook_tl }

% \cs_new_protected:Npn \acro_at_begin_document:n #1
% { \hook_gput_code:nnn {begindocument} {acro} {#1} }

% \cs_new_protected:Npn \acro_at_end_document:n #1
% { \hook_gput_code:nnn {enddocument} {acro} {#1} }
\hook_gput_code:nnn {begindocument} {acro} { \tl_use:N \g_acro_begin_document_hook_tl }
\hook_gput_code:nnn {enddocument} {acro} { \tl_use:N \g_acro_end_document_hook_tl }

\cs_new_protected:Npn \acro_at_begin_document:n #1
{ \tl_gput_right:Nn \g_acro_begin_document_hook_tl {#1} }
Expand Down Expand Up @@ -929,6 +923,9 @@
\NewDocumentCommand \acronopagerange {}
{ \acro_no_page_ranges:e { \AcroTemplateName } }

\NewDocumentCommand \acroneedpages {}
{ \acro_need_pages: }

\NewDocumentCommand \acropagefill {}
{ \acro_if_pages:eT { \AcronymID } { \tl_use:N \l__acro_pages_fill_tl } }

Expand Down Expand Up @@ -1731,6 +1728,7 @@
\DeclareAcroProperty {post}
\DeclareAcroProperty {long-post}
\DeclareAcroProperty {first-style}
\DeclareAcroProperty {subsequent-style}
\DeclareAcroProperty {single-style}

% formatting:
Expand Down Expand Up @@ -1781,8 +1779,10 @@

\keys_define:nn {acro}
{
first-style .tl_set:N = \l__acro_first_style_tl ,
first-style .initial:n = long-short
first-style .tl_set:N = \l__acro_first_style_tl ,
first-style .initial:n = long-short ,
subsequent-style .tl_set:N = \l__acro_subsequent_tl ,
subsequent-style .initial:n = short
}

\cs_new_protected:Npn \acro_declare_acronym:nn #1#2
Expand Down Expand Up @@ -3310,7 +3310,7 @@
\cs_new_protected:Npn \__acro_template_stop:nn #1#2
{ \group_end: \__acro_clear_template_setup:nn {#1} {#2} }

% typesetting the first appearance of acronym: pseude template `first'
% typesetting the first appearance of acronym: pseudo template `first'

% #1: parameter number
% #2: template type
Expand Down Expand Up @@ -3356,7 +3356,14 @@
}
{ \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_first_style_tl }
}
{ \tl_set:Nn \l__acro_tmpa_tl {short} }
{
\acro_property_if_set:VnTF \l_acro_id_tl {subsequent-style}
{
\tl_set:Ne \l__acro_tmpa_tl
{ \acro_property_get:Vn \l_acro_id_tl {subsequent-style} }
}
{ \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_subsequent_tl }
}
}
}
{single} {
Expand Down Expand Up @@ -3682,8 +3689,10 @@
% record page numbers:
\RequirePackage {zref-abspage}

\msg_new:nnn {acro} {label}
{ The~ list~ template~ `#1'~ needs~ the~ option~ `labels'~ activated. }
\msg_new:nnn {acro} {no-page-range}
{
The~ list~ template~ `#1'~ cannot~ display~ a~ page~ range.
}

\msg_new:nnn {acro} {threshold}
{ The~ sequentes~ threshold~ needs~ to~ be~ at~ least~ 3. }
Expand Down Expand Up @@ -3919,23 +3928,18 @@
}
\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 }
% }

% #1: style name
\cs_new_protected:Npn \acro_no_page_ranges:n #1
{
\bool_if:NF \l__acro_label_bool
{ \msg_warning:nnn {acro} {label} {#1} }
\bool_if:NT \l__acro_pages_all_bool
{ \msg_warning:nnn {acro} {no-page-range} {#1} }
\bool_set_false:N \l__acro_pages_all_bool
}
\cs_generate_variant:Nn \acro_no_page_ranges:n {e}

\cs_new_protected:Npn \acro_need_pages:
{ \bool_set_true:N \l__acro_pages_display_bool }

\tl_new:N \l__acro_pages_fill_tl
\tl_new:N \l__acro_pages_sep_tl
\tl_new:N \l__acro_pages_seq_pre_tl
Expand Down Expand Up @@ -5235,13 +5239,15 @@
\AcronymTable
\end {supertabular}
}

\let\l@acro\l@figure

\NewAcroTemplate [list] {lof}
{
\acroheading
\acropreamble
\acronopagerange
\let\l@acro\l@figure
\acroneedpages
\acronymsmapF
{
\contentsline {acro}
Expand All @@ -5268,6 +5274,7 @@
\acroheading
\acropreamble
\acronopagerange
\acroneedpages
\acronymsmapF
{
\contentsline { \acroifchapterTF {chapter} {section} }
Expand Down Expand Up @@ -5652,6 +5659,7 @@
first-long-format .code:n =
\acro_deprecate_option:nn {format/first-long} {#1} ,
list-short-format .code:n = \acro_remove_option: ,
list-short-width .code:n = \acro_remove_option: ,
list-long-format .code:n =
\acro_deprecate_option:nn {format/list} {#1} ,
list-foreign-format .code:n = \acro_remove_option: ,
Expand Down
11 changes: 9 additions & 2 deletions code/acro.templates.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
\cs_new_protected:Npn \__acro_template_stop:nn #1#2
{ \group_end: \__acro_clear_template_setup:nn {#1} {#2} }

% typesetting the first appearance of acronym: pseude template `first'
% typesetting the first appearance of acronym: pseudo template `first'

% #1: parameter number
% #2: template type
Expand Down Expand Up @@ -158,7 +158,14 @@
}
{ \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_first_style_tl }
}
{ \tl_set:Nn \l__acro_tmpa_tl {short} }
{
\acro_property_if_set:VnTF \l_acro_id_tl {subsequent-style}
{
\tl_set:Ne \l__acro_tmpa_tl
{ \acro_property_get:Vn \l_acro_id_tl {subsequent-style} }
}
{ \tl_set_eq:NN \l__acro_tmpa_tl \l__acro_subsequent_tl }
}
}
}
{single} {
Expand Down
1 change: 1 addition & 0 deletions code/acro.upgrade.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
first-long-format .code:n =
\acro_deprecate_option:nn {format/first-long} {#1} ,
list-short-format .code:n = \acro_remove_option: ,
list-short-width .code:n = \acro_remove_option: ,
list-long-format .code:n =
\acro_deprecate_option:nn {format/list} {#1} ,
list-foreign-format .code:n = \acro_remove_option: ,
Expand Down
3 changes: 2 additions & 1 deletion doc/acro-manual.cls
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
% used in templates and command definitions:
acroindefinite, acroformat, acrofull, acrogroupcite, acroheading,
acronymsmap, acronymsmapF, acronymsmapT, acroupper,
acronopagerange,
acroneedpages, acronopagerange,
acroifF, acroifT, acroifTF, acroifallF, acroifallT, acroifallTF,
acroifanyF, acroifanyT, acroifanyTF, acroifchapterF, acroifchapterT,
acroifchapterTF, acroiffirstF, acroiffirstT, acroiffirstTF,
Expand Down Expand Up @@ -657,5 +657,6 @@
\acro@add@version{2020-05-10}{3.2}
\acro@add@version{2020-11-08}{3.2a}
\acro@add@version{2020-11-21}{3.3}
\acro@add@version{2020-12-25}{3.4}

\endinput
Binary file modified doc/acro-manual.pdf
Binary file not shown.
Loading

0 comments on commit 420e252

Please sign in to comment.