texlive[54112] Master/texmf-dist: acronym (5mar20)

commits+karl at tug.org commits+karl at tug.org
Thu Mar 5 23:08:19 CET 2020


Revision: 54112
          http://tug.org/svn/texlive?view=revision&revision=54112
Author:   karl
Date:     2020-03-05 23:08:19 +0100 (Thu, 05 Mar 2020)
Log Message:
-----------
acronym (5mar20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/acronym/CHANGES
    trunk/Master/texmf-dist/doc/latex/acronym/acronym.pdf
    trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx
    trunk/Master/texmf-dist/source/latex/acronym/acronym.ins
    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	2020-03-05 22:08:01 UTC (rev 54111)
+++ trunk/Master/texmf-dist/doc/latex/acronym/CHANGES	2020-03-05 22:08:19 UTC (rev 54112)
@@ -1,10 +1,34 @@
 
+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
+
+Version 1.43 (Feb 2020)
+
+fixed unconventional dots spacing in list of acronyms
+-- Marcus Meeßen
+
+enhanced list of acronyms with hyperrefs
+-- Marcus Meeßen
+
+fixed collisions between acronyms and package commands, can be turned of with
+the |noacroprefix| option
+-- Marcus Meeßen
+
 Version 1.42 (Nov 2019)
 
 fix the carriage return with long lines (line 234/235) -- Philippe Chauvat
+
 fix page number display for acfi Acfi -- Tobi Oetiker
+
 fix double space and missing used flag with acfi -- Horst Schirmeier
 
+two features were added -- Oz Davidi
+ * 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 
+
 Version 1.41 (Mar 2015)
 
 change names of internal macros to avoid nameing conflics with pageslts

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

Modified: trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx	2020-03-05 22:08:01 UTC (rev 54111)
+++ trunk/Master/texmf-dist/source/latex/acronym/acronym.dtx	2020-03-05 22:08:19 UTC (rev 54112)
@@ -2,7 +2,7 @@
 %
 % Doc-Source file to use with LaTeX2e
 %
-% Copyright 1994-2019 by Tobias Oetiker (tobi at oetiker.ch) and many Contributors.
+% Copyright 1994-2020 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{1389}
+% \CheckSum{1518}
 %
 %% \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
@@ -66,7 +66,7 @@
 %             \ensuremath, \expandafter}
 % \DoNotIndex{\fi, \footnote}
 % \DoNotIndex{\gdef, \global}
-% \DoNotIndex{\hfill, \hyperlink, \hypertarget}
+% \DoNotIndex{\hfill, \hyperlink, \hyperref, \hypertarget}
 % \DoNotIndex{\if at filesw, \ifx, \item}
 % \DoNotIndex{\label, \labelsep, \labelwidth, \leftmargin, \let,
 %             \long}
@@ -82,7 +82,8 @@
 % \DoNotIndex{\textbf, \textsf, \textsmaller, \textsuperscript, \the}
 % \DoNotIndex{\usepackage}
 %
-%
+%  \changes{v1.44}{2020/02/07}{Marcus Meeßen \cmd{hskip} Added the |printonlyreused| option, which allows to automatically exclude acronyms from the list of acronyms if they are used only once}
+%  \changes{v1.43}{2020/02/05}{Marcus Meeßen \cmd{hskip} Fixed unconventional dots spacing in list of acronyms, enhanced list of acronyms with hyperrefs, and fixed collisions between acronyms and package commands, which can be turned of with the |noacroprefix| option}
 %  \changes{v1.42}{2019/11/11}{Philippe Chauvat \cmd{hskip} Fix the carriage return with long lines, Tobi Oetiker and Horst Schirmeier fixed usedflag and page number entries for acfi and Acfi}
 %  \changes{v1.41}{2015/03/21}{Tobi Oetiker and Jason Mills \cmd{hskip} fix nameing conflicts with pageslts package}
 %  \changes{v1.40}{2014/09/29}{Hartmut Henkel - remove \cmd{hskip} instances, since they cause bad formating since space at the end of a line can not be collapsed anymore}
