texlive[73491] Master/texmf-dist: acronym (17jan25)

commits+karl at tug.org commits+karl at tug.org
Fri Jan 17 21:20:14 CET 2025


Revision: 73491
          https://tug.org/svn/texlive?view=revision&revision=73491
Author:   karl
Date:     2025-01-17 21:20:14 +0100 (Fri, 17 Jan 2025)
Log Message:
-----------
acronym (17jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/acronym/CHANGES
    trunk/Master/texmf-dist/doc/latex/acronym/acronym.pdf
    trunk/Master/texmf-dist/doc/latex/acronym/acrotest.tex
    trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx
    trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty

Modified: trunk/Master/texmf-dist/doc/latex/acronym/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acronym/CHANGES	2025-01-17 20:20:04 UTC (rev 73490)
+++ trunk/Master/texmf-dist/doc/latex/acronym/CHANGES	2025-01-17 20:20:14 UTC (rev 73491)
@@ -1,3 +1,10 @@
+Version 1.50 (Jan 2025)
+- Adds error option
+-- Theo von Arx
+
+- Fixes label regression #60
+-- Tobi with lots of help
+
 Version 1.49 (Mar 2024)
 
 - Adds noforwardlinks option
@@ -29,7 +36,7 @@
 
 -  Fixed hyperref regression and the longstanding "missing aux" bug.
 -- Marcus Meeßen
- 
+
 Version 1.44 (Feb 2020)
 
 - added the |printonlyreused| option, which allows to automatically exclude acronyms from the list of acronyms if they are used only once
@@ -59,7 +66,7 @@
  * Now it is possible to forbid a line break between the full name and the short name (when they are printed together). It is possible to control it individually (for each command), and also globally (with the |nolinebreak| option).
  * Added the \Ac{p,f,fp,l,lp,lu} commands. They work exactly the same way as the \ac commands, but prints the full name, starting with an upper case letter (in case it was defined with a lower case letter).
 
-correting issue with long lines due to carriage return misplaced -- Philippe Chauvat 
+correting issue with long lines due to carriage return misplaced -- Philippe Chauvat
 
 Version 1.41 (Mar 2015)
 
@@ -81,7 +88,7 @@
 Version 1.38 (Oct 2012)
 
 add support for dynamic indefinite articles depending on the acronym form used
--- Ash Hughes 
+-- Ash Hughes
 
 fix for non hyphenation of first word in long form
 -- Martin Rüßler
@@ -138,7 +145,7 @@
 Version 1.25 (November 2005) properly handle acronyms in pdfbookmarks
 -- Heiko Oberdiek <oberdiek there uni-freiburg.de>
 
-Version 1.24 (October 2005) ac* commands are now not fragile anymore ... 
+Version 1.24 (October 2005) ac* commands are now not fragile anymore ...
 -- José Emilio Vila Forcén jose.vila there cui.unige.ch
 
 Version 1.23 (October 2005) fixed typo in nolist option. added comment about fragility of ac commands.
@@ -145,7 +152,7 @@
 -- Tobias Oetiker (tobi with oetiker.ch)
 
 Version 1.22 (October 2005) added starred versions of ac(p), acf(p), acs(p),
-acl(p), acfi, acsu & aclu 
+acl(p), acfi, acsu & aclu
 -- Stefan Pinnow (Mo-Gul here gmx.net)
 
 Version 1.21 (September 2005): fixed the  \acused command again ... broke it
@@ -212,8 +219,8 @@
 in front matter and addition of \cmd{\acroextra} command.
 -- Danie Els <dnjels there sun.ac.za>
 
-Version 1.9 (October 2003): Fix hyperref processing to work regardles 
-of calling order. 'printused' now prints every acronym used not only 
+Version 1.9 (October 2003): Fix hyperref processing to work regardles
+of calling order. 'printused' now prints every acronym used not only
 the ones called through \ac.
 -- Danie Els <dnjels there sun.ac.za> and Tobi Oetiker
 
@@ -223,12 +230,12 @@
 -- Martin Salois <Martin.Salois there drdc-rddc.gc.ca>
 
 Version 1.7 (September 2003): Added \acresetall for resetting the 'used'-tag
-of \ac. With the new option 'printonlyused', the acronym-list will consist of 
-the used acronyms only and not of all defined acronyms; Optional in a special 
+of \ac. With the new option 'printonlyused', the acronym-list will consist of
+the used acronyms only and not of all defined acronyms; Optional in a special
 deflist - environment.
 -- Sebastian Max <smx there comnets.rwth-aachen.de>
 
-Version 1.6 (May 2000): Added the smaller option and the macros \acsfont, 
+Version 1.6 (May 2000): Added the smaller option and the macros \acsfont,
 \acffont, and \acfsfont used to control the appearance of  \acs and \acf.
 -- Ingo Lepper <lepper there math.uni-muenster.de>
 

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

Modified: trunk/Master/texmf-dist/doc/latex/acronym/acrotest.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/acronym/acrotest.tex	2025-01-17 20:20:04 UTC (rev 73490)
+++ trunk/Master/texmf-dist/doc/latex/acronym/acrotest.tex	2025-01-17 20:20:14 UTC (rev 73491)
@@ -25,6 +25,7 @@
 %%
 \documentclass{article}
 \usepackage[colorlinks]{hyperref}
+\usepackage{amsmath}
 \usepackage[printonlyused,withpage]{acronym}
 \begin{document}
 
@@ -59,7 +60,7 @@
 One mol consists of \acs{NA} atoms or molecules. There is a relation
 between the constant of Boltzmann and the \acl{NA}:
 \begin{equation}
-  k = R/\acs{NA}
+  k = R/\acs{NA}\label{my:eq}
 \end{equation}
 
 \acl{lox}/\acl{lh2} (\acsu{lox}/\acsu{lh2})
@@ -68,7 +69,7 @@
 and final states are different. An example for \iac{LFVP} is
 neutrinoless double beta decay.
 
-\subsection{Some testing fundamentals}
+\subsection{Some testing \acp{IC} fundamentals}
 When testing \acp{IC}, one typically wants to identify functional
 blocks to be tested separately. The latter are commonly indicated as
 \acp{BUT}. To test a \ac{BUT} requires defining a testing strategy\dots{}

Modified: trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx	2025-01-17 20:20:04 UTC (rev 73490)
+++ trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx	2025-01-17 20:20:14 UTC (rev 73491)
@@ -2,7 +2,7 @@
 %
 % Doc-Source file to use with LaTeX2e
 %
-% Copyright 1994-2024 by Tobias Oetiker (tobi at oetiker.ch) and many Contributors.
+% Copyright 1994-2025 by Tobias Oetiker (tobi at oetiker.ch) and many Contributors.
 % All rights reserved.
 %
 % This work may be distributed and/or modified under the conditions of
@@ -35,7 +35,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1634}
+% \CheckSum{1664}
 %
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -73,7 +73,7 @@
 % \DoNotIndex{\makelabel, \mathrm}
 % \DoNotIndex{\NeedsTeXFormat, \newcommand, \newenvironment,
 %             \newif, \newtoks, \noexpand, \nolinebreak, \null}
