diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/README | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/acro-manual.pdf | bin | 868396 -> 879954 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/acro-manual.tex | 73 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.pdf | bin | 0 -> 22752 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.tex | 21 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.pdf | bin | 0 -> 15855 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.tex | 24 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.pdf | bin | 0 -> 15808 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.tex | 39 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.units.pdf | bin | 65310 -> 65067 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex | 17 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/acro/acro.sty | 378 |
12 files changed, 358 insertions, 204 deletions
diff --git a/Master/texmf-dist/doc/latex/acro/README b/Master/texmf-dist/doc/latex/acro/README index 9b6b9df588a..1cfc035d626 100644 --- a/Master/texmf-dist/doc/latex/acro/README +++ b/Master/texmf-dist/doc/latex/acro/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the ACRO package v3.1 2020/05/03 +the ACRO package v3.2 2020/05/10 Typeset Acronyms @@ -22,9 +22,10 @@ This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Clemens Niederberger. -------------------------------------------------------------------------- -The acro package consists of the code file: +The acro package consists of code files: acro.sty + acro2.sty The acro package consists of documentation files: @@ -46,5 +47,8 @@ folder examples/ in the same folder as acro-manual.pdf: acro.example.issue-154.pdf, acro.example.issue-154.tex acro.example.texsx-505891.pdf, acro.example.texsx-505891.tex acro.example.texsx-507726.pdf, acro.example.texsx-507726.tex - + acro.example.texsx-513623.pdf, acro.example.texsx-513623.tex + acro.example.texsx-515295.pdf, acro.example.texsx-515295.tex + acro.example.texsx-542461.pdf, acro.example.texsx-542461.tex + -------------------------------------------------------------------------- diff --git a/Master/texmf-dist/doc/latex/acro/acro-manual.pdf b/Master/texmf-dist/doc/latex/acro/acro-manual.pdf Binary files differindex 5c2310f650b..90a739e61c9 100644 --- a/Master/texmf-dist/doc/latex/acro/acro-manual.pdf +++ b/Master/texmf-dist/doc/latex/acro/acro-manual.pdf diff --git a/Master/texmf-dist/doc/latex/acro/acro-manual.tex b/Master/texmf-dist/doc/latex/acro/acro-manual.tex index af5e2387c6e..1d21678c63e 100644 --- a/Master/texmf-dist/doc/latex/acro/acro-manual.tex +++ b/Master/texmf-dist/doc/latex/acro/acro-manual.tex @@ -1123,7 +1123,7 @@ have different indefinite articles\footnote{This may very well be a language an \ac{ufo} \end{example} And what good would it be to use a package like \acro\ if you have to keep -track of of and second uses, anyway? This is why \acs{ufo} should be defined +track of first and second uses, anyway? This is why \acs{ufo} should be defined like we did on page~\pageref{ufo}. We then can just use the dedicated commands and let them decide for us: \begin{example}[side-by-side] @@ -1179,6 +1179,9 @@ There are also some options: \begin{options} \keybool{display}\Module{foreign}\Default{true} Determine wether to hide or display the foreign form. + \keybool{display}\Module{list,foreign}\Default{true} + \sinceversion{3.2}Determine wether to hide or display the foreign form in + the list of acronyms. \keybool{display}\Module{locale}\Default{false} This options determines wether the language of the foreign form is printed or not when the full form of the acronym is printed. @@ -1250,6 +1253,8 @@ have no effect, of course. } \end{sourcecode} +\pagebreak + There are a number of options to control the uppercasing behavior: \begin{options} \opt{first}\Module{uppercase} @@ -1374,7 +1379,7 @@ for an acronym individually. \end{properties} This manual is an example for the indexing feature. Each acronym from section~\vref{sec:acronyms} that has been used in this manual is also listed -in the manual. +in the index. \section{Barriers}\label{sec:barriers} The main purpose of the concept of barriers is to be able to have \emph{local} @@ -1401,10 +1406,10 @@ barriers with \begin{commands} \command{acbarrier} For this command to have any effect you must set - \module{barriers}\code{/}\option{single} to \code{true}! + \module{barriers}\code{/}\option{use} to \code{true}! \end{commands} \begin{bewareofthedog} - It takes usually two or even three \LaTeX\ runs until acronym usages + It usually takes two or even three \LaTeX\ runs until acronym usages between barriers are properly counted. \end{bewareofthedog} @@ -1415,7 +1420,7 @@ boolean variable if it finds them. Per default \acro\ knows about three tokens: the \enquote{\code{dot}} (\sym{.}), the \enquote{\code{dash}} (\sym{-}) and the \enquote{\code{babel-hyphen}} (\cs*{babelhyphen}). -Yeu have seen an example for this already: +You have seen an example for this already: \begin{sourcecode} \DeclareAcronym{etc}{ short = etc\acdot , @@ -1502,8 +1507,7 @@ This command is used to define the two commands you already know: \code{babel-hyphen} follows. \expandable\command{abbrdot} Inserts \sym{.}\cs*{@} \end{commands} -The definitions are equivalent\footnote{Not \emph{quite}: \acro's definitions - are engine protected.} to the following code: +The definitions are equivalent to the following code: \begin{sourcecode} \newcommand*\acdot{\aciftrailing{dot}{}{\abbrdot}} \newcommand*\acspace{\aciftrailing{dash,babel-hyphen}{}{\space}} @@ -1801,7 +1805,14 @@ to defines own such objects: \tmpl{longtabu} A style that uses a \env*{longtabu} environment for building the list. This needs the \pkg{longtable} package and the \pkg{tabu} - package~\cite{pkg:tabu} loaded. + package~\cite{pkg:tabu} loaded\footnote{Please note that this package + currently is un-maintained and has a number of open bugs. For further + information refer to + \url{https://github.com/tabu-issues-for-future-maintainer/tabu}}. + \tmpl{supertabular} + A\sinceversion{3.2} style that uses a \env*{supertabular} environment for + building the list. This needs the \pkg{supertabular} + package~\cite{pkg:supertabular} loaded. \tmpl{tabular} A style that uses a \env*{tabular} environment for building the list. Since a \env*{tabular} cannot break across pages this is only suited for @@ -1827,7 +1838,7 @@ to defines own such objects: \tmpl{section} Uses \cs*{section} for the heading. \tmpl{section*} - Uses \cs*{section}\sarg* for the heading. + Uses \cs*{section}\sarg\ for the heading. \end{templates} \subsection{Defining new templates}\label{sec:defin-new-templ} @@ -1841,6 +1852,19 @@ For the definition of templates these commends are available: This re-defines a template of type \meta{type} woth the name \meta{name} which inserts \meta{code} when used. A template of type \meta{type} with name \meta{name} must exist. The default type is \code{acronym}. + \command{SetupAcroTemplate}[\oarg{type}\marg{name}\marg{code}] + Adds\sinceversion{3.2} \meta{code} to the beginning of the template + \meta{name} of type \meta{type}. The default type is \code{acronym}. + \command{SetupNextAcroTemplate}[\oarg{type}\marg{name}\marg{code}] + Adds\sinceversion{3.2} \meta{code} to the beginning of \emph{the next use} + of the template \meta{name} of type \meta{type}. The default type is + \code{acronym}. + \expandable\command{AcroTemplateType} + Within a template this expands to the \meta{type} of the current + template. + \expandable\command{AcroTemplateName} + Within a template this expands to the \meta{name} of the current + template. \end{commands} How to use these commands is best explained by examples of how the existing @@ -1867,7 +1891,7 @@ and \cs*{acroifF} each have an argument less than \cs*{acroifTF}. \subsubsection{Commands for common uses} \begin{commands} \expandable\command{acrolistname} - Expnads to whatever is currently set with + Expands to whatever is currently set with \module{list}\code{/}\option{name}. \command{acrowrite}[\marg{property}] Prints the property \meta{property} of the current acronym. Depending on @@ -2137,7 +2161,7 @@ define and use additional articles. \begin{commands} \command{DeclareAcroArticle}[\marg{name}\marg{default}] This command can be used to define properties and options analoguous to - the indefnite article which have been defined this way: + the indefinite article which have been defined this way: \end{commands} \begin{sourcecode} \DeclareAcroArticle{indefinite}{a} @@ -2163,7 +2187,7 @@ template definitions. This command tells the template that the article \meta{foo} should be used. \end{commands} -Section~\vref{sec:own-acronym-commands} has an example of how this can be used +Section~\vref{sec:own-acronym-commands} has examples of how this can be used to define definite articles and commands that make use of them like this: \begin{example} \dacs{hadopi} \par @@ -2208,13 +2232,13 @@ Translations for a language could be added this way\footnote{\acro\ already The existing keywords had been shown in table~\vref{tab:translations}. \section{Properties}\label{sec:new-properties} -As you know from section~\ref{sec:decl-acronyms-other} \acro\ comes with -quiute a number of predefined properties for the control of acronyms. -However, there are cases when additional properties would be nice to have and -to use. \acro\ provides this command: +As you know from section~\ref{sec:decl-acronyms-other} \acro\ comes with quite +a number of predefined properties which control various aspects of +acronyms. However, there are cases when additional properties would be nice to +have and to use. It can be done with the following command: \begin{commands} - \command{DeclareAcroProperty}[\sarg\qarg\barg\uarg\marg{name}] - This defines the new property \meta{name}. The command has four optional + \command{DeclareAcroProperty}[\sarg\arg{?}\arg{!}\arg{|}\arg{>}\marg{name}] + This defines the new property \meta{name}. The command has five optional arguments most of which you probably never need. \par The optional star \sym{*} ensures that each acronym gets a \emph{unique} value for the property. \par @@ -2223,11 +2247,18 @@ to use. \acro\ provides this command: \code{false} and when it is used without value (not an empty value!) then \code{true} is assumed. \par The optional exclamation mark \sym{!} creates a \emph{mandatory} - property. An error if raised if an acronym does not set it. \par + property. An error is raised if an acronym does not set it. \par The optional pipe \sym{|} creates a \emph{static} property which means its value is written to an auxiliary file and read in again at begin - document. Once set the value is the same throughout the document - \command{DeclareAcroPropertyAlias}[\sarg\qarg\barg\uarg\marg{name1}\marg{name2}] + document. Once set the value is the same throughout the document. \par + The optional greater as symbol\sinceversion{3.2} \sym{>} creates a + \emph{display} property. This additionally defines the two boolean + options \meta{name}\code{/}\option{display} and + \module{list}\code{/}\meta{name}\code{/}\option{display}, both initially + set to true. If these options are set to false the acronym commands or + the list act as if the property \meta{name} has not been set. The + \property{foreign} property is an example. + \command{DeclareAcroPropertyAlias}[\sarg\arg{?}\arg{!}\arg{|}\arg{>}\marg{name1}\marg{name2}] This newly declares property \meta{name1} and makes it an alias of property \meta{name2}. This means that \meta{name1} gets the same value that \meta{name2} has unless it is set explicitly. Property \meta{name2} diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.pdf b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.pdf Binary files differnew file mode 100644 index 00000000000..51e1ef49fbb --- /dev/null +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.pdf diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.tex b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.tex new file mode 100644 index 00000000000..049172952b5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-513623.tex @@ -0,0 +1,21 @@ +\documentclass{article} +\usepackage{acro} + +\newrobustcmd*\newspecies[4][]{% + \DeclareAcronym{#2}{ + short = {#3} , + long = {#4} , + #1 , + tag = species , + first-style= long , + format = \itshape + }% +} +\newspecies{ecoli}{E.~coli}{Escherichia coli} + +\begin{document} + +First use: \ac{ecoli}\par +Second use: \ac{ecoli} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.pdf b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.pdf Binary files differnew file mode 100644 index 00000000000..f5cdd4871b2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.pdf diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.tex b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.tex new file mode 100644 index 00000000000..f9a93dfab2e --- /dev/null +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-515295.tex @@ -0,0 +1,24 @@ +\documentclass{article} + +\usepackage{acro} +\usepackage{csquotes} +\usepackage{chemmacros} + +\DeclareAcronym{APA}{ + short = 3-APA , + long = \iupac{3-azido-1-propyl|amine} +} +\DeclareAcronym{CuAAC}{ + short = \enquote{click} chemistry , + long = copper(I)-catalyzed azide-alkyne cycloaddition +} + +\begin{document} + +1: \Acl{APA} + +2: \Acs{CuAAC} + +3: \Acl{CuAAC} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.pdf b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.pdf Binary files differnew file mode 100644 index 00000000000..6c4222c3431 --- /dev/null +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.pdf diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.tex b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.tex new file mode 100644 index 00000000000..c44358073eb --- /dev/null +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-542461.tex @@ -0,0 +1,39 @@ +\documentclass{article} +\usepackage{acro} + +\DeclareAcroArticle{definite}{the} +\DeclareAcroEnding{possessive}{'s}{'s} + +\NewAcroCommand\dac{m}{\acrodefinite\UseAcroTemplate{first}{#1}} +\NewAcroCommand\Dac{m}{\acroupper\acrodefinite\UseAcroTemplate{first}{#1}} + +\NewAcroCommand\Dacg{m}{% + \acroupper + \acrodefinite + \acropossessive + \UseAcroTemplate{first}{#1}% +} + +\DeclareAcronym{css}{ + short = CSS , + long = Centre for Spaghetti Studies , + short-definite = \nospace , + long-possessive = ' +} + +\begin{document} + +Bob hails from \dac{css}. \par +Bob hails from \dac{css}. + +\acreset{css} + +\Dacg{css} mandate is broad. \par +\Dacg{css} mandate is broad. + +\acreset{css} + +\Dac{css} scientists eat well. \par +\Dac{css} scientists eat well. \par + +\end{document} diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.pdf b/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.pdf Binary files differindex 79c07fc50a6..f699cdcd826 100644 --- a/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.pdf +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.pdf diff --git a/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex b/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex index f499a918cb6..ff4d9cc8bb1 100644 --- a/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex +++ b/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex @@ -33,41 +33,36 @@ short = \ensuremath{f} , long = Frequenz , unit = \si{\hertz} , - class = physics + tag = physics } \DeclareAcronym{A}{ short = \ensuremath{A} , long = Fläche , unit = \si{\metre^2} , - class = physics + tag = physics } \DeclareAcronym{C}{ short = \ensuremath{C} , long = Kapazität , unit = \si{\farad} , - class = physics + tag = physics } \DeclareAcronym{F}{ short = \ensuremath{F} , long = Kraft , unit = \si{\newton} , - class = physics + tag = physics } \NewAcroTemplate[list]{physics}{% - \def\TableCode{}% \acronymsmapT{% - \AcroPutRight\TableCode{% - \def\AcronymID{##1}% + \AcroAddRow{% \acrowrite{short}% & - \def\AcronymID{##1}% \acrowrite{unit}% & - \def\AcronymID{##1}% \acrowrite{list}% & - \def\AcronymID{##1}% \acropages {\acrotranslate{page}\nobreakspace}% {\acrotranslate{pages}\nobreakspace}% @@ -80,7 +75,7 @@ \setlength\LTleft{0pt}% \setlength\LTright{0pt}% \begin{longtable}{@{}lll@{\extracolsep{\fill}}l@{}} - \TableCode + \AcronymTable \end{longtable} } diff --git a/Master/texmf-dist/tex/latex/acro/acro.sty b/Master/texmf-dist/tex/latex/acro/acro.sty index 2d1d88f020b..d272acdc82e 100644 --- a/Master/texmf-dist/tex/latex/acro/acro.sty +++ b/Master/texmf-dist/tex/latex/acro/acro.sty @@ -27,9 +27,9 @@ % setup package: \tl_const:Nn \c_acro_package_name_tl {acro} -\tl_const:Nn \c_acro_date_tl {2020/05/04} +\tl_const:Nn \c_acro_date_tl {2020/05/10} \tl_const:Nn \c_acro_version_major_number_tl {3} -\tl_const:Nn \c_acro_version_minor_number_tl {1} +\tl_const:Nn \c_acro_version_minor_number_tl {2} \tl_const:Nn \c_acro_version_subrelease_tl {} \tl_const:Nx \c_acro_version_number_tl { @@ -653,8 +653,11 @@ \NewDocumentCommand \AcroNeedPackage {m} { - \acro_package_if_loaded:nF {m} - { \msg_error:nnen {acro} {package-needed} { \TemplateName } {#1} } + \clist_map_inline:nn {#1} + { + \acro_package_if_loaded:nF {##1} + { \msg_error:nnen {acro} {package-needed} { \TemplateName } {##1} } + } } % -------------------------------------------------------------------------- @@ -693,13 +696,31 @@ { \acro_switch_on: } % -------------------------------------------------------------------------- -\NewDocumentCommand \DeclareAcroProperty {st?t!t|m} - { \acro_property_declare:nnnnn {#1} {#2} {#3} {#4} {#5} } +\NewDocumentCommand \DeclareAcroProperty {st?t!t|t>m} + { + \acro_property_declare:en + { + \IfBooleanT {#1} {unique=true,} + \IfBooleanT {#2} {boolean=true,} + \IfBooleanT {#3} {mandatory=true,} + \IfBooleanT {#4} {static=true,} + \IfBooleanT {#5} {display=true} + } + {#6} + } -\NewDocumentCommand \DeclareAcroPropertyAlias {st?t!t|mm} +\NewDocumentCommand \DeclareAcroPropertyAlias {st?t!t|t>mm} { - \acro_property_declare:nnnnn {#1} {#2} {#3} {#4} {#5} - \acro_property_make_alias:nn {#5} {#6} + \acro_property_declare:en + { + \IfBooleanT {#1} {unique=true,} + \IfBooleanT {#2} {boolean=true,} + \IfBooleanT {#3} {mandatory=true,} + \IfBooleanT {#4} {static=true,} + \IfBooleanT {#5} {display=true} + } + {#6} + \acro_property_make_alias:nn {#6} {#7} } \NewDocumentCommand \MakeAcroPropertyAlias {mm} @@ -714,6 +735,12 @@ \NewDocumentCommand \RenewAcroTemplate {O{acronym}m+m} { \use:c {acro_#1_template_renew:nn} {#2} {#3} } +\NewDocumentCommand \SetupAcroTemplate {O{acronym}m+m} + { \acro_template_setup:nnn {#1} {#2} {#3} } + +\NewDocumentCommand \SetupNextAcroTemplate {O{acronym}m+m} + { \acro_next_template_setup:nnn {#1} {#2} {#3} } + \NewDocumentCommand \DeclareAcronym {m+m} { \acro_declare_acronym:nn {#1} {#2} } @@ -848,16 +875,12 @@ \NewExpandableDocumentCommand \acroifbooleanF {m} { \acro_boolean_property_if:enF { \AcronymID } {#1} } -\NewExpandableDocumentCommand \acroifTF {+m+m+m} - { - \acro_property_if_set:enTF { \AcronymID } {#1} - { \acro_check_foreign:nn {#1} {#2} } - {#3} - } -\NewExpandableDocumentCommand \acroifT {+m+m} - { \acroifTF {#1} {#2} {} } -\NewExpandableDocumentCommand \acroifF {+m+m} - { \acroifTF {#1} {} {#2} } +\NewExpandableDocumentCommand \acroifTF {m} + { \acro_property_if_set:enTF { \AcronymID } {#1} } +\NewExpandableDocumentCommand \acroifT {m} + { \acro_property_if_set:enT { \AcronymID } {#1} } +\NewExpandableDocumentCommand \acroifF {m} + { \acro_property_if_set:enF { \AcronymID } {#1} } \NewDocumentCommand \acroifanyTF {m+m+m} { \acro_property_if_any:enTF { \AcronymID } {#1} {#2} {#3} } @@ -1154,44 +1177,73 @@ \acro_attribute_new:n {mandatory} \acro_attribute_new:n {dynamic} -% \seq_new:N \l__acro_mandatory_properties_seq \tl_new:N \l__acro_mandatory_properties_tl +\bool_new:N \l__acro_property_define_unique_bool +\bool_new:N \l__acro_property_define_boolean_bool +\bool_new:N \l__acro_property_define_mandatory_bool +\bool_new:N \l__acro_property_define_static_bool +\bool_new:N \l__acro_property_define_display_bool + +\cs_new_protected:Npn \__acro_setup_property:nn #1#2 + { \use:c {bool_set_#2:c} {l__acro_property_define_#1_bool} } +\cs_new_protected:Npn \__acro_setup_property:n #1 + { \__acro_setup_property:nn {#1} {true} } + % new property: -% #1: boolean (true = unique) -% #2: boolean (true = boolean) -% #3: boolean (true = mandatory) -% #4: boolean (true = static != dynamic) -% #5: property name -\cs_new_protected:Npn \acro_property_declare:nnnnn #1#2#3#4#5 - { - \acro_property_if_exist:nF {#5} - { - \seq_put_right:Ne \l__acro_properties_seq { \tl_to_str:n {#5} } - \acro_attribute_new:n {property::#5} - \bool_if:nF {#4} - { \acro_attribute_set:nnn {dynamic} {#5} {true} } - \__acro_auxlist_new:n {#5} - \bool_if:nT {#3} +% #1: attributes +% #2: property name +\cs_new_protected:Npn \acro_property_declare:nn #1#2 + { + \acro_property_if_exist:nF {#2} + { + \seq_put_right:Ne \l__acro_properties_seq { \tl_to_str:n {#2} } + \acro_attribute_new:n {property::#2} + \bool_set_false:N \l__acro_property_define_unique_bool + \bool_set_false:N \l__acro_property_define_boolean_bool + \bool_set_false:N \l__acro_property_define_mandatory_bool + \bool_set_false:N \l__acro_property_define_static_bool + \bool_set_false:N \l__acro_property_define_display_bool + \keyval_parse:NNn + \__acro_setup_property:n + \__acro_setup_property:nn + {#1} + \bool_if:NF \l__acro_property_define_static_bool + { \acro_attribute_set:nnn {dynamic} {#2} {true} } + \__acro_auxlist_new:n {#2} + \bool_if:NT \l__acro_property_define_mandatory_bool { - \acro_attribute_set:nnn {mandatory} {#5} {true} - % \seq_put_right:Nn \l__acro_mandatory_properties_seq {#5} - \tl_put_right:Nn \l__acro_mandatory_properties_tl {{#5}} + \acro_attribute_set:nnn {mandatory} {#2} {true} + \tl_put_right:Nn \l__acro_mandatory_properties_tl {{#2}} } - \bool_if:nT {#2} - { \acro_attribute_set:nnn {boolean} {#5} {true} } - \bool_if:nT {#1} + \bool_if:NT \l__acro_property_define_boolean_bool + { \acro_attribute_set:nnn {boolean} {#2} {true} } + \bool_if:NT \l__acro_property_define_unique_bool { - \acro_attribute_set:nnn {unique} {#5} {true} - \seq_new:c {l__acro_unique_#5_seq} + \acro_attribute_set:nnn {unique} {#2} {true} + \seq_new:c {l__acro_unique_#2_seq} } - \bool_if:nT {#4} + \bool_if:NT \l__acro_property_define_static_bool { - \AtEndDocument { \__acro_auxlist_update:n {#5} } - \acro_at_begin_document:n { \__acro_property_set_from_auxlist:n {#5} } + \AtEndDocument { \__acro_auxlist_update:n {#2} } + \acro_at_begin_document:n + { \__acro_property_set_from_auxlist:n {#2} } + } + \bool_if:NT \l__acro_property_define_display_bool + { + \bool_new:c {l__acro_#2_display_bool} + \bool_new:c {l__acro_#2_list_display_bool} + \keys_define:nn {acro} + { + #2/display .bool_set:c = {l__acro_#2_display_bool} , + #2/display .initial:n = true , + list/#2/display .bool_set:c = {l__acro_#2_list_display_bool} , + list/#2/display .initial:n = true + } } } } +\cs_generate_variant:Nn \acro_property_declare:nn {e} % ---------------------------------------------------------------------------- % property conditionals: @@ -1208,7 +1260,17 @@ \prg_new_conditional:Npnn \acro_property_if_set:nn #1#2 {p,T,F,TF} { \acro_attribute_if_set:neTF {#2} { \acro_case_insensitive:n {#1} } - { \prg_return_true: } + { + \cs_if_exist:cTF {l__acro_#2_display_bool} + { + \bool_if:NTF \l__acro_list_bool + { \bool_if:cTF {l__acro_#2_list_display_bool} } + { \bool_if:cTF {l__acro_#2_display_bool} } + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_true: } + } { \prg_return_false: } } \prg_generate_conditional_variant:Nnn \acro_property_if_set:nn @@ -1651,7 +1713,7 @@ \DeclareAcroProperty {pdfcomment} % locale: -\DeclareAcroProperty {foreign} +\DeclareAcroProperty>{foreign} \DeclareAcroProperty {foreign-babel} \DeclareAcroProperty {foreign-locale} @@ -1861,22 +1923,9 @@ { \tl_if_empty:cTF {l__acro_format_ #1 _tl} { \use:n } - { \tl_use:c {l__acro_format_ #1 _tl} } - } - { - \acro_property_if_alias:nTF {#1} - { - \tl_if_exist:cTF - {l__acro_format_ \acro_property_alias:n {#1} _tl} - { - \tl_if_empty:cTF {l__acro_format_ \acro_property_alias:n {#1} _tl} - { \use:n } - { \tl_use:c {l__acro_format_ \acro_property_alias:n {#1} _tl} } - } - { \use:n } - } - { \use:n } + { \exp_not:v {l__acro_format_ #1 _tl} } } + { \use:n } } % #1: id @@ -1932,7 +1981,7 @@ \__acro_global_format:n {#2} { \__acro_property_format:nn {#1} {#2} - { \__acro_pdf_comment:nnn {#1} {#2} {#3} } + { \__acro_pdf_comment:nnn {#1} {#2} {#3} } } } } @@ -1993,9 +2042,7 @@ \cs_new_protected:Npn \acro_article_declare:nn #1#2 { \tl_gput_right:Nn \g__acro_articles_tl {{#1}} - \acro_property_declare:nnnnn - { \c_false_bool } { \c_false_bool } { \c_false_bool } { \c_false_bool } - {#1} + \acro_property_declare:nn {} {#1} \acro_list_map:nn {short} { \DeclareAcroPropertyAlias {##1-#1} {#1} @@ -2049,12 +2096,8 @@ \cs_new_protected:Npn \__acro_declare_ending_properties:n #1 { - \acro_property_declare:nnnnn - { \c_false_bool } { \c_false_bool } { \c_false_bool } { \c_false_bool } - {#1} - \acro_property_declare:nnnnn - { \c_false_bool } { \c_false_bool } { \c_false_bool } { \c_false_bool } - {#1-form} + \acro_property_declare:nn {} {#1} + \acro_property_declare:nn {} {#1-form} } % #1: ending @@ -2571,10 +2614,10 @@ \cs_new_protected:Npn \acro_footnote:n #1 { - \tl_set:Ne \l__acro_fnpct_check_tl { \l__acro_fnpct_check_tl } + \tl_set:Ne \l__acro_tmpa_tl { \l__acro_fnpct_check_tl } \exp_last_unbraced:Nno \footnote {#1} - \l__acro_fnpct_check_tl + \l__acro_tmpa_tl } % options for activating actions: @@ -2932,30 +2975,33 @@ % #2: property \cs_new_protected:Npn \acro_write:nn #1#2 { - \group_begin: - \acro_if_short:nT {#2} { \acro_soft_upper: } - \__acro_make_link:nnn {#1} {#2} - { - \acro_locale:nnn {#1} {#2} + \acro_property_if_set:nnT {#1} {#2} + { + \group_begin: + \acro_if_short:nT {#2} { \acro_soft_upper: } + \__acro_make_link:nnn {#1} {#2} { - \__acro_write:nn {#1} {#2} - \bool_if:NT \l__acro_include_endings_bool + \acro_locale:nnn {#1} {#2} { - \acro_if_ending_form:nnF {#1} {#2} - { \__acro_ending:nn {#1} {#2} } + \__acro_write:nn {#1} {#2} + \bool_if:NT \l__acro_include_endings_bool + { + \acro_if_ending_form:nnF {#1} {#2} + { \__acro_ending:nn {#1} {#2} } + } } } - } - \group_end: - \acro_if_ending_form:nnF {#1} {#2} - { - \bool_if:NF \l__acro_include_endings_bool - { \__acro_ending:nn {#1} {#2} } + \group_end: + \acro_if_ending_form:nnF {#1} {#2} + { + \bool_if:NF \l__acro_include_endings_bool + { \__acro_ending:nn {#1} {#2} } + } + \acro_property_if_eq:nnT {#2} {long} + { \acro_property_get:nn {#1} {long-post} } + \bool_set_false:N \l__acro_upper_bool + \bool_set_false:N \l__acro_article_bool } - \acro_property_if_eq:nnT {#2} {long} - { \acro_property_get:nn {#1} {long-post} } - \bool_set_false:N \l__acro_upper_bool - \bool_set_false:N \l__acro_article_bool } \cs_generate_variant:Nn \acro_write:nn {e} @@ -3139,6 +3185,7 @@ \cs_new_protected:Npn \__acro_template_add:nnn #1#2#3 { \tl_new:c {l__acro_template_#1_#2_setup_tl} + \tl_new:c {l__acro_next_template_#1_#2_setup_tl} \acro_attribute_set:nnn {template::#1} {#2} {#3} } @@ -3181,28 +3228,33 @@ % #3: setup code \cs_new_protected:Npn \acro_template_setup:nnn #1#2#3 { \tl_set:cn {l__acro_template_#1_#2_setup_tl} {#3} } -\cs_generate_variant:Nn \acro_template_setup:nnn {nnV,nVn} + +\cs_new_protected:Npn \acro_next template_setup:nnn #1#2#3 + { \tl_set:cn {l__acro_next_template_#1_#2_setup_tl} {#3} } % #1: template type % #2: template name -\cs_new_protected:Npn \__acro_template_setup:nn #1#2 - { \tl_use:c {l__acro_template_#1_#2_setup_tl} } +\cs_new_protected:Npn \__acro_template_do_setup:nn #1#2 + { + \tl_use:c {l__acro_template_#1_#2_setup_tl} + \tl_use:c {l__acro_next_template_#1_#2_setup_tl} + } % #1: template type % #2: template name \cs_new_protected:Npn \__acro_clear_template_setup:nn #1#2 - { \tl_clear:c {l__acro_template_#1_#2_setup_tl} } + { \tl_clear:c {l__acro_next_template_#1_#2_setup_tl} } % #1: template type % #2: template name \cs_new_protected:Npn \__acro_template_start:nn #1#2 { \group_begin: - \__acro_template_setup:nn {#1} {#2} - \tl_clear_new:N \TemplateType - \tl_set:Nn \TemplateType {#1} - \tl_clear_new:N \TemplateName - \tl_set:Nn \TemplateName {#2} + \__acro_template_do_setup:nn {#1} {#2} + \tl_clear_new:N \AcroTemplateType + \tl_set:Nn \AcroTemplateType {#1} + \tl_clear_new:N \AcroTemplateName + \tl_set:Nn \AcroTemplateName {#2} } % #1: template type @@ -3852,9 +3904,7 @@ { You~ need~ to~ give~ a~ value~ to~ `#1'~ \msg_line_context: } % -------------------------------------------------------------------------- -\bool_new:N \l__acro_show_foreign_bool \bool_new:N \l__acro_show_locale_bool -\bool_new:N \l__acro_list_show_locale_bool \tl_new:N \l__acro_locale_format_tl % #1: property @@ -3865,15 +3915,6 @@ { \prg_return_false: } } -% #1: property -% #2: text -\cs_new:Npn \acro_check_foreign:nn #1#2 - { - \acro_if_foreign:nTF {#1} - { \bool_if:NT \l__acro_show_foreign_bool {#2} } - {#2} - } - % #1: id % #2: property \prg_new_conditional:Npnn \acro_if_locale:nn #1#2 {p,T,F,TF} @@ -3896,37 +3937,30 @@ { \acro_if_foreign:nTF {#2} { - \bool_if:NT \l__acro_show_foreign_bool + \acro_if_locale:nnTF {#1} {#2} { - \acro_if_locale:nnTF {#1} {#2} + \bool_if:NTF \l__acro_list_bool + { \bool_if:NT \l__acro_list_show_locale_bool } + { \bool_if:NT \l__acro_show_locale_bool } { - \bool_lazy_or:nnT - { \l__acro_show_locale_bool } - { - \bool_lazy_and_p:nn - { \l__acro_list_bool } - { \l__acro_list_show_locale_bool } - } - { + { + \l__acro_locale_format_tl { - \l__acro_locale_format_tl + \acro_property_if_set:nnTF {#1} {foreign-locale} + { \acro_property_get:nn {#1} {foreign-locale} } { - \acro_property_if_set:nnTF {#1} {foreign-locale} - { \acro_property_get:nn {#1} {foreign-locale} } - { - \baselanguage - { \acro_property_get:nn {#1} {foreign-babel} } - } + \baselanguage + { \acro_property_get:nn {#1} {foreign-babel} } } } - :~ - } - \__acro_foreign_language:en - { \str_lowercase:e { \acro_property_get:nn {#1} {foreign-babel} } } - {#3} + } + :~ } + \__acro_foreign_language:en + { \str_lowercase:e { \acro_property_get:nn {#1} {foreign-babel} } } {#3} } + {#3} } {#3} } @@ -3955,12 +3989,6 @@ display .initial:n = false } -\keys_define:nn {acro/foreign} - { - display .bool_set:N = \l__acro_show_foreign_bool , - display .initial:n = true - } - % -------------------------------------------------------------------------- \bool_new:N \l__acro_language_auto_bool @@ -4104,13 +4132,6 @@ \cs_generate_variant:Nn \__acro_hyper_target:nn {e} \cs_generate_variant:Nn \__acro_hyper_link:nn {e} -% \acro_property_declare:nnnnn -% { \c_false_bool } % not unique -% { \c_true_bool } % boolean -% { \c_false_bool } % not mandatory -% { \c_false_bool } % dynamic -% {target-set} - \cs_new_protected:Npn \__acro_activate_hyperref_support: { \bool_lazy_and:nnT @@ -4987,8 +5008,7 @@ \NewAcroTemplate[list] {longtable} { - \AcroNeedPackage {array} - \AcroNeedPackage {longtable} + \AcroNeedPackage {array,longtable} \acronymsmapF { \AcroAddRow @@ -5013,16 +5033,14 @@ \acroheading \acropreamble \par \noindent - \begin {longtabu} {>{\bfseries}lp{.7\linewidth}} + \begin {longtable} {>{\bfseries}lp{.7\linewidth}} \AcronymTable - \end {longtabu} + \end {longtable} } \NewAcroTemplate[list] {longtabu} { - \AcroNeedPackage {array} - \AcroNeedPackage {longtable} - \AcroNeedPackage {tabu} + \AcroNeedPackage {array,longtable,tabu} \acronymsmapF { \AcroAddRow @@ -5040,7 +5058,7 @@ \acropages { \acrotranslate {page} \nobreakspace } { \acrotranslate {pages} \nobreakspace } - \tabularnewline + \strut \tabularnewline } } { \AcroRerun } @@ -5052,6 +5070,38 @@ \end {longtabu} } +\NewAcroTemplate[list] {supertabular} + { + \AcroNeedPackage {array,supertabular} + \acronymsmapF + { + \AcroAddRow + { + \acrowrite {short} + \acroifT {alt} { / } \acrowrite {alt} + & + \acrowrite {list} + \acroifanyT {foreign,extra} {~(} + \acrowrite {foreign} + \acroifallT {foreign,extra} {,~} + \acrowrite {extra} + \acroifanyT {foreign,extra} {)} + \acropagefill + \acropages + { \acrotranslate {page} \nobreakspace } + { \acrotranslate {pages} \nobreakspace } + \tabularnewline + } + } + { \AcroRerun } + \acroheading + \acropreamble + \par \noindent + \begin {supertabular} {>{\bfseries}lp{.7\linewidth}} + \AcronymTable + \end {supertabular} + } + \NewAcroTemplate [list] {lof} { \acroheading @@ -5332,24 +5382,14 @@ \cs_new_protected:Npn \acro_deprecated_property:nn #1#2 { \acro_deprecate:nn {#1} {#2} - \acro_property_declare:nnnnn - { \c_false_bool } - { \c_false_bool } - { \c_false_bool } - { \c_false_bool } - {#1} + \acro_property_declare:nn {} {#1} } % #1: old \cs_new_protected:Npn \acro_removed_property:n #1 { \acro_remove:n {#1} - \acro_property_declare:nnnnn - { \c_false_bool } - { \c_false_bool } - { \c_false_bool } - { \c_false_bool } - {#1} + \acro_property_declare:nn {} {#1} } % ---------------------------------------------------------------------------- |