summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/acronym
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/acronym')
-rw-r--r--Master/texmf-dist/tex/latex/acronym/acronym.sty110
1 files changed, 85 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/acronym/acronym.sty b/Master/texmf-dist/tex/latex/acronym/acronym.sty
index 74d30c76359..a093e188baa 100644
--- a/Master/texmf-dist/tex/latex/acronym/acronym.sty
+++ b/Master/texmf-dist/tex/latex/acronym/acronym.sty
@@ -38,10 +38,9 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{acronym}[2008/04/18
- v1.27
+\ProvidesPackage{acronym}[2008/04/22
+ v1.30
Support for acronyms (Tobias Oetiker)]
\RequirePackage{suffix}
\newif\ifAC@footnote
@@ -76,6 +75,7 @@
\newcommand*{\acfsfont}[1]{#1}
\def\AC@hyperlink#1#2{#2}
\def\AC@hypertarget#1#2{#2}
+\def\AC@phantomsection{}
\ifAC@nohyperlinks
\else
\AtBeginDocument{%
@@ -83,7 +83,15 @@
{\let\AC@hyperlink=\hyperlink
\newcommand*\AC@raisedhypertarget[2]{%
\Hy@raisedlink{\hypertarget{#1}{}}#2}%
- \let\AC@hypertarget=\AC@raisedhypertarget}{}}
+ \let\AC@hypertarget=\AC@raisedhypertarget
+ \def\AC@phantomsection{%
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \edef\@currentHref{section*.\the \Hy@linkcounter}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ }%
+ }{}}%
\fi
\AtBeginDocument{%
\providecommand\texorpdfstring[2]{#1}%
@@ -125,7 +133,11 @@
}
\newcommand*\acresetall{\the\clearlist\clearlist={}}
\def\AC@reset#1{%
- \global\expandafter\let\csname ac@#1\endcsname\relax}
+ \global\expandafter\let\csname ac@#1\endcsname\relax
+ \@ifundefined{s@acro:#1}{%
+ \global\@namedef{s@acro:#1}{}%
+ }{}%
+}
\newcommand*\AC@used{@<>@<>@}
\newcommand{\AC@populated}{}
\newcommand*{\AC@logged}[1]{%
@@ -215,10 +227,12 @@
\item[\protect\AC@hypertarget{#1}{\acsfont{#2}}] #3%
\ifAC@withpage%
\expandafter\ifx\csname r@acro:#1\endcsname\relax%
- \G@refundefinedtrue%
+ \PackageWarning{acronym}{%
+ Acronym #1 used in text but not spelled out in
+ full in text}%
\else%
\dotfill\pageref{acro:#1}%
- \fi%
+ \fi\\%
\fi%
\fi%
\else%
@@ -260,6 +274,66 @@
\newcommand*{\@acl}[1]{%
\AC@acl{#1}%
\ifAC@starred\else\AC@logged{#1}\fi}
+\newcommand*\@verridelabel[1]{%
+ \@bsphack
+ \protected@write\@auxout{}{\string\undonewlabel{#1}}%
+ \@overriddenmessage s{#1}%
+ \label{#1}%
+ \@esphack
+}%
+\newcommand*\undonewlabel{\@und@newl@bel r}%
+\newcommand*\@und@newl@bel[2]{%
+ \@ifundefined{#1@#2}{%
+ \@latex@error{Label `#2' shall be overridden although it does
+ not yet^^Jexist}{A label which does not exist cannot be
+ overridden.}%
+ }{%
+ \global\expandafter\let\csname #1@#2\endcsname\relax
+ }%
+}%
+\newcommand*\@overriddenmessage[2]{%
+ \@ifundefined{#1@#2}{\global\@namedef{#1@#2}{i}}{%
+ \expandafter\g@addto@macro\csname #1@#2\endcsname{i}%
+ }%
+ \@latex@warning{Label `#2' overridden}%
+}%
+\newcommand*\my@testdef[3]{%
+ \@ifundefined{s@#2}\@secondoftwo\@firstofone
+ {%
+ \expandafter\ifx\csname s@#2\endcsname\empty
+ \expandafter\@firstofone
+ \else
+ \expandafter\xdef\csname s@#2\endcsname{%
+ \expandafter\expandafter
+ \expandafter\@gobble
+ \csname s@#2\endcsname
+ }%
+ \expandafter\@gobble
+ \fi
+ }%
+ {%
+ \@testdef{#1}{#2}{#3}%
+ }%
+}%
+\protected@write\@auxout{}{%
+ \string\reset@newl@bel
+}%
+\newcommand*\reset@newl@bel{%
+ \ifx\@newl@bel\@testdef
+ \let\@newl@bel\my@testdef
+ \let\undonewlabel\@gobble
+ \fi
+}%
+\newcommand*\AC@placelabel[1]{%
+ \expandafter\ifx\csname ac@#1\endcsname\AC@used
+ {\AC@phantomsection\@verridelabel{acro:#1}}%
+ \else
+ \global\expandafter\let\csname ac@#1\endcsname\AC@used
+ {\AC@phantomsection
+ \@ifundefined{s@acro:#1}{\label}{\@verridelabel}{acro:#1}}%
+ \AC@addtoclearlist{#1}%
+ \fi
+}%
\newcommand*{\acf}{\AC@starredfalse\protect\acfa}%
\WithSuffix\newcommand\acf*{\AC@starredtrue\protect\acfa}%
\newcommand*{\acfa}[1]{%
@@ -267,21 +341,14 @@
\newcommand*{\@acf}[1]{%
\ifAC@footnote
\acsfont{\AC@acs{#1}}%
- \footnote{\AC@acl{#1}{}}%
+ \footnote{\AC@placelabel{#1}\AC@acl{#1}{}}%
\else
\acffont{%
- \AC@acl{#1}%
+ \AC@placelabel{#1}\AC@acl{#1}%
\nolinebreak[3] %
\acfsfont{(\acsfont{\AC@acs{#1}})}%
}%
\fi
- \expandafter\ifx\csname ac@#1\endcsname\AC@used
- \relax%
- \else
- \global\expandafter\let\csname ac@#1\endcsname\AC@used
- \label{acro:#1}%
- \AC@addtoclearlist{#1}%
- \fi
\ifAC@starred\else\AC@logged{#1}\fi}
\newcommand*{\ac}{\AC@starredfalse\protect\@ac}%
\WithSuffix\newcommand\ac*{\AC@starredtrue\protect\@ac}%
@@ -314,21 +381,14 @@
\newcommand*{\@acfp}[1]{%
\ifAC@footnote
\acsfont{\AC@acs{#1}}s%
- \footnote{\AC@acl{#1}s{}}%
+ \footnote{\AC@placelabel{#1}\AC@acl{#1}s{}}%
\else
\acffont{%
- \AC@acl{#1}s%
+ \AC@placelabel{#1}\AC@acl{#1}s%
\nolinebreak[3] %
\acfsfont{(\acsfont{\AC@acs{#1}}s)}%
}%
\fi
- \expandafter\ifx\csname ac@#1\endcsname\AC@used
- \relax%
- \else
- \global\expandafter\let\csname ac@#1\endcsname\AC@used
- \label{acro:#1}%
- \AC@addtoclearlist{#1}%
- \fi
\ifAC@starred\else\AC@logged{#1}\fi}
\newcommand*{\acp}{\AC@starredfalse\protect\@acp}%
\WithSuffix\newcommand\acp*{\AC@starredtrue\protect\@acp}%