summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/glossaries
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-09-25 00:48:57 +0000
committerKarl Berry <karl@freefriends.org>2009-09-25 00:48:57 +0000
commit1b5baf0f475cbfdc378718a46057c5c481b59065 (patch)
tree6ee2f82a5e33642af5af9bfffe47cbc0c48ecbfa /Master/texmf-dist/tex/latex/glossaries
parentf453f119c796c9607b391bbf26971fda1826c51c (diff)
glossaries update (24sep09)
git-svn-id: svn://tug.org/texlive/trunk@15452 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries')
-rw-r--r--Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty118
1 files changed, 72 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty
index d0ee7d8c36f..de71ffe206e 100644
--- a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty
+++ b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{glossaries}[2009/07/13 v2.02 (NLCT)]
+\ProvidesPackage{glossaries}[2009/09/23 v2.03 (NLCT)]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}[2006/11/18]
\RequirePackage{mfirstuc}
@@ -138,6 +138,8 @@ name=true]{%
\glstranslatefalse
\@ifpackageloaded{translator}{\glstranslatetrue}{%
\@ifpackageloaded{babel}{\glstranslatetrue}{}}
+\define@boolkey{glossaries.sty}[gls]{hyperfirst}[true]{}
+\glshyperfirsttrue
\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{%
\ifthenelse{\boolean{glsacrdescription}}{}%
{\renewcommand*{\@gls@sanitizedesc}{}}%
@@ -298,12 +300,25 @@ name=true]{%
\newcommand*{\glossarypreamble}{}
\newcommand*{\glossarypostamble}{}
\newcommand*{\glossarysection}[2][\@gls@title]{%
-\def\@gls@title{#2}%
-\@ifundefined{phantomsection}{%
-\@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}%
-\glossarymark{\glossarytoctitle}%
+ \def\@gls@title{#2}%
+ \@ifundefined{phantomsection}{%
+ \@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}%
+ \glossarymark{\glossarytoctitle}%
+}
+\@ifundefined{glossarymark}{%
+ \newcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
+}{%
+ \GlossariesWarning{overriding \string\glossarymark}%
+ \@ifclassloaded{memoir}%
+ {
+ \renewcommand{\glossarymark}[1]{%
+ \markboth{\memUChead{#1}}{\memUChead{#1}}%
+ }
+ }
+ {
+ \renewcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
+ }
}
-\newcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
\newcommand*{\setglossarysection}[1]{%
\setkeys{glossaries.sty}{section=#1}}
\newcommand*{\@glossarysection}[2]{%
@@ -853,11 +868,21 @@ counter as its value}}{%
\def\@glsnumberformat{#1}}
\define@boolkey{glslink}{hyper}[true]{}
\newcommand{\glslink}{%
-\@ifstar\@sgls@link\@gls@link}
-\newcommand*{\@sgls@link}[1][]{\@gls@link[hyper=false,#1]}
-\newcommand*{\@gls@link}[3][]{%
- \glsdoifexists{#2}%
+\@ifstar\@sgls@link\@gls@@link}
+\newcommand*{\@sgls@link}[1][]{\@gls@@link[hyper=false,#1]}
+\newcommand*{\@gls@@link}[3][]{%
+ \ifglsentryexists{#2}%
{%
+ \@gls@link[#1]{#2}{#3}%
+ }{%
+ \PackageError{glossaries}{Glossary entry `#2' has not been
+ defined}{You need to define a glossary entry before you
+ can use it.}%
+ \glstextformat{#3}%
+ }%
+}
+\def\@gls@link[#1]#2#3{%
+ \leavevmode
\def\glslabel{#2}%
\def\@glsnumberformat{glsnumberformat}%
\edef\@gls@counter{\csname glo@#2@counter\endcsname}%
@@ -871,7 +896,6 @@ counter as its value}}{%
\else
\glstextformat{#3}\relax
\fi
- }%
}
\def\@set@glo@numformat#1#2#3{%
\expandafter\@glo@check@mkidxrangechar#3\@nil
@@ -1218,8 +1242,8 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\@glo@text}%
}{%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}{%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
\@gls@link[#1,hyper=false]{#2}{\@glo@text}%
}{%
\@gls@link[#1]{#2}{\@glo@text}%
@@ -1245,8 +1269,8 @@ counter as its value}}{%
\@gls@link[#1]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}{%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
\@gls@link[#1,hyper=false]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
@@ -1273,8 +1297,8 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}{%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
\@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
}{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
@@ -1301,8 +1325,8 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\@glo@text}%
}{%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}{%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
\@gls@link[#1,hyper=false]{#2}{\@glo@text}%
}{%
\@gls@link[#1]{#2}{\@glo@text}%
@@ -1330,8 +1354,8 @@ counter as its value}}{%
\@gls@link[#1]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}{%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
\@gls@link[#1,hyper=false]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
@@ -1360,8 +1384,8 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}{%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
\@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
}{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
@@ -1372,35 +1396,37 @@ counter as its value}}{%
\newcommand*{\glsdisp}{\@ifstar\@sglsdisp\@glsdisp}
\newcommand*{\@sglsdisp}[1][]{\@glsdisp[hyper=false,#1]}
\newcommand*{\@glsdisp}[3][]{%
- \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
- \def\@gls@link@opts{#1}%
- \def\@gls@link@label{#2}%
- \ifglsused{#2}%
- {%
- \def\@glo@text{%
- \csname gls@\@glo@type @display\endcsname
- {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
- }%
- {%
- \def\@glo@text{%
- \csname gls@\@glo@type @displayfirst\endcsname
- {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
- }%
- \ifglsused{#2}%
- {%
- \@gls@link[#1]{#2}{\@glo@text}%
- }%
- {%
- \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
- \boolean{glsacrfootnote}}%
+ \glsdoifexists{#2}{%
+ \edef\@glo@type{\glsentrytype{#2}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
{%
- \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @display\endcsname
+ {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
}%
{%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @displayfirst\endcsname
+ {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
+ }%
+ \ifglsused{#2}%
+ {%
\@gls@link[#1]{#2}{\@glo@text}%
}%
+ {%
+ \ifthenelse{\(\equal{\@glo@type}{\acronymtype}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ }%
+ \glsunset{#2}}%
}%
- \glsunset{#2}}%
}
\newcommand*{\glstext}{\@ifstar\@sglstext\@glstext}
\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]}