Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some list short-form formatting options #260

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/acro.acronyms.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
\DeclareAcroProperty {foreign-format}
% \DeclareAcroProperty {single-format}
\DeclareAcroProperty {list-format}
\DeclareAcroProperty {list-label-format}
\DeclareAcroProperty {extra-format}

% Accessibility:
Expand Down
23 changes: 10 additions & 13 deletions code/acro.definitions.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
\begin {description}
\acronymsmapF
{
\item [ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} ]
\item [ \acrolistlabel ]
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
\acrowrite {foreign}
Expand Down Expand Up @@ -229,8 +229,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -262,8 +261,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -296,8 +294,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -329,8 +326,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -375,8 +371,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -413,7 +408,9 @@
\contentsline {acro}
{
\numberline
{ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} }
{
\acrolistlabel
}
{
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand All @@ -438,7 +435,7 @@
\acronymsmapF
{
\contentsline { \acroifchapterTF {chapter} {section} }
{ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} }
{ \acrolistlabel }
{}{}
\contentsline { \acroifchapterF {sub} section }
{
Expand Down
1 change: 1 addition & 0 deletions code/acro.formatting.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
\acro_new_format:n {extra}
\acro_new_format:n {foreign}
\acro_new_format:n {list}
\acro_new_format:n {list-label}
\acro_new_format:n {first-long}

\keys_define:nn {acro}
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 @@ -187,6 +187,7 @@
\group_begin:
\IfNoValueF {#1}
{ \keys_set:nn {acro/list} {#1} }
\tl_use:N \l__acro_list_format_keys_tl
\acro_list:
\group_end:
}
Expand All @@ -200,6 +201,8 @@
\NewExpandableDocumentCommand \acrolistname {}
{ \tl_use:N \l__acro_list_name_tl }

\NewDocumentCommand \acrolistlabel {} { \acro_list_label: }

% --------------------------------------------------------------------------
% cmmands for use in templates:
\NewDocumentCommand \acronymsmapTF {+m+m+m}
Expand Down
15 changes: 14 additions & 1 deletion code/acro.list.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
\seq_new:N \g__acro_list_seq

\tl_new:N \l__acro_list_tl
\tl_new:N \l__acro_list_format_keys_tl

\clist_new:N \l__acro_tag_include_clist
\clist_new:N \l__acro_tag_exclude_clist
Expand Down Expand Up @@ -149,6 +150,13 @@

\tl_new:N \l__acro_list_name_tl

\tl_new:N \l__acro_list_label_tl

\cs_new_protected:Npn \acro_list_label:
{
\acroformat {list-label} { \tl_use:N \l__acro_list_label_tl }
}

% --------------------------------------------------------------------------
\keys_define:nn {acro/list}
{
Expand All @@ -171,7 +179,12 @@
postamble .initial:n = ,
name .tl_set:N = \l__acro_list_name_tl ,
name .initial:n = \acro_translate:n {list-name} ,
pages .meta:nn = {acro/pages} {#1}
label .tl_set:N = \l__acro_list_label_tl ,
label .initial:n =
\acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} ,
pages .meta:nn = {acro/pages} {#1} ,
format .code:n =
\keys_precompile:nnN {acro/format} {#1} \l__acro_list_format_keys_tl
}

\acro_if_komascript:TF
Expand Down
43 changes: 29 additions & 14 deletions code/acro.sty
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@
\group_begin:
\IfNoValueF {#1}
{ \keys_set:nn {acro/list} {#1} }
\tl_use:N \l__acro_list_format_keys_tl
\acro_list:
\group_end:
}
Expand All @@ -834,6 +835,8 @@
\NewExpandableDocumentCommand \acrolistname {}
{ \tl_use:N \l__acro_list_name_tl }

\NewDocumentCommand \acrolistlabel {} { \acro_list_label: }

% --------------------------------------------------------------------------
% cmmands for use in templates:
\NewDocumentCommand \acronymsmapTF {+m+m+m}
Expand Down Expand Up @@ -1887,6 +1890,7 @@
\DeclareAcroProperty {foreign-format}
% \DeclareAcroProperty {single-format}
\DeclareAcroProperty {list-format}
\DeclareAcroProperty {list-label-format}
\DeclareAcroProperty {extra-format}

% Accessibility:
Expand Down Expand Up @@ -2198,6 +2202,7 @@
\acro_new_format:n {extra}
\acro_new_format:n {foreign}
\acro_new_format:n {list}
\acro_new_format:n {list-label}
\acro_new_format:n {first-long}

\keys_define:nn {acro}
Expand Down Expand Up @@ -3718,6 +3723,7 @@
\seq_new:N \g__acro_list_seq

\tl_new:N \l__acro_list_tl
\tl_new:N \l__acro_list_format_keys_tl

\clist_new:N \l__acro_tag_include_clist
\clist_new:N \l__acro_tag_exclude_clist
Expand Down Expand Up @@ -3860,6 +3866,13 @@

\tl_new:N \l__acro_list_name_tl

\tl_new:N \l__acro_list_label_tl

\cs_new_protected:Npn \acro_list_label:
{
\acroformat {list-label} { \tl_use:N \l__acro_list_label_tl }
}

% --------------------------------------------------------------------------
\keys_define:nn {acro/list}
{
Expand All @@ -3882,7 +3895,12 @@
postamble .initial:n = ,
name .tl_set:N = \l__acro_list_name_tl ,
name .initial:n = \acro_translate:n {list-name} ,
pages .meta:nn = {acro/pages} {#1}
label .tl_set:N = \l__acro_list_label_tl ,
label .initial:n =
\acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} ,
pages .meta:nn = {acro/pages} {#1} ,
format .code:n =
\keys_precompile:nnN {acro/format} {#1} \l__acro_list_format_keys_tl
}

\acro_if_komascript:TF
Expand Down Expand Up @@ -5418,7 +5436,7 @@
\begin {description}
\acronymsmapF
{
\item [ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} ]
\item [ \acrolistlabel ]
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
\acrowrite {foreign}
Expand Down Expand Up @@ -5448,8 +5466,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -5481,8 +5498,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -5515,8 +5531,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -5548,8 +5563,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -5594,8 +5608,7 @@
{
\AcroAddRow
{
\acrowrite {short}
\acroifT {alt} {/} \acrowrite {alt}
\acrolistlabel
&
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand Down Expand Up @@ -5632,7 +5645,9 @@
\contentsline {acro}
{
\numberline
{ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} }
{
\acrolistlabel
}
{
\acrowrite {list}
\acroifanyT {foreign,extra} {~(}
Expand All @@ -5657,7 +5672,7 @@
\acronymsmapF
{
\contentsline { \acroifchapterTF {chapter} {section} }
{ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} }
{ \acrolistlabel }
{}{}
\contentsline { \acroifchapterF {sub} section }
{
Expand Down