diff options
author | Karl Berry <karl@freefriends.org> | 2017-01-22 22:35:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-01-22 22:35:30 +0000 |
commit | 950e5c9eeef31e314090b8f7c362eda456e36a10 (patch) | |
tree | 49fac0804b89be2c39376a1a68dd3be55b7b69a4 /Master | |
parent | b1eb6bba5161466e7401c67959dd5a849e500e9a (diff) |
acro (22jan17)
git-svn-id: svn://tug.org/texlive/trunk@43019 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/acro_en.pdf | bin | 564783 -> 565869 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/acro_en.tex | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/acro/acro.sty | 1178 |
4 files changed, 658 insertions, 548 deletions
diff --git a/Master/texmf-dist/doc/latex/acro/README b/Master/texmf-dist/doc/latex/acro/README index 0d81fd94b18..31b9c75f32c 100644 --- a/Master/texmf-dist/doc/latex/acro/README +++ b/Master/texmf-dist/doc/latex/acro/README @@ -1,15 +1,15 @@ -------------------------------------------------------------------------- -the ACRO package v2.6e +the ACRO package v2.7 Typeset Acronyms -2016/09/04 +2017/01/22 -------------------------------------------------------------------------- Clemens Niederberger Web: http://www.mychemistry.eu/forums/forum/acro/ E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2012--2016 Clemens Niederberger +Copyright 2012--2017 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/acro/acro_en.pdf b/Master/texmf-dist/doc/latex/acro/acro_en.pdf Binary files differindex ada60f95b40..2580f07c852 100644 --- a/Master/texmf-dist/doc/latex/acro/acro_en.pdf +++ b/Master/texmf-dist/doc/latex/acro/acro_en.pdf diff --git a/Master/texmf-dist/doc/latex/acro/acro_en.tex b/Master/texmf-dist/doc/latex/acro/acro_en.tex index 4a54d178982..2fd56b574e1 100644 --- a/Master/texmf-dist/doc/latex/acro/acro_en.tex +++ b/Master/texmf-dist/doc/latex/acro/acro_en.tex @@ -13,7 +13,7 @@ % Web: http://www.mychemsitry.eu/forums/forum/acro/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2011-2016 Clemens Niederberger +% Copyright 2011-2017 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -1545,7 +1545,7 @@ they're on. \section{Defining Own Acronym Macros}\label{sec:defining-own-acronym} -The commands\sinceversion{2.0}\sinceversion{2.0}\sinceversion{2.0} explained in +The commands\sinceversion{2.0} explained in section~\vref{sec:using-acronyms-comm} have all been defined with a dedicated command -- there is a family of dedicated commands, actually: \begin{commands} @@ -1672,6 +1672,24 @@ commands\footnote{Which is why you need to use them inside an expl3 The\sinceversion{2.6} expl3 version of \cs{acswitchoff}. \command*{acro_switch_on:} The\sinceversion{2.6} expl3 version of \cs{acswitchon}. + \command*{acro_add_action:n}[ \marg{code}] + Adds\sinceversion{2.7} code to \cs*{acro_get:n}. Inside of \meta{code} + you can refer to the \ac{id} of the acronym with \verbcode+#1+. + \command*{acro_get_property:nn}[\TF\ \marg{id} \marg{property} \marg{true} + \marg{false}] + Fetches\sinceversion{2.7} the property \meta{property} of the acronym + \meta{id} and stores it in a tokenlist variable + \cs*{l__acro_\meta{property}_tl} where all dashes in the property names + are replaced with underscores. \meta{true} is placed in the input stream + if the property had been set, \meta{false} otherwise. + \command*{acro_get_property:nn}[\marg{id} \marg{property}] + Like\sinceversion{2.7} \cs*{acro_get_property:nn}\TF, but without the + \meta{true} and \meta{false} arguments. + \command*{acro_if_property:nn}[\TF\ \marg{id} \marg{property} \marg{true} + \marg{false}] + Checks\sinceversion{2.7} if the property \meta{property} of the acronym + \meta{id} is set and places \meta{true} is in the input stream if yes and + \meta{false} otherwise. \end{commands} \paragraph{Examples} diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty index 70437125d2a..3925275bfa8 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-2016 Clemens Niederberger +% Copyright 2011-2017 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,l3sort,xparse,l3keys2e,xtemplate,etoolbox} \ProvidesExplPackage {acro} - {2016/09/04} - {2.6e} + {2017/01/22} + {2.7} {Typeset Acronyms} % -------------------------------------------------------------------------- @@ -99,6 +99,13 @@ If~ this~ is~ no~ typo~ please~ contact~ the~ package~ author. \\ \\ I~ am~ going~ to~ use~ the~ #1~ `#3'~ instead. } +\msg_new:nnn {acro} {definitions-missing} + { + I~ cannot~ find~ the~ file~ \c_acro_definition_file_name_tl + .\c_acro_definition_file_extension_tl !~ This~ file~ contains~ all~ + essential~ user~ commands~ of~ acro~ and~ is~ a~ crucial~ part~ of~ the~ + package!~ Please~ check~ your~ installation. + } % -------------------------------------------------------------------------- % logging: @@ -126,7 +133,7 @@ \cs_new:Npn \__acro_write_log:nn #1#2 { \ \ \ #1 ~ = ~ {#2} } \cs_new:Npn \__acro_write_log_property:nnn #1#2#3 - { \__acro_write_log:nn {#2} { \acro_get_property:nn {#3} {#1} } } + { \__acro_write_log:nn {#2} { \__acro_get_property:nn {#3} {#1} } } \cs_new:Npn \__acro_ending_log_entry:nn #1#2 { @@ -283,6 +290,7 @@ \cs_generate_variant:Nn \seq_set_split:Nnn { NnV } \cs_generate_variant:Nn \seq_if_in:NnT { NV } \cs_generate_variant:Nn \prop_put:Nnn { NnV, cnx, cnv } +\cs_generate_variant:Nn \prop_get:NnNTF { cnc } \cs_generate_variant:Nn \prop_get:NnNF { cn, cnc } \cs_generate_variant:Nn \prop_get:NnN { cnc } \cs_generate_variant:Nn \cs_generate_variant:Nn { c } @@ -298,10 +306,10 @@ \bool_set_true:N \l__acro_print_only_used_bool \bool_new:N \l__acro_hyperref_loaded_bool \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_strict_bool \bool_new:N \l__acro_create_macros_bool -\bool_new:N \l__acro_xspace_bool \bool_new:N \l__acro_first_upper_bool \bool_new:N \l__acro_indefinite_bool \bool_new:N \l__acro_upper_indefinite_bool @@ -345,54 +353,26 @@ \bool_set_true:N \l__acro_use_acronyms_bool \tl_new:N \l__acro_ignore_tl -\tl_new:N \l__acro_short_format_tl -\tl_new:N \l__acro_alt_format_tl -\tl_new:N \l__acro_list_short_format_tl -\tl_new:N \l__acro_long_format_tl -\tl_new:N \l__acro_first_long_format_tl -\tl_new:N \l__acro_list_long_format_tl -\tl_new:N \l__acro_single_format_tl \tl_new:N \l__acro_default_indefinite_tl \tl_set:Nn \l__acro_default_indefinite_tl {a} -\tl_new:N \l__acro_extra_tl -\tl_new:N \l__acro_extra_format_tl -\tl_new:N \l__acro_foreign_tl \tl_new:N \l__acro_foreign_sep_tl -\tl_new:N \l__acro_foreign_format_tl -\tl_new:N \l__acro_foreign_list_format_tl -\tl_set:Nn \l__acro_foreign_list_format_tl { \acroenparen } -\tl_new:N \l__acro_foreign_lang_tl -\tl_new:N \l__acro_first_instance_tl -\tl_set:Nn \l__acro_first_instance_tl {default} -\tl_new:N \l__acro_first_style_tl \tl_new:N \l__acro_extra_instance_tl \tl_set:Nn \l__acro_extra_instance_tl {default} \tl_new:N \l__acro_page_instance_tl \tl_set:Nn \l__acro_page_instance_tl {none} \tl_new:N \l__acro_page_name_tl -\tl_set:Nn \l__acro_page_name_tl {p.\@\,} \tl_new:N \l__acro_pages_name_tl -\tl_set:Nn \l__acro_pages_name_tl {pp.\@\,} \tl_new:N \l__acro_next_page_tl -\tl_set:Nn \l__acro_next_page_tl {\,f.\@} \tl_new:N \l__acro_next_pages_tl -\tl_set:Nn \l__acro_next_pages_tl {\,ff.\@} \tl_new:N \l__acro_list_instance_tl \tl_set:Nn \l__acro_list_instance_tl {description} \tl_new:N \l__acro_list_type_tl -\tl_new:N \l__acro_list_tl +% \tl_new:N \l__acro_list_tl \tl_new:N \l__acro_list_heading_cmd_tl \tl_set:Nn \l__acro_list_heading_cmd_tl {section*} \tl_new:N \l__acro_list_name_tl -\tl_set:Nn \l__acro_list_name_tl {Acronyms} \tl_new:N \l__acro_list_before_tl \tl_new:N \l__acro_list_after_tl -\tl_new:N \l__acro_short_tl -\tl_new:N \l__acro_alt_tl -\tl_new:N \l__acro_long_tl -\tl_new:N \l__acro_single_tl -\tl_new:N \l__acro_long_pre_tl -\tl_new:N \l__acro_long_post_tl \tl_new:N \l__acro_custom_format_tl \tl_new:N \l__acro_first_between_tl \tl_new:N \l__acro_citation_connect_tl @@ -406,15 +386,36 @@ \tl_new:N \l__acro_current_page_tl \tl_new:N \l__acro_list_table_tl \tl_new:N \l__acro_list_table_spec_tl -\tl_new:N \l__acro_index_short_tl -\tl_new:N \l__acro_index_format_tl \tl_new:N \l__acro_acc_supp_tl \tl_new:N \l__acro_acc_supp_options_tl \tl_new:N \l__acro_label_prefix_tl \tl_set:Nn \l__acro_label_prefix_tl { ac: } +\tl_new:N \l__acro_index_short_tl +\tl_new:N \l__acro_first_instance_tl +\tl_set:Nn \l__acro_first_instance_tl {default} + +\tl_new:N \l__acro_short_tl +\tl_new:N \l__acro_short_format_tl +\tl_new:N \l__acro_list_short_format_tl + +\tl_new:N \l__acro_alt_tl +\tl_new:N \l__acro_alt_format_tl + +\tl_new:N \l__acro_long_tl +\tl_new:N \l__acro_list_long_format_tl + \tl_new:N \l__acro_single_form_tl \tl_set:Nn \l__acro_single_form_tl {long} +\tl_new:N \l__acro_extra_format_tl + +\tl_new:N \l__acro_foreign_format_tl +\tl_new:N \l__acro_foreign_list_format_tl +\tl_set:Nn \l__acro_foreign_list_format_tl { \acroenparen } + +\tl_new:N \l__acro_index_format_tl + + \skip_new:N \l__acro_page_space_skip \dim_new:N \l__acro_short_width_dim @@ -457,6 +458,7 @@ tooltip-cmd .value_required:n = true , macros .bool_set:N = \l__acro_create_macros_bool , xspace .bool_set:N = \l__acro_xspace_bool , + % xspace .code:n = \acro_option_deprecated:nn {xspace} {} , strict .bool_set:N = \l__acro_strict_bool , sort .bool_set:N = \l__acro_sort_bool , short-format .code:n = @@ -957,59 +959,6 @@ \tl_set:Nn \l__acro_first_instance_tl {#1} \prop_get:NnN \l__acro_first_styles_prop {#1} \l__acro_tmpa_tl } - -% the different styles: -\DeclareAcroFirstStyle {default} {inline} - { } - -\DeclareAcroFirstStyle {reversed} {inline} - { reversed = true } - -\DeclareAcroFirstStyle {short} {inline} - { - only-short = true , - brackets = false - } - -\DeclareAcroFirstStyle {long} {inline} - { - only-long = true , - brackets = false - } - -\DeclareAcroFirstStyle {square} {inline} - { brackets-type = [] } - -\DeclareAcroFirstStyle {plain} {inline} - { - brackets = false , - between = -- - } - -\DeclareAcroFirstStyle {plain-reversed} {inline} - { - brackets = false , - between = -- , - reversed = true - } - -\DeclareAcroFirstStyle {footnote} {note} - { } - -\DeclareAcroFirstStyle {footnote-reversed} {note} - { reversed = true } - -\DeclareAcroFirstStyle {sidenote} {note} - { note-command = \sidenote {#1} } - -\DeclareAcroFirstStyle {sidenote-reversed} {note} - { - note-command = \sidenote {#1} , - reversed = true - } - -\DeclareAcroFirstStyle {empty} {note} - { use-note = false } % -------------------------------------------------------------------------- % formatting the extras information: @@ -1080,43 +1029,6 @@ \prop_put:Nnn \l__acro_extra_styles_prop {#1} {#2} } -% the different styles: -\DeclareAcroExtraStyle {default} {inline} - { - brackets = false , - punct = true , - punct-symbol = . - } - -\DeclareAcroExtraStyle {plain} {inline} - { - brackets = false , - punct = true , - punct-symbol = - } - -\DeclareAcroExtraStyle {paren} {inline} - { - brackets = true , - punct = true , - punct-symbol = - } - -\DeclareAcroExtraStyle {bracket} {inline} - { - brackets = true , - punct = true , - punct-symbol = , - brackets-type = [] - } - -\DeclareAcroExtraStyle {comma} {inline} - { - punct = true, - punct-symbol = {,} , - brackets = false - } - % -------------------------------------------------------------------------- % outputting the page numbers: \RequirePackage {zref-abspage} @@ -1356,28 +1268,6 @@ \prop_get:NnN \l__acro_page_styles_prop {#1} \l__acro_tmpa_tl } -% the different styles: -\DeclareAcroPageStyle {default} {inline} - { - punct = true , - punct-symbol = . - } - -\DeclareAcroPageStyle {plain} {inline} - { punct = false } - -\DeclareAcroPageStyle {comma} {inline} - { punct = true } - -\DeclareAcroPageStyle {paren} {inline} - { - brackets=true , - punct-symbol = ~ - } - -\DeclareAcroPageStyle {none} {inline} - { display = false } - % -------------------------------------------------------------------------- % the title of the list: \cs_new:Npn \acro_list_title_format:n #1 {#1} @@ -1426,21 +1316,6 @@ \NewDocumentCommand \DeclareAcroListHeading {mm} { \acro_declare_list_heading:nn {#1} {#2} } -% the different styles: -\DeclareAcroListHeading {part} {\part} -\DeclareAcroListHeading {part*} {\part*} -\DeclareAcroListHeading {chapter} {\chapter} -\DeclareAcroListHeading {chapter*} {\chapter*} -\DeclareAcroListHeading {addchap} {\addchap} -\DeclareAcroListHeading {section} {\section} -\DeclareAcroListHeading {section*} {\section*} -\DeclareAcroListHeading {addsec} {\addsec} -\DeclareAcroListHeading {subsection} {\subsection} -\DeclareAcroListHeading {subsection*} {\subsection*} -\DeclareAcroListHeading {subsubsection} {\subsubsection} -\DeclareAcroListHeading {subsubsection*} {\subsubsection*} -\DeclareAcroListHeading {none} {\use_none:n} - % -------------------------------------------------------------------------- % typesetting the acronym list \DeclareObjectType {acro-list} {2} @@ -1502,7 +1377,7 @@ \acro_write_short:nn {#1} { \l__acro_list_short_format_tl - { \acro_get_property:nn {short} {#1} } + { \__acro_get_property:nn {short} {#1} } } } } @@ -1517,8 +1392,8 @@ \acro_write_long:Vf \l__acro_list_long_format_tl { \prop_if_in:NnTF \l__acro_list_prop {#1} - { \acro_get_property:nn {list} {#1} } - { \acro_get_property:nn {long} {#1} } + { \__acro_get_property:nn {list} {#1} } + { \__acro_get_property:nn {long} {#1} } } \group_end: \bool_if:NT \l__acro_foreign_bool @@ -1560,14 +1435,9 @@ {extra} { \__acro_list_entry_extra:n {#2} } {page} { \__acro_list_entry_page:n {#2} } } - { \acro_get_property:nn {#1} {#2} } + { \__acro_get_property:nn {#1} {#2} } } -% #1: property -% #2: id -\cs_new:Npn \acro_get_property:nn #1#2 - { \prop_item:cn {l__acro_#1_prop} {#2} } - % this macro may/should be redefined in templates: % #1: short % #2: long @@ -1915,41 +1785,6 @@ } % -------------------------------------------------------------------------- -% predefined list styles: -\DeclareAcroListStyle {description} {list} - { } - -\DeclareAcroListStyle {toc} {list-of} - { } - -\DeclareAcroListStyle {lof} {list-of} - { style = lof } - -\DeclareAcroListStyle {tabular} {table} - { table = tabular } - -\DeclareAcroListStyle {longtable} {table} - { table = longtable } - -\DeclareAcroListStyle {extra-tabular} {extra-table} - { table = tabular } - -\DeclareAcroListStyle {extra-longtable} {extra-table} - { table = longtable } - -\DeclareAcroListStyle {extra-tabular-rev} {extra-table} - { - table = tabular , - reverse = true - } - -\DeclareAcroListStyle {extra-longtable-rev} {extra-table} - { - table = longtable , - reverse = true - } - -% -------------------------------------------------------------------------- % automatic typesetting, the internals of \ac: % #1: id @@ -2031,8 +1866,10 @@ \prg_new_conditional:Npnn \acro_if_is_single:n #1 { p,T,TF } { - \bool_if:nTF { !\l__acro_use_single_bool || \cs_if_exist_p:c { acro@#1@twice } } - { \prg_return_false: } { \prg_return_true: } + \bool_if:nTF + { !\l__acro_use_single_bool || \cs_if_exist_p:c { acro@#1@twice } } + { \prg_return_false: } + { \prg_return_true: } } \cs_new_protected:Npn \acro_use_acronym:n #1 @@ -2055,6 +1892,64 @@ { \acro_serious_message:nn {undefined} {#1} } } +% expandably gets property but doesn't transform property name -- internal +% name is needed +% #1: property +% #2: id +\cs_new:Npn \__acro_get_property:nn #1#2 + { \prop_item:cn {l__acro_#1_prop} {#2} } + +% #1: id +% #2: property +% #3: set case +% #4: not set case +\prg_new_protected_conditional:Npnn \acro_get_property:nn #1#2 {T,F,TF} + { + \tl_set:Nn \l__acro_tmpa_tl {#2} + \tl_replace_all:Nnn \l__acro_tmpa_tl {-} {_} + \prop_get:cncTF + {l__acro_ \l__acro_tmpa_tl _prop} + {#1} + {l__acro_ \l__acro_tmpa_tl _tl} + { \prg_return_true: } + { \prg_return_false: } + } + +\cs_new_protected:Npn \acro_get_property:nn #1#2 + { \acro_get_property:nnTF {#1} {#2} {} {} } +\cs_generate_variant:Nn \acro_get_property:nn {V} + +% #1: id +% #2: property +% #3: set case +% #4: not set case +\prg_new_protected_conditional:Npnn \acro_if_property:nn #1#2 {T,F,TF} + { + \tl_set:Nn \l__acro_tmpa_tl {#2} + \tl_replace_all:Nnn \l__acro_tmpa_tl {-} {_} + \prop_if_in:cnTF + {l__acro_ \l__acro_tmpa_tl _prop} + {#1} + { \prg_return_true: } + { \prg_return_false: } + } + +\seq_new:N \l__acro_actions_seq + +% within this command one can refer to the current id with `#1' +\cs_new_protected:Npn \acro_add_action:n #1 + { \seq_put_right:Nn \l__acro_actions_seq {#1} } + +\tl_new:N \l_acro_current_id_tl +\cs_new_protected:Npn \__acro_get_actions:n #1 + { + \seq_map_inline:Nn \l__acro_actions_seq + { + \cs_set:Npn \__acro_action:n ####1 {##1} + \__acro_action:n {#1} + } + } + \cs_new_protected:Npn \acro_get:n #1 { \bool_if:NF \l__acro_in_list_bool { \leavevmode } @@ -2062,50 +1957,46 @@ % short: \prop_get:NnNF \l__acro_short_prop {#1} \l__acro_tmpa_tl {} \__acro_make_link:NnV \l__acro_short_tl {#1} \l__acro_tmpa_tl + % \acro_get_property:nn {#1} {short-format} % alt: \prop_get:NnNTF \l__acro_alt_prop {#1} \l__acro_tmpa_tl { \__acro_make_link:NnV \l__acro_alt_tl {#1} \l__acro_tmpa_tl } { \tl_set_eq:NN \l__acro_alt_tl \l__acro_short_tl } % long: - \prop_get:NnNF \l__acro_long_prop {#1} \l__acro_long_tl {} + \acro_get_property:nn {#1} {long} + % \acro_get_property:nn {#1} {long-format} % foreign: - \prop_get:NnNF \l__acro_foreign_prop {#1} \l__acro_foreign_tl {} - % foreign: - \prop_get:NnNF \l__acro_foreign_lang_prop {#1} \l__acro_foreign_lang_tl {} - % \tl_if_blank:VF \l__acro_foreign_lang_tl - % { - % \tl_set:Nx \l__acro_foreign_lang_tl - % { \baselanguage \l__acro_foreign_lang_tl } - % } + \acro_get_property:nn {#1} {foreign} + % foreign-lang: + \acro_get_property:nn {#1} {foreign-lang} % extra: - \prop_get:NnNF \l__acro_extra_prop {#1} \l__acro_extra_tl {} - % single: - \prop_get:NnNF \l__acro_single_prop {#1} \l__acro_single_tl {} + \acro_get_property:nn {#1} {extra} + % \acro_get_property:nn {#1} {extra-format} % single: - \prop_get:NnNF \l__acro_first_style_prop {#1} \l__acro_first_style_tl {} + \acro_get_property:nn {#1} {single} + % \acro_get_property:nn {#1} {single-format} + % first-style: + \acro_get_property:nn {#1} {first-style} % formatting \prop_get:NnNTF \l__acro_long_format_prop {#1} \l__acro_custom_long_format_tl { \bool_set_true:N \l__acro_custom_long_format_bool } { \bool_set_false:N \l__acro_custom_long_format_bool } - \prop_get:NnNF \l__acro_first_long_format_prop {#1} - \l__acro_first_long_format_tl - {}% to avoid hanging compilation if first-long-format hasn't been set + \acro_get_property:nn {#1} {first-long-format} \prop_get:NnNTF \l__acro_format_prop {#1} \l__acro_custom_format_tl { \bool_set_true:N \l__acro_custom_format_bool } { \bool_set_false:N \l__acro_custom_format_bool } - \prop_get:NnNF \l__acro_single_format_prop {#1} - \l__acro_single_format_tl - {} + \acro_get_property:nn {#1} {single-format} \acro_for_endings_do:n { \bool_if:cT {l__acro_##1_bool} { \__acro_set_ending_for:nnn {##1} {#1} {long} } } - \prop_get:NnNF \l__acro_long_post_prop {#1} \l__acro_long_post_tl + \acro_get_property:nnF {#1} {long-post} { \tl_clear:N \l__acro_long_post_tl } - \prop_get:NnNT \l__acro_long_pre_prop {#1} \l__acro_long_pre_tl + \acro_get_property:nnT {#1} {long-pre} { \tl_put_left:NV \l__acro_long_tl \l__acro_long_pre_tl } + \__acro_get_actions:n {#1} } % -------------------------------------------------------------------------- @@ -2244,14 +2135,14 @@ { \bool_set_true:c {l__acro_#1_bool} } % acronym properties: % short-<ending>: - \__acro_declare_property:nnn {short_#1} {short-#1} + \acro_declare_property:nnn {short_#1} {short-#1} { \prop_put:cnn {l__acro_short_#1_form_prop} {##1} { \c_false_bool } \prop_put:cnx {l__acro_pdfstring_short_#1_prop} {##1} { \prop_item:Nn \l__acro_short_prop {##1} \exp_not:n {##2} } } % short-<ending>-form: - \__acro_declare_property_generic:nnn {short_#1_form} {short-#1-form} + \acro_declare_property_generic:nnn {short_#1_form} {short-#1-form} { \__acro_property_check:nn {##1} {short-#1-form} \prop_put:cnn {l__acro_short_#1_form_prop} {##1} { \c_true_bool } @@ -2259,14 +2150,14 @@ \prop_put:cnn {l__acro_pdfstring_short_#1_prop} {##1} {##2} } % alt-<ending>: - \__acro_declare_property:nnn {alt_#1} {alt-#1} + \acro_declare_property:nnn {alt_#1} {alt-#1} { \prop_put:cnn {l__acro_alt_#1_form_prop} {##1} { \c_false_bool } \prop_put:cnx {l__acro_pdfstring_alt_#1_prop} {##1} { \prop_item:Nn \l__acro_alt_prop {##1} \exp_not:n {##2} } } % alt-<ending>-form: - \__acro_declare_property_generic:nnn {alt_#1_form} {alt-#1-form} + \acro_declare_property_generic:nnn {alt_#1_form} {alt-#1-form} { \__acro_property_check:nn {##1} {alt-#1-form} \prop_put:cnn {l__acro_alt_#1_form_prop} {##1} { \c_true_bool } @@ -2274,10 +2165,10 @@ \prop_put:cnn {l__acro_pdfstring_alt_#1_prop} {##1} {##2} } % long-<ending>: - \__acro_declare_property:nnn {long_#1} {long-#1} + \acro_declare_property:nnn {long_#1} {long-#1} { \prop_put:cnn {l__acro_long_#1_form_prop} {##1} { \c_false_bool } } % long-<ending>-form: - \__acro_declare_property_generic:nnn {long_#1_form} {long-#1-form} + \acro_declare_property_generic:nnn {long_#1_form} {long-#1-form} { \__acro_property_check:nn {##1} {long-#1-form} \prop_put:cnn {l__acro_long_#1_form_prop} {##1} { \c_true_bool } @@ -2571,7 +2462,7 @@ } \group_end: } -\cs_generate_variant:Nn \acro_write_long:nn { VV,Vo,Vf,Vn,vn } +\cs_generate_variant:Nn \acro_write_long:nn { VV,Vo,Vf,V,v,vv } \prg_new_conditional:Npnn \acro_if_foreign:n #1 {T,F,TF} { @@ -2666,13 +2557,27 @@ { \tl_set:Nn \l__acro_tmpa_tl {#2} \tl_replace_all:Nnn \l__acro_tmpa_tl {-} {_} - \acro_write_long:vn {l__acro_ \l__acro_tmpa_tl _format_tl} {#3} + \acro_write_long:vn {l__acro_ \l__acro_tmpa_tl _format_tl} {#3} \acro_endings:nn {#1} {long} \tl_if_in:nnT {#2} {long} { \l__acro_long_post_tl } } \cs_generate_variant:Nn \acro_write_expanded:nnn { nnV } +% #1: ID +% #2: long|first-long|list-long|extra +\cs_new_protected:Npn \acro_write_expanded:nn #1#2 + { + \tl_set:Nn \l__acro_tmpa_tl {#2} + \tl_replace_all:Nnn \l__acro_tmpa_tl {-} {_} + \acro_write_long:vv + {l__acro_ \l__acro_tmpa_tl _format_tl} + {l__acro_ \l__acro_tmpa_tl _tl} + \acro_endings:nn {#1} {long} + \tl_if_in:nnT {#2} {long} + { \l__acro_long_post_tl } + } + % #1: id \cs_new:Npn \acro_after:n #1 { @@ -2680,16 +2585,27 @@ \acro_index_if:nn { \l__acro_addto_index_bool } {#1} } +\cs_new_protected:Npn \acro_check_single:n #1 + { + \acro_if_is_single:nT {#1} + { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } + } + % -------------------------------------------------------------------------- -% the standard internals: % #1: id -\cs_new_protected:Npn \acro_short:n #1 +\cs_new_protected:Npn \acro_before:n #1 { \acro_get:n {#1} \acro_is_used:n {#1} + \acro_check_single:n {#1} + } + +% the standard internals: +% #1: id +\cs_new_protected:Npn \acro_short:n #1 + { + \acro_before:n {#1} \acro_write_indefinite:nn {#1} {short} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } \acro_write_compact:nn {#1} {short} \acro_after:n {#1} } @@ -2698,12 +2614,9 @@ % #1: id \cs_new_protected:Npn \acro_alt:n #1 { - \acro_get:n {#1} - \acro_is_used:n {#1} + \acro_before:n {#1} \acro_alt_error:n {#1} \acro_write_indefinite:nn {#1} {alt} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } \acro_write_compact:nn {#1} {alt} \acro_after:n {#1} } @@ -2712,12 +2625,9 @@ % #1: id \cs_new_protected:Npn \acro_long:n #1 { - \acro_get:n {#1} - \acro_is_used:n {#1} + \acro_before:n {#1} \acro_write_indefinite:nn {#1} {long} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } - \acro_write_expanded:nnV {#1} {long} \l__acro_long_tl + \acro_write_expanded:nn {#1} {long} \acro_after:n {#1} } @@ -2729,8 +2639,7 @@ \tl_if_blank:VF \l__acro_foreign_tl { \acro_is_used:n {#1} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } + \acro_check_single:n {#1} \acro_write_long:VV \l__acro_foreign_format_tl \l__acro_foreign_tl \acro_after:n {#1} } @@ -2744,8 +2653,7 @@ \tl_if_blank:VF \l__acro_extra_tl { \acro_is_used:n {#1} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } + \acro_check_single:n {#1} \acro_write_long:VV \l__acro_extra_format_tl \l__acro_extra_tl \acro_after:n {#1} } @@ -2755,14 +2663,9 @@ % #1: id \cs_new_protected:Npn \acro_first:n #1 { - \bool_gset_true:c { g__acro_#1_first_use_bool } - \acro_get:n {#1} - \acro_is_used:n {#1} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } - \acro_first_instance:nV - {#1} - \l__acro_long_tl + \bool_gset_true:c {g__acro_#1_first_use_bool} + \acro_before:n {#1} + \acro_first_instance:nV {#1} \l__acro_long_tl } % output like the first time with own long version: @@ -2770,14 +2673,9 @@ % #2: instead of long entry \cs_new_protected:Npn \acro_first_like:nn #1#2 { - \bool_gset_true:c { g__acro_#1_first_use_bool } - \acro_get:n {#1} - \acro_is_used:n {#1} - \acro_if_is_single:nT {#1} - { \cs_set_eq:NN \acro_hyper_link:nn \use_ii:nn } - \acro_first_instance:nn - {#1} - {#2} + \bool_gset_true:c {g__acro_#1_first_use_bool} + \acro_before:n {#1} + \acro_first_instance:nn {#1} {#2} } % ---------------------------------------------------------------------------- @@ -2861,13 +2759,13 @@ { \tl_set:Nn \l__acro_tmpa_tl { \l__acro_index_format_tl \l__acro_index_short_tl } } \quark_if_no_value:nF {#1} { \cs_set:Npn \__acro_index_cmd:n {#1} } - \quark_if_no_value:nTF { #4 } + \quark_if_no_value:nTF {#4} { \quark_if_no_value:nTF {#3} { \__acro_index_cmd:n { #2 @ { \l__acro_tmpa_tl } } } { \__acro_index_cmd:n { #3 @ { \l__acro_tmpa_tl } } } } - { \__acro_index_cmd:n { #4 } } + { \__acro_index_cmd:n {#4} } } \cs_generate_variant:Nn \__acro_index:nnnn { VnVV } @@ -2969,7 +2867,7 @@ % experimental sorting feature: % the following code is an adaption of expl3 code used for \str_if_eq:NN(TF) -\luatex_if_engine:TF +\sys_if_engine_luatex:TF { \tl_set:Nn \l__acro_tmpa_tl { @@ -3147,21 +3045,16 @@ \clist_map_inline:nn {#1} { \acro_deactivate_trailing_token:n {##1} } } -% register some tokens to be checked for: -\AcroRegisterTrailing . {dot} -\AcroRegisterTrailing - {dash} -\AcroRegisterTrailing \babelhyphen {babel-hyphen} - % some user macros: -\NewDocumentCommand \acdot {} - { \aciftrailing {dot} {} {.\@} } +\cs_new_protected:Npn \acro_dot: + { \acro_if_trailing_tokens:nF {dot} {.\@} } -\NewDocumentCommand \acspace {} - { \aciftrailing {dash,babel-hyphen} {} {\space} } - -\cs_new_eq:NN \acro_dot: \acdot -\cs_new_eq:NN \acro_space: \acspace +\cs_new_protected:Npn \acro_space: + { \acro_if_trailing_tokens:nF {dash,babel-hyphen} { \c_space_tl } } +\NewDocumentCommand \acdot {} { \acro_dot: } +\NewDocumentCommand \acspace {} { \acro_space: } + % --------------------------------------------------------------------------- % reset outputs, they'll behave like the first time again (!not like the _only_ % time!): @@ -3439,204 +3332,6 @@ % similar macros \acro_<ending>: are defined by \acro_provide_ending:nnn -% -------------------------------------------------------------------------- -% the user commands -% automatic: -\NewAcroCommand \ac - { \acro_use:n {#1} } - -\NewAcroCommand \iac - { - \acro_indefinite: - \acro_use:n {#1} - } - -\NewAcroCommand \Iac - { - \acro_first_upper: - \acro_indefinite: - \acro_use:n {#1} - } - -\NewAcroCommand \Ac - { - \acro_first_upper: - \acro_use:n {#1} - } - -\NewAcroCommand \acp - { - \acro_plural: - \acro_use:n {#1} - } - -\NewAcroCommand \Acp - { - \acro_plural: - \acro_first_upper: - \acro_use:n {#1} - } - -\NewAcroCommand \acsingle - { - \acro_get:n {#1} - \acro_single:n {#1} - } - -\NewAcroCommand \Acsingle - { - \acro_get:n {#1} - \acro_first_upper: - \acro_single:n {#1} - } - -% short: -\NewAcroCommand \acs - { \acro_short:n {#1} } - -\NewAcroCommand \iacs - { - \acro_indefinite: - \acro_short:n {#1} - } - -\NewAcroCommand \Iacs - { - \acro_first_upper: - \acro_indefinite: - \acro_short:n {#1} - } - -\NewAcroCommand \acsp - { - \acro_plural: - \acro_short:n {#1} - } - -% alt: -\NewAcroCommand \aca - { \acro_alt:n {#1} } - -\NewAcroCommand \Aca - { - \acro_first_upper: - \acro_alt:n {#1} - } - -\NewAcroCommand \iaca - { - \acro_indefinite: - \acro_alt:n {#1} - } - -\NewAcroCommand \Iaca - { - \acro_first_upper: - \acro_indefinite: - \acro_alt:n {#1} - } - -\NewAcroCommand \acap - { - \acro_plural: - \acro_alt:n {#1} - } - -% long: -\NewAcroCommand \acl - { \acro_long:n {#1} } - -\NewAcroCommand \iacl - { - \acro_indefinite: - \acro_long:n {#1} - } - -\NewAcroCommand \Iacl - { - \acro_first_upper: - \acro_indefinite: - \acro_long:n {#1} - } - -\NewAcroCommand \Acl - { - \acro_first_upper: - \acro_long:n {#1} - } - -\NewAcroCommand \aclp - { - \acro_plural: - \acro_long:n {#1} - } - -\NewAcroCommand \Aclp - { - \acro_plural: - \acro_first_upper: - \acro_long:n {#1} - } - -% first: -\NewAcroCommand \acf - { \acro_first:n {#1} } - -\NewAcroCommand \iacf - { - \acro_indefinite: - \acro_first:n {#1} - } - -\NewAcroCommand \Iacf - { - \acro_first_upper: - \acro_indefinite: - \acro_first:n {#1} - } - -\NewAcroCommand \Acf - { - \acro_first_upper: - \acro_first:n {#1} - } - -\NewAcroCommand \acfp - { - \acro_plural: - \acro_first:n {#1} - } - -\NewAcroCommand \Acfp - { - \acro_plural: - \acro_first_upper: - \acro_first:n {#1} - } - -% first-like: -\NewPseudoAcroCommand \acflike - { \acro_first_like:nn {#1} {#2} } - -\NewPseudoAcroCommand \iacflike - { - \acro_indefinite: - \acro_first_like:nn {#1} {#2} - } - -\NewPseudoAcroCommand \Iacflike - { - \acro_first_upper: - \acro_indefinite: - \acro_first_like:nn {#1} {#2} - } - -\NewPseudoAcroCommand \acfplike - { - \acro_plural: - \acro_first_like:nn {#1} {#2} - } - % --------------------------------------------------------------------------- % process options: \ProcessKeysPackageOptions {acro} @@ -3800,12 +3495,12 @@ % #1: name in associated cs % #2: property name % #3: action -\cs_new_protected:Npn \__acro_declare_property_generic:nnn #1#2#3 +\cs_new_protected:Npn \acro_declare_property_generic:nnn #1#2#3 { - \prop_clear_new:c { l__acro_#1_prop } - \cs_new_protected:cpn { __acro_declare_#1:nn } ##1##2 {#3} - \cs_generate_variant:cn { __acro_declare_#1:nn } { V } - \keys_define:nn { acro / declare-acronym } + \prop_clear_new:c {l__acro_#1_prop} + \cs_new_protected:cpn {__acro_declare_#1:nn} ##1##2 {#3} + \cs_generate_variant:cn {__acro_declare_#1:nn} {V} + \keys_define:nn {acro/declare-acronym} { #2 .code:n = \use:c {__acro_declare_#1:Vn} \l__acro_current_property_tl {##1} @@ -3815,41 +3510,42 @@ % #1: name in associated cs % #2: property name % #3: action -\cs_new_protected:Npn \__acro_declare_property:nnn #1#2#3 +\cs_new_protected:Npn \acro_declare_property:nnn #1#2#3 { - \__acro_declare_property_generic:nnn {#1} {#2} + \acro_declare_property_generic:nnn {#1} {#2} { \__acro_property_check:nn {##1} {#2} - \prop_put:cnn { l__acro_#1_prop } {##1} {##2} + \prop_put:cnn {l__acro_#1_prop} {##1} {##2} #3 } } % #1: name in associated cs % #2: property name -\cs_new_protected:Npn \__acro_declare_property:nn #1#2 - { \__acro_declare_property:nnn {#1} {#2} {} } -\cs_generate_variant:Nn \__acro_declare_property:nn { V } +\cs_new_protected:Npn \acro_declare_property:nn #1#2 + { \acro_declare_property:nnn {#1} {#2} {} } +\cs_generate_variant:Nn \acro_declare_property:nn { V } -\cs_new_protected:Npn \__acro_declare_simple_property:n #1 +\cs_new_protected:Npn \acro_declare_simple_property:n #1 { \tl_set:Nn \l__acro_tmpa_tl {#1} \tl_replace_all:Nnn \l__acro_tmpa_tl {-} {_} - \__acro_declare_property:Vn \l__acro_tmpa_tl {#1} + \tl_clear_new:c {l__acro_ \l__acro_tmpa_tl _tl} + \acro_declare_property:Vn \l__acro_tmpa_tl {#1} } % #1: new alias property % #2: old property -\cs_new_protected:Npn \__acro_declare_property_alias:nn #1#2 +\cs_new_protected:Npn \acro_declare_property_alias:nn #1#2 { - \keys_define:nn { acro / declare-acronym } + \keys_define:nn {acro/declare-acronym} { #1 .meta:n = { #2 = {##1} } } } % -------------------------------------------------------------------------- % declare the properties for \DeclareAcronym: % short: -\__acro_declare_property_generic:nnn {short} {short} +\acro_declare_property_generic:nnn {short} {short} { \__acro_first_property_check:nn {#1} {short} \prop_put:Nnn \l__acro_short_prop {#1} {#2} @@ -3878,7 +3574,7 @@ } % long: -\__acro_declare_property:nnn {long} {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 } } @@ -3892,36 +3588,36 @@ } } -\__acro_declare_simple_property:n {first-style} +\acro_declare_simple_property:n {first-style} % list: -\__acro_declare_simple_property:n {list} +\acro_declare_simple_property:n {list} % defines `short-plural', `long-plural' and `long-plural-form' as well as the % options `plural-ending', `short-plural-ending' and `long-plural-ending': -\ProvideAcroEnding {plural} {s} {s} +% \ProvideAcroEnding {plural} {s} {s} % short indefinite article: -\__acro_declare_simple_property:n {short-indefinite} +\acro_declare_simple_property:n {short-indefinite} % long indefinite article: -\__acro_declare_simple_property:n {long-indefinite} +\acro_declare_simple_property:n {long-indefinite} % pre long: -\__acro_declare_simple_property:n {long-pre} +\acro_declare_simple_property:n {long-pre} % post long: -\__acro_declare_simple_property:n {long-post} +\acro_declare_simple_property:n {long-post} % sort: -\__acro_declare_property:nnn {sort} {sort} +\acro_declare_property:nnn {sort} {sort} { \bool_if:cF { l__acro_#1_index-sort_set_bool } { \prop_put:Nnn \l__acro_index_sort_prop {#1} {#2} } } % alternative: -\__acro_declare_property:nnn {alt} {alt} +\acro_declare_property:nnn {alt} {alt} { \prop_put:Nnn \l__acro_pdfstring_alt_prop {#1} {#2} \prop_put:NnV \l__acro_alt_indefinite_prop @@ -3935,25 +3631,25 @@ } % alt. indefinite article: -\__acro_declare_simple_property:n {alt-indefinite} +\acro_declare_simple_property:n {alt-indefinite} % foreign: -\__acro_declare_simple_property:n {foreign} +\acro_declare_simple_property:n {foreign} % foreign: -\__acro_declare_simple_property:n {foreign-lang} +\acro_declare_simple_property:n {foreign-lang} % format: -\__acro_declare_simple_property:n {format} +\acro_declare_simple_property:n {format} % short format: -\__acro_declare_property_alias:nn {short-format} {format} +\acro_declare_property_alias:nn {short-format} {format} % long format: -\__acro_declare_simple_property:n {long-format} +\acro_declare_simple_property:n {long-format} % first long format: -\__acro_declare_simple_property:n {first-long-format} +\acro_declare_simple_property:n {first-long-format} % pdfstring -- currently needs to be done `by hand': \prop_new:N \l__acro_pdfstring_short_prop @@ -4004,22 +3700,22 @@ } % class: -\__acro_declare_simple_property:n {class} +\acro_declare_simple_property:n {class} % extra information: -\__acro_declare_simple_property:n {extra} +\acro_declare_simple_property:n {extra} % single appearances: -\__acro_declare_simple_property:n {single} +\acro_declare_simple_property:n {single} % single format: -\__acro_declare_simple_property:n {single-format} +\acro_declare_simple_property:n {single-format} % acc supp: -\__acro_declare_property:nn {acc_supp} {accsupp} +\acro_declare_property:nn {acc_supp} {accsupp} % tooltip: -\__acro_declare_simple_property:n {tooltip} +\acro_declare_simple_property:n {tooltip} % citation -- currently needs to be done `by hand': \prop_new:N \l__acro_citation_prop @@ -4032,12 +3728,12 @@ % 2 options: #1: ID: #6: property, #3: first option, #5: second option \tl_if_blank:nF { #2#4#6 } { - \tl_if_empty:nTF { #3 } + \tl_if_empty:nTF {#3} { \__acro_declare_citation_aux:nnnn {#1} { } { } {#2} } { - \tl_if_empty:nTF { #5 } - { \__acro_declare_citation_aux:nnnn {#1} { #3 } { } { #4 } } - { \__acro_declare_citation_aux:nnnn {#1} { #3 } { #5 } { #6 } } + \tl_if_empty:nTF {#5} + { \__acro_declare_citation_aux:nnnn {#1} {#3} { } {#4} } + { \__acro_declare_citation_aux:nnnn {#1} {#3} {#5} {#6} } } } } @@ -4053,11 +3749,11 @@ \cs_new_protected:Npn \__acro_declare_citation_aux:nnnn #1#2#3#4 { \__acro_property_check:nn {#1} {cite} - \prop_put:Nnn \l__acro_citation_prop {#1} { #4 } + \prop_put:Nnn \l__acro_citation_prop {#1} {#4} \tl_if_empty:nF {#2} { \prop_put:Nnn \l__acro_citation_pre_prop {#1} {#2} } - \tl_if_empty:nF { #3 } - { \prop_put:Nnn \l__acro_citation_post_prop {#1} { #3 } } + \tl_if_empty:nF {#3} + { \prop_put:Nnn \l__acro_citation_post_prop {#1} {#3} } } % TODO: @@ -4073,13 +3769,13 @@ % TeX code after an acronym is typeset % index: -\__acro_declare_simple_property:n {index} +\acro_declare_simple_property:n {index} % index-sort: -\__acro_declare_simple_property:n {index-sort} +\acro_declare_simple_property:n {index-sort} % index-cmd: -\__acro_declare_simple_property:n {index-cmd} +\acro_declare_simple_property:n {index-cmd} % -------------------------------------------------------------------------- % acronym macros: @@ -4205,16 +3901,413 @@ { \clist_map_inline:nn {#2} { - \tl_if_blank:nTF {##1} - { }% TODO: empty translation -- skip? + \tl_if_blank:nF {##1} { \__acro_declare_translation:www #1 \q_mark ##1 \q_stop } } } \NewDocumentCommand \DeclareAcroTranslation {mm} { \acro_declare_translation:nn {#1} {#2} } -\@onlypreamble \DeclareAcroTranslation +\@onlypreamble \DeclareAcroTranslation + +% tokenlists using the translations: +\tl_set:Nn \l__acro_list_name_tl { \GetTranslation {acronym-list-name} } +\tl_set:Nn \l__acro_page_name_tl { \GetTranslation {acronym-page-name}\@\, } +\tl_set:Nn \l__acro_pages_name_tl { \GetTranslation {acronym-pages-name}\@\, } +\tl_set:Nn \l__acro_next_page_tl { \,\GetTranslation {acronym-next-page}\@ } +\tl_set:Nn \l__acro_next_pages_tl { \,\GetTranslation {acronym-next-pages}\@ } + +% -------------------------------------------------------------------------- +% definition file: +% \tl_const:Nn \c_acro_definition_file_name_tl {acro} +% \tl_const:Nn \c_acro_definition_file_extension_tl {def} + +% \file_if_exist:nTF +% { \c_acro_definition_file_name_tl .\c_acro_definition_file_extension_tl } +% { +% \@onefilewithoptions +% {\c_acro_definition_file_name_tl} [] [] +% \c_acro_definition_file_extension_tl +% } +% { \acro_serious_message:n {definitions-missing} } + + +% -------------------------------------------------------------------------- +% first appearance styles: +\DeclareAcroFirstStyle {default} {inline} + { } + +\DeclareAcroFirstStyle {reversed} {inline} + { reversed = true } + +\DeclareAcroFirstStyle {short} {inline} + { + only-short = true , + brackets = false + } + +\DeclareAcroFirstStyle {long} {inline} + { + only-long = true , + brackets = false + } + +\DeclareAcroFirstStyle {square} {inline} + { brackets-type = [] } + +\DeclareAcroFirstStyle {plain} {inline} + { + brackets = false , + between = -- + } + +\DeclareAcroFirstStyle {plain-reversed} {inline} + { + brackets = false , + between = -- , + reversed = true + } + +\DeclareAcroFirstStyle {footnote} {note} + { } + +\DeclareAcroFirstStyle {footnote-reversed} {note} + { reversed = true } + +\DeclareAcroFirstStyle {sidenote} {note} + { note-command = \sidenote {#1} } + +\DeclareAcroFirstStyle {sidenote-reversed} {note} + { + note-command = \sidenote {#1} , + reversed = true + } + +\DeclareAcroFirstStyle {empty} {note} + { use-note = false } + +% -------------------------------------------------------------------------- +% extra info appearance styles: +\DeclareAcroExtraStyle {default} {inline} + { + brackets = false , + punct = true , + punct-symbol = . + } + +\DeclareAcroExtraStyle {plain} {inline} + { + brackets = false , + punct = true , + punct-symbol = + } + +\DeclareAcroExtraStyle {paren} {inline} + { + brackets = true , + punct = true , + punct-symbol = + } + +\DeclareAcroExtraStyle {bracket} {inline} + { + brackets = true , + punct = true , + punct-symbol = , + brackets-type = [] + } + +\DeclareAcroExtraStyle {comma} {inline} + { + punct = true, + punct-symbol = {,} , + brackets = false + } + +% -------------------------------------------------------------------------- +% page number appearance styles: +\DeclareAcroPageStyle {default} {inline} + { + punct = true , + punct-symbol = . + } + +\DeclareAcroPageStyle {plain} {inline} + { punct = false } + +\DeclareAcroPageStyle {comma} {inline} + { punct = true } + +\DeclareAcroPageStyle {paren} {inline} + { + brackets=true , + punct-symbol = ~ + } + +\DeclareAcroPageStyle {none} {inline} + { display = false } + +% -------------------------------------------------------------------------- +% list heading styles: +\DeclareAcroListHeading {part} {\part} +\DeclareAcroListHeading {part*} {\part*} +\DeclareAcroListHeading {chapter} {\chapter} +\DeclareAcroListHeading {chapter*} {\chapter*} +\DeclareAcroListHeading {addchap} {\addchap} +\DeclareAcroListHeading {section} {\section} +\DeclareAcroListHeading {section*} {\section*} +\DeclareAcroListHeading {addsec} {\addsec} +\DeclareAcroListHeading {subsection} {\subsection} +\DeclareAcroListHeading {subsection*} {\subsection*} +\DeclareAcroListHeading {subsubsection} {\subsubsection} +\DeclareAcroListHeading {subsubsection*} {\subsubsection*} +\DeclareAcroListHeading {none} {\use_none:n} +% -------------------------------------------------------------------------- +% list styles: +\DeclareAcroListStyle {description} {list} + { } + +\DeclareAcroListStyle {toc} {list-of} + { } + +\DeclareAcroListStyle {lof} {list-of} + { style = lof } + +\DeclareAcroListStyle {tabular} {table} + { table = tabular } + +\DeclareAcroListStyle {longtable} {table} + { table = longtable } + +\DeclareAcroListStyle {extra-tabular} {extra-table} + { table = tabular } + +\DeclareAcroListStyle {extra-longtable} {extra-table} + { table = longtable } + +\DeclareAcroListStyle {extra-tabular-rev} {extra-table} + { + table = tabular , + reverse = true + } + +\DeclareAcroListStyle {extra-longtable-rev} {extra-table} + { + table = longtable , + reverse = true + } + +% -------------------------------------------------------------------------- +% register some tokens to be checked for: +\AcroRegisterTrailing . {dot} +\AcroRegisterTrailing - {dash} +\AcroRegisterTrailing \babelhyphen {babel-hyphen} + +% -------------------------------------------------------------------------- +% the user commands +% automatic: +\NewAcroCommand \ac + { \acro_use:n {#1} } + +\NewAcroCommand \iac + { + \acro_indefinite: + \acro_use:n {#1} + } + +\NewAcroCommand \Iac + { + \acro_first_upper: + \acro_indefinite: + \acro_use:n {#1} + } + +\NewAcroCommand \Ac + { + \acro_first_upper: + \acro_use:n {#1} + } + +\NewAcroCommand \acp + { + \acro_plural: + \acro_use:n {#1} + } + +\NewAcroCommand \Acp + { + \acro_plural: + \acro_first_upper: + \acro_use:n {#1} + } + +\NewAcroCommand \acsingle + { + \acro_get:n {#1} + \acro_single:n {#1} + } + +\NewAcroCommand \Acsingle + { + \acro_get:n {#1} + \acro_first_upper: + \acro_single:n {#1} + } + +% short: +\NewAcroCommand \acs + { \acro_short:n {#1} } + +\NewAcroCommand \iacs + { + \acro_indefinite: + \acro_short:n {#1} + } + +\NewAcroCommand \Iacs + { + \acro_first_upper: + \acro_indefinite: + \acro_short:n {#1} + } + +\NewAcroCommand \acsp + { + \acro_plural: + \acro_short:n {#1} + } + +% alt: +\NewAcroCommand \aca + { \acro_alt:n {#1} } + +\NewAcroCommand \Aca + { + \acro_first_upper: + \acro_alt:n {#1} + } + +\NewAcroCommand \iaca + { + \acro_indefinite: + \acro_alt:n {#1} + } + +\NewAcroCommand \Iaca + { + \acro_first_upper: + \acro_indefinite: + \acro_alt:n {#1} + } + +\NewAcroCommand \acap + { + \acro_plural: + \acro_alt:n {#1} + } + +% long: +\NewAcroCommand \acl + { \acro_long:n {#1} } + +\NewAcroCommand \iacl + { + \acro_indefinite: + \acro_long:n {#1} + } + +\NewAcroCommand \Iacl + { + \acro_first_upper: + \acro_indefinite: + \acro_long:n {#1} + } + +\NewAcroCommand \Acl + { + \acro_first_upper: + \acro_long:n {#1} + } + +\NewAcroCommand \aclp + { + \acro_plural: + \acro_long:n {#1} + } + +\NewAcroCommand \Aclp + { + \acro_plural: + \acro_first_upper: + \acro_long:n {#1} + } + +% first: +\NewAcroCommand \acf + { \acro_first:n {#1} } + +\NewAcroCommand \iacf + { + \acro_indefinite: + \acro_first:n {#1} + } + +\NewAcroCommand \Iacf + { + \acro_first_upper: + \acro_indefinite: + \acro_first:n {#1} + } + +\NewAcroCommand \Acf + { + \acro_first_upper: + \acro_first:n {#1} + } + +\NewAcroCommand \acfp + { + \acro_plural: + \acro_first:n {#1} + } + +\NewAcroCommand \Acfp + { + \acro_plural: + \acro_first_upper: + \acro_first:n {#1} + } + +% first-like: +\NewPseudoAcroCommand \acflike + { \acro_first_like:nn {#1} {#2} } + +\NewPseudoAcroCommand \iacflike + { + \acro_indefinite: + \acro_first_like:nn {#1} {#2} + } + +\NewPseudoAcroCommand \Iacflike + { + \acro_first_upper: + \acro_indefinite: + \acro_first_like:nn {#1} {#2} + } + +\NewPseudoAcroCommand \acfplike + { + \acro_plural: + \acro_first_like:nn {#1} {#2} + } + +% -------------------------------------------------------------------------- +% endings: +\ProvideAcroEnding {plural} {s} {s} + +% -------------------------------------------------------------------------- +% translations: % list name \DeclareAcroTranslation {acronym-list-name} { @@ -4265,13 +4358,6 @@ Portuguese = ss. } -% tokenlists using the translations: -\tl_set:Nn \l__acro_list_name_tl { \GetTranslation {acronym-list-name} } -\tl_set:Nn \l__acro_page_name_tl { \GetTranslation {acronym-page-name}\@\, } -\tl_set:Nn \l__acro_pages_name_tl { \GetTranslation {acronym-pages-name}\@\, } -\tl_set:Nn \l__acro_next_page_tl { \,\GetTranslation {acronym-next-page}\@ } -\tl_set:Nn \l__acro_next_pages_tl { \,\GetTranslation {acronym-next-pages}\@ } - % -------------------------------------------------------------------------- % allow for a configuration file: \tl_const:Nn \c_acro_config_file_name_tl {acro} @@ -4495,6 +4581,12 @@ 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/ +2017/01/22 v2.7 - rename \acro_get_property:nn into \__acro_get_property:nn + - \acro_get_property:nn, \acro_get_property:nnTF, + \acro_if_property:nnTF, retrieve property without error if + not set + - make \__acro_declare_property functions public + - \acro_add_action:n (adds code to \acro_get:n) % -------------------------------------------------------------------------- % TODO: |