-% \DoNotIndex{\PackageWarning, \ProcessOptions, \protect,
+% \DoNotIndex{\PackageWarning, \PackageError, \ProcessOptions, \protect,
 %             \protected at write, \providecommand, \ProvidesPackage}
 % \DoNotIndex{\raggedright, \ref, \relax, \renewcommand,
 %             \RequirePackage}
@@ -82,6 +82,7 @@
 % \DoNotIndex{\textbf, \textsf, \textsmaller, \textsuperscript, \the}
 % \DoNotIndex{\usepackage}
 %
+%  \changes{v1.50}{2025/01/16}{Theo von Arx adds the option 'error' to throw errors upon undefined acronyms, Tobi integrates patches for issue/60 ltx and amsmath}
 %  \changes{v1.49}{2024/03/30}{Chris Landis adds noforwardlinks option and fixes targets for forward links to acs/acl/etc.-only use}
 %  \changes{v1.48}{2021/10/09}{Bruno Le Floch corrected capitalization of acronyms with a custom plural form.}
 %  \changes{v1.47}{2020/04/10}{Tobi Oetiker and Marcus Meeßen \cmd{hskip} Fixed several bugs in macros that use capitalisation, a bug were the output depends on the position of the list of acronyms, and a bug were nested hyperlinks could cause errors.}
@@ -602,6 +603,7 @@
 %<*acrotest>
 \documentclass{article}
 \usepackage[colorlinks]{hyperref}
+\usepackage{amsmath}
 \usepackage[printonlyused,withpage]{acronym}
 \begin{document}
 
@@ -636,7 +638,7 @@
 One mol consists of \acs{NA} atoms or molecules. There is a relation
 between the constant of Boltzmann and the \acl{NA}:
 \begin{equation}
-  k = R/\acs{NA}
+  k = R/\acs{NA}\label{my:eq}
 \end{equation}
 
 \acl{lox}/\acl{lh2} (\acsu{lox}/\acsu{lh2})
@@ -645,7 +647,7 @@
 and final states are different. An example for \iac{LFVP} is
 neutrinoless double beta decay.
 
-\subsection{Some testing fundamentals}
+\subsection{Some testing \acp{IC} fundamentals}
 When testing \acp{IC}, one typically wants to identify functional
 blocks to be tested separately. The latter are commonly indicated as
 \acp{BUT}. To test a \ac{BUT} requires defining a testing strategy\dots{}
@@ -693,8 +695,8 @@
 %    First we test that we got the right format and name the package.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{acronym}[2024/03/30
-                          v1.49
+\ProvidesPackage{acronym}[2025/01/17
+                          v1.50
                           Support for acronyms (Tobias Oetiker)]
 \RequirePackage{suffix,xstring}
 %    \end{macrocode}
@@ -703,6 +705,17 @@
 %
 % \subsection{Options}
 %
+%    \begin{macro}{\ifAC at error}
+%    The option |error| lets this package throw compile errors instead of warnings in case of undefined acronyms.
+%    \begin{macrocode}
+\newif\ifAC at error
+\AC at errorfalse
+%    \end{macrocode}
+%    \begin{macrocode}
+\DeclareOption{error}{\AC at errortrue}
+%    \end{macrocode}
+%    \end{macro}
+%
 %    \begin{macro}{\ifAC at footnote}
 %    The option |footnote| leads to a redefinition of \cmd{\acf},
 %    \cmd{\Acf}, \cmd{\acfp}, and \cmd{\Acfp}, making the full name appear
@@ -1510,10 +1523,29 @@
 %    \end{macrocode}
 %    \end{macro}
 %
+%    \begin{macro}{\AC at logundefined}
+%    The internal macro \cmd{\AC at logundefined} either throws a warning or an error
+%    (if option |error| is set) and prints the name of the acronym in bold with an exclamation
+%    mark at the end.
+%    \begin{macrocode}
+\newcommand\AC at logundefined[1]{%
+  \ifAC at error%
+    \ifx\AC at populated\AC at used%
+      \PackageError{acronym}{#1}{You should define the acronym with
+        \protect\acrodef, \protect\newacro, or \protect\acro.}
+    \else%
+      \PackageWarning{acronym}{#1}%
+    \fi%
+  \else%
+    \PackageWarning{acronym}{#1}%
+  \fi%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
 %    \begin{macro}{\AC at get}
-%    If the acronym is undefined, the internal macro \cmd{\AC at get}
-%    warns the user by printing the name in bold with an exclamation
-%    mark at the end.
+%    If the acronym is undefined, call the internal macro \cmd{\AC at undefined}
+%    for error handling.
 %    If defined, \cmd{\AC at get} uses the same mechanism used by the LaTeX
 %    kernel commands \cmd{\ref} and \cmd{\pageref} to return the short
 %    \cmd{\AC at acs} and long forms \cmd{\AC at acl} of the acronym
@@ -1521,7 +1553,7 @@
 %    \begin{macrocode}
 \newcommand*\AC at get[3]{%
   \ifx#1\relax
-    \PackageWarning{acronym}{Acronym `#3' is not defined}%
+    \AC at logundefined{Acronym #3 is not defined}%
     \textbf{#3!}%
   \else
     \@firstupper at maybe{\expandafter#2#1}%
@@ -1612,17 +1644,21 @@
 %
 %    \subsection{Helper functions to unset labels}
 %
-%    \begin{macro}{\@verridelabel} The internal \cmd{\@verridelabel}
+%    \begin{macro}{\AC at verridelabel} The internal \cmd{\AC at verridelabel}
 %    command lets us 'redefine' an acronym label such that the page
 %    reference in the acronym list points where it should be pointing and
 %    not just to the very first occurrence of the acronym, where it may not
-%    even be expanded. (code by Ulrich Diez)
+%    even be expanded. (code by Ulrich Diez).
 %
 %    \begin{macrocode}
-\newcommand*\@verridelabel[1]{%
+\newcommand*\AC at verridelabel[1]{%
   \@bsphack
   \protected at write\@auxout{}{\string\AC at undonewlabel{#1}}%
-  \label{#1}%
+  \ifdefined\ltx at label%
+    \ltx at label{#1}%
+  \else%
+    \label{#1}%
+  \fi%
   \AC at overriddenmessage rs{#1}%
   \@esphack
 }%
@@ -1688,13 +1724,13 @@
 \newcommand*\AC at placelabel@part[1]{%
   \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used
   \else
-    {\AC at phantomsection\@verridelabel{acro:#1}}%
+    \texorpdfstring{\AC at phantomsection\AC at verridelabel{acro:#1}}{}%
   \fi
 }%
 \newcommand*\AC at placelabel[1]{%
   \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used
   \else
-    {\AC at phantomsection\@verridelabel{acro:#1}}%
+    {\AC at phantomsection\AC at verridelabel{acro:#1}}%
     \ifAC at starred\else%
     \global\expandafter\let\csname AC@\AC at prefix#1\endcsname\AC at used
     \fi%

Modified: trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty	2025-01-17 20:20:04 UTC (rev 73490)
+++ trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty	2025-01-17 20:20:14 UTC (rev 73491)
@@ -40,10 +40,13 @@
 %%
 %%
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{acronym}[2024/03/30
-                          v1.49
+\ProvidesPackage{acronym}[2025/01/17
+                          v1.50
                           Support for acronyms (Tobias Oetiker)]
 \RequirePackage{suffix,xstring}
+\newif\ifAC at error
+\AC at errorfalse
+\DeclareOption{error}{\AC at errortrue}
 \newif\ifAC at footnote
 \AC at footnotefalse
 \DeclareOption{footnote}{\AC at footnotetrue}
@@ -422,9 +425,21 @@
 }
 \newif\ifAC at starred
 \newif\ifAC at upper
+\newcommand\AC at logundefined[1]{%
+  \ifAC at error%
+    \ifx\AC at populated\AC at used%
+      \PackageError{acronym}{#1}{You should define the acronym with
+        \protect\acrodef, \protect\newacro, or \protect\acro.}
+    \else%
+      \PackageWarning{acronym}{#1}%
+    \fi%
+  \else%
+    \PackageWarning{acronym}{#1}%
+  \fi%
+}
 \newcommand*\AC at get[3]{%
   \ifx#1\relax
-    \PackageWarning{acronym}{Acronym `#3' is not defined}%
+    \AC at logundefined{Acronym #3 is not defined}%
     \textbf{#3!}%
   \else
     \@firstupper at maybe{\expandafter#2#1}%
@@ -460,10 +475,14 @@
 \newcommand*{\@Acl}[1]{%
    \AC at placelabel@part{#1}\AC at Acl{#1}%
    \ifAC at starred\else\AC at logged{#1}\fi}
-\newcommand*\@verridelabel[1]{%
+\newcommand*\AC at verridelabel[1]{%
   \@bsphack
   \protected at write\@auxout{}{\string\AC at undonewlabel{#1}}%
-  \label{#1}%
+  \ifdefined\ltx at label%
+    \ltx at label{#1}%
+  \else%
+    \label{#1}%
+  \fi%
   \AC at overriddenmessage rs{#1}%
   \@esphack
 }%
@@ -529,13 +548,13 @@
 \newcommand*\AC at placelabel@part[1]{%
   \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used
   \else
-    {\AC at phantomsection\@verridelabel{acro:#1}}%
+    \texorpdfstring{\AC at phantomsection\AC at verridelabel{acro:#1}}{}%
   \fi
 }%
 \newcommand*\AC at placelabel[1]{%
   \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used
   \else
-    {\AC at phantomsection\@verridelabel{acro:#1}}%
+    {\AC at phantomsection\AC at verridelabel{acro:#1}}%
     \ifAC at starred\else%
     \global\expandafter\let\csname AC@\AC at prefix#1\endcsname\AC at used
     \fi%



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