diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/robustindex/robustglossary.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/robustindex/robustglossary.sty | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/robustindex/robustglossary.sty b/Master/texmf-dist/tex/latex/robustindex/robustglossary.sty new file mode 100644 index 00000000000..f09ed55b37c --- /dev/null +++ b/Master/texmf-dist/tex/latex/robustindex/robustglossary.sty @@ -0,0 +1,65 @@ +% Package robustglossary.sty, Wilberd van der Kallen Feb 2005. +% +% This package is similar to robustindex.sty, but it is much simpler, as it +% does not try to get makeindex to do anything. You are expected to convert +% filename.glo into something usable yourself. This converted file should +% have a different name, so that it can be \input while filename.glo is +% being rewritten. Or you can actually paste entries into the main file, as we +% did in robustsample.tex. +% +% Copyright 2005 Wilberd van der Kallen +% +% This file may be distributed under the conditions of the LaTeX Project Public +% License, either version 1.2 of this license or (at your option) any +% later version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.2 or later is part of all distributions of LaTeX +% version 1999/12/01 or later. + +\ProvidesPackage{robustglossary} + [2005/02/23 + glossary entries with pagerefs] + +\newcounter{gloctr}% + +\newcounter{maxgloctr}% To check if number of \glossary commands has changed. + +\newcommand{\glostring}{glo.}% + +\def\@wrglossary#1{% + \stepcounter{gloctr}% + \stepcounter{gloctr}% + \@bsphack \protected@write \@auxout {}{% + \string \newlabel {\glostring\thegloctr}{{\relax }{\thepage }% + \ifx\ifHy@bookmarks\undefined\else{\relax }{page.\thepage }{}\fi% + }% + }% + \@esphack + \protected@write + \@glossaryfile {}{\string \glossaryentry + {#1}{\string\glopageref{\thegloctr}}}% + \endgroup + \@esphack +}% + +\newcommand{\glopageref}[1]{% + \ifnum\c@maxgloctr<#1\relax\setcounter{maxgloctr}{#1}\fi + \pageref{\glostring#1}% +}% + +\AtEndDocument{% + \ifnum\c@gloctr=\c@maxgloctr + \else + \ifnum\c@gloctr=0% + \PackageWarning{robustglossary}{% + Package needs \string\make glossary in preamble. Detected% + }% + \else + \PackageWarning{robustglossary}{% + Glossary not up to date. Detected% + }% + \fi + \fi +}% + +\relax |