diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/acronym/acronym.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/acronym/acronym.sty | 99 |
1 files changed, 77 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/acronym/acronym.sty b/Master/texmf-dist/tex/latex/acronym/acronym.sty index cd6f1cf2921..f449c7dad5b 100644 --- a/Master/texmf-dist/tex/latex/acronym/acronym.sty +++ b/Master/texmf-dist/tex/latex/acronym/acronym.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% acronym.dtx (with options: `acronym') -%% Copyright 1995--2020 by Tobias Oetiker (tobi@oetiker.ch) +%% Copyright 1995--2021 by Tobias Oetiker (tobi@oetiker.ch) %% and individual authors listed elsewhere. %% All rights reserved. %% @@ -40,16 +40,22 @@ %% %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{acronym}[2020/04/17 - v1.47 +\ProvidesPackage{acronym}[2025/01/17 + v1.50 Support for acronyms (Tobias Oetiker)] \RequirePackage{suffix,xstring} +\newif\ifAC@error +\AC@errorfalse +\DeclareOption{error}{\AC@errortrue} \newif\ifAC@footnote \AC@footnotefalse \DeclareOption{footnote}{\AC@footnotetrue} \newif\ifAC@nohyperlinks \AC@nohyperlinksfalse \DeclareOption{nohyperlinks}{\AC@nohyperlinkstrue} +\newif\ifAC@noforwardlinks +\AC@noforwardlinksfalse +\DeclareOption{noforwardlinks}{\AC@noforwardlinkstrue} \newif\ifAC@noacroprefix \AC@noacroprefixfalse \DeclareOption{noacroprefix}{\AC@noacroprefixtrue} @@ -97,7 +103,7 @@ \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 @@ -152,6 +158,8 @@ \def\Acp#1{\AChy@call{#1}\@Acp}% \def\acfi#1{\AChy@call{#1}\AChy@acf}% \def\Acfi#1{\AChy@call{#1}\AChy@Acf}% + \def\acfip#1{\AChy@call{#1}\AChy@acfp}% + \def\Acfip#1{\AChy@call{#1}\AChy@Acfp}% \let\acsu\acs \let\aclu\acl \let\Aclu\Acl @@ -201,6 +209,13 @@ \StrSplit{#1}{1}{\head}{\tail}% \MakeUppercase\head\tail% } +\newcommand{\@firstupper@maybe}{% + \ifAC@upper + \expandafter\@firstupper + \else + \expandafter\@firstofone + \fi +} \ifAC@noacroprefix \newcommand*\AC@prefix{} \else @@ -391,7 +406,7 @@ } \newcommand*\AC@aclp[1]{% \ifcsname fn@#1@PL\endcsname - \csname fn@#1@PL\endcsname + \@firstupper@maybe{\csname fn@#1@PL\endcsname}% \else \AC@acl{#1}s% \fi @@ -410,16 +425,24 @@ } \newif\ifAC@starred \newif\ifAC@upper +\newcommand\AC@logundefined[1]{% + \ifAC@error% + \ifx\AC@populated\AC@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@get[3]{% \ifx#1\relax - \PackageWarning{acronym}{Acronym `#3' is not defined}% + \AC@logundefined{Acronym #3 is not defined}% \textbf{#3!}% \else - \ifAC@upper - \@firstupper{\expandafter#2#1}% - \else - \expandafter#2#1% - \fi + \@firstupper@maybe{\expandafter#2#1}% \fi } \newcommand*\AC@acs[1]{% @@ -436,7 +459,7 @@ \newcommand*{\acsa}[1]{% \texorpdfstring{\protect\@acs{#1}}{#1}} \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}{}}% @@ -447,15 +470,19 @@ \newcommand*{\Acl}{\AC@starredfalse\protect\@Acl}% \WithSuffix\newcommand\Acl*{\AC@starredtrue\protect\@Acl}% \newcommand*{\@acl}[1]{% - \AC@acl{#1}% + \AC@placelabel@part{#1}\AC@acl{#1}% \ifAC@starred\else\AC@logged{#1}\fi} \newcommand*{\@Acl}[1]{% - \AC@Acl{#1}% + \AC@placelabel@part{#1}\AC@Acl{#1}% \ifAC@starred\else\AC@logged{#1}\fi} -\newcommand*\@verridelabel[1]{% +\newcommand*\AC@verridelabel[1]{% \@bsphack \protected@write\@auxout{}{\string\AC@undonewlabel{#1}}% - \label{#1}% + \ifdefined\ltx@label% + \ltx@label{#1}% + \else% + \label{#1}% + \fi% \AC@overriddenmessage rs{#1}% \@esphack }% @@ -518,10 +545,16 @@ \let\AC@undonewlabel\@gobble \fi }% +\newcommand*\AC@placelabel@part[1]{% + \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used + \else + \texorpdfstring{\AC@phantomsection\AC@verridelabel{acro:#1}}{}% + \fi +}% \newcommand*\AC@placelabel[1]{% \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used \else - {\AC@phantomsection\@verridelabel{acro:#1}}% + {\AC@phantomsection\AC@verridelabel{acro:#1}}% \ifAC@starred\else% \global\expandafter\let\csname AC@\AC@prefix#1\endcsname\AC@used \fi% @@ -591,12 +624,12 @@ \newcommand*{\@iaci}[1]{% \ifcsname fn@#1@IL\endcsname \ifAC@dua - \csname fn@#1@IL\endcsname% + \@firstupper@maybe{\csname fn@#1@IL\endcsname}% \else \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used% \csname fn@#1@IS\endcsname% \else - \csname fn@#1@IL\endcsname% + \@firstupper@maybe{\csname fn@#1@IL\endcsname}% \fi \fi \else @@ -615,17 +648,17 @@ \newcommand*{\acspa}[1]{% \texorpdfstring{\protect\@acsp{#1}}{\AC@acsp{#1}}} \newcommand*{\@acsp}[1]{% - \acsfont{\AC@acsp{#1}}% + \acsfont{\AC@placelabel@part{#1}\AC@acsp{#1}}% \ifAC@starred\else\AC@logged{#1}\fi} \newcommand*{\aclp}{\AC@starredfalse\protect\@aclp}% \WithSuffix\newcommand\aclp*{\AC@starredtrue\protect\@aclp}% \newcommand*{\Aclp}{\AC@starredfalse\protect\@Aclp}% \WithSuffix\newcommand\Aclp*{\AC@starredtrue\protect\@Aclp}% \newcommand*{\@aclp}[1]{% - \AC@aclp{#1}% + \AC@placelabel@part{#1}\AC@aclp{#1}% \ifAC@starred\else\AC@logged{#1}\fi} \newcommand*{\@Aclp}[1]{% - \AC@Aclp{#1}% + \AC@placelabel@part{#1}\AC@Aclp{#1}% \ifAC@starred\else\AC@logged{#1}\fi} \newcommand*{\acfp}{\AC@starredfalse\protect\acfpa}% \WithSuffix\newcommand\acfp*{\AC@starredtrue\protect\acfpa}% @@ -705,6 +738,28 @@ \acfsfont{(\acsfont{\AC@acs{#2}})}% }% \ifAC@starred\else\AC@logged{#2}\fi} +\newcommand*{\acfip}{\AC@starredfalse\protect\acfipa}% +\WithSuffix\newcommand\acfip*{\AC@starredtrue\protect\acfipa}% +\newcommand*{\Acfip}{\AC@starredfalse\protect\Acfipa}% +\WithSuffix\newcommand\Acfip*{\AC@starredtrue\protect\Acfipa}% +\newcommand{\acfipa}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@acfip[#1]{#2}}{{\AC@aclp{#2}} (#2)}} +\newcommand{\Acfipa}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@Acfip[#1]{#2}}{{\AC@Aclp{#2}} (#2)}} +\newcommand*{\@acfip}[2][\AC@linebreakpenalty]{% + \acffont{% + \AC@placelabel{#2}{\itshape\AC@aclp{#2}}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acsp{#2}})}% + }% + \ifAC@starred\else\AC@logged{#2}\fi} +\newcommand*{\@Acfip}[2][\AC@linebreakpenalty]{% + \acffont{% + \AC@placelabel{#2}{\itshape\AC@Aclp{#2}}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acsp{#2}})}% + }% + \ifAC@starred\else\AC@logged{#2}\fi} \newcommand{\acused}[1]{% \global\expandafter\let\csname AC@\AC@prefix#1\endcsname\AC@used% \AC@addtoAC@clearlist{#1}} |