diff options
author | Norbert Preining <norbert@preining.info> | 2022-04-02 03:01:41 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-04-02 03:01:41 +0000 |
commit | 0a334de875944625912f2bf2d918122bb55c0dad (patch) | |
tree | 7a13a8f48bf68f95926e9ff2b70eb9048562b2ed /macros/latex/contrib/acro | |
parent | 18e3709c9fe9554f72b8fa347bd27ae4b76b841e (diff) |
CTAN sync 202204020301
Diffstat (limited to 'macros/latex/contrib/acro')
-rw-r--r-- | macros/latex/contrib/acro/README | 2 | ||||
-rw-r--r-- | macros/latex/contrib/acro/acro-examples.sty | 4 | ||||
-rw-r--r-- | macros/latex/contrib/acro/acro-manual.pdf | bin | 908075 -> 915457 bytes | |||
-rw-r--r-- | macros/latex/contrib/acro/acro-manual.tex | 503 | ||||
-rw-r--r-- | macros/latex/contrib/acro/acro.sty | 463 | ||||
-rw-r--r-- | macros/latex/contrib/acro/acro2.sty | 60 | ||||
-rw-r--r-- | macros/latex/contrib/acro/examples/acro.example.issue-119.tex | 6 |
7 files changed, 623 insertions, 415 deletions
diff --git a/macros/latex/contrib/acro/README b/macros/latex/contrib/acro/README index 9595ae88c5..c69fb418b9 100644 --- a/macros/latex/contrib/acro/README +++ b/macros/latex/contrib/acro/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the ACRO package v3.7 2022/01/27 +the ACRO package v3.8 2022/04/01 Typeset Acronyms diff --git a/macros/latex/contrib/acro/acro-examples.sty b/macros/latex/contrib/acro/acro-examples.sty index 01fca6ada3..2fa89bd3ab 100644 --- a/macros/latex/contrib/acro/acro-examples.sty +++ b/macros/latex/contrib/acro/acro-examples.sty @@ -70,7 +70,7 @@ example definitions with acro (CN)] short = FBI , long = Federal Bureau of Investigation } -\acroifpropertyTF{ +\acroifpropertyTF{short-definite}{ \DeclareAcronym{hadopi}{ short = HADOPI , long = Haute Autorité pour la diffusion des œuvres et la protection des @@ -109,7 +109,7 @@ example definitions with acro (CN)] } \DeclareAcronym{lppl}{ short = LPPL , - long = \unexpanded{\LaTeX} Project Public License + long = \LaTeX\ Project Public License } \DeclareAcronym{ma}{ short = MA , diff --git a/macros/latex/contrib/acro/acro-manual.pdf b/macros/latex/contrib/acro/acro-manual.pdf Binary files differindex 8011c49d28..ae5da7d160 100644 --- a/macros/latex/contrib/acro/acro-manual.pdf +++ b/macros/latex/contrib/acro/acro-manual.pdf diff --git a/macros/latex/contrib/acro/acro-manual.tex b/macros/latex/contrib/acro/acro-manual.tex index 814f7f8ffe..03d0fa6d55 100644 --- a/macros/latex/contrib/acro/acro-manual.tex +++ b/macros/latex/contrib/acro/acro-manual.tex @@ -1,5 +1,5 @@ -% arara: pdflatex -% arara: biber +% !arara: pdflatex +% !arara: biber % arara: pdflatex % arara: pdflatex % -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- \PassOptionsToPackage{ngerman,latin,english}{babel} -\PassOptionsToPackage{version=3,upgrade}{acro} +\PassOptionsToPackage{upgrade}{acro} \documentclass{acro-manual} \begin{filecontents}{\jobname.bib} @@ -70,7 +70,7 @@ foreign = exempli gratia , foreign-babel = latin , short-format = \textit , - foreign-format = \textit + foreign-format = \latin } \DeclareAcronym{etc}{ short = etc\acdot , @@ -108,11 +108,14 @@ } \DeclareAcronym{lppl}{ short = lppl , - long = \unexpanded{\LaTeX} Project Public License , + long = \LaTeX\ Project Public License , short-format = \scshape , pdfstring = LPPL , - short-acc = LPPL + short-acc = LPPL , + single-style = long-short } +\def\LPPL\ (\lppl){\ac{lppl}} + \DeclareAcronym{MP}{ short = MP , long = Member of Parliament , @@ -155,8 +158,7 @@ \DeclareAcronym{sw}{ short = SW , long = Sammelwerk , - long-plural = e , - tag = exclude + long-plural = e } \DeclareAcronym{tex.sx}{ short = \TeX.sx , @@ -187,6 +189,15 @@ friends.} , tag = glossary , no-index } +\DeclareAcronym{module}{ + long = {A \module*{module} is something like a superordinate category for + options. There are several such modules like \module{list} or + \module{pages} for example. Options belonging to a module typically + influence certain objects. For instance options belonging to the + \module{pages} influence how page numbers in the list of acronyms are + handled.} , + tag = glossary , no-index +} \DeclareAcronym{load-time option}{ long = {A load-time \option*{option} is a package option of \acro\ which \emph{must} be set as option to @@ -194,9 +205,9 @@ tag = glossary , no-index } \DeclareAcronym{template}{ - long = {A template determines how different objects of \acro\ are printed. - This includes the acronyms themselves but also for example the list of - acronyms as a whole.} , + long = {A \template*{template} determines how different objects of \acro\ + are printed. This includes the acronyms themselves but also for example + the list of acronyms as a whole.} , tag = glossary , no-index } \DeclareAcronym{articles}{ @@ -226,7 +237,31 @@ \license \section{Glossary} -\printacronyms[include=glossary,template=glossary] +\printacronyms[include=glossary,template=glossary,preamble=This manual +repeatedly uses a number of terms which are explained in this section.] + +\section{Reading the manual} +This manual uses a certain color code in order to be able to distinguish +options, properties and templates visually from each other. +\begin{options} + \keyval*{option}{value} + Options are displayed in \textcolor{option}{yellow}. For the description + of options a certain nomenclature is used which is explained in + section~\ref{sec:setting-options}. Some options belong to module which are + displayed in \textcolor{module}{red}. +\end{options} +\begin{properties} + \propval*{property}{value} + In order to distinguish them visually from options properties are + displayed in \textcolor{property}{blue}. The nomenclature of properties + is quite similar to the one of the options so it is not explained + explicilty but should be clear by analogy. +\end{properties} +\begin{templates} + \tmpl*{template} + In order to distinguish them visually from options and properties + templates are displayed in \textcolor{template}{green}. +\end{templates} \section{\acro\ for the impatient}\label{sec:acro-impatient} @@ -239,11 +274,11 @@ Acronyms are defined in the preamble via the command \end{commands} \begin{properties} %% short - \propval{short}{text}\Default! + \propval{short}{text}\Initial! The short form of the acronym. \emph{This property is required}: an acronym must have a short form. %% long - \propval{long}{text}\Default! + \propval{long}{text}\Initial! The long form of the acronym. \emph{This property is required}: an acronym must have a description. \end{properties} @@ -293,17 +328,19 @@ Then the usage is \acro\ knows only a small set of load-time options which can be used as argument to \cs*{usepackage}: \begin{options} - \keychoice{version}{2,3}\Default{3} - The option allows you to use the last version prior to the update to - version~3. This may help if you don't have the time to fix issues after - upgrading to the new version. - \keybool{upgrade}\Default{false} + \keybool{upgrade}\Initial{false} When this option is used \acro\ tries to give as much helpful and meaningful warning or error messages when a deprecated or removed command, property, or option is used. This is especially useful if you are upgrading from version~2. \end{options} +You can still use version~2 by specifying using one of the following options: +\begin{sourcecode} + \usepackage{acro}[=v2] + \usepackage{acro}[=version2] +\end{sourcecode} + \subsection{Setup command}\label{sec:setup-command} All options of \acro\ that have \emph{not} been mentioned in section~\ref{sec:load-time-options} have to be set up either with this command @@ -317,14 +354,14 @@ section~\ref{sec:load-time-options} have to be set up either with this command \begin{options} \opt*{option} An option without a value. Those options are very rare if there are any. - \keyval*{option}{value}\Default{preset} + \keyval*{option}{value}\Initial{preset} An option where a value can be given. The pre-set value is given to the right. - \keychoice*{option}{\default{choiceA},choiceB,choiceC}\Default{choiceB} + \keychoice*{option}{\default{choiceA},choiceB,choiceC}\Initial{choiceB} An option with a determined set of choices. The underlined value is chosen if the option is given without value. \keybool*{option} - A boolean option with only the choices \code{true} and \code{false}. + A boolean option with the only choices \code{true} and \code{false}. \opt*{option}\Module{module} An option at a deeper level belonging to the module \module*{module}. \end{options} @@ -356,11 +393,11 @@ following sections. This is a comprehensive overview over the existing properties. Many properties are also explained in more detail in later sections of this manual. \begin{options} - \keybool{case-sensitive}\Default{true} + \keybool{case-sensitive}\Initial{true} When this is set you can write the \ac{id} of the acronym upper- or lower- or mixed case and it is recognized by \acro\ as the same. This might be useful when the acronym appears in the page header, for example. - \keybool{case-insensitive}\Default{false} + \keybool{case-insensitive}\Initial{false} \sinceversion{3.6}The inverse of the option \option{case-sensitive}. \end{options} @@ -372,73 +409,73 @@ sections of this manual. \subsection{Basic properties}\label{sec:basic-properties} \begin{properties} %% short - \propval{short}{text}\Default! + \propval{short}{text}\Initial! The short form of the acronym. \emph{This property is required}: an acronym must have a short form. \end{properties} Maybe you mostly have simple acronyms where the \ac{id} and short form are the same. In that case you can use \begin{options} - \keybool{use-id-as-short}\Default{false} + \keybool{use-id-as-short}\Initial{false} to use the \ac{id} of the acronym as short form. For more complicated cases this would still allow you to set the short form. \end{options} \begin{properties} %% long - \propval{long}{text}\Default! + \propval{long}{text}\Initial! The long form of the acronym. \emph{This property is required}: an acronym must have a description. %% alt - \propval{alt}{text}\Default + \propval{alt}{text}\Initial Alternative short form. %% extra - \propval{extra}{text}\Default + \propval{extra}{text}\Initial Extra information to be added in the list of acronyms. %% foreign - \propval{foreign}{long form in foreign language}\Default + \propval{foreign}{long form in foreign language}\Initial Can be useful when dealing with acronyms in foreign languages, see section~\vref{sec:fore-lang-acronyms} for details. %% long-post - \propval{long-post}{text}\Default + \propval{long-post}{text}\Initial \meta{text} is appended to the long form of the acronym in the text but not in the list of acronyms. %% post - \propval{post}{text}\Default + \propval{post}{text}\Initial \meta{text} is appended to the acronym in the text but not in the list of acronyms. %% single - \propval{single}{text}\Default={long} + \propval{single}{text}\Initial={long} If provided \meta{text} will be used instead of the long form if the acronym is only used a single time \emph{and} the option \option{single} has been set, see section~\vref{sec:single-appe-an}. %% sort - \propval{sort}{text}\Default={short} + \propval{sort}{text}\Initial={short} If used the acronym will be sorted according to this property instead of its short form. %% tag - \propval{tag}{csv list}\Default + \propval{tag}{csv list}\Initial The tag(s) of an acronym. %% cite - \proplit-{cite}{\oarg{prenote}\oarg{postnote}\marg{citation keys}}\Default + \proplit-{cite}{\oarg{prenote}\oarg{postnote}\marg{citation keys}}\Initial A citation that is printed to the acronym according to an option explained later. %% before-citation - \propval{before-citation}{text}\Default + \propval{before-citation}{text}\Initial \meta{text} is prepended to the citation of the acronym when and where the citation is printed. %% index - \propval{index}{text}\Default + \propval{index}{text}\Initial This property allows to overwrite the automatic index entry with an arbitrary one. See section~\vref{sec:indexing} for details. %% index-sort - \propval{index-sort}{text}\Default={sort} + \propval{index-sort}{text}\Initial={sort} If you use the option \option{index} every occurrence of an acronym is recorded to the index and sorted by its short form or (if set) by the value of the \property{sort} property. This property allows to set an individual sorting option for the index. See section~\vref{sec:indexing} for details. %% index-cmd - \propval{index-cmd}{index command}\Default + \propval{index-cmd}{index command}\Initial This sets the indexing command for the acronym. If unused then the command set by the corresponding option is used. See section~\vref{sec:indexing} for details. @@ -447,86 +484,86 @@ the same. In that case you can use \subsection{Properties related to plural and indefinite forms}\label{sec:prop-relat-plur} \begin{properties} %% short-plural - \propval{short-plural}{text}\Default{s} + \propval{short-plural}{text}\Initial{s} The plural ending appended to the short form. %% short-plural-form - \propval{short-plural-form}{text}\Default + \propval{short-plural-form}{text}\Initial The plural short form of the acronym; replaces the short form when used instead of appending the plural ending. %% long-plural - \propval{long-plural}{text}\Default{s} + \propval{long-plural}{text}\Initial{s} The plural ending appended to the long form. %% long-plural-form - \propval{long-plural-form}{text}\Default + \propval{long-plural-form}{text}\Initial Plural long form of the acronym; replaces the long form when used instead of appending the plural ending. %% alt-plural - \propval{alt-plural}{text}\Default{s} + \propval{alt-plural}{text}\Initial{s} The plural ending appended to the alternative form. %% alt-plural-form - \propval{alt-plural-form}{text}\Default + \propval{alt-plural-form}{text}\Initial The plural alternative form of the acronym; replaces the alternative form when used instead of appending the plural ending. %% foreign-plural - \propval{foreign-plural}{text}\Default{s} + \propval{foreign-plural}{text}\Initial{s} The plural ending appended to the foreign form. %% foreign-plural-form - \propval{foreign-plural-form}{text}\Default + \propval{foreign-plural-form}{text}\Initial Plural foreign form of the acronym; replaces the foreign form when used instead of appending the plural ending. %% short-indefinite - \propval{short-indefinite}{text}\Default{a} + \propval{short-indefinite}{text}\Initial{a} Indefinite article for the short form. %% long-indefinite - \propval{long-indefinite}{text}\Default{a} + \propval{long-indefinite}{text}\Initial{a} Indefinite article for the long form. %% alt-indefinite - \propval{alt-indefinite}{text}\Default{a} + \propval{alt-indefinite}{text}\Initial{a} Indefinite article for the alternative form. \end{properties} \subsection{Properties related to formatting}\label{sec:prop-relat-form} \begin{properties} - \propval{format}{code}\Default + \propval{format}{code}\Initial The format used for both short and long form of the acronym. %% short-format - \propval{short-format}{code}\Default={format} + \propval{short-format}{code}\Initial={format} The format used for the short form of the acronym. %% long-format - \propval{long-format}{code}\Default={format} + \propval{long-format}{code}\Initial={format} The format used for the long form of the acronym. %% first-long-format - \propval{first-long-format}{code}\Default={long-format} + \propval{first-long-format}{code}\Initial={long-format} The format used for the first appearance of the long form of the acronym. %% alt-format - \propval{alt-format}{code}\Default={short-format} + \propval{alt-format}{code}\Initial={short-format} The format used for the alternative form of the acronym. If this is not given the short format will be used. %% extra-format - \propval{extra-format}{code}\Default + \propval{extra-format}{code}\Initial The format used for the additional information of the acronym. %% foreign-format - \propval{foreign-format}{code}\Default + \propval{foreign-format}{code}\Initial The format used for the foreign form of the acronym. %% single-format - % \propval{single-format}{code}\Default={long-format} + % \propval{single-format}{code}\Initial={long-format} % The format used for the acronym if the acronym is only used a single % time. %% list-format - \propval{list-format}{code}\Default={long-format} + \propval{list-format}{code}\Initial={long-format} The format used for the long form of the acronym in the list if the list template supports it. All pre-defined list templates \emph{do} support it. %% first-style - \propchoice{first-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{first-style}{long-short,short-long,short,long,footnote}\Initial The style of the first appearance of the acronym, see also section~\vref{sec:first-or-full}. %% first-style - \propchoice{subsequent-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{subsequent-style}{long-short,short-long,short,long,footnote}\Initial \sinceversion{3.4}The style of the appearance of the acronym after the first time. %% single-style - \propchoice{single-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{single-style}{long-short,short-long,short,long,footnote}\Initial The style of a single appearance of the acronym, see also section~\vref{sec:single-appe-an}. \end{properties} @@ -534,7 +571,7 @@ the same. In that case you can use \subsection{Properties related to the created \acs*{pdf} file}\label{sec:prop-relat-creat} \begin{properties} %% pdfstring - \propval{pdfstring}{pdfstring}\Default={short} + \propval{pdfstring}{pdfstring}\Initial={short} Used as \acs{pdf} string replacement in bookmarks when used together with the \pkg{hyperref}~\cite{pkg:hyperref} or the \pkg{bookmark} package~\cite{pkg:bookmark}. @@ -545,31 +582,31 @@ the same. In that case you can use \option{pdfcomment/cmd} and \option{pdfcomment/use}, see also section~\vref{sec:pdf-comments}. %% short-acc - \propval{short-acc}{text}\Default={short} + \propval{short-acc}{text}\Initial={short} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the short form of the acronym. %% long-acc - \propval{long-acc}{text}\Default={long} + \propval{long-acc}{text}\Initial={long} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the long form of the acronym. %% alt-acc - \propval{alt-acc}{text}\Default={alt} + \propval{alt-acc}{text}\Initial={alt} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the alternative short form of the acronym. %% foreign-acc - \propval{foreign-acc}{text}\Default={foreign} + \propval{foreign-acc}{text}\Initial={foreign} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the foreign form of the acronym. %% extra-acc - \propval{extra-acc}{text}\Default={extra} + \propval{extra-acc}{text}\Initial={extra} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the extra information of the acronym. %% single-acc - \propval{single-acc}{text}\Default={long-acc} + \propval{single-acc}{text}\Initial={long-acc} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for a single appearance of the acronym. %% list-acc - \propval{list-acc}{text}\Default={list} + \propval{list-acc}{text}\Initial={list} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the appearance in the list of acronyms. \end{properties} @@ -577,11 +614,11 @@ the same. In that case you can use \subsection{Futher properties}\label{sec:futher-properties} \begin{properties} %% list - \propval{list}{text}\Default={long} + \propval{list}{text}\Initial={long} If specified this will be written in the list as description instead of the long form if the corresponding list template supports it. %% foreign-babel - \propval{foreign-babel}{language}\Default + \propval{foreign-babel}{language}\Initial The \pkg{babel}~\cite{pkg:babel} or \pkg{polyglossia}~\cite{pkg:polyglossia} language of the foreign form. This language is used to wrap the entry with @@ -589,19 +626,19 @@ the same. In that case you can use \pkg{polyglossia} is loaded. You'll need to take care that the corresponding language is loaded by \pkg{babel} or \pkg{polyglossia}. %% foreign-locale - \propval{foreign-locale}{language}\Default + \propval{foreign-locale}{language}\Initial The language name that is output when the option \module{locale}\code{/}\option{display} is used. If this property is not set then the appropriate value might be derived from \property{foreign-babel}. See section~\vref{sec:fore-lang-acronyms} for details. %% preset - \propval{preset}{set name}\Default + \propval{preset}{set name}\Initial \sinceversion{3.5}Enables to load a set of properties that has been defined earlier with \cs{NewAcroPreset}, see section~\vref{sec:presets}. %% uselist - \propval{uselist}{csv list of acronym ids}\Default + \propval{uselist}{csv list of acronym ids}\Initial \sinceversion{3.5}If this property is given and all acronyms specified in this property have been used before the first time the current acronym is used it behaves as if it has been used before. @@ -630,9 +667,9 @@ All of these commands have a starred form which means \enquote{don't count allows to set options for that usage only. \begin{commands} \command*{acrocommand}[\sarg\oarg{options}\marg{id}] - This is the general syntax of all of the commands listed below. The star - and the optional argument is left way for the sake of readability. - \emph{A command \cs*{acrocommand} does not actually exist.} + This is the general syntax of \emph{all} of the commands listed below. + The star and the optional argument is left way for the sake of + readability. \emph{A command \cs*{acrocommand} does not actually exist.} \command{ac}[\marg{id}\quad\cs{Ac}\marg{id}\quad\cs{acp}\marg{id}\quad \cs{Acp}\marg{id}\quad\cs{iac}\marg{id}\quad\cs{Iac}\marg{id}] \cs{ac} prints the acronym \meta{id}, the first time with full description @@ -734,12 +771,12 @@ first or full appearance of the acronym is printed\footnote{This usually The first or full appearance of an acronym is determined by this option: \begin{options} - \keychoice{first-style}{long-short,short-long,short,long,footnote}\Default{long-short} + \keychoice{first-style}{long-short,short-long,short,long,footnote}\Initial{long-short} The style of the first appearance of the acronym. This options sets the appearance for all acronyms. Available options in reality are the names of all defined templates of the type \code{acronym}. All pre-defined templates can be found in section~\vref{sec:pre-defin-templ}. - \keychoice{subsequent-style}{long-short,short-long,short,long,footnote}\Default{short} + \keychoice{subsequent-style}{long-short,short-long,short,long,footnote}\Initial{short} \sinceversion{3.4}The style of the appearance of the acronym after the first time. This options sets the appearance for all acronyms. Available options in reality are the names of all defined templates of the type @@ -749,7 +786,7 @@ The first or full appearance of an acronym is determined by this option: It might be desirable to set the first appearance of an acronym individually. This is possible by setting the corresponding property: \begin{properties} - \propchoice{first-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{first-style}{long-short,short-long,short,long,footnote}\Initial The style of the first appearance of the acronym. \end{properties} Let's again look at an example: @@ -788,14 +825,14 @@ single appearance of the acronym is printed\footnote{This usually requires at The single appearance of an acronym is determined by this option: \begin{options} - \keychoice{single}{\default{true},false,\meta{number}}\Default{false} + \keychoice{single}{\default{true},false,\meta{number}}\Initial{false} This option determines whether a single appearance of an acronym counts as \emph{usage}. It might be desirable in such cases that an acronym is simply printed as long form and not added to the list of acronym. This is what this option does. With \meta{number} the minimal number of usages can be given that needs to be exceeded. \keyis{single}{1} is the same as \keyis{single}{true}. - \keychoice{single-style}{long-short,short-long,short,long,footnote}\Default{long} + \keychoice{single-style}{long-short,short-long,short,long,footnote}\Initial{long} The style of the single appearance of an acronym. Can be used to determine how a single appearance is printed if the option \option{single} has been set. This option sets the appearance for all acronyms. @@ -806,16 +843,16 @@ The single appearance of an acronym is determined by this option: If you like you can also set the single appearance of an acronym individually: \begin{properties} - \propval{single}{text}\Default + \propval{single}{text}\Initial If provided \meta{text} will be used instead of whatever template (\enquote{style}) has been set for the single appearance if the acronym is only used a single time \emph{and} the option \option{single} has been set\footnote{Actually the template \template{single} is used which typesets the \property{single} property.}. - % \propval{single-format}{code}\Default={long-format} + % \propval{single-format}{code}\Initial={long-format} % The format used for the acronym if the acronym is only used a single % time. - \propchoice{single-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{single-style}{long-short,short-long,short,long,footnote}\Initial The style of the single appearance of the acronym. \end{properties} Let's again look at an example. The acronym \acs*{png} is defined as follows: @@ -846,23 +883,23 @@ The main idea is simple: just place \end{commands} The options controlling the list are these: \begin{options} - \keychoice{template}{description,tabular,longtable,supertabular,lof,toc}% - \Module{list}\Default{description} + \keychoice{template}{description,tabular,longtable,supertabular,tabularray,lof,toc}% + \Module{list}\Initial{description} Choose the template to create the list with. See more on this in sections~\vref{sec:templates} and~\vref{sec:examples}. - \keybool{sort}\Module{list}\Default{true} + \keybool{sort}\Module{list}\Initial{true} Decide whether to sort the list of acronyms alphabetically or to print it in order of definition. - \keychoice{display}{all,used}\Module{list}\Default{used} + \keychoice{display}{all,used}\Module{list}\Initial{used} Decide whether to print only the acronyms actually used in the document or all acronyms which have been declared in the preamble. - \keyval{exclude}{csv list of tags}\Module{list}\Default + \keyval{exclude}{csv list of tags}\Module{list}\Initial Set a list of tags to exclude from the list. Only acronyms not belonging to one of these tags will be included. - \keyval{include}{csv list of tags}\Module{list}\Default + \keyval{include}{csv list of tags}\Module{list}\Initial Set a list of tags to include in the list. Only acronyms belonging to one of these tags will be included. - \keybool{add}\Module{list}\Default + \keybool{add}\Module{list}\Initial \sinceversion{3.4}Set a list of tags to include in the list. These acronyms will be included in any case. \keychoice{heading}{none,section,section*,chapter,chapter*}\Module{list} @@ -870,18 +907,18 @@ The options controlling the list are these: This only has an effect if the list template supports it. All pre-defined templates \emph{do} support it. - \keyval{name}{text}\Module{list}\Default{\cs{acrotranslate}\Marg{list-name}} + \keyval{name}{text}\Module{list}\Initial{\cs{acrotranslate}\Marg{list-name}} Overwrites the text which is used in the heading. This only has an effect if the list template supports heading templates \emph{and} the heading templates support it. All pre-defined heading templates \emph{do} support this. - \keyval{preamble}{text}\Module{list}\Default + \keyval{preamble}{text}\Module{list}\Initial Set a preamble to be placed between heading and actual list. This only has an effect if the list template supports it. All pre-defined templates \emph{do} support it. - \keybool{display}\Module{list,locale}\Default{false} + \keybool{display}\Module{list,locale}\Initial{false} This options determines whether the language of the foreign form is printed or not. @@ -902,26 +939,26 @@ to \cs{printacronyms}. In the latter case omit the leading If you want to include the page numbers where the acronyms have been used in the list of acronym you can use these options: \begin{options} - \keychoice{display}{first,all,none}\Module{pages}\Default{none} + \keychoice{display}{first,all,none}\Module{pages}\Initial{none} Decide whether to include page numbers in the list of acroynms and whether to add the first page or every page. When you choose \code{first} and have \pkg{hyperref} loaded you will also get a backlink to that page. - \keybool{use}\Module{pages,seq}\Default{true} + \keybool{use}\Module{pages,seq}\Initial{true} Turns a two-page range into \meta{num}\,f.\ (\latin{sequens}) and a three-page range into \meta{num}\,ff.\ (\latin{sequentes}) when set to \code{true}. - \keyval{pre}{code}\Module{pages,seq}\Default{\cs*{,}} + \keyval{pre}{code}\Module{pages,seq}\Initial{\cs*{,}} \meta{code} is inserted between the page number and the sequens or sequentes symbol. - \keyval{threshold}{num}\Module{pages,seq}\Default{3} + \keyval{threshold}{num}\Module{pages,seq}\Initial{3} The threshold for a page range to be turned into \latin{sequentes}. A page range above the threshold is still typeset as a range: \meta{num1}--\meta{num2}. - \keyval{fill}{code}\Module{pages}\Default{\cs*{acrdotfill}} + \keyval{fill}{code}\Module{pages}\Initial{\cs*{acrodotfill}} This is the code that is placed between acronym description and actual page numbers. - \keybool{name}\Module{pages}\Default{false} + \keybool{name}\Module{pages}\Initial{false} If set to true the page numbers are preceded with p.\ or pp. \end{options} \begin{commands} @@ -941,14 +978,14 @@ With the property \property{tag} you can assign one or more tags to an acronym. These tags can be used to filter the list of acronyms. \begin{properties} %% tag - \propval{tag}{csv list}\Default + \propval{tag}{csv list}\Initial The tag(s) of an acronym. \end{properties} \begin{options} - \keyval{exclude}{csv list of tags}\Module{list}\Default + \keyval{exclude}{csv list of tags}\Module{list}\Initial Set a list of tags to exclude from the list. Only acronyms not belonging to one of these tags will be included. - \keyval{include}{csv list of tags}\Module{list}\Default + \keyval{include}{csv list of tags}\Module{list}\Initial Set a list of tags to include in the list. Only acronyms belonging to one of these tags will be included. \end{options} @@ -991,7 +1028,7 @@ or print a list \emph{with only} these acronyms with Maybe you like a list of acronyms for each chapter in a book which only lists the acronyms used within this chapter. You need to do three things: set \begin{options} - \keybool{use}\Module{barriers}\Default{false} + \keybool{use}\Module{barriers}\Initial{false} this option to \code{true}, place \end{options} \begin{commands} @@ -1000,7 +1037,7 @@ the acronyms used within this chapter. You need to do three things: set and use \cs{printacronyms} with the option \end{commands} \begin{options} - \keybool{local}\Module{list}\Default{false} + \keybool{local}\Module{list}\Initial{false} or set this option once in the preamble with \cs{acsetup} so it is applied to every list. \end{options} @@ -1020,69 +1057,69 @@ Please read more on barriers in section~\vref{sec:barriers}. \acro\ has a number of options and parameters which can be used to influence the formatting of acronyms. \begin{options} - \keyval{format}{code}\Default + \keyval{format}{code}\Initial Sets the format for both the short and the long form. - \keyval{short}{code}\Module{format}\Default + \keyval{short}{code}\Module{format}\Initial Sets the format for the short form. - \keyval{long}{code}\Module{format}\Default + \keyval{long}{code}\Module{format}\Initial Sets the format for the long form. - \keyval{first-long}{code}\Module{format}\Default + \keyval{first-long}{code}\Module{format}\Initial Sets the format for the first appearance of the long form. - \keyval{alt}{code}\Module{format}\Default + \keyval{alt}{code}\Module{format}\Initial Sets the format for the alternative form. - \keyval{extra}{code}\Module{format}\Default + \keyval{extra}{code}\Module{format}\Initial Sets the format for the extra information. - \keyval{foreign}{code}\Module{format}\Default + \keyval{foreign}{code}\Module{format}\Initial Sets the format for the foreign form. - \keyval{list}{code}\Module{format}\Default + \keyval{list}{code}\Module{format}\Initial Sets the format for the long form in the list form. \end{options} While this options influence the formatting of the acronyms globally you can also give each acronym its own formatting individually: \begin{properties} - \propval{format}{code}\Default + \propval{format}{code}\Initial The format used for both short and long form of the acronym. %% short-format - \propval{short-format}{code}\Default={format} + \propval{short-format}{code}\Initial={format} The format used for the short form of the acronym. %% long-format - \propval{long-format}{code}\Default={format} + \propval{long-format}{code}\Initial={format} The format used for the long form of the acronym. %% first-long-format - \propval{first-long-format}{code}\Default={long-format} + \propval{first-long-format}{code}\Initial={long-format} The format used for the first appearance of the long form of the acronym. %% alt-format - \propval{alt-format}{code}\Default={short-format} + \propval{alt-format}{code}\Initial={short-format} The format used for the alternative form of the acronym. If this is not given the short format will be used. %% extra-format - \propval{extra-format}{code}\Default + \propval{extra-format}{code}\Initial The format used for the additional information of the acronym. %% foreign-format - \propval{foreign-format}{code}\Default + \propval{foreign-format}{code}\Initial The format used for the foreign form of the acronym. %% single-format - \propval{single-format}{code}\Default={long-format} + \propval{single-format}{code}\Initial={long-format} The format used for the acronym if the acronym is only used a single time. %% list-format - \propval{list-format}{code}\Default={long-format} + \propval{list-format}{code}\Initial={long-format} The format used for the long form of the acronym in the list if the list template supports it. All pre-defined list templates \emph{do} support it. %% first-style - \propchoice{first-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{first-style}{long-short,short-long,short,long,footnote}\Initial The style of the first appearance of the acronym, see also section~\vref{sec:first-or-full}. %% single-style - \propchoice{single-style}{long-short,short-long,short,long,footnote}\Default + \propchoice{single-style}{long-short,short-long,short,long,footnote}\Initial The style of a single appearance of the acronym, see also section~\vref{sec:single-appe-an}. \end{properties} Per\changedversion{3.3} default the individual formatting instructions \emph{replace} the global ones. This can be changed through the option \begin{options} - \keybool{replace}\Module{format}\Default{true} + \keybool{replace}\Module{format}\Initial{true} With this option active local options will \emph{replace} the global ones. \end{options} @@ -1110,40 +1147,40 @@ instead\footnote{German is full of such examples.}. This is why \acro\ has quite a number of different properties related to plural forms or endings: \begin{properties} %% short-plural - \propval{short-plural}{text}\Default{s} + \propval{short-plural}{text}\Initial{s} The plural ending appended to the short form. %% short-plural-form - \propval{short-plural-form}{text}\Default + \propval{short-plural-form}{text}\Initial The plural short form of the acronym; replaces the short form when used instead of appending the plural ending. %% long-plural - \propval{long-plural}{text}\Default{s} + \propval{long-plural}{text}\Initial{s} The plural ending appended to the long form. %% long-plural-form - \propval{long-plural-form}{text}\Default + \propval{long-plural-form}{text}\Initial Plural long form of the acronym; replaces the long form when used instead of appending the plural ending. %% alt-plural - \propval{alt-plural}{text}\Default{s} + \propval{alt-plural}{text}\Initial{s} The plural ending appended to the alternative form. %% alt-plural-form - \propval{alt-plural-form}{text}\Default + \propval{alt-plural-form}{text}\Initial The plural alternative form of the acronym; replaces the alternative form when used instead of appending the plural ending. %% foreign-plural - \propval{foreign-plural}{text}\Default{s} + \propval{foreign-plural}{text}\Initial{s} The plural ending appended to the foreign form. %% foreign-plural-form - \propval{foreign-plural-form}{text}\Default + \propval{foreign-plural-form}{text}\Initial Plural foreign form of the acronym; replaces the foreign form when used instead of appending the plural ending. \end{properties} There are two options which allow to change the default values for the whole document: \begin{options} - \keyval{short-plural-ending}{text}\Default{s} + \keyval{short-plural-ending}{text}\Initial{s} Defines the plural ending for the short forms to be \meta{text}. - \keyval{long-plural-ending}{text}\Default{s} + \keyval{long-plural-ending}{text}\Initial{s} Defines the plural ending for the long forms to be \meta{text}. \end{options} Now let's see two simple examples demonstrating the two different kinds of plural @@ -1210,28 +1247,28 @@ that are derived from another language. \acro\ provides a number of properties for such cases: \begin{properties} %% foreign - \propval{foreign}{long form in foreign language}\Default + \propval{foreign}{long form in foreign language}\Initial Can be useful when dealing with acronyms in foreign languages, see section~\vref{sec:fore-lang-acronyms} for details. %% foreign-plural - \propval{foreign-plural}{text}\Default{s} + \propval{foreign-plural}{text}\Initial{s} The plural ending appended to the foreign form. %% foreign-plural-form - \propval{foreign-plural-form}{text}\Default + \propval{foreign-plural-form}{text}\Initial Plural foreign form of the acronym; replaces the foreign form when used instead of appending the plural ending. %% foreign-format - \propval{foreign-format}{code}\Default + \propval{foreign-format}{code}\Initial The format used for the foreign form of the acronym. %% foreign-babel - \propval{foreign-babel}{language}\Default + \propval{foreign-babel}{language}\Initial The \pkg{babel} or \pkg{polyglossia} language of the foreign form. This language is used to wrap the entry with \cs*{foreignlanguage}\marg{language} if either \pkg{babel} or \pkg{polyglossia} is loaded. You'll need to take care that the corresponding language is loaded by \pkg{babel} or \pkg{polyglossia}. %% foreign-locale - \propval{foreign-locale}{language}\Default + \propval{foreign-locale}{language}\Initial The language name that is output when the option \module{locale}\code{/}\option{display} is used. If this property is not set then the appropriate value might be derived from @@ -1239,17 +1276,17 @@ properties for such cases: \end{properties} There are also some options: \begin{options} - \keybool{display}\Module{foreign}\Default{true} + \keybool{display}\Module{foreign}\Initial{true} Determine whether to hide or display the foreign form. - \keybool{display}\Module{list,foreign}\Default{true} + \keybool{display}\Module{list,foreign}\Initial{true} \sinceversion{3.2}Determine whether to hide or display the foreign form in the list of acronyms. - \keybool{display}\Module{locale}\Default{false} + \keybool{display}\Module{locale}\Initial{false} This options determines whether the language of the foreign form is printed or not when the full form of the acronym is printed. - \keybool{display}\Module{list,locale}\Default{false} + \keybool{display}\Module{list,locale}\Initial{false} The same but for the list of acronyms. - \keyval{format}{code}\Module{locale}\Default{\cs*{em}\cs*{text\_titlecase\_first:n}} + \keyval{format}{code}\Module{locale}\Initial{\cs*{em}\cs*{text\_titlecase\_first:n}} Determines how said language is formatted when printed. The last command in \meta{code} may take a mandatory argument. \end{options} @@ -1339,7 +1376,7 @@ There are a number of options to control the uppercasing behavior: There may be reasons to exclude short forms from being uppercased. This can be controlled by this option: \begin{options} - \keybool{short}\Module{uppercase}\Default{true} + \keybool{short}\Module{uppercase}\Initial{true} It allows you to disable the mechanism for the \property{short} and \property{alt} properties. \end{options} @@ -1369,20 +1406,20 @@ desirable to add the citation rather inside the parentheses together with the short form of the acronym and even cited with a different command. For cases like these \acro\ offers a number of options:\acuse{ny} \begin{options} - \keyval{cmd}{citation command}\Module{cite}\Default{\cs*{cite}} + \keyval{cmd}{citation command}\Module{cite}\Initial{\cs*{cite}} Choose the command with which citations ar printed. - \keybool{group}\Module{cite}\Default{false} + \keybool{group}\Module{cite}\Initial{false} Decide whether to group citations with the short form in the parentheses. The template must support this. \acro's pre-defined templates \emph{do} support it. - \keychoice{display}{first,all,none}\Module{cite}\Default{first} + \keychoice{display}{first,all,none}\Module{cite}\Initial{first} Decide whether to output the citation in the first/full usage only or always or never. - \keyval{pre}{text}\Module{cite}\Default{\cs*{nobreakspace}} + \keyval{pre}{text}\Module{cite}\Initial{\cs*{nobreakspace}} Arbitrary code directly output before the citation. - \keyval{cmd}{citation command}\Module{cite,group}\Default{\cs*{cite}} + \keyval{cmd}{citation command}\Module{cite,group}\Initial{\cs*{cite}} Choose the command with which grouped citations are printed. - \keyval{pre}{text}\Module{cite,group}\Default{,\textvisiblespace} + \keyval{pre}{text}\Module{cite,group}\Initial{,\textvisiblespace} Arbitrary code directly output before the citation in the grouped case. \end{options} @@ -1411,13 +1448,13 @@ Maybe you want to add your acronyms to an index. In that case it is probably desirable to let \acro\ make this automatically. In the simplest case just enable it: \begin{options} - \keychoice{use}{\default{true},false,indexed}\Module{index}\Default{false} + \keychoice{use}{\default{true},false,indexed}\Module{index}\Initial{false} \changedversion{3.5}Enable indexing. If \code{indexed} is chosen only the acronyms for which the property \property{index} has been set are indexed. With \code{true} \emph{all} acronyms are indexed. - \keyval{cmd}{index command}\Module{index}\Default{\cs*{index}} + \keyval{cmd}{index command}\Module{index}\Initial{\cs*{index}} Choose a command for indexing. - \keyval{disable}{code}\Module{index}\Default{\cs*{def}\cs*{@}\{\}} + \keyval{disable}{code}\Module{index}\Initial{\cs*{def}\cs*{@}\{\}} Sometimes it is desirable to change the meaning of a command inside an index entry. For the entries created by \acro\ this can be achieved with this option. @@ -1428,17 +1465,17 @@ While these options set global behavior there are also properties to set them for an acronym individually. \begin{properties} %% index - \propval{index}{text}\Default + \propval{index}{text}\Initial This property allows to overwrite the automatic index entry with an arbitrary one. %% index-sort - \propval{index-sort}{text}\Default={sort} + \propval{index-sort}{text}\Initial={sort} If you use the option \option{index} every occurrence of an acronym is recorded to the index and sorted by its short form or (if set) by the value of the \property{sort} property. This property allows to set an individual sorting option for the index. %% no-index - \propbool{no-index}\Default{true} + \propbool{no-index}\Initial{true} This property allows to exclude an acronym from being indexed. \end{properties} This manual is an example for the indexing feature. Each acronym from @@ -1452,14 +1489,14 @@ The main purpose of the concept of barriers is to be able to have \emph{local} lists of acronyms. This concept does a little bit more than that, though, which should become clear from the following options: \begin{options} - \keybool{use}\Module{barriers}\Default{false} + \keybool{use}\Module{barriers}\Initial{false} Activate usage of barriers. Otherwise the command \cs{acbarrier} just does nothing except writing a warning in the log. - \keybool{reset}\Module{barriers}\Default{false} + \keybool{reset}\Module{barriers}\Initial{false} When set to \code{true} the acronym usage is reset for all acronyms at a barrier. The first use of \cs{ac} after a barrier will again look like the \cs{acf}. - \keybool{single}\Module{barriers}\Default{false} + \keybool{single}\Module{barriers}\Initial{false} When set to \code{true} a single usage of an acronym between two barriers with \cs{ac} will look according to the chosen style as explained in section~\vref{sec:single-appe-an}. This option only has an effect when @@ -1510,16 +1547,13 @@ Another example: let's say you're a German scientist, you have long-plural = e } \end{sourcecode} -and you use it the first time like this: -\begin{sourcecode} - \ac{PU}-Hartschaum -\end{sourcecode} -then according to German orthography and typesetting rules this should be -printed as +and you use it the first time like this: \verbcode+\ac{PU}-Hartschaum+ then +according to German orthography and typesetting rules this should be printed +as \begin{center} \enquote{Polyurethan(PU)-Hartschaum} \end{center} -\ie, with \emph{no} space between long and short form. +\ie, with \emph{no} space between long and short form: \begin{example}[side-by-side] \acf{PU}-Hartschaum \end{example} @@ -1608,10 +1642,10 @@ When \acro\ is used together with the package \pkg{hyperref}~\cite{pkg:hyperref} then you can make use of the following option: \begin{options} - \keybool{make-links}\Default{false} + \keybool{make-links}\Initial{false} If this is activated then every short or alternative appearance of an acronym will be linked to its description in the list of acronyms. - \keybool{link-only-first}\Default{false} + \keybool{link-only-first}\Initial{false} \sinceversion{3.5}If this is activated in addition to \option{make-links} then \emph{only the first} short or alternative appearance of an acronym will be linked to its description in the list of acronyms. @@ -1631,7 +1665,7 @@ user interface at the moment. Contact me at \issues\ if you need it. Acronyms have the property \property{pdfstring}: \begin{properties} %% pdfstring - \propval{pdfstring}{pdfstring}\Default={short} + \propval{pdfstring}{pdfstring}\Initial={short} Used as \acs{pdf} string replacement for the short form in bookmarks when used together with the \pkg{hyperref}~\cite{pkg:hyperref} or the \pkg{bookmark} package~\cite{pkg:bookmark}. @@ -1653,9 +1687,9 @@ if the property where not set. Some people like see comments in the \ac{pdf} when they're hovering with the mouse over the short form of an acronym. This can be achieved. \begin{options} - \keybool{use}\Module{pdfcomments}\Default{false} + \keybool{use}\Module{pdfcomments}\Initial{false} This enables the creation of \ac{pdf} comments. - \keyval{cmd}{code}\Module{pdfcomments}\Default{\cs*{pdftooltip}\Marg{\#1}\Marg{\#2}} + \keyval{cmd}{code}\Module{pdfcomments}\Initial{\cs*{pdftooltip}\Marg{\#1}\Marg{\#2}} Chooses the command for actually creating the comment. You must refer to the printed output in the \ac{pdf} with \code{\#1} and to the comment with \code{\#2}. The default command \cs*{pdftooltip} is provided by the @@ -1694,13 +1728,13 @@ about that simply don't load \pkg{accsupp} and ignore this section. You have a few options to be able to manipulate what \acro\ does here but I recommend to stay with the default settings: \begin{options} - \keybool{use}\Module{accsupp}\Default{true} + \keybool{use}\Module{accsupp}\Initial{true} When this is true and the package \pkg{accsupp} is loaded then accessibility support is used. - \keyval{options}{text}\Module{accsupp}\Default + \keyval{options}{text}\Module{accsupp}\Initial Additional option to be passed to \cs{BeginAccSupp}. See the \pkg{accsupp} manual for possible settings. - \keyval{method}{method}\Module{accsupp}\Default{pdfstringdef} + \keyval{method}{method}\Module{accsupp}\Initial{pdfstringdef} The method used by \cs{BeginAccSupp}. See the \pkg{accsupp} manual for possible values. \end{options} @@ -1710,31 +1744,31 @@ of the acronym properties themselves. You can choose these values individually by setting the corresponding properties: \begin{properties} %% short-acc - \propval{short-acc}{text}\Default={short} + \propval{short-acc}{text}\Initial={short} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the short form of the acronym. %% long-acc - \propval{long-acc}{text}\Default={long} + \propval{long-acc}{text}\Initial={long} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the long form of the acronym. %% alt-acc - \propval{alt-acc}{text}\Default={alt} + \propval{alt-acc}{text}\Initial={alt} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the alternative short form of the acronym. %% foreign-acc - \propval{foreign-acc}{text}\Default={foreign} + \propval{foreign-acc}{text}\Initial={foreign} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the foreign form of the acronym. %% extra-acc - \propval{extra-acc}{text}\Default={extra} + \propval{extra-acc}{text}\Initial={extra} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the extra information of the acronym. %% single-acc - \propval{single-acc}{text}\Default={long-acc} + \propval{single-acc}{text}\Initial={long-acc} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for a single appearance of the acronym. %% list-acc - \propval{list-acc}{text}\Default={list} + \propval{list-acc}{text}\Initial={list} Sets the \code{ActualText} property as presented by the \pkg{accsupp} package for the appearance in the list of acronyms. \end{properties} @@ -1754,6 +1788,11 @@ accessibility support, too: } \end{sourcecode} +\begin{bewareofthedog} + Please note that this mechanism is disabled for inner acronyms if you have + nested definitions. +\end{bewareofthedog} + \section{Localisation}\label{sec:localisation} There are places when \acro\ uses text strings which depend on the language of the document. In order to recognize the language from \pkg{babel} of @@ -1763,7 +1802,7 @@ the \pkg{translations}~\cite{pkg:translations}. If the language is detected incorrectly or you want \acro\ to use another language than it detects you can use the following option: \begin{options} - \keychoice{language}{auto,\meta{language}}\Default{auto} + \keychoice{language}{auto,\meta{language}}\Initial{auto} The default setting \code{auto} lets \acro\ detect the language setting automatically. Valid choices are all language names known to the package \pkg{translations}. Mostly just type your language and it should work. @@ -1817,20 +1856,22 @@ The same is true for single line captions from the \pkg{caption} package. All these patches can be turned off: \begin{options} - \keybool{floats}\Module{patch}\Default{true} + \keybool{floats}\Module{patch}\Initial{true} En-/disable the \option{floats} patch. - \keybool{lists}\Module{patch}\Default{true} + \keybool{lists}\Module{patch}\Initial{true} En-/disable the \option{lists} patch for the table of contents, the list of figures and the list of tables. - \keybool{tabularx}\Module{patch}\Default{true} + \keybool{tabularx}\Module{patch}\Initial{true} En-/disable the \option{tabularx} patch. - \keybool{ltxtable}\Module{patch}\Default{true} + \keybool{longtable}\Module{patch}\Initial{true} + \sinceversion{3.7}En-/disable the \option{longtable} patch. + \keybool{ltxtable}\Module{patch}\Initial{true} En-/disable the \option{ltxtable} patch. - \keybool{tabu}\Module{patch}\Default{true} + \keybool{tabu}\Module{patch}\Initial{true} En-/disable the \option{tabu} patch. - \keybool{caption}\Module{patch}\Default{true} + \keybool{caption}\Module{patch}\Initial{true} En-/disable the \option{caption} patch. - \keybool{maketitle}\Module{patch}\Default{true} + \keybool{maketitle}\Module{patch}\Initial{true} \sinceversion{3.6}En-/disable the \option{maketitle} patch. \end{options} @@ -1881,8 +1922,8 @@ to defines own such objects: \property{first-style}. \tmpl{footnote} A template for the first appearance where the long form is printed in a - footnote. This template also conatains a command - \cs{acroendfootnote}\sinceversion{3.7} at the end of the foornote text + footnote. This template also contains a command + \cs{acroendfootnote}\sinceversion{3.7} at the end of the footnote text which in its default definition does nothing. \tmpl{long} Display the long form of an acronym. @@ -1914,17 +1955,14 @@ to defines own such objects: \tmpl{longtable} A style that uses a \env*{longtable} environment for building the list. This needs the \pkg{longtable} package~\cite{pkg:longtable} loaded. - \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\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{tabularray} + A\sinceversion{3.8} style that uses a custom table environment + \env*{actblr} based on \env*{longtblr}. This needs the \pkg{tabularray} + package~\cite{pkg:tabularray} 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 @@ -1934,6 +1972,16 @@ to defines own such objects: page ranges. \end{templates} +The templates \template{tabular}, \template{longtable}, and +\template{supertabular} support the following option: +\begin{options} + \keyval{colspec}{value}\Module{templates}% + \Initial{\code{>\{\cs*{bfseries}\}lp\{.7\cs*{linewidth}\}}} + \sinceversion{3.8}It enables you to easily adjust the column specification + of the standard table templates to your needs. \emph{Please be aware that + you need \emph{exactly} two columns}. +\end{options} + \subsubsection{Heading templates} \begin{templates} \tmpl{addchap} @@ -2265,23 +2313,23 @@ define and use additional endings. In general \cs{DeclareAcroEnding}\marg{foo}\marg{x}\marg{y} defines these options \begin{options} - \keyval*{short-\meta{foo}-ending}{value}\Default*{\meta{x}} - \keyval*{long-\meta{foo}-ending}{value}\Default*{\meta{y}} + \keyval*{short-\meta{foo}-ending}{value}\Initial*{\meta{x}} + \keyval*{long-\meta{foo}-ending}{value}\Initial*{\meta{y}} \end{options} and these properties \begin{properties} - \propval*{short-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{short-\meta{foo}-form}{value}\Default* - \propval*{alt-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{alt-\meta{foo}-form}{value}\Default* - \propval*{long-\meta{foo}}{value}\Default*{\meta{y}} - \propval*{long-\meta{foo}-form}{value}\Default* - \propval*{foreign-\meta{foo}}{value}\Default*{\meta{y}} - \propval*{foreign-\meta{foo}-form}{value}\Default* - \propval*{single-\meta{foo}}{value}\Default*{\meta{y}} - \propval*{single-\meta{foo}-form}{value}\Default* - \propval*{extra-\meta{foo}}{value}\Default*{\meta{y}} - \propval*{extra-\meta{foo}-form}{value}\Default* + \propval*{short-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{short-\meta{foo}-form}{value}\Initial* + \propval*{alt-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{alt-\meta{foo}-form}{value}\Initial* + \propval*{long-\meta{foo}}{value}\Initial*{\meta{y}} + \propval*{long-\meta{foo}-form}{value}\Initial* + \propval*{foreign-\meta{foo}}{value}\Initial*{\meta{y}} + \propval*{foreign-\meta{foo}-form}{value}\Initial* + \propval*{single-\meta{foo}}{value}\Initial*{\meta{y}} + \propval*{single-\meta{foo}-form}{value}\Initial* + \propval*{extra-\meta{foo}}{value}\Initial*{\meta{y}} + \propval*{extra-\meta{foo}-form}{value}\Initial* \end{properties} In addition another command is defined which is meant to be used in template definitions. @@ -2310,16 +2358,16 @@ define and use additional articles. In general \cs{DeclareAcroArticle}\marg{foo}\marg{x} defines the option \begin{options} - \keyval*{\meta{foo}}{value}\Default*{\meta{x}} + \keyval*{\meta{foo}}{value}\Initial*{\meta{x}} \end{options} and these properties \begin{properties} - \propval*{short-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{alt-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{long-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{foreign-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{single-\meta{foo}}{value}\Default*{\meta{x}} - \propval*{extra-\meta{foo}}{value}\Default*{\meta{x}} + \propval*{short-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{alt-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{long-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{foreign-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{single-\meta{foo}}{value}\Initial*{\meta{x}} + \propval*{extra-\meta{foo}}{value}\Initial*{\meta{x}} \end{properties} In addition another command is defined which is meant to be used in template definitions. @@ -2564,8 +2612,9 @@ The command \printacronyms[ preamble = {\label{sec:acronyms}Below all abbreviations are listed which - have been defined for the manual.} , - exclude = {exclude,glossary} + have been defined for the manual. The ones without page numbers have been + defined but haven't been used.} , + exclude = {glossary} ] \printbibliography diff --git a/macros/latex/contrib/acro/acro.sty b/macros/latex/contrib/acro/acro.sty index e53c01b014..1a40b2b80f 100644 --- a/macros/latex/contrib/acro/acro.sty +++ b/macros/latex/contrib/acro/acro.sty @@ -22,14 +22,17 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- +\DeclareRelease{v2}{2020-03-07}{acro2.sty} +\DeclareRelease{version2}{2020-03-07}{acro2.sty} + \RequirePackage {l3keys2e} \ExplSyntaxOn % setup package: \tl_const:Nn \c_acro_package_name_tl {acro} -\tl_const:Nn \c_acro_date_tl {2022/01/27} +\tl_const:Nn \c_acro_date_tl {2022/04/01} \tl_const:Nn \c_acro_version_major_number_tl {3} -\tl_const:Nn \c_acro_version_minor_number_tl {7} +\tl_const:Nn \c_acro_version_minor_number_tl {8} \tl_const:Nn \c_acro_version_subrelease_tl {} \tl_const:Nx \c_acro_version_number_tl { @@ -48,6 +51,7 @@ {\c_acro_date_tl} {\c_acro_version_tl} {\c_acro_info_tl \c_space_tl (CN)} +\DeclareCurrentRelease{v3}{\c_acro_date_tl} % -------------------------------------------------------------------------- % document hooks: @@ -79,6 +83,12 @@ typo.~ Check~ the~ manual~ for~ help. } +\msg_new:nnn {acro} {version} + { + Please~ specify~ the~ version~ by~ saying~ \token_to_str:N + \usepackage{acro}[=v#1],~ i.e., using~ LaTeX's~ release~ mechanism. + } + % -------------------------------------------------------------------------- % re-compile mechanism: \bool_new:N \g__acro_rerun_bool @@ -183,8 +193,6 @@ \cs_generate_variant:Nn \msg_error:nnn {nnV} \cs_generate_variant:Nn \msg_warning:nnn {nnV} -\int_new:N \g__acro_version_int - \keys_define:nn {acro/package} { debug .bool_gset:N = \g__acro_debug_bool , @@ -194,20 +202,13 @@ final .bool_gset:N = \g__acro_final_bool , final .initial:n = false , version .choice: , - version / 2 .code:n = \int_gset:Nn \g__acro_version_int {2} , - version / 3 .code:n = \int_gset:Nn \g__acro_version_int {3} , - version .initial:n = 3 , + version / 2 .code:n = \msg_error:nnn {acro} {version} {#1} \file_input_stop: , + version / 3 .code:n = \msg_warning:nnn {acro} {version} {#1} , unknown .code:n = \__acro_loadtime_warning:n {unknown-option} } \ProcessKeysPackageOptions {acro/package} -\int_compare:nNnT \g__acro_version_int = 2 - { - \RequirePackage {acro2} - \file_input_stop: - } - \keys_define:nn {acro/package} { debug .code:n = \__acro_loadtime_error:n {load-time-option} , @@ -1000,51 +1001,41 @@ % -------------------------------------------------------------------------- \AcroModuleEnd -\AcroModule{aux}{usage of auxiliary files} +\AcroModule{aux}{usage of LaTeX's aux files} + + +% this is still true \AtBeginDocument: +\prg_new_conditional:Npnn \acro_if_preamble: {p,T,F,TF} + { + \cs_if_eq:NNTF \@onlypreamble \@notprerr + { \prg_return_false: } + { \prg_return_true: } + } \cs_new_protected:Npn \ACRO #1 { \use:c {__acro_aux_#1:} } \cs_new_protected:Npn \__acro_auxlist_field_new:cpn #1 { \cs_new_protected:cpn {__acro_aux_#1:} } +\cs_new_protected:Npn \acro_auxlist_write_entry:nn #1#2 + { + \acro_if_preamble:F + { + \acro_write_to_aux:x + { \token_to_str:N \ACRO {#1} #2 } + } + } + \cs_new_protected:Npn \acro_auxlist_to_aux:nn #1#2 { \acro_write_to_aux:x { \token_to_str:N \ACRO {#1} #2 } } -\tl_const:Nx \c_acro_auxfile_tl { \c_sys_jobname_str .acr } - -\iow_new:N \l__acro_aux_file_iow \tl_new:N \l__acro_mdfive_hash_tl -\cs_new_protected:Npn \acro_close_aux: - { - \legacy_if:nT {@filesw} - { \iow_now:Nx \@auxout { \token_to_str:N \ACRO {readaux} } } - } - \cs_new_protected:Npn \acro_write_to_aux:n #1 - { - \legacy_if:nT {@filesw} - { \iow_now:Nn \@auxout {#1} } - } + { \legacy_if:nT {@filesw} { \iow_now:Nn \@auxout {#1} } } \cs_generate_variant:Nn \acro_write_to_aux:n {x} -\__acro_auxlist_field_new:cpn {readaux} - { - \file_if_exist:nT { \c_sys_jobname_str .acr } - { \file_input:n { \c_sys_jobname_str .acr } } - } - % ---------------------------------------------------------------------------- -% list for recording values that need to be written to the aux file and -% updated at begin document - -\str_new:N \l__acro_auxlist_split_str -\keys_define:nn {acro} - { - auxlist-split .code:n = \str_set:Nn \l__acro_auxlist_split_str {#1} , - auxlist-split .initial:n = || - } - % define list: % #1: name \cs_new_protected:Npn \__acro_auxlist_new:n #1 @@ -1058,8 +1049,7 @@ { \tl_if_blank:nF {##1} { - \seq_gset_split:cVx {g__acro_auxlist_#1_seq} - \l__acro_auxlist_split_str + \seq_gput_right:cx {g__acro_auxlist_#1_seq} { \tl_to_str:n {##1} } \seq_map_inline:cn {g__acro_auxlist_#1_seq} { \acro_attribute_set:nnn {#1} {####1} {} } @@ -1074,7 +1064,7 @@ \str_set:Nn \l__acro_tmpa_str {##1} \seq_gput_right:cV {g__acro_auxlist_recorded_#1_seq} \l__acro_tmpa_str } - \seq_gremove_duplicates:c {g__acro_auxlist_recorded_#1_seq} + \seq_gremove_duplicates:c {g__acro_auxlist_recorded_#1_seq} } } @@ -1087,7 +1077,9 @@ \acro_attribute_set:nnn {#1} {#2} {} \seq_if_in:cVT {g__acro_auxlist_#1_seq} \l__acro_tmpa_str { \seq_gremove_all:cV {g__acro_auxlist_#1_seq} \l__acro_tmpa_str } + % \acro_auxlist_write_entry:nn {#1} {{#2}} \seq_gput_right:cV {g__acro_auxlist_#1_seq} \l__acro_tmpa_str + \seq_gremove_duplicates:c {g__acro_auxlist_#1_seq} } \cs_generate_variant:Nn \__acro_auxlist_add:nn {nx} @@ -1100,8 +1092,6 @@ { \acro_attribute_unset:nn {#1} {#2} } \seq_if_in:cVT {g__acro_auxlist_#1_seq} \l__acro_tmpa_str { \seq_gremove_all:cV {g__acro_auxlist_#1_seq} \l__acro_tmpa_str } - \seq_if_in:cVT {g__acro_auxlist_recorded#1_seq} \l__acro_tmpa_str - { \seq_gremove_all:cV {g__acro_auxlist_recorded_#1_seq} \l__acro_tmpa_str } } \cs_generate_variant:Nn \__acro_auxlist_remove:nn {nx} @@ -1120,22 +1110,41 @@ \cs_new_protected:Npn \acro_auxlists_clear: { \bool_set_true:N \l__acro_auxlists_clear_bool } + +\cs_new_protected:Npn \__acro_get_string_from_property_seq:NN #1#2 + { + \prop_clear:N \l__acro_tmpa_prop + \seq_clear:N \l__acro_tmpa_seq + \seq_map_inline:Nn #1 + { + \__acro_get_aux_entry:nNN {##1} + \l__acro_tmpa_tl + \l__acro_tmpb_tl + \prop_put:NVV \l__acro_tmpa_prop \l__acro_tmpa_tl \l__acro_tmpb_tl + } + \prop_map_inline:Nn \l__acro_tmpa_prop + { \seq_put_right:Nn \l__acro_tmpa_seq {##1:##2} } + \acro_seq_sort:N \l__acro_tmpa_seq + \str_set:Nx #2 { \seq_use:Nn \l__acro_tmpa_seq {} } + } +\cs_generate_variant:Nn \__acro_get_string_from_property_seq:NN {c} + % update list (should be used inside \acro_at_end_document:n): % #1: name \cs_new_protected:Npn \__acro_auxlist_update:n #1 { - \seq_gremove_duplicates:c {g__acro_auxlist_#1_seq} - \seq_gremove_duplicates:c {g__acro_auxlist_recorded_#1_seq} - \str_set:Nx \l__acro_tmpa_str - { \seq_use:cn {g__acro_auxlist_#1_seq} {} } - \str_set:Nx \l__acro_tmpb_str - { \seq_use:cn {g__acro_auxlist_recorded_#1_seq} {} } + \__acro_get_string_from_property_seq:cN + {g__acro_auxlist_#1_seq} + \l__acro_tmpa_str + \__acro_get_string_from_property_seq:cN + {g__acro_auxlist_recorded_#1_seq} + \l__acro_tmpb_str \str_if_eq:NNF \l__acro_tmpa_str \l__acro_tmpb_str { \acro_rerun:n {property} } \bool_if:NF \l__acro_auxlists_clear_bool { - \acro_auxlist_to_aux:nn {#1} - { { \seq_use:cV {g__acro_auxlist_#1_seq} \l__acro_auxlist_split_str } } + \seq_map_inline:cn {g__acro_auxlist_#1_seq} + { \acro_auxlist_write_entry:nn {#1} {{##1}} } } } @@ -1271,7 +1280,8 @@ } \bool_if:NT \l__acro_property_define_static_bool { - \hook_gput_code:nnn {enddocument} {acro} { \__acro_auxlist_update:n {#2} } + \hook_gput_code:nnn {enddocument/afterlastpage} {acro} + { \__acro_auxlist_update:n {#2} } \acro_at_begin_document:n { \__acro_property_set_from_auxlist:n {#2} } } @@ -1377,6 +1387,13 @@ { \prg_return_false: } } +\prg_new_conditional:Npnn \acro_property_if_static:n #1 {p,T,F,TF} + { + \acro_attribute_if_set:nnTF {dynamic} {#1} + { \prg_return_false: } + { \prg_return_true: } + } + \prg_new_conditional:Npnn \acro_property_if_unique:n #1 {p,T,F,TF} { \acro_attribute_if_set:nnTF {unique} {#1} @@ -1518,7 +1535,7 @@ \__acro_auxlist_add:nn {#2} {#1=={#3}} \acro_attribute_set:nnn {#2} {#1} {#3} } -\cs_generate_variant:Nn \__acro_property_set:nnn {VnV,nne} +\cs_generate_variant:Nn \__acro_property_set:nnn {VnV,nne,V} \tl_set:Nx \l__acro_tmpa_tl { \cs_to_str:N \{ } \tl_set:Nx \l__acro_tmpb_tl { \cs_to_str:N \} } @@ -1534,6 +1551,9 @@ \str_set:Nn #2 {#4} } +\str_new:N \l____acro_tmpa_str +\str_new:N \l____acro_tmpb_str + % #1: id % #2: property \cs_new_protected:Npn \__acro_property_remove_from_auxlist:nn #1#2 @@ -1542,22 +1562,22 @@ \__acro_auxlist_foreach_entry:nn {#2} { \__acro_property_extract_auxlist_entry:NNww - \l__acro_tmpa_str \l__acro_tmpb_str ##1 \q_stop - \str_if_eq:xnT { \l__acro_tmpa_str } {#1} + \l____acro_tmpa_str \l____acro_tmpb_str ##1 \q_stop + \str_if_eq:xnT { \l____acro_tmpa_str } {#1} { \__acro_auxlist_remove:nx {#2} - { #1 == {\l__acro_tmpb_str} } + { #1 == { \l____acro_tmpb_str } } } } % make sure we change the entry if it has been set during the current run: \__acro_auxlist_foreach_new_entry:nn {#2} { \__acro_property_extract_auxlist_entry:NNww - \l__acro_tmpa_str \l__acro_tmpb_str ##1 \q_stop - \str_if_eq:xnT { \l__acro_tmpa_str } {#1} + \l____acro_tmpa_str \l____acro_tmpb_str ##1 \q_stop + \str_if_eq:xnT { \l____acro_tmpa_str } {#1} { \__acro_auxlist_remove:nx {#2} - { #1 == {\l__acro_tmpb_str} } + { #1 == { \l____acro_tmpb_str } } } } } @@ -1566,13 +1586,33 @@ \cs_new_protected:Npn \__acro_property_set_from_auxlist:n #1 { \__acro_auxlist_foreach_entry:nn {#1} - { - \__acro_property_extract_auxlist_entry:NNww - \l__acro_tmpa_str \l__acro_tmpb_str ##1 \q_stop - \tl_set_rescan:Nnx \l__acro_tmpa_tl {} { \l__acro_tmpb_str } - \__acro_property_set:VnV \l__acro_tmpa_str {#1} \l__acro_tmpa_tl - } + { \__acro_property_set_from_aux_entry:nn {#1} {##1} } + } + +% #1: property +% #2: id=={value} +\cs_new_protected:Npn \__acro_property_set_from_aux_entry:nn #1#2 + { + \__acro_property_extract_auxlist_entry:NNww + \l____acro_tmpa_str \l____acro_tmpb_str #2 \q_stop + \tl_set_rescan:NnV \l__acro_tmpa_tl {} \l____acro_tmpb_str + \__acro_property_set:VnV \l____acro_tmpa_str {#1} \l__acro_tmpa_tl + } +\cs_generate_variant:Nn \__acro_property_set_from_aux_entry:nn {ne} +\cs_generate_variant:Nn \tl_set_rescan:Nnn {NnV} + +% #1: id=={value} +% #2: tl var +% #3: tl var +\cs_new_protected:Npn \__acro_get_aux_entry:nNN #1#2#3 + { + \__acro_property_extract_auxlist_entry:NNww + \l____acro_tmpa_str \l____acro_tmpb_str #1 \q_stop + \tl_set_rescan:Nnx \l__acro_tmpa_tl {} { \l____acro_tmpb_str } + \tl_set:NV #3 \l__acro_tmpa_tl + \tl_set:NV #2 \l____acro_tmpa_str } +\cs_generate_variant:Nn \__acro_property_set_from_aux_entry:nn {ne} % set properties: % #1: id @@ -1659,8 +1699,8 @@ % inspect properties: \cs_new_protected:Npn \acro_property_show:nn #1#2 { - \acro_property_if_set:nnT {#1} {#2} - { + % \acro_property_if_set:nnT {#1} {#2} + % { \iow_term:x { \c_space_tl \c_space_tl @@ -1668,7 +1708,7 @@ \c_space_tl \c_space_tl => \c_space_tl \c_space_tl { \acro_property_get:nn {#1} {#2} } } - } + % } } \cs_generate_variant:Nn \acro_property_show:nn {e} @@ -1899,7 +1939,7 @@ % #2: properties \cs_new_protected:Npn \__acro_declare_acronym:nn #1#2 { - \int_new:c {g__acro_#1_int} + \newcounter {g@acro@#1@int} \seq_new:c {g__acro_#1_pages_seq} \seq_new:c {g__acro_#1_barriers_seq} \acro_at_begin_document:n @@ -1933,7 +1973,7 @@ \acro_set_endings:n {#1} \acro_at_end_document:n { - \acro_property_set:nnx {#1} {usage} { \int_use:c {g__acro_#1_int} } + \acro_property_set:nnx {#1} {usage} { \arabic {g@acro@#1@int} } \acro_set_barriers:n {#1} } } @@ -2011,13 +2051,7 @@ { \seq_map_inline:Nn \g_acro_acronyms_seq { \__acro_use:n {##1} } } \cs_new_protected:Npn \__acro_reset:n #1 - { - \acro_property_set:nnn {#1} {used} {false} - % \int_gzero:c {g__acro_ \acro_case_insensitive:n {#1} _int} - % \int_compare:nNnF - % { \acro_property_get:nn {#1} {usage} } > 0 - % { \acro_property_set:nnn {#1} {usage} {0} } - } + { \acro_property_set:nnn {#1} {used} {false} } \cs_new_protected:Npn \acro_reset:n #1 { \clist_map_inline:nn {#1} { \__acro_reset:n {##1} } } @@ -2388,7 +2422,7 @@ % #1: id \cs_new_protected:Npn \acro_step:n #1 - { \int_gincr:c {g__acro_ \acro_case_insensitive:n {#1} _int} } + { \stepcounter {g@acro@ \acro_case_insensitive:n {#1} @int} } \cs_generate_variant:Nn \acro_step:n {e} % #1: id @@ -2867,6 +2901,21 @@ } } +\cs_new_protected:Npn \acro_seq_sort:N #1 + { + \seq_sort:Nn #1 + { + \int_compare:nNnTF + { + \__acro_strcmp:nn + { \str_foldcase:e {##1} } + { \str_foldcase:e {##2} } + } = {-1} + { \sort_return_same: } + { \sort_return_swapped: } + } + } + % -------------------------------------------------------------------------- % barriers: \int_new:N \g_acro_barrier_int @@ -3133,9 +3182,12 @@ % #2: property \cs_new_protected:Npn \__acro_write_acronym:nn #1#2 { - \__acro_upper:n { \__acro_article:nn {#1} {#2} } \bool_if:NT \l__acro_article_bool - { \bool_set_false:N \l__acro_upper_bool } + { + \__acro_upper:n { \__acro_article:nn {#1} {#2} } + \bool_set_false:N \l__acro_article_bool + \bool_set_false:N \l__acro_upper_bool + } \bool_lazy_and:nnTF { \acro_property_if_eq_p:nn {#2} {long} } { \acro_if_first_p:n {#1} } @@ -3255,6 +3307,8 @@ \tl_new:N \l_acro_id_tl \tl_new:N \AcronymID +\int_new:N \l_acro_nest_level_int + % #1: csname % #2: xparse csname % #3: action @@ -3270,6 +3324,7 @@ { base \__acro_remove_bs:N ##1 } {##2} { \acro_begin: + \int_incr:N \l_acro_nest_level_int \l__acro_begin_command_hook_tl \cs_set:Npn \nospace { \exp:w \exp_end_continue_f:w } \acro_check_definition:nT @@ -3283,6 +3338,7 @@ { \l__acro_star_bool } { \acro_case_insensitive:n {####1} } \l__acro_end_command_hook_tl + \int_decr:N \l_acro_nest_level_int } \acro_end: } @@ -3854,34 +3910,36 @@ \msg_new:nnn {acro} {threshold} { The~ sequentes~ threshold~ needs~ to~ be~ at~ least~ 3. } -\group_begin: -\char_set_catcode_other:N \@ - % #1: id \cs_new_protected:Npn \acro_record_page:n #1 { - \seq_if_in:ceF {g__acro_#1_pages_seq} - { - \int_use:N \g_shipout_totalpages_int - @ \int_use:N \g_acro_barrier_int - @ \thepage - } - { - \seq_gput_right:ce {g__acro_#1_pages_seq} - { - \int_use:N \g_shipout_totalpages_int - @ \int_use:N \g_acro_barrier_int - @ \thepage - } - } - \seq_gremove_duplicates:c {g__acro_#1_pages_seq} - \acro_at_end_document:n + \__acro_record_page:n {#1} + \hook_gput_code:nnn {enddocument} {acro} { + \seq_gremove_duplicates:c {g__acro_#1_pages_seq} \acro_property_set:nnx {#1} {pages} { \seq_use:cn {g__acro_#1_pages_seq} {|} } } } +\cs_new_protected:Npn \__acro_record_page:n #1 + { + \iow_shipout_x:Nn \@auxout + { + \token_to_str:N \ACRO {recordpage} + {#1} + { \int_use:N \g_shipout_totalpages_int } + { \int_use:N \g_acro_barrier_int } + { \thepage } + } + } + +\group_begin: +\char_set_catcode_other:N \@ + +\__acro_auxlist_field_new:cpn {recordpage} #1#2#3#4 + { \seq_gput_right:ce {g__acro_#1_pages_seq} {#2@#3@#4} } + \cs_new:Npn \__acro_page_name:w #1@#2@#3 \q_stop { \acro_package_if_loaded:nTF {hyperref} @@ -3924,12 +3982,16 @@ { \seq_set_split:Nnx \l__acro_tmpa_seq {|} { \acro_property_get:nn {#1} {pages} } - \use:e + \seq_remove_all:Nn \l__acro_tmpa_seq {} + \seq_if_empty:NF \l__acro_tmpa_seq { - \exp_last_unbraced:Ne - \__acro_page_name:w - { \seq_item:Nn \l__acro_tmpa_seq {1} } - \q_stop + \use:e + { + \exp_last_unbraced:Ne + \__acro_page_name:w + { \seq_item:Nn \l__acro_tmpa_seq {1} } + \q_stop + } } } @@ -3940,11 +4002,12 @@ { \seq_set_split:Nnx \l__acro_tmpa_seq {|} { \acro_property_get:nn {#1} {pages} } + \seq_remove_all:Nn \l__acro_tmpa_seq {} \intarray_gzero:N \g__acro_pages_intarray \seq_map_inline:Nn \l__acro_tmpa_seq { \intarray_gset:Nnn \g__acro_pages_intarray - { \__acro_absolute_page:w ##1 \q_stop + 1 } + { \__acro_absolute_page:w ##1 \q_stop } { \bool_if:NTF \l__acro_list_local_bool { @@ -3977,7 +4040,7 @@ { % the current page \int_set:Nn \l__acro_tmpa_int - { \__acro_absolute_page:w ##1 \q_stop + 1 } + { \__acro_absolute_page:w ##1 \q_stop } \int_compare:nNnTF \l__acro_tmpa_int = 1 { % first page, start range \seq_put_right:Ne \l__acro_tmpb_seq @@ -4089,7 +4152,11 @@ { \bool_lazy_and_p:nn { \acro_attribute_if_set_p:nn {pages} {#1} } - { !\acro_if_single_p:n {#1} } + { + \bool_lazy_or_p:nn + { \l__acro_list_display_all_bool } + { !\acro_if_single_p:n {#1} } + } } { \prg_return_true: } { \prg_return_false: } @@ -4295,8 +4362,15 @@ { \bool_if:NTF \l__acro_language_auto_bool { - \tl_set:Nx \l_acro_language_tl - { \@trnslt@language{\@trnslt@current@language} } + \tl_if_exist:NTF \c_trnslt_current_language_tl + { + \tl_set_eq:NN \l_acro_language_tl + \c_trnslt_current_language_tl + } + { + \tl_set:Nx \l_acro_language_tl + { \@trnslt@language{\@trnslt@current@language} } + } } { \tl_set_eq:NN @@ -4425,8 +4499,8 @@ { \hyperlink {##1} { \XeTeXLinkBox {##2} } } } { \cs_set_eq:NN \__acro_hyper_link:nn \hyperlink } - \cs_set:Npn \__acro_hyper_target:nn ##1##2 - { \raisebox {3ex} [0pt] { \hypertarget {##1} { } } ##2 } + \cs_set_protected:Npn \__acro_hyper_target:nn ##1##2 + { \Hy@raisedlink { \hypertarget {##1} { } } ##2 } \cs_set_eq:NN \__acro_hyper_back_link:nn \__acro_hyper_link:nn \cs_set_eq:NN \__acro_hyper_back_target:nn \__acro_hyper_target:nn } @@ -4443,7 +4517,11 @@ { { \acro_package_if_loaded_p:n {hyperref} } { \l__acro_hyperref_use_bool } - { !\acro_if_single_p:n {#1} } + { + \bool_lazy_or_p:nn + { \l__acro_list_display_all_bool } + { !\acro_if_single_p:n {#1} } + } { \bool_lazy_or_p:nn { !\l__acro_link_only_first_bool } @@ -4451,7 +4529,9 @@ } } { - \bool_if:NTF \l__acro_list_bool + \bool_lazy_and:nnTF + { \l__acro_list_bool } + { \int_compare_p:nNn { \l_acro_nest_level_int } = 0 } { \__acro_hyper_target:en { @@ -4531,10 +4611,14 @@ { \bool_if:NTF \l__acro_accsupp_bool { - \__acro_do_accsupp:Vnn - \l__acro_acc_supp_options_tl - {#1} + \int_compare:nNnTF { \l_acro_nest_level_int } > 1 {#2} + { + \__acro_do_accsupp:Vnn + \l__acro_acc_supp_options_tl + {#1} + {#2} + } } {#2} } @@ -5019,6 +5103,8 @@ \msg_new:nnn {acro} {patch} { Patching~ `#1'~ failed.~ Please~ contact~ the~ acro~ author. } +\RequirePackage {etoolbox} + \cs_new_protected:Npn \acro_new_patch:n #1 { \bool_new:c {l__acro_patch_#1_bool} @@ -5072,6 +5158,19 @@ {} { \msg_error:nnn {acro} {patch} {floats} } } + % contents lists: + \acro_if_patch:nT {lists} + { + \addtocontents {toc} { \acswitchoff } + \addtocontents {lof} { \acswitchoff } + \addtocontents {lot} { \acswitchoff } + } + % caption package: + \acro_if_patch:nT {caption} + { + \cs_if_exist:NT \caption@prepareslc + { \tl_gput_right:Nn \caption@prepareslc { \acswitchoff } } + } % tables: % * tabularx \acro_if_patch:nT {tabularx} @@ -5103,20 +5202,7 @@ \cs_if_exist:NT \tabuDisableCommands { \tabuDisableCommands { \acswitchoff } } } - % contents lists: - \acro_if_patch:nT {lists} - { - \addtocontents {toc} { \acswitchoff } - \addtocontents {lof} { \acswitchoff } - \addtocontents {lot} { \acswitchoff } - } - % caption package: - \acro_if_patch:nT {caption} - { - \cs_if_exist:NT \caption@prepareslc - { \tl_gput_right:Nn \caption@prepareslc { \acswitchoff } } - } - % longtable pakage: + % * longtable \acro_if_patch:nT {longtable} { \cs_if_exist:NT \endlongtable @@ -5235,8 +5321,8 @@ { \space ( - \acroifT {alt} { \acrotranslate {or} ~ \acrowrite {alt} ~ } - \acroifT {foreign} { \acrowrite {foreign} :~ } + \acroifT {alt} { \acrotranslate {or} ~ \acrowrite {alt} ,~ } + \acroifT {foreign} { \acrowrite {foreign} ,~ } \acrowrite {long} \acrogroupcite ) @@ -5250,7 +5336,7 @@ { \acfootnote { - \acroifT {alt} { \acrotranslate {or} ~ \acrowrite {alt} :~ } + \acroifT {alt} { \acrotranslate {or} ~ \acrowrite {alt} ,~ } \acroifT {foreign} { \acrowrite {foreign} ,~ } \acrowrite {long} \acrogroupcite @@ -5332,7 +5418,7 @@ \begin {description} \acronymsmapF { - \item [ \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} ] + \item [ \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} ] \acrowrite {list} \acroifanyT {foreign,extra} {~(} \acrowrite {foreign} @@ -5348,6 +5434,13 @@ \end {description} } +\tl_new:N \l_acro_table_colspec_tl +\keys_define:nn {acro/templates} + { + colspec .tl_set:N = \l_acro_table_colspec_tl , + colspec .initial:n = {>{\bfseries}lp{.7\linewidth}} + } + \NewAcroTemplate[list] {tabular} { \AcroNeedPackage {array} @@ -5356,7 +5449,7 @@ \AcroAddRow { \acrowrite {short} - \acroifT {alt} { / } \acrowrite {alt} + \acroifT {alt} {/} \acrowrite {alt} & \acrowrite {list} \acroifanyT {foreign,extra} {~(} @@ -5375,7 +5468,8 @@ \acroheading \acropreamble \par \noindent - \begin {tabular} {>{\bfseries}lp{.7\linewidth}} + \exp_args:NnV + \begin {tabular} \l_acro_table_colspec_tl \AcronymTable \end {tabular} } @@ -5388,7 +5482,7 @@ \AcroAddRow { \acrowrite {short} - \acroifT {alt} { / } \acrowrite {alt} + \acroifT {alt} {/} \acrowrite {alt} & \acrowrite {list} \acroifanyT {foreign,extra} {~(} @@ -5407,20 +5501,22 @@ \acroheading \acropreamble \par \noindent - \begin {longtable} {>{\bfseries}lp{.7\linewidth}} + \exp_args:NnV + \begin {longtable} \l_acro_table_colspec_tl \AcronymTable \end {longtable} + \addtocounter {table} {-1} } - -\NewAcroTemplate[list] {longtabu} + +\NewAcroTemplate[list] {supertabular} { - \AcroNeedPackage {array,longtable,tabu} + \AcroNeedPackage {array,supertabular} \acronymsmapF { \AcroAddRow { \acrowrite {short} - \acroifT {alt} { / } \acrowrite {alt} + \acroifT {alt} {/} \acrowrite {alt} & \acrowrite {list} \acroifanyT {foreign,extra} {~(} @@ -5432,27 +5528,28 @@ \acropages { \acrotranslate {page} \nobreakspace } { \acrotranslate {pages} \nobreakspace } - \strut \tabularnewline + \tabularnewline } } - { \AcroRerun } + { \AcroRerun } \acroheading \acropreamble \par \noindent - \begin {longtabu} {>{\bfseries}lX[l]} + \exp_args:NnV + \begin {supertabular} \l_acro_table_colspec_tl \AcronymTable - \end {longtabu} + \end {supertabular} } -\NewAcroTemplate[list] {supertabular} +\NewAcroTemplate[list] {xltabular} { - \AcroNeedPackage {array,supertabular} + \AcroNeedPackage {xltabular} \acronymsmapF { \AcroAddRow { \acrowrite {short} - \acroifT {alt} { / } \acrowrite {alt} + \acroifT {alt} {/} \acrowrite {alt} & \acrowrite {list} \acroifanyT {foreign,extra} {~(} @@ -5471,13 +5568,59 @@ \acroheading \acropreamble \par \noindent - \begin {supertabular} {>{\bfseries}lp{.7\linewidth}} + \begin {xltabular} {\linewidth} {>{\bfseries}lX} \AcronymTable - \end {supertabular} + \end {xltabular} + } + +\hook_gput_code:nnn {package/tabularray/after} {acro} + { + \NewTblrTheme {acro} { \DefTblrTemplate {foot} {default} {} } + \NewTblrEnviron {actblr} + \SetTblrOuter [actblr] { + long , + expand = \AcronymTable , + theme = acro , + entry = none , + label = none + } + \SetTblrInner [actblr] { rowsep = 0pt } + } + +\NewAcroTemplate [list] {tabularray} + { + \AcroNeedPackage {tabularray} + \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 } + \strut \\ + } + } + { \AcroRerun } + \acroheading + \acropreamble + \par \noindent + \begin {actblr} { colspec = {lX[l]}, column{1} = { font = \bfseries } } + \AcronymTable + \end {actblr} } \let\l@acro\l@figure - + \NewAcroTemplate [list] {lof} { \acroheading @@ -5489,7 +5632,7 @@ \contentsline {acro} { \numberline - { \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} } + { \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} } { \acrowrite {list} \acroifanyT {foreign,extra} {~(} @@ -5514,7 +5657,7 @@ \acronymsmapF { \contentsline { \acroifchapterTF {chapter} {section} } - { \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} } + { \acrowrite {short} \acroifT {alt} {/} \acrowrite {alt} } {}{} \contentsline { \acroifchapterF {sub} section } { @@ -5954,6 +6097,6 @@ % ---------------------------------------------------------------------------- \AcroModuleEnd % finish package: -\hook_gput_code:nnn {enddocument} {acro} { \acro_close_aux: \acro_do_rerun: } +\hook_gput_code:nnn {enddocument} {acro} { \acro_do_rerun: } %---------------------------------------------------------------------------- \file_input_stop: diff --git a/macros/latex/contrib/acro/acro2.sty b/macros/latex/contrib/acro/acro2.sty index d5c7d0b59f..599f65211b 100644 --- a/macros/latex/contrib/acro/acro2.sty +++ b/macros/latex/contrib/acro/acro2.sty @@ -5,18 +5,18 @@ % % -------------------------------------------------------------------------- % Clemens Niederberger -% Web: https://github.com/cgnieder/acro/ +% Web: https://bitbucket.org/cgnieder/acro/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- % Copyright 2011--2020 Clemens Niederberger % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3c +% conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX -% version 2008/05/04 or later. +% version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % @@ -33,11 +33,29 @@ \RequirePackage{expl3,xparse,xtemplate,l3keys2e} \RequirePackage{etoolbox} % for the document hooks +\ExplSyntaxOn + +\tl_const:Nn \c_acro_date_tl {2020/03/07} +\tl_const:Nn \c_acro_version_major_number_tl {2} +\tl_const:Nn \c_acro_version_minor_number_tl {11} +\tl_const:Nn \c_acro_version_subrelease_tl {d} +\tl_const:Nx \c_acro_version_number_tl + { + \c_acro_version_major_number_tl . + \c_acro_version_minor_number_tl + } +\tl_const:Nx \c_acro_version_tl + { + \c_acro_version_number_tl + \c_acro_version_subrelease_tl + } +\tl_const:Nn \c_acro_info_tl {Typeset~ Acronyms} + \ProvidesExplPackage - {acro2} - {2020/03/07} - {2.11d} - {\csname c_acro_info_tl\endcsname} + {acro} + {\c_acro_date_tl} + {\c_acro_version_tl} + {\c_acro_info_tl} % -------------------------------------------------------------------------- % warning and error messages: @@ -193,6 +211,7 @@ \bool_new:N \l__acro_place_label_bool \bool_new:N \l__acro_print_only_used_bool \bool_set_true:N \l__acro_print_only_used_bool +\bool_new:N \g__acro_rerun_bool \bool_new:N \g__acro_reset_at_barrier_bool \bool_new:N \l__acro_silence_bool \bool_new:N \l__acro_single_use_bool @@ -2481,7 +2500,7 @@ \cs_new_protected:Npn \acro@pages #1#2 { \tl_gset:cn {g__acro_#1_recorded_pages_tl} {#2} } - + \cs_new_protected:Npn \acro@rerun@check { \bool_if:NT \g__acro_rerun_bool @@ -3009,7 +3028,7 @@ \bool_if:NT \l__acro_indefinite_bool { \prop_item:cn {l__acro_#2_indefinite_prop} {#1} ~ } \bool_if:NT \l__acro_upper_indefinite_bool - { + { % \bool_set_true:N \l__acro_first_upper_bool \__acro_first_upper_case:x { \prop_item:cn {l__acro_#2_indefinite_prop} {#1} } ~ } @@ -4078,18 +4097,7 @@ \tl_set:Nn \l__acro_next_pages_tl { \,\GetTranslation {acronym-next-pages}\@ } % -------------------------------------------------------------------------- -% allow for a configuration file: - -\file_if_exist:nT - { \l_acro_config_file_name_tl . \l_acro_config_file_extension_tl } - { - \@onefilewithoptions - {\l_acro_config_file_name_tl} [] [] - \l_acro_config_file_extension_tl - } - -% -------------------------------------------------------------------------- -% define user functions: +% definition file: % document commands: \NewDocumentCommand \DeclareAcronym {mm} { \acro_declare_acronym:nn {#1} {#2} } @@ -4637,4 +4645,14 @@ } % -------------------------------------------------------------------------- +% allow for a configuration file: + +\file_if_exist:nT + { \l_acro_config_file_name_tl . \l_acro_config_file_extension_tl } + { + \@onefilewithoptions + {\l_acro_config_file_name_tl} [] [] + \l_acro_config_file_extension_tl + } + \file_input_stop: diff --git a/macros/latex/contrib/acro/examples/acro.example.issue-119.tex b/macros/latex/contrib/acro/examples/acro.example.issue-119.tex index 098e50a0e1..9d19dc7b0d 100644 --- a/macros/latex/contrib/acro/examples/acro.example.issue-119.tex +++ b/macros/latex/contrib/acro/examples/acro.example.issue-119.tex @@ -1,7 +1,5 @@ \documentclass{article} -\usepackage[enable-debug]{expl3} - -\usepackage[version=3]{acro} +\usepackage{acro}[=v3] \makeatletter \NewAcroTemplate[list]{external}{% @@ -15,7 +13,7 @@ \space\space \item[\acrofield{##1}{short}] \acrofield{##1}{list}% - \acrofieldifTF{##1}{extra}{ (\acrofield{##1}{extra})}{}% + \acroiffieldTF{##1}{extra}{ (\acrofield{##1}{extra})}{}% }% }{\immediate\write\acro@list{\item}\AcroRerun}% \immediate\write\acro@list{\string\end{description}} |