texlive[55016] Master/texmf-dist: acro (3may20)

commits+karl at tug.org commits+karl at tug.org
Mon May 4 23:24:10 CEST 2020


Revision: 55016
          http://tug.org/svn/texlive?view=revision&revision=55016
Author:   karl
Date:     2020-05-04 23:24:10 +0200 (Mon, 04 May 2020)
Log Message:
-----------
acro (3may20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/acro/README
    trunk/Master/texmf-dist/doc/latex/acro/acro-manual.pdf
    trunk/Master/texmf-dist/doc/latex/acro/acro-manual.tex
    trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.acflike.pdf
    trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.issue-119.tex
    trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-505891.pdf
    trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-505891.tex
    trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-507726.tex
    trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex
    trunk/Master/texmf-dist/tex/latex/acro/acro.sty

Modified: trunk/Master/texmf-dist/doc/latex/acro/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/README	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/doc/latex/acro/README	2020-05-04 21:24:10 UTC (rev 55016)
@@ -1,5 +1,5 @@
 --------------------------------------------------------------------------
-the ACRO package v3.0 2020/04/29
+the ACRO package v3.1 2020/05/03
 
   Typeset Acronyms
 

Modified: trunk/Master/texmf-dist/doc/latex/acro/acro-manual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/acro/acro-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/acro-manual.tex	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/doc/latex/acro/acro-manual.tex	2020-05-04 21:24:10 UTC (rev 55016)
@@ -1,8 +1,3 @@
-% arara: pdflatex: { interaction: nonstopmode }
-% !arara: biber
-% arara: pdflatex: { interaction: nonstopmode }
-% !arara: pdflatex: { interaction: nonstopmode }
-% !arara: pdflatex: { interaction: nonstopmode }
 % --------------------------------------------------------------------------
 % the ACRO package
 % 
@@ -16,25 +11,17 @@
 % 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.3
+% conditions of the LaTeX Project Public License, either version 1.3c
 % 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 2005/12/01 or later.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
 % 
 % This work has nce status `maintained'.
 % 
 % The Current Maintainer of this work is Clemens Niederberger.
 % --------------------------------------------------------------------------
-% The acro package consists of the files
-% - acro.sty, acro.definitions.tex, acro.cfg
-% - acro-manual.tex, acro-manual.pdf, acro-manual.cls
-% - acro.history, README
-% --------------------------------------------------------------------------
-% If you have any ideas, questions, suggestions or bugs to report, please
-% feel free to contact me.
-% --------------------------------------------------------------------------
 \PassOptionsToPackage{ngerman,latin,english}{babel}
 \PassOptionsToPackage{version=3,upgrade}{acro}
 \documentclass{acro-manual}
@@ -190,19 +177,22 @@
   tag = glossary , no-index
 }
 \DeclareAcronym{option}{
-  long = An \option*{option} is a package option of \acro\ which must set
-    with \cs*{acsetup}. It \emph{cannot} be set as option to \cs*{usepackage}. ,
+  long = {An \option*{option} is a package option of \acro\ which must set
+    with \cs*{acsetup}. It \emph{cannot} be set as option to \cs*{usepackage}.
+    Options usually also can be set in the optional argument of \cs*{ac} and
+    friends.} ,
   tag = glossary , no-index
 }
 \DeclareAcronym{load-time option}{
-  long = A load-time \option*{option} is a package option of \acro\ which must
-    be set as option to \cs*{usepackage}\oarg{options}\Marg{acro}. ,
+  long = {A load-time \option*{option} is a package option of \acro\ which
+    \emph{must} be set as option to
+    \cs*{usepackage}\oarg{options}\Marg{acro}.} ,
   tag = glossary , no-index
 }
 \DeclareAcronym{template}{
-  long = A template determines how different objects of \acro\ are printed.
+  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. ,
+    acronyms as a whole.} ,
   tag = glossary , no-index
 }
 \DeclareAcronym{articles}{
@@ -216,12 +206,11 @@
   tag = glossary , no-index
 }
 \DeclareAcronym{translations}{
-  long = Localisation strings which can be modified. ,
+  long = {Localisation strings which can be modified.} ,
   tag = glossary , no-index
 }
 
 \newcommand*\issues{\url{https://github.com/cgnieder/acro/issues}}
-
 \newcommand*\latin[1]{\textit{#1}}
 
 \begin{document}
@@ -661,6 +650,13 @@
   \acfp{ufo}
 \end{example}
 
+\begin{bewareofthedog}
+  In a number of contexts all acronym commands act as if their starred form is
+  used: in the table of contents, in the list of figures, and in the list of
+  tables.  The same is true for floats and the measuring phase of common
+  table environments like \env*{tabularx} or \env*{ltxtable}.
+\end{bewareofthedog}
+
 \section{Alternative short forms}\label{sec:altern-short-forms}
 Sometimes expressions have two different short forms. And example might be
 \acs*{jpg} which also often is \aca*{jpg}. This is what the property
@@ -1181,6 +1177,8 @@
 \end{properties}
 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{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.
@@ -1527,6 +1525,13 @@
     Every acronym will be reset.
 \end{commands}
 
+\begin{bewareofthedog}
+  In a number of contexts all acronym commands act as if their starred form is
+  used: in the table of contents, in the list of figures, and in the list of
+  tables.  The same is true for floats and the measuring phase of common
+  table environments like \env*{tabularx} or \env*{ltxtable}.
+\end{bewareofthedog}
+
 \section{Bookmarks, backlinks and accessibility support}\label{sec:pdf-properties}
 \subsection{Backlinks}\label{sec:backlinks}
 When \acro\ is used together with the package
@@ -1881,6 +1886,9 @@
   \command{acroif\TF}[\marg{property}\marg{true}\marg{false}]
     Checks if the property \meta{property} has been set for the current
     acronym and either leaves \meta{true} or \meta{false} in the input stream.
+  \command{acroifboolean\TF}[\marg{property}\marg{true}\marg{false}]
+    \sinceversion{3.1}Returns \meta{true} if the boolean property
+    \meta{property} has been set to \code{true} and \meta{false} otherwise.
   \command{acroifall\TF}[\marg{properties}\marg{true}\marg{false}]
     Checks if all properties in the csv list \meta{properties} have been set
     for the current acronym and either leaves \meta{true} or \meta{false} in

Modified: trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.acflike.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.issue-119.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.issue-119.tex	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.issue-119.tex	2020-05-04 21:24:10 UTC (rev 55016)
@@ -14,7 +14,7 @@
       \immediate\write\acro at list{%
         \space\space
         \item[\acrofield{##1}{short}]
-        \acrofield{##1}{long}%
+        \acrofield{##1}{list}%
         \acrofieldifTF{##1}{extra}{ (\acrofield{##1}{extra})}{}%
       }%
     }{\immediate\write\acro at list{\item}\AcroRerun}%

Modified: trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-505891.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-505891.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-505891.tex	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-505891.tex	2020-05-04 21:24:10 UTC (rev 55016)
@@ -1,6 +1,6 @@
 \documentclass{article}
 
-\usepackage[version=3]{acro}
+\usepackage{acro}
 
 \DeclareAcroProperty{alt2}
 \DeclareAcroProperty{alt2-format}
@@ -12,10 +12,10 @@
     \acronymsmapF{
       \item [%
           \acrowrite{short}%
-          \acroifT{alt}{/\acrowrite{alt}}%
-          \acroifT{alt2}{/\acrowrite{alt2}}%
+          \acroifT{alt}{/}\acrowrite{alt}%
+          \acroifT{alt2}{/}\acrowrite{alt2}%
         ]
-        \acrowrite{long}%
+        \acrowrite{list}%
         \acroifanyT{foreign,extra}{ (}%
         \acroifT{foreign}{%
           \acrowrite{foreign}%
@@ -22,14 +22,12 @@
           \acroifT{foreign-short}{, \acrowrite{foreign-short}}%
           \acroifT{extra}{, }%
         }%
-        \acroifT{extra}{\acrowrite{extra}}%
+        \acrowrite{extra}%
         \acroifanyT{foreign,extra}{)}%
-        \acroifpagesT{%
-          \acropagefill
-          \acropages
-            {\acrotranslate{page}\nobreakspace}%
-            {\acrotranslate{pages}\nobreakspace}%
-        }%
+        \acropagefill
+        \acropages
+          {\acrotranslate{page}\nobreakspace}%
+          {\acrotranslate{pages}\nobreakspace}%
     }
     { \item \AcroRerun }
   \end {description}

Modified: trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-507726.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-507726.tex	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.texsx-507726.tex	2020-05-04 21:24:10 UTC (rev 55016)
@@ -1,18 +1,20 @@
 \documentclass{article}
 \usepackage[english,ngerman]{babel}
 \usepackage{csquotes}
-\usepackage[version=3]{acro}
+\usepackage{acro}
 
 % issue #136
 \DeclareAcroProperty{foreign-short}
 
-\RenewAcroTemplate {long-short}{%
+\RenewAcroTemplate{long-short}{%
   \acroiffirstTF{%
     \acrowrite{long}\acspace
     (%
       \acrowrite{short}%
-      \acroifT{foreign}{, \acrowrite{foreign}}%
-      \acroifT{foreign-short}{, \acrowrite{foreign-short}}%
+      \acroifT{foreign}{, }%
+      \acrowrite{foreign}%
+      \acroifT{foreign-short}{, }%
+      \acrowrite{foreign-short}%
       \acrogroupcite
     )%
   }
@@ -26,14 +28,13 @@
     \acronymsmapF{
       \item [\acrowrite{short}\acroifT{alt}{/\acrowrite{alt}}]
         \acrowrite{long}%
-        \acroifanyT{foreign,extra}{ (}%
-        \acroifT{foreign}{%
-          \acrowrite{foreign}%
-          \acroifT{foreign-short}{, \acrowrite{foreign-short}}%
-          \acroifT{extra}{, }%
-        }%
-        \acroifT{extra}{\acrowrite{extra}}%
-        \acroifanyT{foreign,extra}{)}%
+        \acroifanyT{foreign,extra,foreign-short}{ (}%
+        \acrowrite{foreign}%
+        \acroifallT{foreign-short,foreign}{, }%
+        \acrowrite{foreign-short}%
+        \acroifanyT{foreign-short,foreign}{\acroifT{extra}{, }}%
+        \acrowrite{extra}%
+        \acroifanyT{foreign,extra,foreign-short}{)}%
         \acroifpagesT{%
           \acropagefill
           \acropages

Modified: trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/doc/latex/acro/examples/acro.example.units.tex	2020-05-04 21:24:10 UTC (rev 55016)
@@ -65,10 +65,12 @@
       \acrowrite{unit}%
       &
       \def\AcronymID{##1}%
-      \acrowrite{long}%
+      \acrowrite{list}%
       &
       \def\AcronymID{##1}%
-      \acroifpagesT{\acropages{S. }{S. }}%
+      \acropages
+        {\acrotranslate{page}\nobreakspace}%
+        {\acrotranslate{pages}\nobreakspace}%
       \tabularnewline
     }%
   }%

Modified: trunk/Master/texmf-dist/tex/latex/acro/acro.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/acro/acro.sty	2020-05-04 21:23:55 UTC (rev 55015)
+++ trunk/Master/texmf-dist/tex/latex/acro/acro.sty	2020-05-04 21:24:10 UTC (rev 55016)
@@ -11,33 +11,25 @@
 % 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.3
+% conditions of the LaTeX Project Public License, either version 1.3c
 % 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 2005/12/01 or later.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
 % 
 % This work has the LPPL maintenance status `maintained'.
 % 
 % The Current Maintainer of this work is Clemens Niederberger.
 % --------------------------------------------------------------------------
-% The acro package consists of the files
-% - acro.sty, acro.definitions.tex, acro.cfg
-% - acro-manual.tex, acro-manual.pdf, acro-manual.cls
-% - acro.history, README
-% --------------------------------------------------------------------------
-% If you have any ideas, questions, suggestions or bugs to report, please
-% feel free to contact me.
-% --------------------------------------------------------------------------
 \RequirePackage{expl3,xparse,l3keys2e}
 \ExplSyntaxOn
 
 % setup package:
 \tl_const:Nn \c_acro_package_name_tl {acro}
-\tl_const:Nn \c_acro_date_tl {2020/04/29}
+\tl_const:Nn \c_acro_date_tl {2020/05/04}
 \tl_const:Nn \c_acro_version_major_number_tl {3}
-\tl_const:Nn \c_acro_version_minor_number_tl {0}
+\tl_const:Nn \c_acro_version_minor_number_tl {1}
 \tl_const:Nn \c_acro_version_subrelease_tl   {}
 \tl_const:Nx \c_acro_version_number_tl
   {
@@ -769,6 +761,7 @@
 % commands for list templates
 \NewDocumentCommand \acroheading  {} { \acro_heading: }
 \NewDocumentCommand \acropreamble {} { \acro_preamble: }
+\NewDocumentCommand \acropostamble {} { \acro_postamble: }
 
 \NewExpandableDocumentCommand \acrolistname {}
   { \tl_use:N \l__acro_list_name_tl }
@@ -846,13 +839,26 @@
 \NewDocumentCommand \acrocite {}
   { \bool_set_true:N \l__acro_cite_always_bool }
 
-\NewDocumentCommand \acroifTF {m+m+m}
-  { \acro_property_if_set:enTF { \AcronymID } {#1} {#2} {#3} }
-\NewDocumentCommand \acroifT {m+m}
-  { \acro_property_if_set:enTF { \AcronymID } {#1} {#2} {} }
-\NewDocumentCommand \acroifF {m+m}
-  { \acro_property_if_set:enTF { \AcronymID } {#1} {} {#2} }
+\NewExpandableDocumentCommand \acroifbooleanTF {m}
+  { \acro_boolean_property_if:enTF { \AcronymID } {#1} }
 
+\NewExpandableDocumentCommand \acroifbooleanT {m}
+  { \acro_boolean_property_if:enT { \AcronymID } {#1} }
+
+\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} }
+
 \NewDocumentCommand \acroifanyTF {m+m+m}
   { \acro_property_if_any:enTF { \AcronymID } {#1} {#2} {#3} }
 \NewDocumentCommand \acroifanyT {m+m}
@@ -1317,8 +1323,7 @@
       }
       { \prg_return_false: }
   }
-\cs_generate_variant:Nn \acro_boolean_property_if:nnTF {oo}
-\cs_generate_variant:Nn \acro_boolean_property_if:nnF  {nV}
+\prg_generate_conditional_variant:Nnn \acro_boolean_property_if:nn {nV,oo,e} {T,F,TF}
 
 % ----------------------------------------------------------------------------
 % set properties:
@@ -1567,33 +1572,6 @@
 
 % ----------------------------------------------------------------------------
 \AcroModuleEnd
-% ----------------------------------------------------------------------------
-% the ACRO package - acronyms module
-% 
-%   Typeset Acronyms
-% 
-% --------------------------------------------------------------------------
-% Clemens Niederberger
-% Web:    https://github.com/cgnieder/acro/
-% E-Mail: contact at 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.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 2005/12/01 or later.
-% 
-% This work has the LPPL maintenance status `maintained'.
-% 
-% The Current Maintainer of this work is Clemens Niederberger.
-% --------------------------------------------------------------------------
-% If you have any ideas, questions, suggestions or bugs to report, please
-% feel free to contact me.
-% --------------------------------------------------------------------------
 \AcroModule{acronyms}{define acronyms}
 
 % --------------------------------------------------------------------------
@@ -1860,8 +1838,7 @@
 % --------------------------------------------------------------------------
 \AcroModuleEnd
 \AcroModule{formatting}{formatting of acronyms}
-% --------------------------------------------------------------------------
-% formatting:
+
 \bool_new:N \l__acro_format_replace_bool
 
 % sets the format from the global option:
@@ -1880,8 +1857,26 @@
 % #1: property
 \cs_new:Npn \__acro_use_global_format:n #1
   {
-    \tl_if_exist:cT {l__acro_format_ #1 _tl}
-      { \tl_use:c {l__acro_format_ #1 _tl} }
+    \tl_if_exist:cTF {l__acro_format_ #1 _tl}
+      {
+        \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 }
+      }
   }
 
 % #1: id
@@ -1918,7 +1913,7 @@
 % #1: id
 % #1: property
 \cs_new:Npn \__acro_property_format:nn #1#2
-  { \__acro_property_format:nnF {#1} {#2} {} }
+  { \__acro_property_format:nnF {#1} {#2} { \use:n } }
 
 % sets the individual format:
 % #1: id
@@ -1931,13 +1926,13 @@
         {
           \__acro_property_format:nnF {#1} {#2}
             { \__acro_global_format:n {#2} }
-          {#3}
+          { \__acro_pdf_comment:nnn {#1} {#2} {#3} }
         }
         {
           \__acro_global_format:n {#2}
             {
               \__acro_property_format:nn {#1} {#2}
-              {#3}
+              { \__acro_pdf_comment:nnn {#1} {#2} {#3} }
             }
         }
     }
@@ -1944,6 +1939,22 @@
   }
 \cs_generate_variant:Nn \acro_format:nnn {e}
 
+\cs_new:Npn \acro_index_format:nnn #1#2#3
+  {
+    {
+      \bool_if:NTF \l__acro_format_replace_bool
+        {
+          \__acro_property_format:nnF {#1} {#2}
+            { \__acro_global_format:n {#2} }
+          {#3}
+        }
+        {
+          \__acro_global_format:n {#2}
+            { \__acro_property_format:nn {#1} {#2} {#3} }
+        }
+    }
+  }
+
 % #1: property:
 \cs_new_protected:Npn \acro_new_format:n #1
   {
@@ -1950,8 +1961,7 @@
     \tl_new:c {l__acro_format_#1_tl}
     \keys_define:nn {acro/format}
       {
-        #1 .tl_set:c  = l__acro_format_#1_tl ,
-        #1 .initial:n =
+        #1 .tl_set:c  = l__acro_format_#1_tl
       }
   }
 
@@ -2410,7 +2420,7 @@
               \__acro_index:e
                 {
                   \acro_property_get:nn {#1} {index-sort} @
-                  \acro_format:nnn
+                  \acro_index_format:nnn
                     {#1}
                     {short}
                     { \acro_property_get:nn {#1} {short} }
@@ -2879,7 +2889,7 @@
     \acro_property_if_exist:nTF {#2-acc}
       {
         \__acro_accsupp:ee
-          { \__acro_write_acronym:nn {#1} {#2-acc} }
+          { \__acro_write_acronym_acc:nn {#1} {#2-acc} }
           { \__acro_write_acronym:nn {#1} {#2} }
       }
       { \__acro_write_acronym:nn {#1} {#2} }
@@ -2907,6 +2917,19 @@
 
 % #1: id
 % #2: property
+\cs_new:Npn \__acro_write_acronym_acc:nn #1#2
+  {
+    \__acro_upper:n
+      {
+        \__acro_article:nn {#1} {#2}
+        \acro_if_ending_form:nnTF {#1} {#2}
+          { \acro_ending_form:nn {#1} {#2} }
+          { \acro_property_get:nn {#1} {#2} }
+      }
+  }
+
+% #1: id
+% #2: property
 \cs_new_protected:Npn \acro_write:nn #1#2
   {
     \group_begin:
@@ -3010,7 +3033,6 @@
               \l__acro_begin_command_hook_tl
               \cs_set:Npn \nospace { \exp:w \exp_end_continue_f:w }
               \acro_check_definition:n {####1}
-              \bool_set_true:N \l__acro_use_bool
               \keys_set:nV {acro} \l__acro_options_tl
               \tl_set:Ne \AcronymID { \acro_case_insensitive:n {####1} }
               \tl_set:Ne \l_acro_id_tl { \acro_case_insensitive:n {####1} }
@@ -3196,13 +3218,12 @@
 \cs_new_protected:Npn \acro_template_use:nnn #1#2#3
   {
     \bool_set_false:N \l__acro_tmpa_bool
-    \bool_if:NT \l__acro_use_only_first_bool
+    \bool_lazy_and:nnT
+      { \l__acro_use_only_first_bool }
+      { \l__acro_use_bool }
       {
-        \bool_if:NT \l__acro_use_bool
-          {
-            \bool_set_true:N \l__acro_tmpa_bool
-            \bool_set_false:N \l__acro_use_bool
-          }
+        \bool_set_true:N \l__acro_tmpa_bool
+        \bool_set_false:N \l__acro_use_bool
       }
     \str_case:nnF {#3}
       {
@@ -3356,8 +3377,7 @@
 % ----------------------------------------------------------------------------
 \AcroModuleEnd
 \AcroModule{list}{the list of acronyms}
-% --------------------------------------------------------------------------
-% list of acronyms:
+
 \bool_new:N \l__acro_list_display_all_bool
 \bool_new:N \l__acro_list_bool
 \bool_new:N \l__acro_list_local_bool
@@ -3481,6 +3501,7 @@
 % --------------------------------------------------------------------------
 \tl_new:N \l__acro_heading_tl
 \tl_new:N \l__acro_preamble_tl
+\tl_new:N \l__acro_postamble_tl
 
 \cs_new_protected:Npn \acro_heading:
   { \acro_template_use:nnV {0} {heading} \l__acro_heading_tl }
@@ -3488,6 +3509,9 @@
 \cs_new_protected:Npn \acro_preamble:
   { \tl_use:N \l__acro_preamble_tl }
 
+\cs_new_protected:Npn \acro_postamble:
+  { \tl_use:N \l__acro_postamble_tl }
+
 \tl_new:N \l__acro_list_name_tl
 
 % --------------------------------------------------------------------------
@@ -3507,6 +3531,8 @@
     heading      .tl_set:N  = \l__acro_heading_tl ,
     preamble     .tl_set:N  = \l__acro_preamble_tl ,
     preamble     .initial:n = ,
+    postamble    .tl_set:N  = \l__acro_postamble_tl ,
+    postamble    .initial:n = ,
     name         .tl_set:N  = \l__acro_list_name_tl ,
     name         .initial:n = \acro_translate:n {list-name}
   }
@@ -3826,15 +3852,33 @@
   { 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
+\prg_new_conditional:Npnn \acro_if_foreign:n #1 {p,T,F,TF}
+  {
+    \str_if_eq:nnTF {#1} {foreign}
+      { \prg_return_true: }
+      { \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}
   {
-    \str_if_eq:nnTF {#2} {foreign}
+    \acro_if_foreign:nTF {#2}
       {
         \bool_lazy_or:nnTF
           { \acro_property_if_set_p:nn {#1} {foreign-babel} }
@@ -3850,33 +3894,38 @@
 % #3: text
 \cs_new_protected:Npn \acro_locale:nnn #1#2#3
   {
-    \acro_if_locale:nnTF {#1} {#2}
+    \acro_if_foreign:nTF {#2}
       {
-        \__acro_foreign_language:en
-          { \str_lowercase:e { \acro_property_get:nn {#1} {foreign-babel} } }
+        \bool_if:NT \l__acro_show_foreign_bool
           {
-            \bool_lazy_or:nnT
-              { \l__acro_show_locale_bool }
+            \acro_if_locale:nnTF {#1} {#2}
               {
-                \bool_lazy_and_p:nn
-                  { \l__acro_list_bool }
-                  { \l__acro_list_show_locale_bool }
-              }
-              {
-                {
-                  \l__acro_locale_format_tl
+                \bool_lazy_or:nnT
+                  { \l__acro_show_locale_bool }
+                  {
+                    \bool_lazy_and_p:nn
+                      { \l__acro_list_bool }
+                      { \l__acro_list_show_locale_bool }
+                  }
+                  {
                     {
-                      \acro_property_if_set:nnTF {#1} {foreign-locale}
-                        { \acro_property_get:nn {#1} {foreign-locale} }
+                      \l__acro_locale_format_tl
                         {
-                           \baselanguage
-                             { \acro_property_get:nn {#1} {foreign-babel} }
+                          \acro_property_if_set:nnTF {#1} {foreign-locale}
+                            { \acro_property_get:nn {#1} {foreign-locale} }
+                            {
+                               \baselanguage
+                                 { \acro_property_get:nn {#1} {foreign-babel} }
+                            }
                         }
                     }
-                }
-                :~
+                    :~
+                  }
+                \__acro_foreign_language:en
+                  { \str_lowercase:e { \acro_property_get:nn {#1} {foreign-babel} } }
+                  {#3}
               }
-            #3
+              {#3}
           }
       }
       {#3}
@@ -3906,6 +3955,12 @@
     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
@@ -4216,7 +4271,7 @@
 % #1: id
 % #2: property
 % #3: text
-\cs_new_protected:Npn \__acro_pdf_comment:nnn #1#2#3
+\cs_new:Npn \__acro_pdf_comment:nnn #1#2#3
   {
     \bool_lazy_all:nTF
       {
@@ -4225,7 +4280,7 @@
         { \acro_if_short_p:n {#2} }
       }
       {
-        \__acro_pdf_comment_cmd:nn
+        \__acro_pdf_comment_cmd:ee
           {#3}
           { \acro_property_get:nn {#1} {pdfcomment} }
       }
@@ -4232,11 +4287,14 @@
       {#3}
   }
 
+\cs_new:Npn \__acro_pdf_comment_cmd:nn #1#2 {#1}
+\cs_generate_variant:Nn \__acro_pdf_comment_cmd:nn {ee}
+
 \keys_define:nn {acro/pdfcomments}
   {
     use .bool_set:N = \l__acro_pdfcomment_use_bool ,
     use .initial:n = false ,
-    cmd .cs_set:Np = \__acro_pdf_comment_cmd:nn #1#2 ,
+    cmd .cs_set_protected:Np = \__acro_pdf_comment_cmd:nn #1#2 ,
     cmd .initial:n = \pdftooltip {#1} {#2}
   }
 
@@ -4644,6 +4702,50 @@
 
 % ----------------------------------------------------------------------------
 \AcroModuleEnd
+\AcroModule{patch}{patch other code}
+
+\msg_new:nnn {acro} {patch}
+  { Patching~ `#1'~ failed.~ Please~ contact~ the~ acro~ author. }
+
+\AtEndPreamble
+  {
+    % floats:
+    \apptocmd \@floatboxreset
+      { \acswitchoff }
+      {}
+      { \msg_error:nnn {acro} {patch} {floats} }
+    % tables:
+    % * tabularx
+    \cs_if_exist:NT \TX at trial
+      {
+        \patchcmd \TX at trial
+          { \let\hbadness\@tempcnta }
+          { \acswitchoff\let\hbadness\@tempcnta }
+          {}
+          { \msg_error:nnn {acro} {patch} {tabularx} }
+      }
+    % * ltxtable
+    \cs_if_exist:NT \LTXtable
+      {
+        \patchcmd \LTXtable
+          { \input }
+          { \acswitchoff\input }
+          {}
+          { \msg_error:nnn {acro} {patch} {ltxtable} }
+      }
+    % * tabu
+    \cs_if_exist:NT \tabuDisableCommands
+      { \tabuDisableCommands { \acswitchoff } }
+    % contents lists:
+    \addtocontents {toc} { \acswitchoff }
+    \addtocontents {lof} { \acswitchoff }
+    \addtocontents {lot} { \acswitchoff }
+    % caption package:
+    \cs_if_exist:NT \caption at prepareslc
+      { \tl_gput_right:Nn \caption at prepareslc { \acswitchoff } }
+  }
+
+\AcroModuleEnd
 \AcroModule{definitions}{definitions of user commands}
 
 % --------------------------------------------------------------------------
@@ -4835,16 +4937,12 @@
     \begin {description}
       \acronymsmapF
         {
-          \item [ \acrowrite {short} \acroifT {alt} { / \acrowrite {alt} } ]
+          \item [ \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} ]
             \acrowrite {list}
             \acroifanyT {foreign,extra} {~(}
-            \acroifT {foreign}
-              {
-                \acrowrite {foreign}
-                \acroifT {extra} {,~}
-              }
-            \acroifT {extra}
-              { \acrowrite {extra} }
+            \acrowrite {foreign}
+            \acroifallT {foreign,extra} {,~}
+            \acrowrite {extra}
             \acroifanyT {foreign,extra} {)}
             \acropagefill
             \acropages
@@ -4863,17 +4961,13 @@
         \AcroAddRow
           {
             \acrowrite {short}
-            \acroifT {alt} { / \acrowrite {alt} }
+            \acroifT {alt} { / } \acrowrite {alt}
             &
             \acrowrite {list}
             \acroifanyT {foreign,extra} {~(}
-            \acroifT {foreign}
-              {
-                \acrowrite {foreign}
-                \acroifT {extra} {,~}
-              }
-            \acroifT {extra}
-              { \acrowrite {extra} }
+            \acrowrite {foreign}
+            \acroifallT {foreign,extra} {,~}
+            \acrowrite {extra}
             \acroifanyT {foreign,extra} {)}
             \acropagefill
             \acropages
@@ -4900,17 +4994,13 @@
         \AcroAddRow
           {
             \acrowrite {short}
-            \acroifT {alt} { / \acrowrite {alt} }
+            \acroifT {alt} { / } \acrowrite {alt}
             &
             \acrowrite {list}
             \acroifanyT {foreign,extra} {~(}
-            \acroifT {foreign}
-              {
-                \acrowrite {foreign}
-                \acroifT {extra} {,~}
-              }
-            \acroifT {extra}
-              { \acrowrite {extra} }
+            \acrowrite {foreign}
+            \acroifallT {foreign,extra} {,~}
+            \acrowrite {extra}
             \acroifanyT {foreign,extra} {)}
             \acropagefill
             \acropages
@@ -4938,17 +5028,13 @@
         \AcroAddRow
           {
             \acrowrite {short}
-            \acroifT {alt} { / \acrowrite {alt} }
+            \acroifT {alt} { / } \acrowrite {alt}
             &
             \acrowrite {list}
             \acroifanyT {foreign,extra} {~(}
-            \acroifT {foreign}
-              {
-                \acrowrite {foreign}
-                \acroifT {extra} {,~}
-              }
-            \acroifT {extra}
-              { \acrowrite {extra} }
+            \acrowrite {foreign}
+            \acroifallT {foreign,extra} {,~}
+            \acrowrite {extra}
             \acroifanyT {foreign,extra} {)}
             \acropagefill
             \acropages
@@ -4977,12 +5063,13 @@
         \contentsline {acro}
           {
             \numberline
-              { \acrowrite {short} \acroifT {alt} { / \acrowrite {alt} } }
+              { \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} }
               {
                 \acrowrite {list}
-                \acroifT {foreign}
-                  { \acrowrite {foreign} \acroifT {extra} {,~} }
-                \acroifT {extra} { \acrowrite {extra} }
+                \acroifanyT {foreign,extra} {~(}
+                \acrowrite {foreign}
+                \acroifallT {foreign,extra} {,~}
+                \acrowrite {extra}
                 \acroifanyT {foreign,extra} {)}
               }
           }
@@ -5000,15 +5087,16 @@
     \acronymsmapF
       {
         \contentsline { \acroifchapterTF {chapter} {section} }
-          { \acrowrite {short} \acroifT {alt} { / \acrowrite {alt} } }
+          { \acrowrite {short} \acroifT {alt} { / } \acrowrite {alt} }
           {}{}
         \contentsline { \acroifchapterF {sub} section }
           {
             \acrowrite {list}
-            \acroifT {foreign}
-              { \acrowrite {foreign} \acroifT {extra} {,~} }
-            \acroifT {extra} { \acrowrite {extra} }
-            \acroifanyT {foreign,extra} {) }
+            \acroifanyT {foreign,extra} {~(}
+            \acrowrite {foreign}
+            \acroifallT {foreign,extra} {,~}
+            \acrowrite {extra}
+            \acroifanyT {foreign,extra} {)}
           }
           { \acropages {} {} }
           {}
@@ -5357,7 +5445,8 @@
       \acro_deprecate_option:nn {use-only-first} {true} ,
     sort .code:n =
       \acro_deprecate_option:nn {list/sort} {true} ,
-    display-foreign .code:n = \acro_remove_option: ,
+    display-foreign .code:n =
+      \acro_deprecate_option:nn {foreign/display} {#1} ,
     cite .code:n =
       \acro_deprecate_option:nn {cite/display} {#1} ,
     cite-cmd .code:n =



More information about the tex-live-commits mailing list.