From f57f2792c48675f6a594714d95d6a57868564f5a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 28 Aug 2013 15:02:46 +0000 Subject: acro (27aug13) git-svn-id: svn://tug.org/texlive/trunk@31531 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/acro/README | 4 +- Master/texmf-dist/doc/latex/acro/acro_en.pdf | Bin 498198 -> 501337 bytes Master/texmf-dist/doc/latex/acro/acro_en.tex | 59 ++++++++++------------ Master/texmf-dist/tex/latex/acro/acro.sty | 72 +++++++++++++++++++++------ Master/texmf-dist/tex/latex/acro/acro1.def | 21 ++++++-- 5 files changed, 103 insertions(+), 53 deletions(-) diff --git a/Master/texmf-dist/doc/latex/acro/README b/Master/texmf-dist/doc/latex/acro/README index ba310893385..09c8e5427f3 100644 --- a/Master/texmf-dist/doc/latex/acro/README +++ b/Master/texmf-dist/doc/latex/acro/README @@ -1,9 +1,9 @@ -------------------------------------------------------------------------- -the ACRO package v1.3d +the ACRO package v1.4 Typeset Acronyms -2013/07/08 +2013/08/27 -------------------------------------------------------------------------- Clemens Niederberger Web: https://bitbucket.org/cgnieder/acro/ diff --git a/Master/texmf-dist/doc/latex/acro/acro_en.pdf b/Master/texmf-dist/doc/latex/acro/acro_en.pdf index 9e31d00688a..bbd2894a8d8 100644 Binary files a/Master/texmf-dist/doc/latex/acro/acro_en.pdf and b/Master/texmf-dist/doc/latex/acro/acro_en.pdf differ diff --git a/Master/texmf-dist/doc/latex/acro/acro_en.tex b/Master/texmf-dist/doc/latex/acro/acro_en.tex index 5a7961af9c5..fb5db184bf7 100644 --- a/Master/texmf-dist/doc/latex/acro/acro_en.tex +++ b/Master/texmf-dist/doc/latex/acro/acro_en.tex @@ -1,6 +1,6 @@ % arara: pdflatex % !arara: biber -% !arara: pdflatex +% arara: pdflatex % !arara: pdflatex % -------------------------------------------------------------------------- % the ACRO package @@ -174,19 +174,6 @@ \textsc{Wikipedia}} \newcommand*\h[1]{\textcolor{main}{\textbf{#1}}} -\ExplSyntaxOn -\NewDocumentCommand \Default {sg} - { - \hfill\llap - { - \IfNoValueTF { #2 } - {(initially~empty)} - {Default:~\code{#2}} - } - \IfBooleanF { #1 } { \newline } - } -\ExplSyntaxOff - % declare acronyms \DeclareAcronym{cd} { @@ -278,22 +265,9 @@ long-indefinite = an } -\usepackage{marginnote} -\makeatletter -\providecommand*\sinceversion[1]{% - \@bsphack - \marginnote{% - \footnotesize\sffamily\RaggedRight - \textcolor{black!75}{Introduced in version~#1}}% - \@esphack} -\providecommand*\changedversion[1]{% - \@bsphack - \marginnote{% - \footnotesize\sffamily\RaggedRight - \textcolor{black!75}{Changed in version~#1}}% - \@esphack} \renewcommand*\cnpkgdoctriangle{} +\makeatletter \AtBeginDocument{% \ifdef\texorpdfstring{}{\let\texorpdfstring\@firstoftwo}% } @@ -400,6 +374,10 @@ are not described immediately but at appropriate places in the documentation. \Option{long-plural-form}{}\newline plural long form of the acronym; replaces the long form when used instead of appending the plural ending. + %% list + \Option{list}{}\newline + \sinceversion{1.4}if specified this will be written in the list as + description instead of the long form. %% short-indefinite \Option{short-indefinite}{}\Default{a} \sinceversion{1.2}% @@ -740,6 +718,15 @@ article. \Iac{ufo}; \iacs{ufo}; \iacl{ufo} \end{beispiel} +\subsection{Uppercasing}\secidx[uppercasing]{Additional Commands} +\begin{beschreibung} + \Befehl{acfirstupper}{}\newline + \sinceversion{1.3e}This command uppercases the first token in \code{}. The command is less powerful than \cmd{makefirstuc} that is + provided by the \paket{mfirstuc} package but it is expandable. Obvious + downsides are for example that it does not uppercase accented letters. +\end{beschreibung} + \subsection{Simulating the First Appearance} \noindent\sinceversion{1.2}% Users told me\footnote{Well -- one, to be precise ;)} that there are cases when it @@ -794,12 +781,18 @@ lists. \acl{ny} (\acs{ny}) \end{beispiel} -\subsection{Reset or Mark as Used}\secidx[resetting]{Additional Commands} +\subsection{Reset or Mark as Used, Test if Acronym Has Been Used} +\secidx[resetting]{Additional Commands}\secidx[testing]{Additional Commands} + If you want for some reason to fool \acro into thinking that an acronym is used for the first time you can call one of these commands: \begin{beschreibung} \Befehl{acreset}{}\sinceversion{0.5} \Befehl{acresetall} + \Befehl{acifused}{}\ma{}\ma{}\newline + \sinceversion{1.3e}This command tests if the acronym with \ac{id} + \code{} has already been used and either puts \code{} or + \code{} in the input stream. \end{beschreibung} \begin{beispiel} \acreset{ny}\ac{ny} @@ -1005,11 +998,11 @@ There are a few options which change the general behaviour of \acro. \sinceversion{1.0}Activates the access support as provided by the \paket{accsupp} package. %% - \Option{uc-cmd}{}\Default{\cmd*{acro_first_upper_case:n}} + \Option{uc-cmd}{}\Default{\cmd{acfirstupper}} The command that is used to capitalize the first word in the \cmd{Ac} and the - like commands. You can change it to another one like for example - \cmd*{makefirstuc}\footnote{from the \paket*{mfirstuc} package} or - \cmd*{MakeTextUppercase}\footnote{from the \paket*{textcase} package}.\catcode`\_=8 + like commands. You can change it to another one like for example + \cmd{makefirstuc}\footnote{from the \paket*{mfirstuc} package} or + \cmd*{MakeTextUppercase}\footnote{from the \paket*{textcase} package}. \end{beschreibung} All options of this and the following sections can be set up either as package diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty index 7780a14e882..40d3cef8a9c 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,xparse,l3keys2e,xtemplate} \ProvidesExplPackage {acro} - {2013/07/08} - {1.3d} + {2013/08/27} + {1.4} {Typeset Acronyms} % -------------------------------------------------------------------------- @@ -237,6 +237,7 @@ \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 % -------------------------------------------------------------------------- % comma list variables @@ -248,10 +249,11 @@ \prop_new:N \l__acro_alt_prop \prop_new:N \l__acro_sort_prop \prop_new:N \l__acro_long_prop +\prop_new:N \l__acro_list_prop \prop_new:N \l__acro_class_prop -\prop_new:N \l__acro_replace_plural_prop \prop_new:N \l__acro_short_plural_prop \prop_new:N \l__acro_long_plural_prop +\prop_new:N \l__acro_replace_long_plural_prop \prop_new:N \l__acro_short_indefinite_prop \prop_new:N \l__acro_long_indefinite_prop \prop_new:N \l__acro_alt_indefinite_prop @@ -288,6 +290,9 @@ \cs_new_eq:NN \acro_first_upper_case:n \__acro_first_upper_case:n +\NewDocumentCommand \acfirstupper { m } + { \acro_first_upper_case:n { #1 } } + % -------------------------------------------------------------------------- % versioning: \clist_put_right:Nn \l__acro_versions_clist { 0 } @@ -314,6 +319,7 @@ { version .code:n = \__acro_select_version:n { #1 } , accsupp .bool_set:N = \l__acro_acc_supp_bool , + accsupp-options .tl_set:N = \l__acro_acc_supp_options_tl , macros .bool_set:N = \l__acro_create_macros_bool , xspace .bool_set:N = \l__acro_xspace_bool , strict .bool_set:N = \l__acro_strict_bool , @@ -1040,9 +1046,11 @@ \acro_get:n { ##1 } \bool_if:nT { + \bool_if_p:c { g__acro_##1_used_bool } && ( ( \l__acro_use_single_bool && \cs_if_exist_p:c { acro@##1@twice } ) || ( !\l__acro_use_single_bool && \cs_if_exist_p:c { acro@##1@once } && \l__acro_print_only_used_bool ) || ( !\l__acro_use_single_bool && !\l__acro_print_only_used_bool ) + ) } { \acro_is_excluded:nnF { ##1 } { #2 } @@ -1113,7 +1121,11 @@ \cs_set:Npn \acro_print_list_long:n ##1 { \__acro_write_long:Nf \l__acro_list_long_format_tl - { \prop_get:Nn \l__acro_long_prop { ##1 } } + { + \prop_if_in:NnTF \l__acro_list_prop { ##1 } + { \prop_get:Nn \l__acro_list_prop { ##1 } } + { \prop_get:Nn \l__acro_long_prop { ##1 } } + } \__acro_cite_if:Nn \l__acro_citation_all_bool { ##1 } } \cs_set_protected:Npn \acro_print_list_extra:n ##1 @@ -1165,7 +1177,11 @@ \cs_set:Npn \acro_print_list_long:n ##1 { \__acro_write_long:Nf \l__acro_list_long_format_tl - { \prop_get:Nn \l__acro_long_prop { ##1 } } + { + \prop_if_in:NnTF \l__acro_list_prop { ##1 } + { \prop_get:Nn \l__acro_list_prop { ##1 } } + { \prop_get:Nn \l__acro_long_prop { ##1 } } + } \__acro_cite_if:Nn \l__acro_citation_all_bool { ##1 } } \cs_set_protected:Npn \acro_print_list_extra:n ##1 @@ -1216,7 +1232,11 @@ \cs_set:Npn \acro_print_list_long:n ##1 { \__acro_write_long:Nf \l__acro_list_long_format_tl - { \prop_get:Nn \l__acro_long_prop { ##1 } } + { + \prop_if_in:NnTF \l__acro_list_prop { ##1 } + { \prop_get:Nn \l__acro_list_prop { ##1 } } + { \prop_get:Nn \l__acro_long_prop { ##1 } } + } \__acro_cite_if:Nn \l__acro_citation_all_bool { ##1 } & } @@ -1267,7 +1287,11 @@ \bool_if:NT \l__acro_capitalize_list_bool { \bool_set_true:N \l__acro_first_upper_bool } \__acro_write_long:Nf \l__acro_long_format_tl - { \prop_get:Nn \l__acro_long_prop { ##1 } } + { + \prop_if_in:NnTF \l__acro_list_prop { ##1 } + { \prop_get:Nn \l__acro_list_prop { ##1 } } + { \prop_get:Nn \l__acro_long_prop { ##1 } } + } \__acro_cite_if:Nn \l__acro_citation_all_bool { ##1 } & } @@ -1347,7 +1371,7 @@ } } -\prg_new_conditional:Npnn \__acro_is_single:n #1 { T,TF } +\prg_new_conditional:Npnn \__acro_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: } @@ -1401,7 +1425,7 @@ { \bool_if:NT \l__acro_use_plural_bool { - \bool_if:nTF { \prop_get:Nn \l__acro_replace_plural_prop { #1 } } + \bool_if:nTF { \prop_get:Nn \l__acro_replace_long_plural_prop { #1 } } { \prop_get:NnNF \l__acro_long_plural_prop { #1 } \l__acro_long_tl {} } { \tl_put_right:Nn \l__acro_long_tl @@ -1694,13 +1718,13 @@ % accessability support \cs_new_eq:NN \__acro_acc_supp:nn \use_ii:nn -\cs_new:Npn \__acro_acc_supp_aux:nn #1#2 +\cs_new:Npn \acro_acc_supp:nnn #1#2#3 { - \BeginAccSupp { ActualText = #1 } - #2 + \BeginAccSupp { ActualText = #1 , #2 } + #3 \EndAccSupp { } } -\cs_generate_variant:Nn \__acro_acc_supp_aux:nn { V } +\cs_generate_variant:Nn \acro_acc_supp:nnn { VV } \AtBeginDocument { @@ -1713,7 +1737,10 @@ { \prop_get:NnNF \l__acro_short_prop { #1 } \l__acro_acc_supp_tl {} } \bool_if:NT \l__acro_use_plural_bool { \tl_put_right:NV \l__acro_acc_supp_tl \l__acro_short_plural_tl } - \__acro_acc_supp_aux:Vn \l__acro_acc_supp_tl { #2 } + \acro_acc_supp:VVn + \l__acro_acc_supp_tl + \l__acro_acc_supp_options_tl + { #2 } } } } @@ -2170,6 +2197,20 @@ \cs_new_protected:Npn \acro_mark_all_as_used: { \prop_map_inline:Nn \l__acro_short_prop { \acro_mark_as_used:n { ##1 } } } +\DeclareExpandableDocumentCommand \acifused { m } + { \acro_if_acronym_used:nTF { #1 } } + +\prg_new_conditional:Npnn \acro_if_acronym_used:n #1 { TF } + { + \bool_if:nTF + { + \bool_if_p:c { g__acro_#1_used_bool } && + ( !\__acro_is_single_p:n { #1 } ) + } + { \prg_return_true: } + { \prg_return_false: } + } + \NewDocumentCommand \acresetall {} { \acro_reset_all: } @@ -2372,6 +2413,9 @@ 2013/06/16 v1.3c - added \leavevmode to \acro_get:n 2013/07/08 v1.3d - corrected wrong call of \leavevmode in the list (list-type=list) +2013/08/07 v1.3e - bug fix in the list when testing for used acronyms + - new commands \acifused, \acfirstupper +2013/08/27 v1.4 - new property `list' % -------------------------------------------------------------------------- % TODO: diff --git a/Master/texmf-dist/tex/latex/acro/acro1.def b/Master/texmf-dist/tex/latex/acro/acro1.def index 925db9a97e2..ed3c0568b9f 100644 --- a/Master/texmf-dist/tex/latex/acro/acro1.def +++ b/Master/texmf-dist/tex/latex/acro/acro1.def @@ -103,6 +103,7 @@ } \cs_generate_variant:Nn \__acro_declare_short:nn { V } +% short plural: \cs_new_protected:Npn \__acro_declare_short_plural:nn #1#2 { \__acro_key_check:nn { #1 } { short-plural } @@ -114,7 +115,7 @@ \cs_new_protected:Npn \__acro_declare_long:nn #1#2 { \__acro_key_check:nn { #1 } { long } - \prop_put:Nnn \l__acro_replace_plural_prop { #1 } { \c_false_bool } + \prop_put:Nnn \l__acro_replace_long_plural_prop { #1 } { \c_false_bool } \prop_put:Nnn \l__acro_long_prop { #1 } { #2 } \prop_put:Nnx \l__acro_long_indefinite_prop { #1 } { \l__acro_default_indefinite_tl } @@ -126,11 +127,19 @@ } \cs_generate_variant:Nn \__acro_declare_long:nn { V } +% list: +\cs_new_protected:Npn \__acro_declare_list:nn #1#2 + { + \__acro_key_check:nn { #1 } { list } + \prop_put:Nnn \l__acro_list_prop { #1 } { #2 } + } +\cs_generate_variant:Nn \__acro_declare_list:nn { V } + % long plural: \cs_new_protected:Npn \__acro_declare_long_plural:nn #1#2 { \__acro_key_check:nn { #1 } { long-plural } - \prop_put:Nnn \l__acro_replace_plural_prop { #1 } { \c_false_bool } + \prop_put:Nnn \l__acro_replace_long_plural_prop { #1 } { \c_false_bool } \prop_put:Nnn \l__acro_long_plural_prop { #1 } { #2 } } \cs_generate_variant:Nn \__acro_declare_long_plural:nn { V } @@ -139,7 +148,7 @@ \cs_new_protected:Npn \__acro_declare_long_plural_form:nn #1#2 { \__acro_key_check:nn { #1 } { long-plural-form } - \prop_put:Nnn \l__acro_replace_plural_prop { #1 } { \c_true_bool } + \prop_put:Nnn \l__acro_replace_long_plural_prop { #1 } { \c_true_bool } \prop_put:Nnn \l__acro_long_plural_prop { #1 } { #2 } } \cs_generate_variant:Nn \__acro_declare_long_plural_form:nn { V } @@ -350,6 +359,8 @@ \__acro_declare_short:Vn \l__acro_current_key_tl { #1 } , short-plural .code:n = \__acro_declare_short_plural:Vn \l__acro_current_key_tl { #1 } , +% short-plural-form .code:n = +% \__acro_declare_short_plural_form:Vn \l__acro_current_key_tl { #1 } , alt .code:n = \__acro_declare_alt:Vn \l__acro_current_key_tl { #1 } , long .code:n = @@ -358,6 +369,8 @@ \__acro_declare_long_plural:Vn \l__acro_current_key_tl { #1 } , long-plural-form .code:n = \__acro_declare_long_plural_form:Vn \l__acro_current_key_tl { #1 } , + list .code:n = + \__acro_declare_list:Vn \l__acro_current_key_tl { #1 } , short-indefinite .code:n = \__acro_declare_short_indefinite:Vn \l__acro_current_key_tl { #1 } , alt-indefinite .code:n = @@ -488,4 +501,4 @@ \NewDocumentCommand \printacronyms { O{} } { \acro_print_acronyms:n { #1 } } -\tex_endinput:D \ No newline at end of file +\tex_endinput:D -- cgit v1.2.3