Skip to content

Commit

Permalink
Merge pull request #54 from chrislandis/master
Browse files Browse the repository at this point in the history
adds noforwardlinks option and fixes targets for forward links to acs/acl/etc.-only use
  • Loading branch information
oetiker authored Jul 31, 2024
2 parents ecbec3d + 8af700c commit 8a0b312
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Version 1.48 (Mar 2024)

- Adds noforwardlinks option
-- Chris Landis
- Fixes targets for forward links to acs/acl/etc.-only use
-- Chris Landis

Version 1.47 (Apr 2020)

- Fixed \Iac macro expansion bug
Expand Down
47 changes: 33 additions & 14 deletions acronym.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%
% Doc-Source file to use with LaTeX2e
%
% Copyright 1994-2021 by Tobias Oetiker ([email protected]) and many Contributors.
% Copyright 1994-2024 by Tobias Oetiker ([email protected]) and many Contributors.
% All rights reserved.
%
% This work may be distributed and/or modified under the conditions of
Expand Down Expand Up @@ -35,7 +35,7 @@
%</driver>
% \fi
%
% \CheckSum{1608}
% \CheckSum{1634}
%
%% \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
Expand Down Expand Up @@ -82,6 +82,7 @@
% \DoNotIndex{\textbf, \textsf, \textsmaller, \textsuperscript, \the}
% \DoNotIndex{\usepackage}
%
% \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.}
% \changes{v1.46}{2020/03/13}{Tobi Oetiker \cmd{hskip} Fixed miss merge}
Expand Down Expand Up @@ -692,8 +693,8 @@ blocks to be tested separately. The latter are commonly indicated as
% First we test that we got the right format and name the package.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{acronym}[2021/10/09
v1.48
\ProvidesPackage{acronym}[2024/03/30
v1.49
Support for acronyms (Tobias Oetiker)]
\RequirePackage{suffix,xstring}
% \end{macrocode}
Expand All @@ -716,7 +717,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macro}
%
% \begin{macro}{\ifAC@nohyperlinks}
% If hyperref is loaded, all acronyms will link to their glossary entry.
% If hyperref is loaded, all acronyms will link to their glossary entry and the glossary entries to the first in-text use.
% With the option |nohyperlinks| these links can be suppressed.
% \begin{macrocode}
\newif\ifAC@nohyperlinks
Expand All @@ -727,6 +728,18 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifAC@noforwardlinks}
% If hyperref is loaded and the |nohyperlinks| option is not selected,
% the option |noforwardlinks| suppresses the links from the glossary entries to the in-text use.
% \begin{macrocode}
\newif\ifAC@noforwardlinks
\AC@noforwardlinksfalse
% \end{macrocode}
% \begin{macrocode}
\DeclareOption{noforwardlinks}{\AC@noforwardlinkstrue}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifAC@noacroprefix}
% With the |noacroprefix| option the acronym commands are not prefixed. This
% reproduces the old behavior of version <1.43, but can cause collisions
Expand Down Expand Up @@ -899,7 +912,7 @@ blocks to be tested separately. The latter are commonly indicated as
\AtBeginDocument{%
\@ifpackageloaded{hyperref}
{\let\AC@hyperlink=\hyperlink
\let\AC@hyperref=\hyperref
\ifAC@noforwardlinks\else\let\AC@hyperref=\hyperref\fi
\newcommand*\AC@raisedhypertarget[2]{%
\Hy@raisedlink{\hypertarget{#1}{}}#2}%
\let\AC@hypertarget=\AC@raisedhypertarget
Expand Down Expand Up @@ -1172,7 +1185,7 @@ blocks to be tested separately. The latter are commonly indicated as
%
%
% \begin{environment}{AC@deflist}
% In standard mode, the acronym - list is formatted with a description
% In standard mode, the acronym list is formatted with a description
% environment. If an optional argument is passed to the acronym
% environment, the list is formatted as a AC@deflist, which needs the
% longest appearing acronym as parameter. If the option 'nolist' is selected
Expand Down Expand Up @@ -1217,7 +1230,7 @@ blocks to be tested separately. The latter are commonly indicated as
%
% \begin{macro}{\acro}
% Acronyms can be defined with the user command \cmd{\acro}
% in side the |acronym| environment.
% inside the |acronym| environment.
%
% \begin{macrocode}
\newenvironment{acronym}[1][1]{%
Expand Down Expand Up @@ -1557,7 +1570,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@acs}[1]{%
\acsfont{\AC@acs{#1}}%
\acsfont{\AC@placelabel@part{#1}\AC@acs{#1}}%
%% having a footnote on acs sort of defeats the purpose
%% \ifAC@footnote
%% \footnote{\AC@acl{#1}{}}%
Expand All @@ -1584,12 +1597,12 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@acl}[1]{%
\AC@acl{#1}%
\AC@placelabel@part{#1}\AC@acl{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@Acl}[1]{%
\AC@Acl{#1}%
\AC@placelabel@part{#1}\AC@Acl{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \end{macro}
Expand Down Expand Up @@ -1672,6 +1685,12 @@ blocks to be tested separately. The latter are commonly indicated as
\let\AC@undonewlabel\@gobble
\fi
}%
\newcommand*\AC@placelabel@part[1]{%
\expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used
\else
{\AC@phantomsection\@verridelabel{acro:#1}}%
\fi
}%
\newcommand*\AC@placelabel[1]{%
\expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used
\else
Expand Down Expand Up @@ -1861,7 +1880,7 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@acsp}[1]{%
\acsfont{\AC@acsp{#1}}%
\acsfont{\AC@placelabel@part{#1}\AC@acsp{#1}}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \end{macro}
Expand All @@ -1884,12 +1903,12 @@ blocks to be tested separately. The latter are commonly indicated as
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@aclp}[1]{%
\AC@aclp{#1}%
\AC@placelabel@part{#1}\AC@aclp{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \begin{macrocode}
\newcommand*{\@Aclp}[1]{%
\AC@Aclp{#1}%
\AC@placelabel@part{#1}\AC@Aclp{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
% \end{macrocode}
% \end{macro}
Expand Down

0 comments on commit 8a0b312

Please sign in to comment.