texlive[56884] Master/texmf-dist: acro (8nov20)

commits+karl at tug.org commits+karl at tug.org
Sun Nov 8 22:40:47 CET 2020


Revision: 56884
          http://tug.org/svn/texlive?view=revision&revision=56884
Author:   karl
Date:     2020-11-08 22:40:47 +0100 (Sun, 08 Nov 2020)
Log Message:
-----------
acro (8nov20)

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/tex/latex/acro/acro.sty
    trunk/Master/texmf-dist/tex/latex/acro/acro2.sty

Modified: trunk/Master/texmf-dist/doc/latex/acro/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acro/README	2020-11-08 21:40:29 UTC (rev 56883)
+++ trunk/Master/texmf-dist/doc/latex/acro/README	2020-11-08 21:40:47 UTC (rev 56884)
@@ -1,5 +1,5 @@
 --------------------------------------------------------------------------
-the ACRO package v3.2 2020/05/10
+the ACRO package v3.2a 2020/11/08
 
   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-11-08 21:40:29 UTC (rev 56883)
+++ trunk/Master/texmf-dist/doc/latex/acro/acro-manual.tex	2020-11-08 21:40:47 UTC (rev 56884)
@@ -641,7 +641,7 @@
     long-indefinite = an
   }
 \end{sourcecode}
-Then typical outputs look like this:
+The typical outputs look like this:
 \begin{example}
   \ac{ufo} \\
   \iac{ufo} \\
@@ -1724,6 +1724,44 @@
   \label{tab:translations}
 \end{table}
 
+\section{Patches}\label{sec:patches}
+In several situations it can lead to wrong results if \acro\ marks an acronym
+as used too early or at all.  This is why it is possible to disable the
+mechanism which is responsible:
+\begin{commands}
+  \command{acswitchoff}
+    This disables the mechanism which marks acronyms as used. After this
+    command every acronym command like \cs{ac} acts like its starred version.
+  \command{acswitchon}
+    This command enables the mechanism again.
+\end{commands}
+
+In certain circumstances \acro\ uses these commands itself. For example it is
+often preferable that acronyms are not counted as used in floats, the table of
+contents or the lists of figures and tables.  This is why \acro\ turns the
+mechanism off in these places.
+
+Certain table environments typeset their contents twice for measurement
+purposes.  \acro\ tries to disable the usage mechanism during these phases.
+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}
+    En-/disable the \option{floats} patch.
+  \keybool{lists}\Module{patch}\Default{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}
+    En-/disable the \option{tabularx} patch.
+  \keybool{ltxtable}\Module{patch}\Default{true}
+    En-/disable the \option{ltxtable} patch.
+  \keybool{tabu}\Module{patch}\Default{true}
+    En-/disable the \option{tabu} patch.
+  \keybool{caption}\Module{patch}\Default{true}
+    En-/disable the \option{caption} patch.
+\end{options}
+
 \part{Extending \acro}\label{part:extending-acro}
 \section{Background}\label{sec:background}
 \subsection{Templates}

Modified: trunk/Master/texmf-dist/tex/latex/acro/acro.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/acro/acro.sty	2020-11-08 21:40:29 UTC (rev 56883)
+++ trunk/Master/texmf-dist/tex/latex/acro/acro.sty	2020-11-08 21:40:47 UTC (rev 56884)
@@ -27,10 +27,10 @@
 
 % setup package:
 \tl_const:Nn \c_acro_package_name_tl {acro}
-\tl_const:Nn \c_acro_date_tl {2020/05/10}
+\tl_const:Nn \c_acro_date_tl {2020/11/08}
 \tl_const:Nn \c_acro_version_major_number_tl {3}
 \tl_const:Nn \c_acro_version_minor_number_tl {2}
