summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/glossaries/base
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-08 00:29:03 +0000
committerKarl Berry <karl@freefriends.org>2008-09-08 00:29:03 +0000
commit4e6ebfdfca3e464341eb91ad375a8f6b4f78d3e9 (patch)
tree8a26e02304c575b73f62cecdf15179a0ac59fd1f /Master/texmf-dist/tex/latex/glossaries/base
parent06ebf7d14fd3c483ed229b86d938732cf3f6a5d2 (diff)
glossaries update (28aug08)
git-svn-id: svn://tug.org/texlive/trunk@10468 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries/base')
-rw-r--r--Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty89
1 files changed, 61 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty
index c30716a7552..0209e843f0c 100644
--- a/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty
+++ b/Master/texmf-dist/tex/latex/glossaries/base/glossaries.sty
@@ -39,10 +39,11 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{glossaries}[2008/06/17 v1.14 (NLCT)]
+\ProvidesPackage{glossaries}[2008/08/27 v1.16 (NLCT)]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}[2006/11/18]
\RequirePackage{mfirstuc}
+\RequirePackage{xfor}
\@ifpackageloaded{babel}{\IfFileExists{translator.sty}{%
\RequirePackage{translator}}{}}{}
\RequirePackage{amsgen}
@@ -140,6 +141,8 @@ name=true]{%
\@ifundefined{hyperdef}{}{\hyperdef{section}{\thesection}{}}}}}{}
\providecommand*{\glossaryname}{Glossary}
\providecommand*{\acronymname}{Acronyms}
+\newcommand*{\glssettoctitle}[1]{%
+\def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}
\providecommand*{\entryname}{Notation}
\providecommand*{\descriptionname}{Description}
\providecommand*{\symbolname}{Symbol}
@@ -149,6 +152,12 @@ name=true]{%
\newcommand*{\glspluralsuffix}{s}
\ifglstranslate
\@ifpackageloaded{translator}{\usedictionary{glossaries-dictionary}%
+ \renewcommand*{\glssettoctitle}[1]{%
+ \ifthenelse{\equal{#1}{main}}{%
+ \translatelet{\glossarytoctitle}{Glossary}}{%
+ \ifthenelse{\equal{#1}{acronym}}{%
+ \translatelet{\glossarytoctitle}{Acronyms}}{%
+ \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}}}%
\renewcommand*{\glossaryname}{\translate{Glossary}}%
\renewcommand*{\acronymname}{\translate{Acronyms}}%
\renewcommand*{\entryname}{\translate{Notation (glossaries)}}%
@@ -309,8 +318,8 @@ counter as its value}}{%
\def\@glo@symbolplural{\@glo@symbol}%
\def\@glo@text{\@glo@name}%
\def\@glo@plural{\@glo@text\glspluralsuffix}%
-\def\@glo@first{\relax}%
-\def\@glo@firstplural{\relax}%
+\let\@glo@first\relax
+\let\@glo@firstplural\relax
\def\@glo@sort{\@glo@name}%
\def\@glo@counter{\@gls@getcounter{\@glo@type}}%
\setkeys{glossentry}{#2}%
@@ -321,15 +330,15 @@ in it}}{%
\protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}%
\expandafter\xdef\csname glolist@\@glo@type\endcsname{\@glolist@{#1},}%
}%
-\if\relax\@glo@firstplural\relax%
- \if\relax\@glo@first\relax%
+\ifx\relax\@glo@firstplural
+ \ifx\relax\@glo@first
\def\@glo@firstplural{\@glo@plural}%
\def\@glo@first{\@glo@text}%
\else
\def\@glo@firstplural{\@glo@first\glspluralsuffix}%
\fi
\else
- \if\relax\@glo@first\relax%
+ \ifx\relax\@glo@first
\def\@glo@first{\@glo@text}%
\fi
\fi
@@ -341,10 +350,18 @@ in it}}{%
\expandafter\protected@xdef\csname glo@#1@counter\endcsname{\@glo@counter}%
\@gls@sanitizename
\expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}%
+\def\@glo@@desc{\@glo@first}%
+\ifx\@glo@desc\@glo@@desc
+ \let\@glo@desc\@glo@first
+\fi
\@gls@sanitizedesc
\expandafter\protected@xdef\csname glo@#1@desc\endcsname{\@glo@desc}%
\expandafter\protected@xdef\csname glo@#1@descplural\endcsname{\@glo@descplural}%
\expandafter\protected@xdef\csname glo@#1@sort\endcsname{\@glo@sort}%
+\def\@glo@@symbol{\@glo@text}%
+\ifx\@glo@symbol\@glo@@symbol
+ \let\@glo@symbol\@glo@text
+\fi
\@gls@sanitizesymbol
\expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}%
\expandafter\protected@xdef\csname glo@#1@symbolplural\endcsname{\@glo@symbolplural}%
@@ -405,6 +422,7 @@ counter as its value}}{%
\newcommand*{\@sgls@link}[1][]{\@gls@link[hyper=false,#1]}
\newcommand*{\@gls@link}[3][]{%
\glsdoifexists{#2}{%
+\def\glslabel{#2}%
\def\@glsnumberformat{glsnumberformat}%
\edef\@gls@counter{\csname glo@#2@counter\endcsname}%
\KV@glslink@hypertrue
@@ -665,16 +683,22 @@ counter as its value}}{%
}{%
\gdef\@glslink#1#2{\hyperlink{#1}{#2}}%
}
+\newlength\gls@tmplen
\@ifundefined{hypertarget}{%
\gdef\@glstarget#1#2{#2}%
}{%
- \gdef\@glstarget#1#2{\hypertarget{#1}{#2}}}
+ \gdef\@glstarget#1#2{%
+ \settoheight{\gls@tmplen}{#2}%
+ \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2}%
+}
\newcommand{\glsdisablehyper}{%
\renewcommand*\@glslink[2]{##2}%
\renewcommand*\@glstarget[2]{##2}}
\newcommand{\glsenablehyper}{%
\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}%
-\renewcommand*\@glstarget[2]{\hypertarget{##1}{##2}}}
+\renewcommand*\@glstarget[2]{%
+ \settoheight{\gls@tmplen}{##2}%
+ \raisebox{\gls@tmplen}{\hypertarget{##1}{}}##2}}
\newcommand*{\gls}{\@ifstar\@sgls\@gls}
\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]}
\newcommand*{\@gls}[2][]{%
@@ -692,11 +716,12 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\@glo@text}%
}{%
- \ifglsacrfootnote
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}{%
\@gls@link[#1,hyper=false]{#2}{\@glo@text}%
- \else
+ }{%
\@gls@link[#1]{#2}{\@glo@text}%
- \fi
+ }%
}%
\glsunset{#2}}%
}
@@ -718,13 +743,14 @@ counter as its value}}{%
\@gls@link[#1]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
- \ifglsacrfootnote
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}{%
\@gls@link[#1,hyper=false]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
- \else
+ }{%
\@gls@link[#1]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
- \fi
+ }%
}%
\glsunset{#2}}%
}
@@ -745,11 +771,12 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
- \ifglsacrfootnote
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}{%
\@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
- \else
+ }{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
- \fi
+ }%
}%
\glsunset{#2}}%
}
@@ -772,11 +799,12 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\@glo@text}%
}{%
- \ifglsacrfootnote
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}{%
\@gls@link[#1,hyper=false]{#2}{\@glo@text}%
- \else
+ }{%
\@gls@link[#1]{#2}{\@glo@text}%
- \fi
+ }%
}%
\glsunset{#2}}%
}
@@ -800,13 +828,14 @@ counter as its value}}{%
\@gls@link[#1]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
- \ifglsacrfootnote
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}{%
\@gls@link[#1,hyper=false]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
- \else
+ }{%
\@gls@link[#1]{#2}{%
\expandafter\makefirstuc\expandafter{\@glo@text}}%
- \fi
+ }%
}%
\glsunset{#2}}%
}
@@ -829,11 +858,12 @@ counter as its value}}{%
\ifglsused{#2}{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
- \ifglsacrfootnote
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}{%
\@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
- \else
+ }{%
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
- \fi
+ }%
}%
\glsunset{#2}}%
}
@@ -1262,10 +1292,11 @@ to move \string\makeglossaries\space after all your
\newcommand*{\printglossary}[1][type=\glsdefaulttype]{%
\def\@glo@type{\glsdefaulttype}%
\def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}%
-\def\glossarytoctitle{\glossarytitle}%
\def\@glossarystyle{}%
+\def\gls@dotoctitle{\glssettoctitle{\@glo@type}}%
\bgroup
\setkeys{printgloss}{#1}%
+\gls@dotoctitle
\@glossarystyle
\makeatletter
\@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}%
@@ -1275,7 +1306,9 @@ to move \string\makeglossaries\space after all your
\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}}
\define@key{printgloss}{type}{\def\@glo@type{#1}}
\define@key{printgloss}{title}{\def\glossarytitle{#1}}
-\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}}
+\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}%
+\let\gls@dotoctitle\relax
+}
\define@key{printgloss}{style}{%
\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary
style `#1' undefined}{}}{%