@@ -423,11 +424,12 @@
 %    In standard mode, the acronym-list will consist of all defined
 %    acronyms, regardless if the the acronym was used in the text
 %    before or not. This behavior can be changed by loading the
-%    package with the parameter \texttt{printonlyused}:
+%    package with the parameter \texttt{printonlyused} (used at least once) or
+%    \texttt{printonlyreused} (use more than once):
 %    \begin{quote}
 %    |\usepackage[printonlyused]{acronym}|
 %    \end{quote}
-%    In \texttt{printonlyused}-mode you can add to each acronym the
+%    In \texttt{printonly(re)used}-mode you can add to each acronym the
 %    the page number where it was first used by additionally specifying
 %    the option \texttt{withpage}.
 %    \begin{quote}
@@ -675,8 +677,8 @@
 %    First we test that we got the right format and name the package.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{acronym}[2019/11/11
-                          v1.42
+\ProvidesPackage{acronym}[2020/02/07
+                          v1.44
                           Support for acronyms (Tobias Oetiker)]
 \RequirePackage{suffix,xstring}
 %    \end{macrocode}
@@ -710,6 +712,18 @@
 %    \end{macrocode}
 %    \end{macro}
 %
+%    \begin{macro}{\ifAC at noacroprefix}
+%    With the |noacroprefix| option the acronym commands are not prefixed. This
+%    reproduces the old behavior of version <1.43, but can cause collisions
+%    between user-defined acronyms and commands of this package.
+%    \begin{macrocode}
+\newif\ifAC at noacroprefix
+\AC at noacroprefixfalse
+%    \end{macrocode}
+%    \begin{macrocode}
+\DeclareOption{noacroprefix}{\AC at noacroprefixtrue}
+%    \end{macrocode}
+%    \end{macro}
 %
 %    \begin{macro}{\ifAC at printonlyused}
 %    We need a marker
@@ -723,6 +737,18 @@
 %    \end{macrocode}
 %    \end{macro}
 %
+%    \begin{macro}{\ifAC at printonlyreused}
+%    With the |printonlyreused| option, only those acronyms are included in the
+%    list of acronyms that have been used more than once, i.e. at least twice.
+%    \begin{macrocode}
+\newif\ifAC at printonlyreused
+\AC at printonlyreusedfalse
+%    \end{macrocode}
+%    \begin{macrocode}
+\DeclareOption{printonlyreused}{\AC at printonlyreusedtrue}
+%    \end{macrocode}
+%    \end{macro}
+%
 %    \begin{macro}{\ifAC at withpage}
 %    A marker which tells us to print page numbers.
 %    \begin{macrocode}
@@ -834,15 +860,21 @@
 %    \subsection{Hyperlinks and PDF support}
 %
 %    \begin{macro}{\AC at hyperlink}
+%    \begin{macro}{\AC at hyperref}
 %    \begin{macro}{\AC at hypertarget}
+%    \begin{macro}{\AC at phantomsection}
 %    Define dummy hyperlink commands
 %    \begin{macrocode}
 \def\AC at hyperlink#1#2{#2}
+\def\AC at hyperref[#1]#2{#2}
 \def\AC at hypertarget#1#2{#2}
 \def\AC at phantomsection{}
 %    \end{macrocode}
 %    \end{macro}
 %    \end{macro}
+%    \end{macro}
+%    \end{macro}
+%
 %    \begin{macro}{\AC at raisedhypertarget}
 %    Make sure that hyperlink processing gets enabled before we process
 %    the document if hyperref has been loaded in the mean time.
@@ -852,6 +884,7 @@
    \AtBeginDocument{%
       \@ifpackageloaded{hyperref}
          {\let\AC at hyperlink=\hyperlink
+          \let\AC at hyperref=\hyperref
           \newcommand*\AC at raisedhypertarget[2]{%
              \Hy at raisedlink{\hypertarget{#1}{}}#2}%
           \let\AC at hypertarget=\AC at raisedhypertarget
@@ -867,6 +900,19 @@
 %    \end{macrocode}
 %    \end{macro}
 %
+%    \begin{macro}{\AC at pageref}
+%    Use |\pageref*| instead of |\pageref| when the |hyperref| package is used.
+%    \begin{macrocode}
+\AtBeginDocument{%
+  \@ifpackageloaded{hyperref}{%
+    \let\AC at pageref=\@pagerefstar%
+  }{%
+    \let\AC at pageref=\pageref%
+  }%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
 %    \noindent
 %    The \texttt{hyperref} package defines \cmd{\pdfstringdefDisableCommands}
 %    and \cmd{\texorpdfstring} for text in bookmarks. If undefined, then provide them
@@ -952,7 +998,7 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \def\AC at reset#1{%
-  \global\expandafter\let\csname AC@#1\endcsname\relax
+  \global\expandafter\let\csname AC@\AC at prefix#1\endcsname\relax
 }
 %    \end{macrocode}
 %    \end{macro}
@@ -967,7 +1013,7 @@
 %
 %    \begin{macro}{\AC at populated}
 %    An on/off flag to note if any acronyms were logged. This
-%    is needed for the first run with |printonlyused| option,
+%    is needed for the first run with |printonly(re)used| option,
 %    because the acronym list are then empty, resulting in a
 %    |"missing item"| error.
 %
@@ -1008,12 +1054,22 @@
 %    (called by the \texttt{aux} file).
 %    \begin{macrocode}
 \newcommand*{\acronymused}[1]{%
-   \expandafter\ifx\csname acused@#1\endcsname\AC at used
-      \relax
-   \else
-       \global\expandafter\let\csname acused@#1\endcsname\AC at used
-       \global\let\AC at populated\AC at used
-   \fi}
+  \expandafter\ifx\csname acused@#1 at once\endcsname\AC at used%
+    \expandafter\ifx\csname acused@#1 at twice\endcsname\AC at used%
+      \relax%
+    \else%
+      \global\expandafter\let\csname acused@#1 at twice\endcsname\AC at used%
+      \global\let\AC at populated\AC at used%
+    \fi%
+  \else%
+    \global\expandafter\let\csname acused@#1 at once\endcsname\AC at used%
+    \ifAC at printonlyreused%
+      \relax%
+    \else%
+      \global\let\AC at populated\AC at used%
+    \fi%
+  \fi%
+}
 %    \end{macrocode}
 %    \end{macro}
 %    \end{macro}
@@ -1029,6 +1085,18 @@
 %    \end{macrocode}
 %    \end{macro}
 %
+%    \begin{macro}{AC at prefix}
+%    Returns the prefix used to build the defined acronym commands as long as
+%    the |noacroprefix| option is disabled. Otherwise the output is empty, so
+%    the old behaviour from version <1.43 is reproduced.
+%    \begin{macrocode}
+\ifAC at noacroprefix
+  \newcommand*\AC at prefix{}
+\else
+  \newcommand*\AC at prefix{acronyms@}
+\fi
+%    \end{macrocode}
+%    \end{macro}
 %
 % \subsection{Defining acronyms}
 %
@@ -1170,16 +1238,33 @@
 %    \begin{macro}{\AC@@acro}
 %    \begin{macrocode}
 \newcommand*\AC at acro[1]{%
-  \@ifnextchar[{\AC@@acro{#1}}{\AC@@acro{#1}[#1]}}
+  \@ifnextchar[{%
+    \csname AC@\AC at prefix{}@acro\endcsname{#1}%
+  }{%
+    \csname AC@\AC at prefix{}@acro\endcsname{#1}[#1]%
+  }%
+}
 %    \end{macrocode}
 %    \begin{macrocode}
-\newcommand\AC@@acro{}
-\def\AC@@acro#1[#2]#3{%
+\expandafter\newcommand\csname AC@\AC at prefix{}@acro\endcsname{}
+\expandafter\def\csname AC@\AC at prefix{}@acro\endcsname#1[#2]#3{%
   \ifAC at nolist%
   \else%
-  \ifAC at printonlyused%
-    \expandafter\ifx\csname acused@#1\endcsname\AC at used%
-       \item[\protect\AC at hypertarget{#1}{\aclabelfont{#2}}] #3%
+  \ifnum%
+    \ifAC at printonlyused 1%
+    \else\ifAC at printonlyreused 1%
+    \else 0\fi\fi%
+  =1%
+    \ifnum%
+      \ifAC at printonlyused%
+        \expandafter\ifx\csname acused@#1 at once\endcsname\AC at used 1 \else 0 \fi%
+      \else\ifAC at printonlyreused%
+        \expandafter\ifx\csname acused@#1 at twice\endcsname\AC at used 1 \else 0 \fi%
+      \else 0 \fi\fi%
+    =1%
+      \item[\protect\AC at hypertarget{#1}{%
+        \AC at hyperref[acro:#1]{\aclabelfont{#2}\hfill}%
+      }]\AC at hyperref[acro:#1]{#3}%
           \ifAC at withpage%
             \expandafter\ifx\csname r at acro:#1\endcsname\relax%
                \PackageInfo{acronym}{%
@@ -1186,19 +1271,35 @@
                  Acronym #1 used in text but not spelled out in
                  full in text}%
             \else%
-               \dotfill\pageref{acro:#1}%
+              \nobreak\leaders\hbox{$\m at th\mkern\@dotsep mu\hbox{.}\mkern\@dotsep mu$}\hfill%
+              \nobreak\hb at xt@\@pnumwidth{%
+                \hfil\normalfont\normalcolor\AC at pageref{acro:#1}%
+              }%
             \fi%
           \fi\\%
     \fi%
- \else%
-    \item[\protect\AC at hypertarget{#1}{\aclabelfont{#2}}] #3%
- \fi%
- \fi%
- \begingroup
+  \else%
+    \item[\protect\AC at hypertarget{#1}{\AC at hyperref[acro:#1]{\aclabelfont{#2}\hfill}}]\AC at hyperref[acro:#1]{#3}%
+  \fi%
+  \fi%
+  \begingroup
     \def\acroextra##1{}%
     \@bsphack
-    \protected at write\@auxout{}%
-       {\string\newacro{#1}[\string\AC at hyperlink{#1}{#2}]{#3}}%
+      \ifAC at printonlyreused%
+        \protected at write\@auxout{}{%
+          \string\newacro{#1}[%
+            \expandafter\ifx\csname acused@#1 at twice\endcsname\AC at used%
+              \string\AC at hyperlink{#1}{#2}%
+            \else%
+              {#2}%
+            \fi%
+          ]{#3}%
+        }%
+      \else%
+        \protected at write\@auxout{}{%
+          \string\newacro{#1}[\string\AC at hyperlink{#1}{#2}]{#3}%
+        }%
+      \fi%
     \@esphack
   \endgroup
   \ignorespaces}
@@ -1535,11 +1636,11 @@
   \fi
 }%
 \newcommand*\AC at placelabel[1]{%
-  \expandafter\ifx\csname AC@#1\endcsname\AC at used
+  \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used
   \else
     {\AC at phantomsection\@verridelabel{acro:#1}}%
     \ifAC at starred\else%
-    \global\expandafter\let\csname AC@#1\endcsname\AC at used
+    \global\expandafter\let\csname AC@\AC at prefix#1\endcsname\AC at used
     \fi%
     \AC at addtoAC@clearlist{#1}%
   \fi
@@ -1638,7 +1739,7 @@
   \ifAC at dua
      \ifAC at starred\acl*{#2}\else\acl{#2}\fi%
   \else
-     \expandafter\ifx\csname AC@#2\endcsname\AC at used%
+     \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used%
      \ifAC at starred\acs*{#2}\else\acs{#2}\fi%
    \else
      \ifAC at starred\acf*[#1]{#2}\else\acf[#1]{#2}\fi%
@@ -1650,7 +1751,7 @@
   \ifAC at dua
      \ifAC at starred\Acl*{#2}\else\Acl{#2}\fi%
   \else
-     \expandafter\ifx\csname AC@#2\endcsname\AC at used%
+     \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used%
      \ifAC at starred\acs*{#2}\else\acs{#2}\fi%
    \else
      \ifAC at starred\Acf*[#1]{#2}\else\Acf[#1]{#2}\fi%
@@ -1681,7 +1782,7 @@
      \ifAC at dua
         \csname fn@#1 at IL\endcsname%
      \else
-        \expandafter\ifx\csname AC@#1\endcsname\AC at used%
+        \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used%
         \csname fn@#1 at IS\endcsname%
       \else
         \csname fn@#1 at IL\endcsname%
@@ -1844,7 +1945,7 @@
   \ifAC at dua
      \ifAC at starred\aclp*{#2}\else\aclp{#2}\fi%
   \else
-   \expandafter\ifx\csname AC@#2\endcsname\AC at used
+   \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used
       \ifAC at starred\acsp*{#2}\else\acsp{#2}\fi%
    \else
       \ifAC at starred\acfp*[#1]{#2}\else\acfp[#1]{#2}\fi%
@@ -1856,7 +1957,7 @@
   \ifAC at dua
      \ifAC at starred\Aclp*{#2}\else\Aclp{#2}\fi%
   \else
-   \expandafter\ifx\csname AC@#2\endcsname\AC at used
+   \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used
       \ifAC at starred\acsp*{#2}\else\acsp{#2}\fi%
    \else
       \ifAC at starred\Acfp*[#1]{#2}\else\Acfp[#1]{#2}\fi%
@@ -1919,7 +2020,7 @@
 %    \cmd{\acronymused}!
 %    \begin{macrocode}
 \newcommand{\acused}[1]{%
-\global\expandafter\let\csname AC@#1\endcsname\AC at used%
+\global\expandafter\let\csname AC@\AC at prefix#1\endcsname\AC at used%
 \AC at addtoAC@clearlist{#1}}
 %    \end{macrocode}
 %    \end{macro}

Modified: trunk/Master/texmf-dist/source/latex/acronym/acronym.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/acronym/acronym.ins	2020-03-05 22:08:01 UTC (rev 54111)
+++ trunk/Master/texmf-dist/source/latex/acronym/acronym.ins	2020-03-05 22:08:19 UTC (rev 54112)
@@ -4,7 +4,7 @@
 %% driver files from the doc files in this package when run through
 %% LaTeX or TeX.
 %%
-%% Copyright 1995--2010  by Tobias Oetiker (tobi at oetiker.ch)
+%% Copyright 1995--2020  by Tobias Oetiker (tobi at oetiker.ch)
 %%                       and individual authors listed elsewhere
 %%                       in this file.
 %% All rights reserved.
@@ -31,7 +31,7 @@
 \keepsilent
 
 \preamble
- Copyright 1995--2009  by Tobias Oetiker (tobi at oetiker.ch)
+ Copyright 1995--2020  by Tobias Oetiker (tobi at oetiker.ch)
                        and individual authors listed elsewhere.
  All rights reserved.
 

Modified: trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty	2020-03-05 22:08:01 UTC (rev 54111)
+++ trunk/Master/texmf-dist/tex/latex/acronym/acronym.sty	2020-03-05 22:08:19 UTC (rev 54112)
@@ -5,7 +5,7 @@
 %% The original source files were:
 %%
 %% acronym.dtx  (with options: `acronym')
-%%  Copyright 1995--2009  by Tobias Oetiker (tobi at oetiker.ch)
+%%  Copyright 1995--2020  by Tobias Oetiker (tobi at oetiker.ch)
 %%                        and individual authors listed elsewhere.
 %%  All rights reserved.
 %% 
@@ -40,8 +40,8 @@
 %%
 %%
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{acronym}[2019/11/11
-                          v1.42
+\ProvidesPackage{acronym}[2020/02/07
+                          v1.44
                           Support for acronyms (Tobias Oetiker)]
 \RequirePackage{suffix,xstring}
 \newif\ifAC at footnote
@@ -50,9 +50,15 @@
 \newif\ifAC at nohyperlinks
 \AC at nohyperlinksfalse
 \DeclareOption{nohyperlinks}{\AC at nohyperlinkstrue}
+\newif\ifAC at noacroprefix
+\AC at noacroprefixfalse
+\DeclareOption{noacroprefix}{\AC at noacroprefixtrue}
 \newif\ifAC at printonlyused
 \AC at printonlyusedfalse
 \DeclareOption{printonlyused}{\AC at printonlyusedtrue}
+\newif\ifAC at printonlyreused
+\AC at printonlyreusedfalse
+\DeclareOption{printonlyreused}{\AC at printonlyreusedtrue}
 \newif\ifAC at withpage
 \AC at withpagefalse
 \DeclareOption{withpage}{\AC at withpagetrue}
@@ -83,6 +89,7 @@
   \def\AC at linebreakpenalty{3}
 \fi
 \def\AC at hyperlink#1#2{#2}
+\def\AC at hyperref[#1]#2{#2}
 \def\AC at hypertarget#1#2{#2}
 \def\AC at phantomsection{}
 \ifAC at nohyperlinks
@@ -90,6 +97,7 @@
    \AtBeginDocument{%
       \@ifpackageloaded{hyperref}
          {\let\AC at hyperlink=\hyperlink
+          \let\AC at hyperref=\hyperref
           \newcommand*\AC at raisedhypertarget[2]{%
              \Hy at raisedlink{\hypertarget{#1}{}}#2}%
           \let\AC at hypertarget=\AC at raisedhypertarget
@@ -103,6 +111,13 @@
          }{}}%
 \fi
 \AtBeginDocument{%
+  \@ifpackageloaded{hyperref}{%
+    \let\AC at pageref=\@pagerefstar%
+  }{%
+    \let\AC at pageref=\pageref%
+  }%
+}
+\AtBeginDocument{%
    \providecommand\texorpdfstring[2]{#1}%
    \providecommand\pdfstringdefDisableCommands[1]{}%
    \pdfstringdefDisableCommands{%
@@ -152,7 +167,7 @@
 }
 \newcommand*\acresetall{\the\AC at clearlist\AC at clearlist={}}
 \def\AC at reset#1{%
-  \global\expandafter\let\csname AC@#1\endcsname\relax
+  \global\expandafter\let\csname AC@\AC at prefix#1\endcsname\relax
 }
 \newcommand*\AC at used{@<>@<>@}
 \newcommand{\AC at populated}{}
@@ -167,17 +182,32 @@
    }%
 }
 \newcommand*{\acronymused}[1]{%
-   \expandafter\ifx\csname acused@#1\endcsname\AC at used
-      \relax
-   \else
-       \global\expandafter\let\csname acused@#1\endcsname\AC at used
-       \global\let\AC at populated\AC at used
-   \fi}
+  \expandafter\ifx\csname acused@#1 at once\endcsname\AC at used%
+    \expandafter\ifx\csname acused@#1 at twice\endcsname\AC at used%
+      \relax%
+    \else%
+      \global\expandafter\let\csname acused@#1 at twice\endcsname\AC at used%
+      \global\let\AC at populated\AC at used%
+    \fi%
+  \else%
+    \global\expandafter\let\csname acused@#1 at once\endcsname\AC at used%
+    \ifAC at printonlyreused%
+      \relax%
+    \else%
+      \global\let\AC at populated\AC at used%
+    \fi%
+  \fi%
+}
 \newcommand{\@firstupper}[1]{%
     \StrLeft{#1}{1}[\firstletter]%
     \StrGobbleLeft{#1}{1}[\remainder]%
     \MakeUppercase\firstletter\remainder%
 }
+\ifAC at noacroprefix
+  \newcommand*\AC at prefix{}
+\else
+  \newcommand*\AC at prefix{acronyms@}
+\fi
 \newcommand*\newacro[1]{%
   \@ifnextchar[{\AC at newacro{#1}}{\AC at newacro{#1}[#1]}}
 \newcommand\AC at newacro{}
@@ -239,14 +269,31 @@
       \end{AC at deflist}%
    \fi}%
 \newcommand*\AC at acro[1]{%
-  \@ifnextchar[{\AC@@acro{#1}}{\AC@@acro{#1}[#1]}}
-\newcommand\AC@@acro{}
-\def\AC@@acro#1[#2]#3{%
+  \@ifnextchar[{%
+    \csname AC@\AC at prefix{}@acro\endcsname{#1}%
+  }{%
+    \csname AC@\AC at prefix{}@acro\endcsname{#1}[#1]%
+  }%
+}
+\expandafter\newcommand\csname AC@\AC at prefix{}@acro\endcsname{}
+\expandafter\def\csname AC@\AC at prefix{}@acro\endcsname#1[#2]#3{%
   \ifAC at nolist%
   \else%
-  \ifAC at printonlyused%
-    \expandafter\ifx\csname acused@#1\endcsname\AC at used%
-       \item[\protect\AC at hypertarget{#1}{\aclabelfont{#2}}] #3%
+  \ifnum%
+    \ifAC at printonlyused 1%
+    \else\ifAC at printonlyreused 1%
+    \else 0\fi\fi%
+  =1%
+    \ifnum%
+      \ifAC at printonlyused%
+        \expandafter\ifx\csname acused@#1 at once\endcsname\AC at used 1 \else 0 \fi%
+      \else\ifAC at printonlyreused%
+        \expandafter\ifx\csname acused@#1 at twice\endcsname\AC at used 1 \else 0 \fi%
+      \else 0 \fi\fi%
+    =1%
+      \item[\protect\AC at hypertarget{#1}{%
+        \AC at hyperref[acro:#1]{\aclabelfont{#2}\hfill}%
+      }]\AC at hyperref[acro:#1]{#3}%
           \ifAC at withpage%
             \expandafter\ifx\csname r at acro:#1\endcsname\relax%
                \PackageInfo{acronym}{%
@@ -253,19 +300,35 @@
                  Acronym #1 used in text but not spelled out in
                  full in text}%
             \else%
-               \dotfill\pageref{acro:#1}%
+              \nobreak\leaders\hbox{$\m at th\mkern\@dotsep mu\hbox{.}\mkern\@dotsep mu$}\hfill%
+              \nobreak\hb at xt@\@pnumwidth{%
+                \hfil\normalfont\normalcolor\AC at pageref{acro:#1}%
+              }%
             \fi%
           \fi\\%
     \fi%
- \else%
-    \item[\protect\AC at hypertarget{#1}{\aclabelfont{#2}}] #3%
- \fi%
- \fi%
- \begingroup
+  \else%
+    \item[\protect\AC at hypertarget{#1}{\AC at hyperref[acro:#1]{\aclabelfont{#2}\hfill}}]\AC at hyperref[acro:#1]{#3}%
+  \fi%
+  \fi%
+  \begingroup
     \def\acroextra##1{}%
     \@bsphack
-    \protected at write\@auxout{}%
-       {\string\newacro{#1}[\string\AC at hyperlink{#1}{#2}]{#3}}%
+      \ifAC at printonlyreused%
+        \protected at write\@auxout{}{%
+          \string\newacro{#1}[%
+            \expandafter\ifx\csname acused@#1 at twice\endcsname\AC at used%
+              \string\AC at hyperlink{#1}{#2}%
+            \else%
+              {#2}%
+            \fi%
+          ]{#3}%
+        }%
+      \else%
+        \protected at write\@auxout{}{%
+          \string\newacro{#1}[\string\AC at hyperlink{#1}{#2}]{#3}%
+        }%
+      \fi%
     \@esphack
   \endgroup
   \ignorespaces}
@@ -448,11 +511,11 @@
   \fi
 }%
 \newcommand*\AC at placelabel[1]{%
-  \expandafter\ifx\csname AC@#1\endcsname\AC at used
+  \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used
   \else
     {\AC at phantomsection\@verridelabel{acro:#1}}%
     \ifAC at starred\else%
-    \global\expandafter\let\csname AC@#1\endcsname\AC at used
+    \global\expandafter\let\csname AC@\AC at prefix#1\endcsname\AC at used
     \fi%
     \AC at addtoAC@clearlist{#1}%
   \fi
@@ -497,7 +560,7 @@
   \ifAC at dua
      \ifAC at starred\acl*{#2}\else\acl{#2}\fi%
   \else
-     \expandafter\ifx\csname AC@#2\endcsname\AC at used%
+     \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used%
      \ifAC at starred\acs*{#2}\else\acs{#2}\fi%
    \else
      \ifAC at starred\acf*[#1]{#2}\else\acf[#1]{#2}\fi%
@@ -507,7 +570,7 @@
   \ifAC at dua
      \ifAC at starred\Acl*{#2}\else\Acl{#2}\fi%
   \else
-     \expandafter\ifx\csname AC@#2\endcsname\AC at used%
+     \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used%
      \ifAC at starred\acs*{#2}\else\acs{#2}\fi%
    \else
      \ifAC at starred\Acf*[#1]{#2}\else\Acf[#1]{#2}\fi%
@@ -522,7 +585,7 @@
      \ifAC at dua
         \csname fn@#1 at IL\endcsname%
      \else
-        \expandafter\ifx\csname AC@#1\endcsname\AC at used%
+        \expandafter\ifx\csname AC@\AC at prefix#1\endcsname\AC at used%
         \csname fn@#1 at IS\endcsname%
       \else
         \csname fn@#1 at IL\endcsname%
@@ -595,7 +658,7 @@
   \ifAC at dua
      \ifAC at starred\aclp*{#2}\else\aclp{#2}\fi%
   \else
-   \expandafter\ifx\csname AC@#2\endcsname\AC at used
+   \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used
       \ifAC at starred\acsp*{#2}\else\acsp{#2}\fi%
    \else
       \ifAC at starred\acfp*[#1]{#2}\else\acfp[#1]{#2}\fi%
@@ -605,7 +668,7 @@
   \ifAC at dua
      \ifAC at starred\Aclp*{#2}\else\Aclp{#2}\fi%
   \else
-   \expandafter\ifx\csname AC@#2\endcsname\AC at used
+   \expandafter\ifx\csname AC@\AC at prefix#2\endcsname\AC at used
       \ifAC at starred\acsp*{#2}\else\acsp{#2}\fi%
    \else
       \ifAC at starred\Acfp*[#1]{#2}\else\Acfp[#1]{#2}\fi%
@@ -634,7 +697,7 @@
      }%
      \ifAC at starred\else\AC at logged{#2}\fi}
 \newcommand{\acused}[1]{%
-\global\expandafter\let\csname AC@#1\endcsname\AC at used%
+\global\expandafter\let\csname AC@\AC at prefix#1\endcsname\AC at used%
 \AC at addtoAC@clearlist{#1}}
 \newcommand*{\acsu}{\AC at starredfalse\protect\acsua}%
 \WithSuffix\newcommand\acsu*{\AC at starredtrue\protect\acsua}%



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