-\tl_const:Nn \c_acro_version_subrelease_tl   {}
+\tl_const:Nn \c_acro_version_subrelease_tl   {a}
 \tl_const:Nx \c_acro_version_number_tl
   {
     \c_acro_version_major_number_tl .
@@ -295,7 +295,7 @@
 
 \cs_new_protected:Npn \__acro_module_load:n #1
   {
-    \acro_if_module_loaded:nF {#1}
+    \acro_module_if_loaded:nF {#1}
       {
         \acro_module_if_exist:nTF {#1}
           {
@@ -311,7 +311,7 @@
   }
 \cs_generate_variant:Nn \__acro_module_load:n {V}
 
-\prg_new_conditional:Npnn \acro_if_module_loaded:n #1 {p,T,F,TF}
+\prg_new_conditional:Npnn \acro_module_if_loaded:n #1 {p,T,F,TF}
   {
     \tl_if_in:NnTF \g__acro_modules_loaded_tl {#1}
       { \prg_return_true: }
@@ -332,7 +332,7 @@
 % #2: code
 \cs_new_protected:Npn \acro_module_after:nn #1#2
   {
-    \acro_if_module_loaded:nTF {#1}
+    \acro_module_if_loaded:nTF {#1}
       {#2}
       { \__acro_add_to_module_hook:nnn {#1} {after} {#2} }
   }
@@ -342,7 +342,7 @@
 \cs_new_protected:Npn \acro_module_before:nn #1#2
   {
     % TODO: error in T case?
-    \acro_if_module_loaded:nF {#1}
+    \acro_module_if_loaded:nF {#1}
       { \__acro_add_to_module_hook:nnn {#1} {before} {#2} }
   }
 
@@ -351,7 +351,7 @@
 % #3: code
 \cs_new_protected:Npn \__acro_add_to_module_hook:nnn #1#2#3
   {
-    \acro_if_module_loaded:nF {#1}
+    \acro_module_if_loaded:nF {#1}
       {
         \tl_if_exist:cF {g__acro_module_hook_#1_#2_tl}
           { \tl_new:c {g__acro_module_hook_#1_#2_tl} }
@@ -1857,7 +1857,7 @@
   }
 
 \cs_new_protected:Npn \acro_use:n #1
-  { \clist_map_inline:nn {#1} { \__acro_use:n {#1} } }
+  { \clist_map_inline:nn {#1} { \__acro_use:n {##1} } }
 \cs_generate_variant:Nn \acro_use:n {e}
 
 \cs_new_protected:Npn \acro_use_all:
@@ -1866,10 +1866,10 @@
 \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} }
+    % \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} }
   }
 
 \cs_new_protected:Npn \acro_reset:n #1
@@ -2748,6 +2748,7 @@
           { \g_acro_barrier_int }
       }
   }
+\cs_generate_variant:Nn \acro_barrier_usage:n {V}
 
 % #1: id
 \cs_new_protected:Npn \acro_set_barriers:n #1
@@ -2940,8 +2941,11 @@
 
 % #1: id
 % #2: property
-\cs_new:Npn \__acro_write_acronym:nn #1#2
+\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 }
     \bool_lazy_and:nnTF
       { \acro_property_if_eq_p:nn {#2} {long} }
       { \acro_if_first_p:n {#1} }
@@ -2950,7 +2954,6 @@
       {
         \__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} }
@@ -3020,7 +3023,7 @@
     \bool_if:NF \g__acro_cited_bool
       { \acro_cite_if:nnT {#1} {#2} { \acro_cite:n {#2} } }
     \bool_gset_false:N \g__acro_cited_bool
-    \acro_property_if_set:nnT {#1} {post}
+    \acro_property_if_set:nnT {#2} {post}
       { \acro_property_get:nn {#2} {post} }
     \bool_lazy_all:nT
       {
@@ -3406,8 +3409,8 @@
   {
     \__acro_template_add:nnn {list} {#1}
       {
+        \tl_clear_new:N \AcronymTable
         \__acro_template_start:nn {list} {#1}
-        \tl_clear_new:N \AcronymTable
         #2
         \__acro_template_stop:nn {list} {#1}
       }
@@ -4728,42 +4731,89 @@
 \msg_new:nnn {acro} {patch}
   { Patching~ `#1'~ failed.~ Please~ contact~ the~ acro~ author. }
 
+\cs_new_protected:Npn \acro_new_patch:n #1
+  {
+    \bool_new:c {l__acro_patch_#1_bool}
+    \keys_define:nn
+      {acro}
+      {
+        patch / #1 .bool_set:c = {l__acro_patch_#1_bool} ,
+        patch / #1 .initial:n  = true
+      }
+  }
+
+\prg_new_conditional:Npnn \acro_if_patch:n #1 {T,F,TF}
+  {
+    \cs_if_exist:cTF {l__acro_patch_#1_bool}
+      {
+        \bool_if:cTF {l__acro_patch_#1_bool}
+          { \prg_return_true: }
+          { \prg_return_false: }
+      }
+      { \prg_return_false: }
+  }
+
+\acro_new_patch:n {floats}
+\acro_new_patch:n {lists}
+\acro_new_patch:n {tabularx}
+\acro_new_patch:n {tabu}
+\acro_new_patch:n {ltxtable}
+\acro_new_patch:n {caption}
+
 \AtEndPreamble
   {
     % floats:
-    \apptocmd \@floatboxreset
-      { \acswitchoff }
-      {}
-      { \msg_error:nnn {acro} {patch} {floats} }
+    \acro_if_patch:nT {floats}
+      {
+        \apptocmd \@floatboxreset
+          { \acswitchoff }
+          {}
+          { \msg_error:nnn {acro} {patch} {floats} }
+      }
     % tables:
     % * tabularx
-    \cs_if_exist:NT \TX at trial
+    \acro_if_patch:nT {tabularx}
       {
-        \patchcmd \TX at trial
-          { \let\hbadness\@tempcnta }
-          { \acswitchoff\let\hbadness\@tempcnta }
-          {}
-          { \msg_error:nnn {acro} {patch} {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
+    \acro_if_patch:nT {ltxtable}
       {
-        \patchcmd \LTXtable
-          { \input }
-          { \acswitchoff\input }
-          {}
-          { \msg_error:nnn {acro} {patch} {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 } }
+    \acro_if_patch:nT {tabu}
+      {
+        \cs_if_exist:NT \tabuDisableCommands
+          { \tabuDisableCommands { \acswitchoff } }
+      }
     % contents lists:
-    \addtocontents {toc} { \acswitchoff }
-    \addtocontents {lof} { \acswitchoff }
-    \addtocontents {lot} { \acswitchoff }
+    \acro_if_patch:nT {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 } }
+    \acro_if_patch:nT {caption}
+      {
+        \cs_if_exist:NT \caption at prepareslc
+          { \tl_gput_right:Nn \caption at prepareslc { \acswitchoff } }
+      }
   }
 
 \AcroModuleEnd
@@ -4895,7 +4945,11 @@
   }
 
 \NewAcroTemplate {long}
-  { \acrowrite {long} }
+  {
+    \acroifTF {single}
+      { \acrowrite {single} }
+      { \acrowrite {long} }
+  }
 
 \NewAcroTemplate {short}
   { \acrowrite {short} }

Modified: trunk/Master/texmf-dist/tex/latex/acro/acro2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/acro/acro2.sty	2020-11-08 21:40:29 UTC (rev 56883)
+++ trunk/Master/texmf-dist/tex/latex/acro/acro2.sty	2020-11-08 21:40:47 UTC (rev 56884)
@@ -2482,6 +2482,8 @@
 \cs_new_protected:Npn \acro at pages #1#2
   { \tl_gset:cn {g__acro_#1_recorded_pages_tl} {#2} }
 
+\bool_new:N \g__acro_rerun_bool
+  
 \cs_new_protected:Npn \acro at rerun@check
   {
     \bool_if:NT \g__acro_rerun_bool



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