%\iffalse
% glossaries.dtx generated using makedtx version 0.94b (c) Nicola Talbot
% Command line args:
%   -macrocode "glossaries\.perl"
%   -macrocode ".*\.tex"
%   -src "glossaries.sty\Z=>glossaries.sty"
%   -src "mfirstuc.sty\Z=>mfirstuc.sty"
%   -src "(glossary-.+)\.(sty)\Z=>\1.\2"
%   -src "(glossaries-babel)\.(sty)\Z=>\1.\2"
%   -src "(glossaries-dictionary-.+)\.(dict)\Z=>\1.\2"
%   -src "(minimalgls\.tex)\Z=>\1"
%   -src "(sample.*\.tex)\Z=>\1"
%   -src "(database.*\.tex)\Z=>\1"
%   -src "(glossaries\.perl)\Z=>\1"
%   -author "Nicola Talbot"
%   -dir "source"
%   -setambles "glossaries\.perl=>\nopreamble\nopostamble"
%   -setambles ".*\.tex=>\nopreamble\nopostamble"
%   -comment "glossaries\.perl"
%   -comment ".*\.tex"
%   -doc "glossaries-manual.tex"
%   -codetitle "Documented Code"
%   glossaries
% Created on 2008/6/18 16:44
%\fi
%\iffalse
%<*package>
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2008 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage{ifthen}
\usepackage{alltt}
\usepackage[colorlinks,
            bookmarks,
            hyperindex=false,
            pdfauthor={Nicola L.C. Talbot},
            pdftitle={glossaries.sty: LaTeX2e Package to Assist Generating Glossaries},
            pdfkeywords={LaTeX,package,glossary,acronyms}]{hyperref}

 %hyperindex conflicts with doc
 %(end up with |usage|hyperpage in indexentry)
 %This unfortunately means that the changes section doesn't
 %have active links, but at least it will keep makeindex happy.


\renewcommand{\usage}[1]{\textit{\hyperpage{#1}}}
\renewcommand{\main}[1]{\hyperpage{#1}}
\newcommand{\see}[2]{\emph{see} #1}
\makeatletter
\def\index@prologue{\section*{Index}}
\makeatother
\RecordChanges
\PageIndex
\CheckSum{5121}
\CodelineNumbered
\newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}}
\newcommand*{\term}[1]{#1\iterm{#1}}
\newcommand*{\iterm}[1]{\index{#1|main}}
\newcommand{\dq}[1]{``#1''}
\newcommand*{\tableref}[1]{\hyperref[#1]{table~\ref*{#1}}}
\newcommand*{\Tableref}[1]{\hyperref[#1]{Table~\ref*{#1}}}
\newlength\boxlength
\newsavebox\importantbox
\newenvironment{important}{%
\setlength{\fboxrule}{4pt}%
\setlength\boxlength{\linewidth}%
\addtolength\boxlength{-2\fboxsep}%
\addtolength\boxlength{-2\fboxrule}%
\begin{lrbox}{\importantbox}%
\begin{minipage}{\boxlength}%
}{\end{minipage}\end{lrbox}%
\par\vskip10pt\noindent
\fcolorbox{red}{white}{\usebox{\importantbox}}\par\vskip10pt}



\newcommand*{\istkey}[1]{\texttt{#1}\index{makeindex=\texttt{makeindex}>#1=\texttt{#1}|hyperpage}}
\newcommand*{\ics}[1]{\texttt{\char`\\#1}\SpecialMainIndex{#1}}
\newcommand*{\appname}[1]{\texttt{#1}\index{#1=\texttt{#1}|hyperpage}}
\newcommand*{\mkidxspch}{\index{makeindex=\texttt{makeindex}>special characters|hyperpage}}
\newcommand*{\igloskey}[2][newglossaryentry]{\index{#1 options=\cs{#1} options>#2=\textsf{#2}|hyperpage}}
\newcommand*{\gloskey}[2][newglossaryentry]{\textsf{#2}\igloskey[#1]{#2}}
\newcommand*{\ipkgopt}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\index{package options>#2=\textsf{#2}|hyperpage}}{%
\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}}
\newcommand*{\pkgopt}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\textsf{#2}\index{package options>#2=\textsf{#2}|hyperpage}}{%
\textsf{#2=#1}\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}}
\newcommand*{\pkgoptval}[2]{\textsf{#1}\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}
\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles>#1|hyperpage}}
\newcommand*{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}}
\newcommand*{\sty}[1]{\textsf{#1}}
\newcommand*{\isty}[1]{\sty{#1}\index{#1 package=\sty{#1} package|hyperpage}}
\newcommand*{\envname}[1]{\textsf{#1}}


\begin{document}\DocInput{glossaries.dtx}
\end{document}
%</driver>
%\fi
%\MakeShortVerb{"}
%\DeleteShortVerb{\|}
%
% \title{glossaries.sty v 1.14: \LaTeXe\ Package to Assist Generating Glossaries}
% \author{Nicola L.C. Talbot\\[10pt]
%School of Computing Sciences\\
%University of East Anglia\\
%Norwich. Norfolk\\
%NR4 7TJ. United Kingdom.\\
%\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
%
% \date{18th June 2008}
% \maketitle
%\tableofcontents
%
% \section{Introduction}
%
% \changes{1.0}{2007 May 16}{Initial version}
%The \sty{glossaries} package is provided to assist generating
%glossaries.  It has a certain amount of flexibility, allowing the user
%to customize the format of the glossary and define multiple glossaries.
%It also supports acronyms and glossary styles that include
%symbols (in addition to a name and description) for glossary
%entries. There is provision for loading a database of glossary terms
%where only those terms used in the text are added to the glossary.
%This package replaces the \isty{glossary} package which is now
%obsolete.
%
%This documentation is structured as follows: \autoref{sec:quick} is for people who want a few quick pointers of how to get started,
%without having to read through lengthy descriptions, 
%\autoref{sec:overview} gives an overview of available commands and their syntax, \autoref{sec:mfirstuc} describes the associated
%\sty{mfirstuc} 
%package, \autoref{sec:code} contains the documented source code for those who want to know more about how the
%package works and \autoref{sec:code:mfirstuc} contains the documented
%code for the \sty{mfirstuc} package.
%
%\subsection{Multi-Lingual Support}
%\label{sec:languages}
%
%As from version 1.08, the \sty{glossaries} package now has
%limited multi-lingual support, thanks to all the people who have sent
%me the relevant translations either via email or via 
%\texttt{comp.text.tex}.
%However you must load \isty{babel} \emph{before} 
%\sty{glossaries} to enable this. Note that if \isty{babel} is loaded 
%and the \isty{translator} package is detected on \TeX's path, then the
%\isty{translator} package will be loaded automatically, however,
%it may not pick up on the required languages, so if the predefined
%text is not translated, you may need to explicitly load the
%\isty{translator} package with the required languages. For example:
%\begin{verbatim}
%\usepackage[spanish]{babel}
%\usepackage[spanish]{translator}
%\usepackage{glossaries}
%\end{verbatim}
%
%If you want to use \isty{ngerman} or \isty{german} instead
%of \isty{babel}, you will need to include the \isty{translator} package 
%to provide the translations. For example:
%\begin{verbatim}
%\documentclass[ngerman]{article}
%\usepackage{ngerman}
%\usepackage{translator}
%\usepackage{glossaries}
%\end{verbatim}
%
%The following languages are currently supported:
%\begin{center}
%\begin{tabular}{lc}
%\bfseries Language & \bfseries As from version\\
%Danish & 1.08\\
%Dutch & 1.08\\
%English & 1.08\\
%French & 1.08\\
%German & 1.08\\
%Irish & 1.08\\
%Italian & 1.08\\
%Hungarian & 1.08\\
%Polish & 1.13\\
%Spanish & 1.08
%\end{tabular}
%\end{center}
%The language dependent commands and \isty{translator} keys used by the 
%glossaries package are listed in \tableref{tab:predefinednames}.
%
%\begin{table}[htbp]
%\caption{Customised Text}
%\label{tab:predefinednames}
%\begin{center}
%\begin{tabular}{@{}llp{0.4\linewidth}@{}}
%\bfseries Command Name & \bfseries Translator key word &
%\bfseries What it's for\\
%\ics{glossaryname} & \texttt{Glossary} & Title of the main glossary.\\
%\ics{acronymname} & \texttt{Acronyms} & Title of the list of acronyms
%(when used with package option \pkgopt{acronym}).\\
%\ics{entryname} & \texttt{Notation (glossaries)} & 
%Header for first column in glossary (for 2, 3 or 4 column glossaries 
%that support headers).\\
%\ics{descriptionname} & \texttt{Description (glossaries)} &
%Header for second column in glossary (for 2, 3 or 4 column glossaries
%that support headers).\\
%\ics{symbolname} & \texttt{Symbol (glossaries)} & Header for symbol
%column in glossary for glossary styles that support this option.\\
%\ics{pagelistname} & \texttt{Page List (glossaries)} & 
%Header for page list column in glossary for glossaries that support 
%this option.\\
%\ics{glssymbolsgroupname} & \texttt{Symbols (glossaries)} & 
%Header for symbols section of the glossary for glossary styles that 
%support this option.\\
%\ics{glsnumbersgroupname} & \texttt{Numbers (glossaries)} & Header for
%numbers section of the glossary for glossary styles that support
%this option.
%\end{tabular}
%\end{center}
%\end{table}
%
%Due to the varied nature of glossaries, it's likely that the
%predefined translations may not be appropriate. If you are using
%the \isty{babel} package and do not have the \isty{translator} package
%installed, you need to be familiar with the 
% advice given in \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=latexwords}. 
%
%If you have the \isty{translator} package installed, then it becomes
%much easier to change the default translations. For example, if you
%are writing in Irish and you want \cs{symbolname} to produce
%\dq{Siombail} instead of \dq{Comhartha}, then you can put the following
%in your document preamble:
%\begin{verbatim}
%\deftranslation[to=Irish]{Symbol (glossaries)}{Siombail}
%\end{verbatim}
%
%\subsection{Generating the associated glossary files}
%\label{sec:makeglossaries}
%
%The \sty{glossaries} package comes with the Perl script
%\appname{makeglossaries} which will run \appname{makeindex} on
%all the glossary files using a customized \appname{makeindex}
%\filetype{.ist} style file (which is created by \ics{makeglossaries}). 
%The relevant extensions are obtained from the
%auxiliary file, so you should only pass the basename as the
%argument. For example, if your document is called 
%\texttt{myfile.tex}, do:
%\begin{verbatim}
%latex myfile
%makeglossaries myfile
%latex myfile
%\end{verbatim}
%You may need to explicitly load \appname{makeglossaries} into
%Perl:
%\begin{verbatim}
%perl makeglossaries myfile
%\end{verbatim}
%There is a batch file called \texttt{makeglossaries.bat} which
%does this for Windows users, but you must have Perl installed to
%be able to use it.
%
%If you don't have Perl installed, you will have to run 
%\appname{makeindex} for each glossary type you have defined.
%For example, if you have used the \pkgopt{acronym} package option
%then you will have both a main glossary as well as a list of acronyms, so you
%will need to do (assuming your document is called \texttt{myfile.tex}):
%\begin{verbatim}
%makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo
%makeindex -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn
%\end{verbatim}
%This requires remembering all extensions for each of the glossaries
%defined in your document, so where possible you should use
%\appname{makeglossaries} instead to reduce the possibility of error.
%Don't pass all the glossary files in a single call to 
%\appname{makeindex} or it will merge all your glossaries into a
%single glossary.
%
%If any problems occur, remember to check the transcript files 
%(e.g.\ \filetype{.glg} or \filetype{.alg}) for messages.
%\subsection{Troubleshooting}
%
%The \sty{glossaries} package comes with a minimal file called 
%\texttt{minimalgls.tex} which can be used for testing. This
%should be located in \texttt{texmf/doc/latex/glossaries/samples/}. 
%Further information on debugging \LaTeX\ code is available at
%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/}.
%
%Below is a list of the most frequently asked questions. For
%other queries, consult the \sty{glossaries} FAQ at
%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html}. 
%
%\begin{enumerate}
%\item I've used the \pkgopt{smallcaps} option, but the acronyms
%are displayed in normal sized upper case letters.
%
%The \pkgopt{smallcaps} package option uses \cs{textsc} to typeset
%the acronyms. This command converts lower case letters to small 
%capitals, while upper case letters remain their usual size. Therefore
%you need to specify the acronym in lower case letters.
%
%\item How do I change the font that the acronyms are displayed in?
%
%The easiest way to do this is to specify the \pkgopt{smaller} package
%option and redefine \cs{acronymfont} to use the required typesetting
%command.  For example, suppose you would like the acronyms displayed in 
%a sans-serif font, then you can do:
%\begin{verbatim}
%\usepackage[smaller]{glossaries}
%\renewcommand*{\acronymfont}[1]{\textsf{#1}}
%\end{verbatim}
%
%\item How do I change the font that the acronyms are displayed in
%on first use?
%
%The easiest way to do this is to specify the \pkgopt{smaller} package
%option and redefine \cs{firstacronymfont} to use the required 
%command. Note that if you don't want the acronym on subsequent use
%to use \cs{smaller}, you will also need to redefine \cs{acronymfont},
%as above. For example to make the acronym emphasized on first use,
%but use the surrounding font for subsequent use, you can do:
%\begin{verbatim}
%\usepackage[smaller]{glossaries}
%\renewcommand*{\firstacronymfont}[1]{\emph{#1}}
%\renewcommand*{\acronymfont}[1]{#1}
%\end{verbatim}
%
%\item I don't have Perl installed, do I have to use 
%\appname{makeglossaries}?
%
%Read \autoref{sec:makeglossaries}.
%
%
%\item I'm used to using the \sty{glossary} package: are there any
%instructions on migrating from the \isty{glossary} package to the
%\sty{glossaries} package?
%
%Read the file \texttt{glossary2glossaries.pdf} which should be available from the 
%same location as this document.
%
%\item I'm using \isty{babel} but the fixed names haven't been 
%translated.
%
%The \sty{glossaries} package currently only supports the following
%languages: Danish, Dutch, English, French, German, Irish, Italian,
%Hungarian, Polish and Spanish. If you want to add another language,
%send me the translations, and I'll add them to the next version.
%
%If you are using one of the above languages, but the text hasn't been
%translated, try adding the \isty{translator} package with the
%required languages explicitly (before you load the \sty{glossaries}
%package). For example:
%\begin{verbatim}
%\usepackage[ngerman]{babel}
%\usepackage[ngerman]{translator}
%\usepackage{glossaries}
%\end{verbatim}
%Alternatively, you may be able to add the language as a global option
%to the class file. Check the \sty{translator} package documentation for
%further details.
%
%\item My glossaries haven't appeared.
%
%Remember to do the following:
%\begin{itemize}
%\item Add \ics{makeglossaries} to the document preamble.
%
%\item Use either \ics{printglossary} for each glossary that has
%been defined or \ics{printglossaries}.
%
%\item Use \ics{gls}, \ics{Gls}, \ics{GLS}, \ics{glspl}, \ics{Glspl},
%\ics{GLSpl}, \ics{glslink}, \ics{glsadd} or \ics{glsaddall} in the
%document.
%
%\item Run \LaTeX\ on your document, then run \appname{makeglossaries},
%then run \LaTeX\ on your document again. If you want the glossaries
%to appear in the table of contents, you will need an extra \LaTeX\
%run.
%\end{itemize}
%\end{enumerate}
%
%\section{A Quick Guide For The Impatient}
%\label{sec:quick}
%
%This section is for people who want a few quick pointers
%of how to get started. However it is recommended that you read 
%\autoref{sec:overview} for additional commands and advice not listed here.
%
%\begin{enumerate}
%\item Load \sty{glossaries} \emph{after} \isty{hyperref}:
%\begin{verbatim}
%\usepackage{hyperref}
%\usepackage{glossaries}
%\end{verbatim}
%Similarly for the \isty{html} package:
%\begin{verbatim}
%\usepackage{html}
%\usepackage{glossaries}
%\end{verbatim}
%
%\item Always use \ics{makeglossaries} if you want the glossary
%entries to be written to the glossary file:
%\begin{verbatim}
%\documentclass{article}
%\usepackage{glossaries}
%\makeglossaries
%\end{verbatim}
%If you don't use \ics{makeglossaries}, your glossaries will
%not appear in the document!
%
%\item Use \ics{printglossaries} to make your glossaries appear 
%in the document at that point. For example:
%\begin{verbatim}
%\maketitle
%\printglossaries
%\section{Introduction}
%\end{verbatim}
%Note that only the glossary entries that have been used in the
%document text will appear in the glossary.
%
%\item When you have created your document, run \LaTeX\ on it,
%then the Perl script \appname{makeglossaries}, then run \LaTeX\
%on it again:
%\begin{verbatim}
%latex myfile
%makeglossaries myfile
%latex myfile
%\end{verbatim}
%(You may need to run \LaTeX\ again if you have used the \pkgopt{toc}
%package option.)
%If you use Windows, there is a batch file called 
%\texttt{makeglossaries.bat} which you can use, but you will
%still need Perl installed.
%
%\item New glossaries can be defined using:\par
%\ics{newglossary}\oarg{log-ext}%
%\marg{label}\marg{in-ext}\marg{out-ext}%
%\marg{title}\par where \meta{label} is an identifying label,
%\meta{in-ext} is the extension of the file to be created
%by \appname{makeindex} (called by \appname{makeglossaries}),
%\meta{out-ext} is the extension of the file to be read by
%\appname{makeindex} and \meta{title} is the title for this
%new glossary. The first optional argument \meta{log-ext} specifies
%the extension of the \appname{makeindex} transcript file. Example:
%\begin{verbatim}
%\newglossary[nlg]{notation}{not}{ntn}{Notation}
%\end{verbatim}
%This glossary's label is \texttt{notation} and its title
%will be Notation. If you use \appname{makeglossaries}, the 
%\appname{makeindex} transcript will be written to a file with the
%extension \filetype{.nlg}. If \meta{log-ext} is omitted, the extension
%\filetype{.glg} will be used.
%
%\item Any new glossaries must be defined before 
%\cs{makeglossaries}
%\begin{verbatim}
%\documentclass{article}
%\usepackage{glossaries}
%\newglossary{notation}{not}{ntn}{Notation}
%\makeglossaries
%\end{verbatim}
%
%\item If you use the \pkgopt{acronym} package option, the 
%\sty{glossaries} package
%will automatically create a new glossary type labelled
%\texttt{acronym}:
%\begin{verbatim}
%\usepackage[acronym]{glossaries}
%\end{verbatim}
%
%\item If your pages have a hyphen compositor (i.e.\ your page
%numbers appear in the form 2-1), redefine \ics{glscompositor}
%\emph{before} \ics{makeglossaries}:
%\begin{verbatim}
%\documentclass{article}
%\usepackage{glossaries}
%\renewcommand{\glscompositor}{-}
%\makeglossaries
%\end{verbatim}
%
%\item To add the glossaries to the table of contents use the
%\pkgopt{toc} package option:
%\begin{verbatim}
%\usepackage[toc]{glossaries}
%\end{verbatim}
%
%\item Define a new entry with:\par
%\ics{newglossaryentry}\marg{label}\marg{key-val list}\par
%The \meta{key-val list} must at least contain a \gloskey{name}
%key and a \gloskey{description} key.
%For example:
%\begin{verbatim}
%\newglossaryentry{perl}{name=Perl,
%description=A scripting language}
%\end{verbatim}
%In this example, I have given the entry the label \texttt{perl}.
%Whenever I want to use this entry, that is the label I need
%to use to identify it.
%
%\item If the entry name starts with an accented letter, you will
%need to group the first letter (otherwise it will cause a
%problem for \ics{Gls} and \ics{Glspl}):
%\begin{verbatim}
%\newglossaryentry{elite}{name={{\'e}lite},
%description={select group or class}}
%\end{verbatim}
%Likewise with commands such as \cs{ae} and \cs{oe}:
%\begin{verbatim}
%\newglossaryentry{oesophagus}{%
%name={{\oe}sophagus},
%description={canal from mouth to stomach}}
%\end{verbatim}
%
%\item If you have multiple glossaries, use the \gloskey{type}
%key to specify in which glossary the entry belongs. For example:
%\begin{verbatim}
%\newglossary{languages}{lan}{lng}{Index of Languages}
%
%\makeglossaries
%
%\newglossaryentry{perl}{name=Perl,
%description=A scripting language,
%type=languages}
%\end{verbatim}
%If \gloskey{type} is omitted, the default glossary is used.
%
%\item Remember to group values that have a comma or equal sign.
%For example:
%\begin{verbatim}
%\newglossaryentry{pagelist}{name=page list,
%description={A list of individual pages or page ranges
%(e.g.\ 1,2,4,7--9)}}
%\end{verbatim}
%
%\item Plural forms are assumed to be the singular form with an
%\dq{s} appended, unless otherwise specified. To specify an
%irregular plural, use the \gloskey{plural} key. For example:
%\begin{verbatim}
%\newglossaryentry{matrix}{name=matrix,
%description=rectangular array of quantities,
%plural=matrices}
%\end{verbatim}
%
%\item The way the term appears in the main text can be different
%from the way the term appears in the glossary:
%\begin{verbatim}
%\newglossaryentry{matrix}{name=Matrix,
%description=rectangular array of quantities,
%text=matrix,
%plural=matrices}
%\end{verbatim}
%In this example, the entry name appears as \dq{Matrix} in the 
%glossary, and either \dq{matrix} or \dq{matrices} in the text.
%
%\item The way the term appears on first use can be different
%to the way it appears subsequently:
%\begin{verbatim}
%\newglossaryentry{singmtx}{name=Singular Matrix,
%description=A matrix with a zero determinant,
%first=singular matrix (SM),
%text=SM,
%firstplural=singular matrices (SMs)}
%\end{verbatim}
%In this example, the entry name appears as \dq{Singular Matrix} in
%the glossary, and in the text it appears as \dq{singular matrix (SM)}
%or \dq{singular matrices (SMs)} the first time the entry is used,
%and subsequently appears as \dq{SM} or \dq{SMs}.
%
%\item The quick and easy way to define an acronym is to use:\par
%\ics{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}%
%\marg{long}\par
%For example:
%\begin{verbatim}
%\newacronym{svm}{SVM}{support vector machine}
%\end{verbatim}
%This is equivalent to:
%\begin{verbatim}
%\newglossaryentry{svm}{type=\acronymtype,
%name={SVM},
%description={support vector machine},
%text={SVM},
%first={support vector machine (SVM)},
%plural={SVMs},
%firstplural={support vector machines (SVMs)}}
%\end{verbatim}
%(The value of \ics{acronymtype} varies depending on whether
%the \pkgopt{acronym} package option is used or not.
%The optional argument \meta{key-val list} can be used to
%override any of the \ics{newglossaryentry} keys; for
%example, if the acronym has an irregular plural.)
%
%\item The font used to display the entry name in the glossary
%is governed by \ics{glsnamefont}. This can be redefined
%as required. For example, to make the entry names appear
%in a medium sans-serif font do:
%\begin{verbatim}
%\renewcommand{\glsnamefont}[1]{\textsf{\mdseries #1}}
%\end{verbatim}
%Note that the list-like glossary styles defined in the
%\isty{glossary-list} package place the entry name in
%the optional argument to \ics{item}, so they will
%appear in bold, unless you redefine \ics{glsnamefont} to counteract the
%bold font.
%
%\item In the document use \ics{gls}\marg{label}
%to use a predefined term (this will also enter the term into 
%the associated glossary output file). For example:
%\begin{verbatim}
%A \gls{singmtx} is a matrix with a zero determinant.
%\end{verbatim}
%
%\item Other variations:
%\begin{itemize}
%\item \ics{Gls}\marg{label} : like \cs{gls},
%but with first letter in upper case
%\item \ics{GLS}\marg{label} : like \cs{gls},
%but all upper case.
%\item \ics{glspl}\marg{label} : use plural
%\item \ics{Glspl}\marg{label} : use plural with
%first letter in upper case
%\item \ics{GLSpl}\marg{label} : use plural but
%all upper case
%\item \ics{glslink}\marg{label}\marg{link text} :
%use \meta{link text} to link to the given entry in the glossary.
%\end{itemize}
%For example, the following will produce the plural form with
%the first letter in uppercase:
%\begin{verbatim}
%\Glspl{singmtx} are matrices with a zero determinant.
%\end{verbatim}
%
%\item Additional text can be appended to the link using the
%end optional argument. For example, to form the possessive:
%\begin{verbatim}
%The \gls{singmtx}['s] dimensions \ldots
%\end{verbatim}
%
%\item The format of the associated entry number can be
%changed using the \gloskey[glslink]{format} key in the optional argument.
%Note that the value of the \gloskey[glslink]{format} key should be the
%name of a command \emph{without} the initial backslash. For
%example:
%\begin{verbatim}
%The primary definition of \glspl[format=textbf]{singmtx}.
%\end{verbatim}
%In this example the relevant glossary entry will have the
%page number in bold (since it uses \cs{textbf}) but
%it will no longer have a hyperlink (if hyperlinks are enabled.)
%
%\item The \sty{glossaries} package provides commands to
%change the font whilst ensuring that the number remains a
%hyperlink. These are of the form \cs{hyper}\meta{xx} and
%are equivalent to the standard font changing commands of the
%form \cs{text}\meta{xx}, as well as \ics{hyperemph}
%(which uses \ics{emph}.) For example:
%\begin{verbatim}
%The primary definition of \glspl[format=hyperbf]{singmtx}.
%\end{verbatim}
%
%\item Don't use declarations in \gloskey[glslink]{format} as this can
%cause unpredictable results, as there is no guarantee that the effect
%will be localised to the required text.
%
%\item Entries can be added to the glossary without producing
%any text using \ics{glsadd}\marg{label} or
%\ics{glsaddall}. These commands also take an optional
%argument where you can specify the format. For example
%\begin{verbatim}
%\glsadd[format=hyperbf]{singmtx}
%\end{verbatim}
%will add a line to the
%glossary file for the specified term, but will not produce
%any text where the command occurs.
%
%\item A number range can be entered using \verb|format=(| and
%\verb"format=)" to mark the beginning and ending of the
%range\footnote{This is new to version 1.01}. For example:
%\begin{verbatim}
% \glsadd[format=(]{singmtx}
% This is a very long section all about \glspl{singmtx}.
%
% % lots of text omitted
%
% \glsadd[format=)]{singmtx}
%\end{verbatim}
%This is equivalent to \appname{makeindex}'s \verb"|(" and \verb"|)" 
%formats.
%
%\item You can combine the range markers with a formatting command
%(again without the preceding backslash). For example:
%\begin{verbatim}
% This is the start of a very long section all 
% about \glspl[format=(hyperbf]{singmtx}.
%
% % lots of text omitted
%
% This is the end a very long section all about 
% \glspl[format=)hyperbf]{singmtx}.
%\end{verbatim}
%
%\item Only those terms that have actually been used in the
%document will be placed in the glossary. If you have defined
%a term that doesn't appear in the document, then it means
%you haven't used it in the text (either via \ics{glslink}
%or \ics{gls} and related commands, or via \ics{glsadd}
%or \ics{glsaddall}.)
%
%\item To change the sorting order, use the \gloskey{sort} key.
%For example:
%\begin{verbatim}
%\newglossaryentry{universal}{name={\ensuremath{\mathcal{U}}},
%description=The universal set,
%sort=U}
%\end{verbatim}
%
%\item You don't need to escape \appname{makeindex}'s special characters:
%\begin{verbatim}
%\newglossaryentry{quote}{name={"},
%description={Double quote character}}
%
%\newglossaryentry{exclam}{name={!},
%description={Exclamation mark}}
%
%\newacronym{rna}{RNA}{ribonukleins\"aure}
%\end{verbatim}
%
%\item Associated symbols can also be specified, but whether the
%symbol appears in the glossary depends on the glossary style.
%For example:
%\begin{verbatim}
%\newglossaryentry{metre}{name={metre},
%description={A metric measurement of length},
%symbol={m}}
%\end{verbatim}
%The predefined glossary styles that display the entry symbol
%are: \glostyle{long4col}, \glostyle{long4colheader},
%\glostyle{long4colborder}, \glostyle{long4colheaderborder},
%\glostyle{super4col}, \glostyle{super4colheader}, 
%\glostyle{super4colborder} and \glostyle{super4colheaderborder}.
%All the other styles supplied by this package ignore the associated 
%symbol.
%
%\item Glossary styles can be set using the \pkgopt{style} 
%package option. For example:
%\begin{verbatim}
%\usepackage[style=long3col]{glossaries}
%\end{verbatim}
%or using \ics{glossarystyle}\marg{style}. For example:
%\begin{verbatim}
%\glossarystyle{altlist}
%\end{verbatim}
%The predefined glossary styles provided by the \sty{glossaries}
%bundle are listed in \autoref{sec:styles}.
%\item The list of numbers associated with each glossary entry
%can be suppressed using the package option \pkgopt{nonumberlist}:
%\begin{verbatim}
%\usepackage[nonumberlist]{glossaries}
%\end{verbatim}
%
%\item By default, the glossaries will appear in an unnumbered 
%chapter if chapters are defined, otherwise in an unnumbered
%section. This can be changed using the \pkgopt{section} package
%option. For example, to make the glossaries appear in an unnumbered
%section, even if chapters are defined, do:
%\begin{verbatim}
%\usepackage[section]{glossaries}
%\end{verbatim}
%Other sectional units can also be specified as 
%\pkgopt{section}=\meta{value}. For example, to make the glossaries
%appear in unnumbered subsections:
%\begin{verbatim}
%\usepackage[section=subsection]{glossaries}
%\end{verbatim}
%
%\end{enumerate}
%\section{Overview}\label{sec:overview}
% \changes{1.02}{2007 May 25}{added overview section}
%
%\subsection{Package Options}
%\label{sec:pkgopts}
%
%The \sty{glossaries} package options are as follows:
%\begin{description}
%\item[\pkgopt{toc}] Add the glossaries to the table of contents.
%
%\item[\pkgopt{numberline}] When used with \pkgopt{toc}, this will
%add \cs{numberline}\verb|{}| in the final argument of 
%\cs{addcontentsline}. This will align the table of contents entry 
%with the numbered section titles. Note that this option has no
%effect if the \pkgopt{toc} option is omitted. If \pkgopt{toc} is
%used without \pkgopt{numberline}, the title will be aligned with
%the section numbers rather than the section titles.
%
%\item[\pkgopt{acronym}] Make a separate glossary for acronyms.
%
%\item[\pkgopt{section}] This is a \meta{key}=\meta{value} option.  Its
%value should be the name of a sectional unit (e.g.\ chapter).
%This will make the glossaries appear in the named sectional unit,
%otherwise each glossary will appear in a chapter, if chapters
%exists, otherwise in a section. Unnumbered sectional units will be used
%by default. Example:
%\begin{verbatim}
%\usepackage[section=subsection]{glossaries}
%\end{verbatim}
%You can omit the value if you want to use sections, i.e.\
%\begin{verbatim}
%\usepackage[section]{glossaries}
%\end{verbatim}
%is equivalent to
%\begin{verbatim}
%\usepackage[section=section]{glossaries}
%\end{verbatim}
%You can change this value later in the document using
%\ics{setglossarysection}\marg{type}.
%
%\item[\pkgopt{numberedsection}]
%The glossaries are placed in unnumbered sectional units by default,
%but this can be changed using \pkgopt{numberedsection}. This option can take
%three possible values: \pkgoptval{false}{numberedsection} (no
%number, i.e.\ use starred form), \pkgoptval{nolabel}{numberedsection}
%(numbered, i.e.\ unstarred form, but not labelled) and
%\pkgoptval{autolabel}{numberedsection} (numbered with automatic
%labelling). If \pkgopt[autolabel]{numberedsection} is used, each
%glossary is given a label that matches the glossary type, so the
%main (default) glossary is labelled \texttt{main}, the list of
%acronyms is labelled \texttt{acronym}\footnote{if the
%\pkgopt{acronym} option is used, otherwise the list of
%acronyms is the main glossary} and additional glossaries are labelled
%using the value specified in the first mandatory argument to 
%\cs{newglossary}. For example, if you load \sty{glossaries}
%using:
%\begin{verbatim}
%\usepackage[section,numberedsection=autolabel]{glossaries}
%\end{verbatim}
%then each glossary will appear in a numbered section, and can
%be referenced using something like:
%\begin{verbatim}
%The main glossary is in section~\ref{main} and the list of
%acronyms is in section~\ref{acronym}.
%\end{verbatim}
%If you can't decide whether to have the acronyms in the main
%glossary or a separate list of acronyms, you can use
%\ics{acronymtype} which is set to \texttt{main} if the
%\pkgopt{acronym} option is not used and is set to \texttt{acronym}
%if the \pkgopt{acronym} option is used. For example:
%\begin{verbatim}
%The list of acronyms is in section~\ref{\acronymtype}.
%\end{verbatim}
%
%As from version 1.14, you can add a prefix to the label by
%redefining \DescribeMacro{\glsautoprefix}\cs{glsautoprefix}.
%For example:
%\begin{verbatim}
%\renewcommand*{\glsautoprefix}{glo:}
%\end{verbatim}
%will add \texttt{glo:} to the automatically generated label, so
%you can then, for example, refer to the list of acronyms as follows:
%\begin{verbatim}
%The list of acronyms is in section~\ref{glo:\acronymtype}.
%\end{verbatim}
%Or, if you are undecided on a prefix:
%\begin{verbatim}
%The list of acronyms is in section~\ref{\glsautoprefix\acronymtype}.
%\end{verbatim}
%
%
%\item[\pkgopt{style}] This is a \meta{key}=\meta{value} option. Its 
%value should be the name of the glossary style to use. Predefined 
%glossary styles are listed in \autoref{sec:styles}.
%\item[\pkgopt{nonumberlist}] This option will suppress the 
%associated number lists\iterm{number list} in the glossaries (see also 
%\autoref{sec:numberlists}.)
%\item[\pkgopt{counter}] This is a \meta{key}=\meta{value} option. The
%value should be the name of the default counter to use in the number
%lists\iterm{number list}.
%
%\hypertarget{sanitize}{}\relax\item[\pkgopt{sanitize}] This is a \meta{key}=\meta{value} option whose
%value is also a \meta{key}=\meta{value} list. By default, the
%\sty{glossaries} package sanitizes the values of the
%\gloskey{name}, \gloskey{description} and \gloskey{symbol} keys used
%when defining a new glossary entry. This may lead to unexpected results
%if you try to display these values within the document text. This
%sanitization can be switched off using the \pkgopt{sanitize} package
%option. (See \autoref{sec:pkgopt} and \autoref{sec:newentry} for further details.) For example, to switch off the sanitization for the
%\gloskey{description} and \gloskey{name} keys, but not for the
%\gloskey{symbol} key, do:
%\begin{verbatim}
%\usepackage[sanitize={name=false,description=false,%
%symbol=true}]{glossaries}
%\end{verbatim}
%
%\begin{important}%
%\textbf{Note}: this sanitization only applies to the \gloskey{name}, 
%\gloskey{description} and \gloskey{symbol} keys. It doesn't apply
%to any of the other keys (except the \gloskey{sort} key which is
%always sanitized) so fragile commands contained in the value of
%the other keys must always be protected using \cs{protect}.
%Since the value of the \gloskey{text} key is obtained from the
%\gloskey{name} key, you will still need to protect fragile commands
%in the \gloskey{name} key if you don't use the \gloskey{text} key. 
%\end{important}
%
%\item[\pkgopt{description}] This option changes the definition of
%\ics{newacronym} to allow a description. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{footnote}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{smallcaps}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{smaller}] This option changes the definition of
%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{dua}] This option changes the definition of
%\ics{newacronym} so that acronyms are always expanded. 
%See \autoref{sec:acronyms} for further details.
%
%\item[\pkgopt{shortcuts}] This option provides shortcut commands
%for acronyms.
%See \autoref{sec:acronyms} for further details.
%
%\end{description}
%\subsection{Defining Glossary Entries}
%\label{sec:newglosentry}
%
%All glossary entries must be defined before they are used, so it
%is better to define them in the preamble to ensure this.\footnote{The
%only preamble restriction on \cs{newglossaryentry} and \cs{newacronym}
%was removed in version 1.13, but the restriction remains for
%\cs{loadglsentries}.} However
%only those entries that occur in the document
%(using any of the commands described in \autoref{sec:glslink} and \autoref{sec:glsadd}) will appear in the glossary. Each time an entry is used in this way, a line is added to an associated glossary
%(\filetype{.glo}) file, which then needs to be converted into a
%corresponding \filetype{.gls} file which contains the typeset glossary
%which is input by \ics{printglossary} or
%\ics{printglossaries}.  The Perl script \appname{makeglossaries}
%can be used to call \appname{makeindex}, using a customised
%\filetype{.ist} style file, for each of the glossaries that are defined
%in the document.  Note that there should be no need for you to
%explicitly edit or input any of these external files.
%
%\DescribeMacro{\makeglossaries}
%The command \cs{makeglossaries} must be placed in the preamble in
%order to create the customised \appname{makeindex} \filetype{.ist}
%style file and to ensure that glossary entries are written to the
%appropriate output file. If you omit \cs{makeglossaries} none of the
%glossaries will be created. Note that if your page numbers use a 
%hyphen compositor, you must set this by redefining 
%\DescribeMacro{\glscompositor}\cs{glscompositor} \emph{before}
%using \cs{makeglossaries}:
%\begin{verbatim}
%\renewcommand*{\glscompositor}{-}
%\end{verbatim}
%(The default value of \cs{glscompositor} is a full stop.)
%
%\DescribeMacro{\newglossaryentry}
%New glossary entries are defined using the command:\\[10pt]
%\cs{newglossaryentry}\marg{label}\marg{key-val list}\\[10pt] The first
%argument, \meta{label}, must be a unique label with which to identify
%this entry. The second argument, \meta{key-val list}, is a
%\meta{key}=\meta{value} list that supplies the relevant information
%about this entry. There are two required fields: \gloskey{name} and
%\gloskey{description}. Available fields are listed below:
%
%\begin{description}
%\item[{\gloskey{name}}] The name of the entry (as it will appear in the
%glossary).
%
%\item[{\gloskey{description}}] A brief description of this term (to
%appear in the glossary).
%
%\item[{\gloskey{descriptionplural}}] The plural form of the 
%description (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst}
%by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value
%is set to the same as the \gloskey{description} key.
%
%\item[{\gloskey{text}}] How this entry will appear in the document text
%when using \ics{gls} (or one of its uppercase variants). If this
%field is omitted, the value of the \gloskey{name} key is used.
%
%\item[{\gloskey{first}}] How the entry will appear in the document text
%the first time it is used with \ics{gls} (or one of its uppercase
%variants). If this field is omitted, the value of the \gloskey{text}
%key is used.
%
%\item[{\gloskey{plural}}] How the entry will appear in the document text
%when using \ics{glspl} (or one of its uppercase variants).
%If this field is omitted, the value is obtained by appending 
%\ics{glspluralsuffix} to the value of the \gloskey{text} field.
%
%\item[{\gloskey{firstplural}}] How the entry will appear in the
%document text the first time it is used with \ics{glspl} (or one of its
%uppercase variants). If this field is omitted, the value is obtained
%from the \gloskey{plural} key, if the \gloskey{first} key is omitted,
%or by appending \ics{glspluralsuffix} to the value of the
%\gloskey{first} field, if the \gloskey{first} field is present.
%
%\textbf{Note:} prior to version 1.13, the default value of 
%\gloskey{firstplural} was always taken by appending \dq{s} to the
%\gloskey{first} key, which meant that you had to specify both
%\gloskey{plural} and \gloskey{firstplural}, even if you hadn't
%used the \gloskey{first} key.
%
%\item[{\gloskey{symbol}}] This field is provided to allow the user to
%specify an associated symbol, but most glossary styles ignore
%this value. If omitted, the value is set to \cs{relax}.
%
%\item[{\gloskey{symbolplural}}] This is the plural form of the
%symbol (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst}
%by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value
%is set to the same as the \gloskey{symbol} key.
%
%\item[{\gloskey{sort}}] This value indicates how \appname{makeindex}
%should sort this entry. If omitted, the value is given by the
%\gloskey{name} field.  This value is equivalent to
%\appname{makeindex}'s \dq{actual} character (which is usually the
%at-sign @ although the \sty{glossaries} package uses a different
%symbol).
%
%\item[{\gloskey{type}}] This is the glossary type to which this entry
%belongs. If omitted, the default glossary is assumed.
%The list of acronyms type is given by
%\ics{acronymtype} which will either be \texttt{main} or
%\texttt{acronym}, depending on whether the \pkgopt{acronym} package
%option was used.
%\end{description}
%Note that if the key starts with an accented letter,
%you must group the accented letter, otherwise it will cause a
%problem for commands like \cs{Gls} and \cs{Glspl}. For example:
%\begin{verbatim}
%\newglossaryentry{elite}{name={{\'e}lite},
%description={select group or class}}
%\end{verbatim}
%
%
%\subsubsection{Plurals}
%You may have noticed from above that you can specify the plural form
%when you define a term. If you omit this, the plural will be obtained 
%\DescribeMacro{\glspluralsuffix}by appending \cs{glspluralsuffix} to 
%the singular form. This command defaults to \texttt{s}. For example:
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,description={a fully grown
%female of any bovine animal}}
%\end{verbatim}
%defines a new entry whose singular form is \dq{cow} and plural form 
%is \dq{cows}. However, if you are writing in archaic English, you 
%may want to use \dq{kine} as the plural form, in which case you would 
%have to do:
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,plural=kine,
%description={a fully grown female of any bovine animal}}
%\end{verbatim}
%
%If you are writing in a language that supports
%multiple plurals (for a given term) then use the \gloskey{plural} key
%for one of them (typically the one you are most likely to use) and
%for the others you will need to explicitly write the plural form using
%\cs{glslink} rather than using \cs{glspl}. Returning to the cow 
%example above, suppose you will mostly be using \dq{cows} as the
%plural, but occasionally you want to use \dq{kine} as the plural,
%then define the term as
%\begin{verbatim}
%\newglossaryentry{cow}{name=cow,description={a fully grown
%female of any bovine animal (plural cows, archaic plural kine)}}
%\end{verbatim}
%and use \verb|\glspl{cow}| to produce \dq{cows} and use
%\verb|\glslink{cow}{kine}| to produce \dq{kine}.
%
%If you are using a language that usually forms plurals
%by appending a different letter, or sequence of letters, you can
%redefine \cs{glspluralsuffix} as required. However, this must be
%done \emph{before} the entries are defined. For languages that don't
%form plurals by simply appending a suffix, all the plural forms must be 
%specified using the \gloskey{plural} key (and the \gloskey{firstplural}
%key where necessary). 
%
%
%\subsubsection{Loading Entries From a File}
%\label{sec:loadglsentries}
%
%\DescribeMacro{\loadglsentries}
%You can store all your glossary entry definitions in another
%file, and use:\\[10pt]
%\cs{loadglsentries}\oarg{type}\marg{filename}\\[10pt]
%where \meta{filename} is the name of the file containing all the
%\cs{newglossaryentry} commands. The optional argument
%\meta{type} is the name of the glossary to which those entries
%should belong, for those entries where the \gloskey{type} key has 
%been omitted (or, more specifically, for those entries whose
%type has been specified by \cs{glsdefaulttype}, which is what
%\cs{newglossaryentry} uses by default). For example, suppose I have
%a file called \texttt{myentries.tex} which contains:
%\begin{verbatim}
%\newglossaryentry{perl}{type=main,
%name={Perl},
%description={A scripting language}}
%
%\newglossaryentry{tex}{name={\TeX},
%description={A typesetting language}}
%
%\newglossaryentry{html}{type=\glsdefaulttype,
%name={html},
%description={A mark up language}}
%\end{verbatim}
%and suppose in my document preamble I use the command:
%\begin{verbatim}
%\loadglsentries[languages]{myentries}
%\end{verbatim}
%then this will add the entries \texttt{tex} and \texttt{html}
%to the glossary whose type is given by \texttt{languages}, but
%the entry \texttt{perl} will be added to the main glossary, since
%it explicitly sets the type to \texttt{main}.
%
%\textbf{Note:} if you
%use \cs{newacronym} (see \autoref{sec:acronyms}) the type is set as \verb|type=\acronymtype| 
%unless you explicitly override it. For example, if my file
%\texttt{myacronyms.tex} contains:
%\begin{verbatim}
%\newacronym{aca}{aca}{a contrived acronym}
%\end{verbatim}
%then (supposing I have defined a new glossary type called
%\texttt{altacronym})
%\begin{verbatim}
%\loadglsentries[altacronym]{myacronyms}
%\end{verbatim}
%will add \texttt{aca} to the glossary type \texttt{acronym}, if the
%package option \pkgopt{acronym} has been specified, or will add
%\texttt{aca} to the glossary type \texttt{altacronym}, if the
%package option \pkgopt{acronym} is not specified. In this instance,
%it is better to change \texttt{myacronyms.tex} to:
%\begin{verbatim}
%\newacronym[type=\glsdefaulttype]{aca}{aca}{a contrived acronym}
%\end{verbatim}
%and now
%\begin{verbatim}
%\loadglsentries[altacronym]{myacronyms}
%\end{verbatim}
%will add \texttt{aca} to the glossary type \texttt{altacronym},
%regardless of whether or not the package option \pkgopt{acronym} is
%used.
%
%Note that only those entries that have been used
%in the text will appear in the relevant glossaries.
%Note also that \cs{loadglsentries} may only be used in the 
%preamble.
%\subsection{Number lists}
%\label{sec:numberlists}
%
%Each entry in the glossary has an associated \termdef{number list}. 
%By default,
%these numbers refer to the pages on which that entry has been used
%(using any of the commands described in \autoref{sec:glslink} and \autoref{sec:glsadd}). The number list can be suppressed using the \pkgopt{nonumberlist} package option, or an alternative counter
%can be set as the default using the \pkgopt{counter} package option.
%\subsection{Links to Glossary Entries}
%\label{sec:glslink}
%
%Once you have defined a glossary entry using 
%\ics{newglossaryentry}, you can refer to that entry in the
%document using one of the commands listed in this section. The
%text which appears at that point in the document when using 
%one of these commands is referred to as the 
%\termdef{link text} (even if there are no hyperlinks).
%
%The way the \term{link text} is displayed 
%depends on \DescribeMacro{\glstextformat}\cs{glstextformat}\marg{text}.
%For example, to make all \term{link text} appear in a sans-serif
%font, do:
%\begin{verbatim}
%\renewcommand*{\glstextformat}[1]{\textsf{#1}}
%\end{verbatim}
%
%\DescribeMacro{\glslink}
%The command:\\[10pt]
%\cs{glslink}\oarg{options}\marg{label}\marg{text}\\[10pt]
%will place \cs{glstextformat}\marg{text} in the document at that point
%and add a line into the associated glossary file for the glossary entry
%given by \meta{label}. If hyperlinks are supported, \meta{text} will be
%a hyperlink to the relevant line in the glossary. The optional argument
%\meta{options} must be a \meta{key}=\meta{value} list which can take
%any of the following keys:
%
%\begin{description}
%\item[{\gloskey[glslink]{format}}] This specifies how to format the
%associated number for this entry in the glossary. This value is
%equivalent to the \appname{makeindex} encap value, and (as with
%\cs{index}) the value needs to be the name of a command \emph{without}
%the initial backslash. As with \cs{index}, the characters \verb"(" and
%\verb")" can also be used to specify the beginning and ending of a
%number range.  Again as with \cs{index}, the command should be the name
%of a command which takes an argument (which will be the associated
%number).  Be careful not to use a declaration (such as \cs{bfseries})
%instead of a text block command (such as \cs{textbf}) as the effect is
%not guaranteed to be localised. If you want to apply more than one
%style to a given entry (e.g.\ \textbf{bold} and \emph{italic}) you will
%need to create a command that applies both formats, e.g.\ 
%\begin{verbatim}
%\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}}
%\end{verbatim}
%and use that command.
%
%If you are using hyperlinks and you want to change the font of the
%hyperlink, don't use \cs{hyperpage} (provided by the \isty{hyperref}
%package) as the numbers may not refer to a page number.
%Instead, the \sty{glossaries} package provides the following 
%number formats:
%\begin{center}
%\begin{tabular}{@{\sffamily}lp{0.8\linewidth}}hyperrm & The number is a serif hyperlink to the relevant part of the 
%document\\
%hypersf & The number is a sans-serif hyperlink to the relevant part 
%of the document\\
%hypertt & The number is a monospaced hyperlink to the relevant part 
%of the document\\
%hyperbf & The number is a bold hyperlink to the relevant part of the 
%document\\
%hypermd & The number is a medium weight hyperlink to the relevant 
%part of the document\\
%hyperit & The number is an italic hyperlink to the relevant 
%part of the document\\
%hypersl & The number is a slanted hyperlink to the relevant 
%part of the document\\
%hyperup & The number is an upright hyperlink to the relevant 
%part of the document\\
%hypersc & The number is a small caps hyperlink to the relevant 
%part of the document\\
%hyperemph & The number is an emphasized hyperlink to the relevant 
%part of the document
%\end{tabular}
%\end{center}
%Note that if the \cs{hyperlink} command hasn't been defined,
%the \texttt{hyper}\meta{xx} formats are equivalent to the
%analogous \cs{text}\meta{xx} font commands. If you want to
%make a new format, you will need to define a command which takes
%one argument and use that; for example, if you want the associated 
%number in the glossary to be in a bold sans-serif font, you can define a
%command called, say, \cs{hyperbsf}:
%\begin{verbatim}
%\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}}
%\end{verbatim}
%and then use \texttt{hyperbsf} as the value for the \gloskey{format}
%key.  (See also \autoref{sec:printglos}.)
%\item[{\gloskey[glslink]{counter}}] This specifies which counter
%to use for the associated number for this glossary entry. (See also
%\autoref{sec:numberlists}.)
%\item[{\gloskey[glslink]{hyper}}] This is a boolean key which can
%be used to enable/disable the hyperlink to the relevant entry
%in the glossary. (Note that setting \texttt{hyper=true} will have no
%effect if \cs{hyperlink} has not been defined.) The default
%value is \texttt{hyper=true}.
%
%\end{description}
%\DescribeMacro{\glslink*}
%There is also a starred version:\\[10pt]
%\cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt]
%which is equivalent to \cs{glslink}, except it sets
%\texttt{hyper=false}.
%
%\DescribeMacro{\gls}
%The command:\\[10pt]
%\cs{gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is the same as \cs{glslink}, except that the \term{link text}
%is determined from the values of the \gloskey{text} and 
%\gloskey{first} keys supplied when the entry was defined using
%\ics{newglossaryentry}. If the entry has been marked as having
%been used, the value of the \gloskey{text} key will be used, otherwise
%the value of the \gloskey{first} key will be used. 
%On completion, \cs{gls} will mark the entry given by \meta{label} as
%used.
%
%There are two uppercase variants:\\[10pt]
%\DescribeMacro{\Gls}
%\cs{Gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%and\\[10pt]
%\DescribeMacro{\GLS}
%\cs{GLS}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%which make the first letter of the link or all the link text
%uppercase, respectively.
%
%The final optional argument \meta{insert}, allows you to insert
%some additional text into the link text. By default, this will
%append \meta{insert} at the end of the link text, but this
%can be changed (see 
%\autoref{sec:glsdisplay}). 
%
%The first optional argument \meta{options} is the same as the optional
%argument to \ics{glslink}. As with \cs{glslink}, these commands also
%have a starred version that disable the hyperlink.
%
%There are also analogous plural forms:\\[10pt]
%\DescribeMacro{\glspl}
%\cs{glspl}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%\DescribeMacro{\Glspl}
%\cs{Glspl}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSpl}
%\cs{GLSpl}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%These determine the link text from the \gloskey{plural} and
%\gloskey{firstplural} keys supplied when the entry was first
%defined. As before, these commands also have
%a starred version that disable the hyperlink.
%
%\DescribeMacro{\glstext}The command:\\[10pt]
%\cs{glstext}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{gls} except that it always uses the value
%of the \gloskey{text} key and does not mark the entry as
%having been used. Unlike \cs{gls}, the inserted text \meta{insert} 
%is always appended to the link text.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glstext}
%\cs{Glstext}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLStext}
%\cs{GLStext}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsfirst}The command:\\[10pt]
%\cs{glsfirst}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{first} key. Again, \meta{insert} is always appended
%to the end of the link text and does not mark the entry as having
%been used.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsfirst}
%\cs{Glsfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSfirst}
%\cs{GLSfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsplural}The command:\\[10pt]
%\cs{glsplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{plural} key. Again, \meta{insert} is always appended
%to the end of the link text and does not mark the entry as having
%been used.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsplural}
%\cs{Glsplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSplural}
%\cs{GLSplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsfirstplural}The command:\\[10pt]
%\cs{glsfirstplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{firstplural} key. Again, \meta{insert} is always 
%appended to the end of the link text and does not mark the entry as
%having been used.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsfirstplural}
%\cs{Glsfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSfirstplural}
%\cs{GLSfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsname}The command:\\[10pt]
%\cs{glsname}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value of the
%\gloskey{name} key. Again, \meta{insert} is always appended to the end
%of the link text and does not mark the entry as having
%been used.  Note: if you want to use this command and the
%\gloskey{name} key contains commands, you will have to disable the
%\hyperlink{sanitize}{sanitization} of the \gloskey{name} key and protect fragile commands.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsname}
%\cs{Glsname}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSname}
%\cs{GLSname}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glssymbol}The command:\\[10pt]
%\cs{glssymbol}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value of the
%\gloskey{symbol} key. Again, \meta{insert} is always appended to the
%end of the link text and does not mark the entry as having
%been used.  Note: if you want to use this command and the
%\gloskey{symbol} key contains commands, you will have to disable the
%\hyperlink{sanitize}{sanitization} of the \gloskey{symbol} key and protect fragile commands.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glssymbol}
%\cs{Glssymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSsymbol}
%\cs{GLSsymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%\DescribeMacro{\glsdesc}The command:\\[10pt]
%\cs{glsdesc}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%is similar to \ics{glstext} except that it always uses the value
%of the \gloskey{description} key. Again, \meta{insert} is always
%appended to the end of the link text and does not mark the entry as 
%having been used.  Note: if you want to use this
%command and the \gloskey{description} key contains commands, you will
%have to disable the
%\hyperlink{sanitize}{sanitization} of the \gloskey{description} key and protect fragile commands.
%
%There are also analogous commands:\\[10pt]
%\DescribeMacro{\Glsdesc}
%\cs{Glsdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%\DescribeMacro{\GLSdesc}
%\cs{GLSdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt]
%As before, these commands also have a starred version that disable
%the hyperlink.
%
%
%\subsubsection{Changing the format of the link text}
%\label{sec:glsdisplay}
%
%The format of the \term{link text} for \ics{gls}, \ics{glspl}
%and their uppercase variants is governed by two commands:
%\DescribeMacro{\glsdisplayfirst}\cs{glsdisplayfirst}, which is used the
%first time a glossary entry is used in the text and
%\DescribeMacro{\glsdisplay}\cs{glsdisplay}, which is used subsequently.
%Both commands take four arguments: the first is either the singular or
%plural form given by the \gloskey{text}, \gloskey{plural},
%\gloskey{first} or \gloskey{firstplural} keys (used when the term was
%defined) depending on context; the second argument is the term's
%description (as supplied by the \gloskey{description} key); the third
%argument is the symbol associated with the term (as supplied by the
%\gloskey{symbol} key) and the fourth argument is the additional text
%supplied in the final optional argument to \cs{gls} or
%\cs{glspl} (or their uppercase variants). The default definitions
%of \cs{glsdisplay} and \cs{glsdisplayfirst} simply
%print the first argument immediately followed by the fourth argument.
%The remaining arguments are ignored.
%
%For example, suppose you want a glossary of measurements and
%units, you can use the \gloskey{symbol} key to store the unit:
%\begin{verbatim}
%\newglossaryentry{distance}{name=distance,
%description={The length between two points},
%symbol={km}}
%\end{verbatim}
%and now suppose you want \verb|\gls{distance}| to produce
%\dq{distance (km)} on first use, then you can redefine
%\cs{glsdisplayfirst} as follows:
%\begin{verbatim}
%\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}
%\end{verbatim}
%Note that the additional text is placed after \verb|#1|, so
%\verb|\gls{distance}['s]| will produce \dq{distance's (km)}
%rather than \dq{distance (km)'s} which looks a bit odd (even though
%it may be in the context of \dq{the distance (km) is measured between
%the two points} --- but in this instance it may be better not to
%use a contraction).
%
%Note also that all of the \term{link text} will be formatted according
%to \ics{glstextformat} (described earlier). So if you do, say:
%\begin{verbatim}
%\renewcommand{\glstextformat}[1]{\textbf{#1}}
%\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}
%\end{verbatim}
%then \verb|\gls{distance}| will produce \dq{\textbf{distance (km)}}.
%
%If you have multiple glossaries, changing \cs{glsdisplayfirst} and
%\cs{glsdisplay} will change the way entries for all of the
%glossaries appear when using commands \cs{gls}, \cs{glspl} and their
%uppercase variants.  If you only
%want the change to affect entries for a given glossary, then you need
%to use \DescribeMacro{\defglsdisplay}\cs{defglsdisplay} and
%\DescribeMacro{\defglsdisplayfirst}\cs{defglsdisplayfirst} instead
%of redefining \cs{glsdisplay} and \cs{glsdisplayfirst}.
%
%Both \cs{defglsdisplay} and \cs{defglsdisplayfirst} take two arguments:
%the first (which is optional) is the glossary's label\footnote{\texttt{main} for the main
%(default) glossary, \cs{acronymtype} for the list of acronyms, or the
%name supplied in the first mandatory argument to \cs{newglossary} for
%additional glossaries.} and the second is how the term should be
%displayed when it is invoked using commands \cs{gls}, 
%\cs{glspl} and their uppercase variants. This is similar to the way \cs{glsdisplayfirst} was
%redefined above.
%
%For example, suppose you have created a new glossary called
%\texttt{notation} and you want to change the way the entry is
%displayed on first use so that it includes the symbol, you can
%do:
%\begin{verbatim}
%\defglsdisplayfirst[notation]{#1#4 (denoted #3)}
%\end{verbatim}
%Now suppose you have defined an entry as follows:
%\begin{verbatim}
%\newglossaryentry{set}{type=notation,
%name=set,
%description={A collection of objects},
%symbol={$S$}
%}
%\end{verbatim}
%The first time you reference this entry using \cs{gls} it
%will be displayed as: \dq{set (denoted $S$)} (similarly for \cs{glspl} and the uppercase variants).
%
%Remember that if you use the \gloskey{symbol} key, you need to use a
%glossary style that displays the symbol, as many of the styles ignore
%it. In addition, if you want either the description or symbol to appear
%in the \term{link text}, you will have to disable the
%\hyperlink{sanitize}{sanitization} of these keys and protect fragile commands.
%\subsubsection{Enabling and disabling hyperlinks to glossary entries}
%
%If you load the \isty{hyperref} or \isty{html} packages prior to
%loading the \sty{glossaries} package, commands such as \ics{glslink}
%and \ics{gls}, described above, will automatically have hyperlinks
%to the relevant glossary entry, unless the \gloskey[glslink]{hyper}
%option has been set to \texttt{false}. You can disable or enable links using:\\[10pt]
%\DescribeMacro{\glsdisablehyper}\cs{glsdisablehyper}\\[10pt]
%and\\[10pt]
%\DescribeMacro{\glsenablehyper}\cs{glsenablehyper}\\[10pt]
%respectively. The effect can be localised by placing the commands
%within a group. Note that you should only use \cs{glsenablehyper}
%if the commands \ics{hyperlink} and \ics{hypertarget} have been
%defined (for example, by the \isty{hyperref} package).
%
%\subsection{Adding an entry to the glossary without generating text}
%\label{sec:glsadd}
%
%\DescribeMacro{\glsadd}
%It is possible to add a line in the glossary file without
%generating any text at that point in the document using:\\[10pt]
%\cs{glsadd}\oarg{options}\marg{label}\\[10pt]
%This is similar to \ics{glslink}, only it doesn't produce
%any text (so therefore, there is no \gloskey[glslink]{hyper} key
%available in \meta{options} but all the other options that can
%be used with \cs{glslink} can be passed to \cs{glsadd}).
%For example, to add a page range to the glossary number list for the
%entry whose label is given by \texttt{set}:
%\begin{verbatim}
%\glsadd[format=(]{set}
%Lots of text about sets spanning many pages.
%\glsadd[format=)]{set}
%\end{verbatim}
%
%\DescribeMacro{\glsaddall}
%To add all entries that have been defined, use:\\[10pt]
%\cs{glsaddall}\oarg{options}\\[10pt]
%The optional argument is the same as for \cs{glsadd}, except
%there is also a key \gloskey[glsaddall]{types} which can be
%used to specify which glossaries to use. This should be a
%comma separated list. For example, if you only want to add
%all the entries belonging to the list of acronyms (specified by
%the glossary type \cs{acronymtype}) and a list of
%notation (specified by the glossary type \texttt{notation}) then you can
%do:
%\begin{verbatim}
%\glsaddall[types={\acronymtype,notation}]
%\end{verbatim}
%
%\subsection{Displaying a glossary}
%
%\DescribeMacro{\printglossaries}
%The command \cs{printglossaries} will display all the
%glossaries in the order in which they were defined. 
%Note that no glossaries will appear until
%you have either used the Perl script \appname{makeglossaries}
%or have directly used \appname{makeindex} (as described in 
%\autoref{sec:makeglossaries}). If the glossary still does not appear after you re-\LaTeX\ your document, check
%the \appname{makeindex} log files to see if there is a problem.
%Remember that you also need to use the command \ics{makeglossaries} in
%the preamble to enable the glossaries.
%
%\DescribeMacro{\printglossary}
%An individual glossary can be displayed using:\\[10pt]
%\cs{printglossary}\oarg{options}\\[10pt]
%where \meta{options} is a \meta{key}=\meta{value} list of options. 
%The following keys are available:
%\begin{description}
%\item[{\gloskey[printglossary]{type}}] The value of this key
%specifies which glossary to print. If omitted, the default
%glossary is assumed. For example, to print the list of acronyms:
%\begin{verbatim}
%\printglossary[type=\acronymtype]
%\end{verbatim}
%
%\item[{\gloskey[printglossary]{title}}] This is the glossary's
%title (overriding the title specified when the glossary was 
%defined).
%
%\item[{\gloskey[printglossary]{toctitle}}] This is the title
%to use for the table of contents (if the \pkgopt{toc} package
%option has been used). If omitted, the glossary title is used.
%
%\item[{\gloskey[printglossary]{style}}] This specifies which
%glossary style to use for this glossary, overriding the effect
%of the \pkgopt{style} package option or \ics{glossarystyle}.
%
%\item[{\gloskey[printglossary]{numberedsection}}] This specifies
%whether to use a numbered section for this glossary, overriding
%the effect of the \pkgopt{numberedsection} package option. This
%key has the same syntax as the \pkgopt{numberedsection} package
%option, described in \autoref{sec:pkgopts}.
%\item[{\gloskey[printglossary]{nonumberlist}}] Unlike the package option
%of the same name, this key is a boolean key. If true (\verb|nonumberlist=true|) the numberlist
%is suppressed for this glossary. If false (\verb|nonumberlist=false|) the numberlist is
%displayed for this glossary. If no value is supplied, true is 
%assumed.
%
%\end{description}
%
%\DescribeMacro{\glossarypreamble}
%Information can be added to the start of the glossary by redefining
%\cs{glossarypreamble}. For example:
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Numbers in italic indicate
%primary definitions.}
%\end{verbatim}
%This needs to be done before the glossary is displayed using
%\cs{printglossaries} or \cs{printglossary}. Note that if you
%want a different preamble for each glossary, you will need to
%use a separate \cs{printglossary} for each glossary and change
%the definition of \cs{glossarypreamble} between each glossary.
%For example:
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Numbers in italic indicate
%primary definitions.}
%\printglossary
%\renewcommand{\glossarypreamble}{}
%\printglossary[type=acronym]
%\end{verbatim}
%Alternatively, you can do something like:
%\begin{verbatim}
%\renewcommand{\glossarypreamble}{Numbers in italic indicate
%primary definitions.\gdef\glossarypreamble{}}
%\printglossaries
%\end{verbatim}
%which will print the preamble text for the first glossary and 
%change the preamble to do nothing for subsequent glossaries.
%(Note that \cs{gdef} is required as the glossary is placed within
%a group.)
%
%\DescribeMacro{\glossarypostamble}There is an analogous command
%called \cs{glossarypostamble} which is placed at the end of each
%glossary.
%\subsubsection{Changing the way the entry name appears in the glossary}
%\label{sec:glsnamefont}
%
%\DescribeMacro{\glsnamefont}Within each glossary, each entry name is
%formatted according to \cs{glsnamefont} which takes one argument: the
%entry name. This command is always used regardless of the glossary
%style.  By default, \cs{glsnamefont} simply displays its argument in
%whatever the surrounding font happens to be. This means that in the
%list styles the name will appear in bold, since the name is placed in
%the optional argument of \cs{item}, whereas in the tabular styles the
%name will appear in the normal font.
%
%For example, suppose you want all the entry names to appear in 
%medium weight small caps, then you can do:
%\begin{verbatim}
%\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}}
%\end{verbatim}
%
%\subsection{Defining New Glossaries}
%
%\DescribeMacro{\newglossary}
%A new glossary can be defined using:\\[10pt]
%\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}\marg{title}\oarg{counter}\\[10pt]
%where \meta{name} is the label to assign to this glossary. The arguments
%\meta{in-ext} and \meta{out-ext} specify the extensions to give to the
%input and output files for that glossary, \meta{title} is the default
%title for this new glossary and the final optional argument
%\meta{counter} specifies which counter to use for the associated number
%lists\iterm{number list} (see also \autoref{sec:numberlists}). The first optional argument specifies the extension for the
%\appname{makeindex} transcript file (this information is only used by
%\appname{makeglossaries} which picks up the information from the
%auxiliary file).
%
%Note that the main (default) glossary is automatically created as:
%\begin{verbatim}
%\newglossary{main}{gls}{glo}{\glossaryname}
%\end{verbatim}
%so it can be identified by the label \texttt{main}. Using the
%\pkgopt{acronym} package option is equivalent to:
%\begin{verbatim}
%\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
%\end{verbatim}
%so it can be identified by the label \texttt{acronym}. If you are
%not sure whether the \pkgopt{acronym} option has been used, you
%can identify the list of acronyms by the command 
%\DescribeMacro{\acronymtype}\cs{acronymtype} which is set to
%\texttt{acronym}, if the \pkgopt{acronym} option has been used,
%otherwise it is set to \texttt{main}.
%\subsection{Acronyms}
%\label{sec:acronyms}
%
%\DescribeMacro{\newacronym}
%As you may have noticed in \autoref{sec:newglosentry}, when you specify a new entry, you can specify alternate text to use when
%the term is first used in the document. This provides a useful
%means to define acronyms. For convenience, the \sty{glossaries} package
%defines the command:\\[10pt]
%\cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long}\\[10pt]
%By default, this is equivalent to:\vskip5pt
%\begin{ttfamily}\par\noindent
%\cs{newglossaryentry}\textrm{\marg{label}}\{type=\cs{acronymtype},\\
%name=\textrm{\marg{abbrv}},\\
%description=\textrm{\marg{long}},\\
%text=\textrm{\marg{abbrv}},\\
%first=\{\textrm{\meta{long}} (\textrm{\meta{abbrv}})\},\\
%plural=\{\textrm{\meta{abbrv}}\cs{glspluralsuffix}\},\\
%firstplural=\{\textrm{\meta{long}}\cs{glspluralsuffix}\cs{space}
%(\textrm{\meta{abbrv}}\cs{glspluralsuffix})\},\\
%\textrm{\meta{key-val list}}\}\par
%\end{ttfamily}
%\vskip5pt
%As mentioned in the previous section, the command \cs{acronymtype} is
%the name of the glossary in which the acronyms should appear. If the
%\pkgopt{acronym} package option has been used, this will be
%\texttt{acronym}, otherwise it will be \texttt{main}. The acronyms can
%then be used in exactly the same way as any other glossary entry.
%
%\begin{important}%
%\textbf{Note:} since \cs{newacronym} sets \verb|type=\acronymtype|,
%if you want to load a file containing acronym definitions using
%\cs{loadglsentries}\oarg{type}\marg{filename}, the optional argument 
%\meta{type} will not have an effect unless you explicitly set the
%type as \verb|type=\glsdefaulttype|. See \autoref{sec:loadglsentries}.\end{important}
%
%For example, the following defines the acronym IDN:
%\begin{verbatim}
%\newacronym{idn}{IDN}{identification number}
%\end{verbatim}
%This is equivalent to:
%\begin{verbatim}
%\newglossaryentry{idn}{type=\acronymtype,
%name={IDN},
%description={identification number},
%text={IDN},
%first={identification number (IDN)},
%plural={IDNs},
%firstplural={identification numbers (IDNs)}}
%\end{verbatim}
%so \verb|\gls{idn}| will produce \dq{identification number (IDN)} on
%first use and \dq{IDN} on subsequent uses.
%
%This section describes acronyms that have been defined using
%\cs{newacronym}. If you prefer to define all your acronyms using
%\cs{newglossaryentry} explicitly, then you should skip this section
%and ignore the package options: \pkgopt{smallcaps}, \pkgopt{smaller},
%\pkgopt{description}, \pkgopt{dua}, \pkgopt{footnote} and
%\pkgopt{shortcuts}, as these options change the
%definition of \ics{newacronym} for common acronym formats
%as well as the way that the link text is displayed (see
%\autoref{sec:glsdisplay}). Likewise you should ignore the new commands described in this section,
%such as \cs{acrshort}, as they vary according to the definition of
%\cs{newacronym}.
%
%
%\Tableref{tab:acronymsettings} lists the package options and how the
%\ics{newglossaryentry} keys are used to store \meta{long} (the long
%form) and \meta{abbrv} (the short form). Note that the
%\pkgopt{smallcaps} option redefines
%\DescribeMacro{\acronymfont}\cs{acronymfont} so that it sets its
%argument using \cs{textsc} (so you should use lower case characters in
%\meta{abbrv}) and the \pkgopt{smaller} option redefines
%\cs{acronymfont} to use \cs{smaller},\footnote{you will need to load a
%package, such as \sty{relsize}, that defines \cs{smaller} if you use
%this option.} otherwise \cs{acronymfont} simply displays its argument
%in the surrounding font. Note also that if none of the package options
%\pkgopt{smallcaps}, \pkgopt{smaller}, \pkgopt{dua},
%\pkgopt{description} or \pkgopt{footnote} are used, \cs{acronymfont} is
%not used, so changing the definition of \cs{acronymfont} will have no
%effect under such circumstances.
%
%If you want to display the acronym in another font, for example,
%emphasized, then use the \pkgopt{smaller} package option and
%redefine \ics{acronymfont} to use the required font. For example:
%\begin{verbatim}
%\usepackage[smaller]{glossaries}
%\renewcommand*{\acronymfont}[1]{\emph{#1}}
%\end{verbatim}
%Where \cs{acronymfont} is available, 
%\DescribeMacro{\firstacronymfont}\cs{firstacronymfont} is also
%available. By default, this simply uses \cs{acronymfont}, but it
%can be redefined to change the way the acronym is displayed on
%first use.
%
%\begin{table}[htbp]
%\caption{Package options governing \cs{newacronym} and how the 
%information is stored in the keys for \cs{newglossaryentry}}
%\label{tab:acronymsettings}
%\begin{center}
%\begin{tabular}{lllll}
%\bfseries Package Option &
%\gloskey{first} key &
%\gloskey{text} key &
%\gloskey{description} key &
%\gloskey{symbol} key\\
%\pkgopt{description},\pkgopt{footnote} &
%\meta{abbrv} &
%\meta{abbrv} &
%user supplied &
%\meta{long}\\
%\pkgopt{description},\pkgopt{dua} &
%\meta{long} &
%\meta{long} &
%user supplied &
%\meta{abbrv}\\
%\pkgopt{description} &
%\meta{long} &
%\meta{abbrv} &
%user supplied &
%\meta{abbrv}\\
%\pkgopt{footnote} &
%\meta{abbrv} &
%\meta{abbrv} &
%\meta{long} &
% \\
%\pkgopt{smallcaps} &
%\meta{long} &
%\meta{abbrv} &
%\meta{long} &
%\meta{abbrv}\\
%\pkgopt{smaller} &
%\meta{long} &
%\meta{abbrv} &
%\meta{long} &
%\meta{abbrv}\\
%\pkgopt{dua} &
%\meta{long} &
%\meta{long} &
%\meta{long} &
%\meta{abbrv}\\
%None of the above&
%\meta{long} (\meta{abbrv}) &
%\meta{abbrv} &
%\meta{long} &
%\end{tabular}
%\end{center}
%\end{table}
%
%In case you can't remember which key stores the long or short forms
%(or their plurals) the \sty{glossaries} package provides the 
%commands:
%\begin{itemize}
%\item\DescribeMacro{\glsshortkey}\cs{glsshortkey}
%The key used to store the short form.
%\item\DescribeMacro{\glsshortpluralkey}\cs{glsshortpluralkey}
%The key used to store the plural version of the short form.
%\item\DescribeMacro{\glslongkey}\cs{glslongkey}
%The key used to store the long form.
%\item\DescribeMacro{\glslongpluralkey}\cs{glslongpluralkey}
%The key used to store the plural version of the long form.
%\end{itemize}
%These can be used in the optional argument of \cs{newacronym}
%to override the defaults. For example:
%\begin{verbatim}
%\newacronym[\glslongpluralkey={diagonal matrices}]{dm}{DM}{diagonal 
%matrix}
%\end{verbatim}
%If the first use uses the plural form, \verb|\glspl{dm}| will
%display: diagonal matrices (DMs).
%
%Each of the package options \pkgopt{smallcaps}, \pkgopt{smaller}, 
%\pkgopt{footnote}, \pkgopt{dua}
%and \pkgopt{description} use \ics{defglsdisplay} and 
%\ics{defglsdisplayfirst} (described in \autoref{sec:glsdisplay}) 
%to change the way the link text is displayed.
%
%\begin{description}
%\item[\pkgopt{description},\pkgopt{footnote}]\mbox{}\par When these two package options are used together, the first use displays
%the entry as:\\[10pt]
%\cs{firstacronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long} 
%\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%where \meta{insert} indicates the text supplied in the final
%optional argument to \cs{gls}, \cs{glspl} or their uppercase 
%variants.
%
%Note also that when these two package options are used (in the
%given order), the \sty{glossaries} package additionally implements the
%\pkgopt{sanitize} option using 
%\ipkgopt[description]{sanitize}\ipkgopt[symbol]{sanitize}\verb|sanitize={description=false,symbol=false}|, so 
%remember to protect fragile commands when defining acronyms.
%
%\item[\pkgopt{dua}]\mbox{}\par The \pkgopt{dua} package option always displays the expanded
%form and so may not be used with \pkgopt{footnote}, \pkgopt{smaller} or 
%\pkgopt{smallcaps}. Both first use and subsequent use displays the
%entry in the form:\\[10pt]
%\meta{long}\meta{insert}\\[10pt]
%If the \pkgopt{description} package option is also used, the 
%\gloskey{name} key is set to the long form, otherwise the
%\gloskey{name} key is set to the short form and the
%\gloskey{description} key is set to the long form.
%
%\item[\pkgopt{description}]\mbox{}\par This package option displays the entry on first use as:\\[10pt]
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%\item[\pkgopt{footnote}]\mbox{}\par This package option displays the entry on first use as:\\[10pt]
%\cs{firstacronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long}\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}
%
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[description]{sanitize}\verb|sanitize={description=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%\item[\pkgopt{smallcaps}]\mbox{}\par If neither the \pkgopt{footnote} nor \pkgopt{description} options
%have been set, this option displays the entry on first use as:\\[10pt]
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%where \cs{acronymfont} is set to \verb|\textsc{#1}|, so \meta{abbrv}
%should be specified in lower case.
%
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%\item[\pkgopt{smaller}]\mbox{}\par If neither the \pkgopt{footnote} nor \pkgopt{description} options
%have been set, this option displays the entry on first use as:\\[10pt]
%\meta{long}\meta{insert} (\cs{firstacronymfont}\marg{abbrv})\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt]
%where \cs{acronymfont} is set to \verb|{\smaller #1}|.
%
%Remember to load a package that defines \ics{smaller} (such as
%\isty{relsize}) if you want to use this option.
%
%Note also that if this package option is used, the \sty{glossaries}
%package additionally implements the option 
%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so
%remember to protect fragile commands when defining acronyms.
%
%\item[None of the above]\mbox{}\par If none of the package options \pkgopt{smallcaps}, \pkgopt{smaller},
%\pkgopt{footnote}, \pkgopt{dua} or \pkgopt{description} are used, 
%then on first use the entry is displayed as:\\[10pt]
%\meta{long} (\meta{abbrv})\meta{insert}\\[10pt]
%while subsequent use displays the entry as:\\[10pt]
%\meta{abbrv}\meta{insert}
%\end{description}
%
%Recall from \autoref{sec:glslink} that you can access the values of individual keys using commands
%like \ics{glstext}, so it is possible to use these commands to
%print just the long form or just the abbreviation without affecting
%the flag that determines whether the entry has been used. However
%the keys that store the long and short form vary depending on
%the acronym style, so the \sty{glossaries} package provides
%commands that are set according to the package options. These are
%as follows:
%\vspace{10pt}\par\noindent
%\DescribeMacro{\acrshort}
%\cs{acrshort}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\Acrshort}
%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\ACRshort}
%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%Print the abbreviated version with a hyperlink (if necessary) to the
%relevant entry in the glossary. This is usually equivalent to
%\ics{glstext} (or its uppercase variants) but may additionally
%put the link text within the argument to \ics{acronymfont}.
%\vspace{10pt}\par\noindent
%\DescribeMacro{\acrlong}
%\cs{acrlong}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\Acrlong}
%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\ACRlong}
%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%Print the long version with a hyperlink (if necessary) to the
%relevant entry in the glossary. This is may be equivalent to
%\ics{glsdesc},  \ics{glssymbol} or \ics{glsfirst} (or their uppercase 
%variants), depending on package options.
%\vspace{10pt}\par\noindent
%\DescribeMacro{\acrfull}
%\cs{acrfull}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\Acrfull}
%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\
%\DescribeMacro{\ACRfull}
%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\[10pt]
%Print the long version followed by the abbreviation in brackets 
%with a hyperlink (if necessary) to the
%relevant entry in the glossary.
%
%Note that if you change the definition of \ics{newacronym}, you
%may additionally need to change the above commands as well as
%the changing way the text is displayed using \ics{defglsdisplay}
%and \ics{defglsdisplayfirst}.
%
%The package option \pkgopt{shortcuts} provides the synonyms listed
%in \tableref{tab:shortcuts}. If any of those commands generate
%an \dq{undefined control sequence} error message, check that you
%have enabled the shortcuts using the \pkgopt{shortcuts} package 
%option. Note that there are no shortcuts for the commands that
%produce all upper case text.
%
%\begin{table}[htbp]
%\caption{Synonyms provided by the package option \pkgopt{shortcuts}}
%\label{tab:shortcuts}
%\begin{center}
%\begin{tabular}{ll}
%\bfseries Shortcut Command & \bfseries Equivalent Command\\
%\ics{acs} & \ics{acrshort}\\
%\ics{Acs} & \ics{Acrshort}\\
%\ics{acsp} & \ics{acrshortpl}\\
%\ics{Acsp} & \ics{Acrshortpl}\\
%\ics{acl} & \ics{acrlong}\\
%\ics{Acl} & \ics{Acrlong}\\
%\ics{aclp} & \ics{acrlongpl}\\
%\ics{Aclp} & \ics{Acrlongpl}\\
%\ics{acf} & \ics{acrfull}\\
%\ics{Acf} & \ics{Acrfull}\\
%\ics{acfp} & \ics{acrfullpl}\\
%\ics{Acfp} & \ics{Acrfullpl}\\
%\ics{ac} & \ics{gls}\\
%\ics{Ac} & \ics{Gls}\\
%\ics{acp} & \ics{glspl}\\
%\ics{Acp} & \ics{Glspl}
%\end{tabular}
%\end{center}
%\end{table}
%
%
%\subsection{Unsetting and resetting entry flags}
%
%When using \ics{gls}, \ics{glspl} and their uppercase variants it is
%possible that you may want to use the value given by the
%\gloskey{first} key, even though you have already used the glossary
%entry. Conversely, you may want to use the value given by the
%\gloskey{text} key, even though you haven't used the glossary entry.
%The former can be achieved by one of the following commands:\\[10pt]
%\DescribeMacro{\glsreset}\cs{glsreset}\marg{label}\\
%\DescribeMacro{\glslocalreset}\cs{glslocalreset}\marg{label}\\[10pt]
%while the latter can be achieved by one of the following commands:\\[10pt]
%\DescribeMacro{\glsunset}\cs{glsunset}\marg{label}\\
%\DescribeMacro{\glslocalunset}\cs{glslocalunset}\marg{label}
%\\[10pt]
%You can determine whether an entry has been used using:\\[10pt]
%\DescribeMacro{\ifglsused}
%\cs{ifglsused}\marg{label}\marg{true part}\marg{false part}\\[10pt]
%where \meta{label} is the label of the required entry. If the
%entry has been used, \meta{true part} will be done, otherwise
%\meta{false part} will be done.
%
%\subsection{Glossary Styles}
%\label{sec:styles}
%The \sty{glossaries} package comes with some pre-defined
%glossary styles. These are as follows:
%\begin{description}
%\item[list] The \glostyle{list} style uses the \envname{description}
%environment. The entry name is placed in the optional argument
%of the \cs{item} command (so it will appear in bold by
%default). The description follows, and then the associated number
%list for that entry. Sub groups are separated using \cs{indexspace}.
%
%\item[listgroup] The \glostyle{listgroup} style is like 
%\glostyle{list} but the glossary groups have headings.
%
%\item[listhypergroup] The \glostyle{listhypergroup} style is like 
%\glostyle{listgroup} but has a set of links to the glossary 
%groups. The start of the glossary has a navigation panel to
%each group that is present in the glossary. This requires an
%additional run through \LaTeX\ to ensure the group information
%is up-to-date.  In the navigation panel, each group is separated
%by \DescribeMacro{\glshypernavsep}\cs{glshypernavsep} which 
%defaults to a vertical bar with a space on either side. For example,
%to simply have a space separating each group, do:
%\begin{verbatim}
%\renewcommand*{\glshypernavsep}{\space}
%\end{verbatim}
%
%Note that the hyper-navigation panel is now (as from version 1.14) 
%set inside the optional argument to \cs{item} instead of after it
%to prevent a spurious space at the start. This can be changed
%by redefining \ics{glossaryheader}, but note that this needs to
%be done \emph{after} the glossary style has been set.
%
%\item[altlist] The \glostyle{altlist} style is like \glostyle{list}
%but the description is placed on the following line.
%
%\item[altlistgroup] The \glostyle{altlistgroup} style is like 
%\glostyle{altlist} but the glossary groups have headings.
%
%\item[altlisthypergroup] The \glostyle{altlisthypergroup} style is like 
%\glostyle{altlistgroup} but has a set of links to the glossary 
%groups. The navigation panel is the same as that for 
%\glostyle{listhypergroup}, described above.
%
%\item[listdotted] This style uses the \envname{description}
%environment.  Each entry starts with \verb|\item[]|, followed by the
%name followed by a dotted line, followed by the description. Note that
%this style ignores both the \term{number list} and the symbol. The
%length \DescribeMacro{\glslistdottedwidth}\cs{glslistdottedwidth}
%governs where the description should start.\footnote{This style was
%supplied by Axel~Menzel.}
%
%\item[long] The \glostyle{long} style uses the \envname{longtable}
%environment (defined by the \isty{longtable} package). It has two
%columns: the first column contains the entry's name and the second
%column contains the description followed by the \term{number list}.
%Sub groups are separated with a blank row.
%
%\item[longborder] The \glostyle{longborder} style is like
%\glostyle{long} but has horizontal and vertical lines around it.
%
%\item[longheader] The \glostyle{longheader} style is like
%\glostyle{long} but has a header row.
%
%\item[longheaderborder] The \glostyle{longheaderborder} style is
%like \glostyle{longheader} but has horizontal and vertical lines
%around it.
%
%\item[long3col] The \glostyle{long3col} style is like
%\glostyle{long} but has three columns. The first column contains
%the entry's name, the second column contains the description
%and the third column contains the \term{number list}.
%
%\item[long3colborder] The \glostyle{long3colborder} style is like
%the \glostyle{long3col} style but has horizontal and vertical
%lines around it.
%
%\item[long3colheader] The \glostyle{long3colheader} style is like
%\glostyle{long3col} but has a header row.
%
%\item[long3colheaderborder] The \glostyle{long3colheaderborder} style is
%like \glostyle{long3colheader} but has horizontal and vertical lines
%around it.
%
%\item[long4col] The \glostyle{long4col} style is like 
%\glostyle{long3col} but has an additional column in which the
%entry's associated symbol appears.
%
%\item[long4colborder] The \glostyle{long4colborder} style is like
%the \glostyle{long4col} style but has horizontal and vertical
%lines around it.
%
%\item[long4colheader] The \glostyle{long4colheader} style is like
%\glostyle{long4col} but has a header row.
%
%\item[long4colheaderborder] The \glostyle{long4colheaderborder} style is
%like \glostyle{long4colheader} but has horizontal and vertical lines
%around it.
%
%\item[super] The \glostyle{super} style uses the \envname{supertabular}
%environment (defined by the \isty{supertabular} package). It has two
%columns: the first column contains the entry's name and the second
%column contains the description followed by the \term{number list}.
%Sub groups are separated with a blank row.
%
%\item[superborder] The \glostyle{superborder} style is like
%\glostyle{super} but has horizontal and vertical lines around it.
%
%\item[superheader] The \glostyle{superheader} style is like
%\glostyle{super} but has a header row.
%
%\item[superheaderborder] The \glostyle{superheaderborder} style is
%like \glostyle{superheader} but has horizontal and vertical lines
%around it.
%
%\item[super3col] The \glostyle{super3col} style is like
%\glostyle{super} but has three columns. The first column contains
%the entry's name, the second column contains the description
%and the third column contains the \iterm{number list}.
%
%\item[super3colborder] The \glostyle{super3colborder} style is like
%the \glostyle{super3col} style but has horizontal and vertical
%lines around it.
%
%\item[super3colheader] The \glostyle{super3colheader} style is like
%\glostyle{super3col} but has a header row.
%
%\item[super3colheaderborder] The \glostyle{super3colheaderborder} style
%is like \glostyle{super3colheader} but has horizontal and vertical
%lines around it.
%
%\item[super4col] The \glostyle{super4col} style is like 
%\glostyle{super3col} but has an additional column in which the
%entry's associated symbol appears.
%
%\item[super4colborder] The \glostyle{super4colborder} style is like
%the \glostyle{super4col} style but has horizontal and vertical
%lines around it.
%
%\item[super4colheader] The \glostyle{super4colheader} style is like
%\glostyle{super4col} but has a header row.
%
%\item[super4colheaderborder] The \glostyle{super4colheaderborder} style
%is like \glostyle{super4colheader} but has horizontal and vertical
%lines around it.
%
%\end{description}
%
%The glossary style can be set using the \pkgopt{style} package option
%or using the \gloskey[printglossary]{style} key in the optional
%argument to \ics{printglossary} or using the command:\\[10pt]
%\DescribeMacro{\glossarystyle}\cs{glossarystyle}\marg{style-name}\\[10pt]
%
%Note that if you use the \gloskey[printglossary]{style} key in the
%optional argument to \ics{printglossary}, it will override any 
%previous style settings for the given glossary, so if, for example,
%you do:
%\begin{verbatim}
%\renewcommand*{\glsgroupskip}{}
%\printglossary[style=long]
%\end{verbatim}
%The new definition of \ics{glsgroupskip} will not have an affect
%for this glossary, as \cs{glsgroupskip} is redefined by 
%\verb|style=long|. Likewise, \ics{glossarystyle} will also
%override any previous style definitions, so, again:
%\begin{verbatim}
%\renewcommand*{\glsgroupskip}{}
%\glossarystyle{long}
%\end{verbatim}
%will reset \cs{glsgroupskip} back to its default definition for the
%named glossary style (\dq{long} in this case). If you want to 
%modify the styles, either use \ics{newglossarystyle} (described
%in the next section) or make the modifications after 
%\ics{glossarystyle}.
%
% \changes{1.03}{2007 July 4}{'glspostdescription added}
%All the styles except for the three- and four-column styles and the
%\glostyle{listdotted} style use the command
%\DescribeMacro{\glspostdescription}\cs{glspostdescription} after the
%description. This simply displays a full stop by default.  To eliminate
%this full stop (or replace it with something else, say a comma) you
%will need to redefine \cs{glspostdescription} before the glossary is
%displayed.
%\subsection{Defining your own glossary style}
%
%If the predefined styles don't fit your requirements, you can
%define your own style using\DescribeMacro{\newglossarystyle}:\\[10pt]
%\cs{newglossarystyle}\marg{name}\marg{definitions}\\[10pt]
%where \meta{name} is the name of the new glossary style (to be
%used in \cs{glossarystyle}). The second argument \meta{definitions},
%needs to redefine all of the following:
%
%\begin{description}
%\item
%\DescribeEnv{theglossary}
%\envname{theglossary}\par\noindent
%This environment defines how the main body of the glossary should
%be typeset. Note that this does not include the section heading,
%the glossary preamble (defined by \cs{glossarypreamble}) or the
%glossary postamble (defined by \cs{glossarypostamble}.) For example,
%the \glostyle{list} style uses the \envname{description} environment,
%so the \envname{theglossary} environment is simply redefined to begin
%and end the \envname{description} environment.
%
%\item
%\DescribeMacro{\glossaryheader}
%\cs{glossaryheader}\par\noindent
%This macro indicates what to do at the start of the main body
%of the glossary. Note that this is not the same as 
%\cs{glossarypreamble}, which should not be affected by changes in
%the glossary style. The \glostyle{list} glossary style redefines
%\cs{glossaryheader} to do nothing, whereas the \glostyle{longheader}
%glossary style redefines \cs{glossaryheader} to do a header row.
%
%\item
%\DescribeMacro{\glsgroupheading}
%\cs{glsgroupheading}\marg{label}\par\noindent
%This macro indicates what to do at the start of each logical block
%within the main body of the glossary. The glossary is sub-divided into
%twenty-eight logical blocks that are determined by the first character
%of the \gloskey{sort} key (or \gloskey{name} key if the \gloskey{sort}
%key is omitted). The sub-divisions are in the following order: symbols,
%numbers, A, \ldots, Z. Note that the argument to \cs{glsgroupheading}
%is a label \emph{not} the group title. The group title can be obtained
%via \cs{glsgetgrouptitle}\marg{label}, and a navigation hypertarget can
%be created using \cs{glsnavhypertarget}\marg{label}. Most of the
%predefined glossary styles redefine \cs{glsgroupheading} to simply
%ignore its argument.  The \glostyle{listhypergroup} style redefines
%\cs{glsgroupheading} as follows:
%\begin{verbatim}
%\renewcommand*{\glsgroupheading}[1]{%
%\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}
%\end{verbatim}
%See also \cs{glsgroupskip} below. (Note that command definitions within 
%\cs{newglossarystyle} must use \verb|##1| etc instead of \verb|#1| etc.)
%
%\item
%\DescribeMacro{\glsgroupskip}
%\cs{glsgroupskip}\par\noindent
%This macro determines what to do after one logical group but before
%the header for the next logical group. The \glostyle{list} glossary
%style simply redefines \cs{glsgroupskip} to be \cs{indexspace}.
%
%\item
%\DescribeMacro{\glossaryentryfield}
%\cs{glossaryentryfield}\marg{label}\marg{formatted
%name}\marg{description}\marg{symbol}
%\marg{number list}\par\noindent
%This macro indicates what to do for a given glossary entry.
%Note that \meta{formatted name} will always be in the form
%\cs{glsnamefont}\marg{name}. This allows the user to set a given
%font for the entry name, regardless of the glossary style used.
%Note that \meta{label} is the label used when the glossary entry
%was defined via either \cs{newglossaryentry} or \cs{newacronym}. 
%Each time you use a glossary entry it creates a 
%link\footnote{if the document doesn't have hyperlinks enabled
%\cs{@glslink} ignores the label and simply typesets the text.} 
%using \cs{@glslink}\marg{label}\marg{text} with the label 
%\texttt{glo:}\meta{label}. Your
%new glossary style must therefore redefine \cs{glossaryentryfield}
%so that it uses \cs{@glstarget}\verb|{|\texttt{glo:}\meta{label}\verb|}|\marg{text}
%to ensure the hyperlinks function correctly.\footnote{again, if the
%document doesn't support hyperlinks, \cs{@glstarget} will ignore
%the label, and just typeset the text.} For example, the 
%\glostyle{list} style defines \cs{glossaryentryfield} as follows:
%\begin{verbatim}
%\renewcommand*{\glossaryentryfield}[5]{%
%\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5}
%\end{verbatim}
%
%Note also that \meta{number list} will always be of the form\\[10pt]
%\cs{glossaryentrynumbers}\{\cs{relax}\\
%\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}\}\\[10pt]
%where \meta{number(s)}
%may contain \cs{delimN} (to delimit individual numbers) and/or
%\cs{delimR} (to indicate a range of numbers). There may be 
%multiple occurrences of 
%\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}, but note
%that the entire number list is enclosed within the argument
%to \ics{glossaryentrynumbers}. The user can redefine this to change
%the way the entire number list is formatted, regardless of 
%the glossary style. However the most common use of
%\cs{glossaryentrynumbers} is to provide a means of suppressing the
%number list altogether. (In fact, the \pkgopt{nonumberlist} option 
%redefines \cs{glossaryentrynumbers} to ignore its argument.)
%Therefore, when you define a new glossary style, you don't need
%to worry about whether the user has specified the 
%\pkgopt{nonumberlist} package option.
%\end{description}
%\subsubsection{Example: creating a completely new style}
%
%If you want a completely new style, you will need to redefine all
%of the commands and environment listed above. You also need to
%take care when using internal commands (commands whose name
%contain the @ symbol). These should either be used in a \texttt{.sty}
%file or must be placed within \cs{makeatletter} and \cs{makeatother}.
%
%For example, suppose you want each entry to start with a bullet point.
%This means that the glossary should be placed in the \envname{itemize}
%environment, so \envname{theglossary} should start and end that
%environment. Let's also suppose that you don't want anything between
%the glossary groups (so \cs{glsgroupheading} and \cs{glsgroupskip}
%should do nothing) and suppose you don't want anything to appear
%immediately after \verb|\begin{theglossary}| (so \cs{glossaryheader}
%should do nothing). In addition, let's suppose the symbol should
%appear in brackets after the name, followed by the description and
%last of all the \term{number list} should appear within square brackets
%at the end. Then you can create this new glossary style, called, say,
%\texttt{mylist}, as follows:
%\begin{verbatim}
% \newglossarystyle{mylist}{%
% % put the glossary in the itemize environment:
% \renewenvironment{theglossary}{\begin{itemize}}{\end{itemize}}%
% % have nothing after \begin{theglossary}:
% \renewcommand*{\glossaryheader}{}%
% % have nothing between glossary groups:
% \renewcommand*{\glsgroupheading}[1]{}%
% \renewcommand*{\glsgroupskip}{}%
% % set how each entry should appear:
% \renewcommand*{\glossaryentryfield}[5]{%
% \item % bullet point
% \@glstarget{glo:##1}{##2}% the entry name
% \space (##4)% the symbol in brackets
% \space ##3% the description
% \space [##5]% the number list in square brackets
% }%
% }
%\end{verbatim}
%
%\subsubsection{Example: creating a new glossary style based on an
%existing style}
%
%\changes{1.11}{2008 March 1}{Fixed error in manual (glossary style
%is set using 'glossarystyle not 'setglossarystyle)}%
%If you want to define a new style that is a slightly modified
%version of an existing style, you can use \cs{glossarystyle}
%within the second argument of \cs{newglossarystyle} followed by
%whatever alterations you require. For example, suppose you want 
%a style like the \glostyle{list} style but you don't want the extra
%vertical space created by \cs{indexspace} between groups, then you
%can create a new glossary style called, say, \texttt{mylist} as
%follows:
%\begin{verbatim}
%\newglossarystyle{mylist}{%
%\glossarystyle{list}% base this style on the list style
%\renewcommand{\glsgroupskip}{}% make nothing happen between groups
%}
%\end{verbatim} 
%
%\section{Mfirstuc Package}
%\label{sec:mfirstuc}
%
%The \sty{glossaries} package is supplied with the package 
%\isty{mfirstuc} which provides the command:\\[10pt]
%\DescribeMacro{\makefirstuc}
%\cs{makefirstuc}\marg{stuff}\\[10pt]
%which makes the first object of
%\meta{stuff} uppercase unless \meta{stuff} starts with a control
%sequence followed by a non-empty group, in which case the first
%object in the group is converted to uppercase. Examples:
%\begin{itemize}
%\item \verb|\makefirstuc{abc}| produces Abc
%
%\item \verb|\makefirstuc{\emph{abc}}| produces \emph{Abc} 
%(\ics{MakeUppercase} has been applied to the letter \dq{a} rather
%than \cs{emph}.)
%
%\item \verb|\makefirstuc{{\'a}bc}| produces {\'A}bc
%
%\item \verb|\makefirstuc{\ae bc}| produces \AE bc
%
%\item \verb|\makefirstuc{{\ae}bc}| produces {\AE}bc
%\end{itemize}
%
%\begin{important}
%In version 1.02 of \sty{mfirstuc}, a bug fix resulted in a change
%in output if the first object is a control sequence followed by
%an empty group. Prior to version 1.02, \verb|\makefirstuc{\ae{}bc}|
%produced \ae Bc. However as from version 1.02, it now produces
%\AE bc.
%\end{important}
%
%Note also that
%\begin{verbatim}
%\newcommand{\abc}{abc}
%\makefirstuc{\abc}
%\end{verbatim}
%produces: ABC. This is because the first object in the argument of
%\cs{makefirstuc} is \cs{abc}, so it does \verb|\MakeUppercase{\abc}|.
%Whereas:
%\begin{verbatim}
%\newcommand{\abc}{abc}
%\expandafter\makefirstuc\expandafter{\abc}
%\end{verbatim}
%produces: Abc. There is a short cut command which will do this:\\[10pt]
%\DescribeMacro{\xmakefirstuc}
%\cs{xmakefirstuc}\marg{stuff}\\[10pt]
%This is equivalent to \cs{expandafter}\cs{makefirstuc}\cs{expandafter}\marg{stuff}. So
%\begin{verbatim}
%\newcommand{\abc}{abc}
%\xmakefirstuc{\abc}
%\end{verbatim}
%produces: Abc.
%
%If you want to use an alternative command to convert to uppercase,
%for example \cs{MakeTextUppercase}\footnote{defined in the 
%\sty{textcase} package}, you can redefine the internal
%command \cs{@gls@makefirstuc}. For example:
%\begin{verbatim}
%\renewcommand{\@gls@makefirstuc}[1]{\MakeTextUppercase #1}
%\end{verbatim}
%(Remember that command names that contain the @ character must
%either be placed in packages or be placed between \cs{makeatletter} 
%\cs{makeatother}.)
%
%
% \StopEventually{\clearpage\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex}
%
%
%
%
%\section{Documented Code}
%\iffalse
%    \begin{macrocode}
%<*glossaries.sty>
%    \end{macrocode}
%\fi
%\label{sec:code}
% \subsection{Package Definition}
% This package requires \LaTeXe.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossaries}[2008/06/17 v1.14 (NLCT)]
%    \end{macrocode}
% Required packages:
%    \begin{macrocode}
\RequirePackage{ifthen}
\RequirePackage{xkeyval}[2006/11/18]
\RequirePackage{mfirstuc}
%    \end{macrocode}
% If \isty{babel} package is loaded, check to see if \isty{translator} is installed.
%    \begin{macrocode}
\@ifpackageloaded{babel}{\IfFileExists{translator.sty}{%
  \RequirePackage{translator}}{}}{}
%    \end{macrocode}
%\changes{1.1}{2008 Feb 22}{amsgen now loaded (\cs{new@ifnextchar} needed)}
% Need to use \cs{new@ifnextchar} instead of \cs{@ifnextchar} in 
% commands that have a final optional argument (such as \ics{gls})
% so require \isty{amsgen}.
% Thanks to Morten~H{\o}gholm for suggesting this. (This has
% replaced using the \sty{xspace} package.)
%    \begin{macrocode}
\RequirePackage{amsgen}
%    \end{macrocode}
%
% \subsection{Package Options}\label{sec:pkgopt}
% The \pkgopt{toc} package option will add the glossaries 
% to the table of contents. This is a boolean key, if the
% value is omitted it is taken to be true.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{toc}[true]{}
%    \end{macrocode}
%\changes{1.1}{2008 Feb 22}{numberline option added}
% The \pkgopt{numberline} package option adds \cs{numberline} to
% \cs{addcontentsline}. Note that this option only has an effect
% if used in with \pkgopt[true]{toc}.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{numberline}[true]{}
%    \end{macrocode}
%
% The sectional unit used to start the glossary is stored in
% \cs{@@glossarysec}. If chapters are defined, this
% is initialised to \texttt{chapter}, otherwise it is
% initialised to \texttt{section}.
%\begin{macro}{\@@glossarysec}
%    \begin{macrocode}
\@ifundefined{chapter}{\newcommand*{\@@glossarysec}{section}}{%
\newcommand*{\@@glossarysec}{chapter}}
%    \end{macrocode}
%\end{macro}
% The \pkgopt{section} key can be used to set the sectional unit.
% If no unit is specified, use \texttt{section} as the default.
% The starred form of the named sectional unit will be used.
% If you want some other way to start the glossary section (e.g.\ 
% a numbered section) you will have to redefined 
% \ics{glossarysection}.
%    \begin{macrocode}
\define@choicekey{glossaries.sty}{section}{part,chapter,section,%
subsection,subsubsection,paragraph,subparagraph}[section]{%
\renewcommand*{\@@glossarysec}{#1}}
%    \end{macrocode}
%\changes{1.1}{2008 Feb 22}{numberedsection option added}
% Determine whether or not to use numbered sections.
%\begin{macro}{\@@glossarysecstar}
%    \begin{macrocode}
\newcommand*{\@@glossarysecstar}{*}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@@glossaryseclabel}
%    \begin{macrocode}
\newcommand*{\@@glossaryseclabel}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsautoprefix}
% Prefix to add before label if automatically generated:
%\changes{1.14}{2008 June 17}{new}
%    \begin{macrocode}
\newcommand*{\glsautoprefix}{}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\define@choicekey{glossaries.sty}{numberedsection}[\val\nr]{%
false,nolabel,autolabel}[nolabel]{%
\ifcase\nr\relax
  \renewcommand*{\@@glossarysecstar}{*}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}%
\fi}
%    \end{macrocode}
%
% The default glossary style is stored in 
% \cs{@glossary@default@style}. This is initialised to
% \texttt{list}. (The \glostyle{list} style is
% defined in the accompanying \isty{glossary-list} package
% described in \autoref{sec:code:styles}.)
%\begin{macro}{\@glossary@default@style}
%    \begin{macrocode}
\newcommand*{\@glossary@default@style}{list}
%    \end{macrocode}
%\end{macro}
% The default glossary style can be changed using the \pkgopt{style}
% package option. The value can be the name of any
% defined glossary style. The glossary style is set at the beginning
% of the document, so you can still use the \pkgopt{style} key to
% set a style that is defined in another package. This package comes
% with some predefined styles that are defined in 
% \autoref{sec:code:styles}.
%    \begin{macrocode}
\define@key{glossaries.sty}{style}{%
\renewcommand*{\@glossary@default@style}{#1}}
%    \end{macrocode}
%
% Each entry within a given glossary will have an associated
% number list. By default, this refers to the page numbers on
% which that entry has been used, but it can also refer to any counter
% used in the document (such as the section or equation counters).
% The default number list format displays the number list ``as is'':
%\begin{macro}{\glossaryentrynumbers}
%    \begin{macrocode}
\newcommand*{\glossaryentrynumbers}[1]{#1}
%    \end{macrocode}
%\end{macro}
% Note that the entire number list for a given entry will be
% passed to \cs{glossaryentrynumbers} so any font changes
% will also be applied to the delimiters.
% The \pkgopt{nonumberlist} package option suppresses the 
% number lists (this simply redefines 
% \cs{glossaryentrynumbers} to ignores its argument.)
%    \begin{macrocode}
\DeclareOptionX{nonumberlist}{%
\renewcommand*{\glossaryentrynumbers}[1]{}}
%    \end{macrocode}
%
% Keep track of the default glossary. This is initialised to
% the main glossary, but can be changed if for some reason
% you want to make a secondary glossary the main glossary. This
% affects any commands that can optionally take a glossary name
% as an argument (or as the value of the 
% \gloskey{type}\igloskey[printglossary]{type} key in 
%a key-value list.) This was mainly done so that 
% \ics{loadglsentries} can temporarily change 
% \cs{glsdefaulttype} while it loads a file containing
% new glossary entries (see \autoref{sec:load}).
%\begin{macro}{\glsdefaulttype}
%    \begin{macrocode}
\newcommand{\glsdefaulttype}{main}
%    \end{macrocode}
%\end{macro}
% Keep track of which glossary the acronyms are in. This is 
% initialised to \cs{glsdefaulttype}, but is changed by
% the \pkgopt{acronym} package option.
%\begin{macro}{\acronymtype}
%    \begin{macrocode}
\newcommand{\acronymtype}{\glsdefaulttype}
%    \end{macrocode}
%\end{macro}
% The \pkgopt{acronym} option sets an associated conditional 
% which is used in \autoref{sec:acronym} to determine whether
% or not to define a separate glossary for acronyms.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{acronym}[true]{}
%    \end{macrocode}
%
% The default counter associated with the numbers in the glossary
% is stored in \cs{glscounter}. This is initialised to the 
% page counter. This is used as the default counter when a
% new glossary is defined, unless a different counter is specified
% in the optional argument to \ics{newglossary} (see
% \autoref{sec:newglos}).
%\begin{macro}{\glscounter}
%    \begin{macrocode}
\newcommand{\glscounter}{page}
%    \end{macrocode}
%\end{macro}
% The \pkgopt{counter} option changes the default counter. (This
% just redefines \cs{glscounter}.)
%    \begin{macrocode}
\define@key{glossaries.sty}{counter}{%
\renewcommand*{\glscounter}{#1}}
%    \end{macrocode}
%
% The glossary keys whose values are written to another file (i.e.\
% \gloskey{sort}, \gloskey{name}, \gloskey{description} and
% \gloskey{symbol}) need to be sanitized, otherwise fragile
% commands would not be able to be used in 
% \ics{newglossaryentry}. However, strange results will occur
% if you then use those fields in the document. As these fields
% are not normally used in the document, but are by default only
% used in the glossary, the default is to sanitize them. If however
% you want to use these values in the document (either by redefining
% commands like \ics{glsdisplay} or by using commands like
% \ics{glsentrydesc}) you will have to switch off the 
% sanitization using the \pkgopt{sanitize} package option, but
% you will then have to use \ics{protect} to protect fragile 
% commands when defining new glossary entries. 
% The \pkgopt{sanitize} option
% takes a key-value list as its value, which can be used to 
% switch individual values on and off. For example:
%\begin{verbatim}
%\usepackage[sanitize={description,name,symbol=false}]{glossaries}
%\end{verbatim}
%will switch off the sanitization for the \gloskey{symbol} key, but
% switch it on for the \gloskey{description} and \gloskey{name} keys.
% This would mean that you can use fragile commands in the
%description and name when defining a new glossary entry, but not
% for the symbol.
%
% The default values are defined as:
%\begin{macro}{\@gls@sanitizedesc}
%    \begin{macrocode}
\newcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@sanitizename}
%    \begin{macrocode}
\newcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@sanitizesymbol}
%    \begin{macrocode}
\newcommand*{\@gls@sanitizesymbol}{\@onelevel@sanitize\@glo@symbol}
%    \end{macrocode}
%\end{macro}
% (There is no equivalent for the \gloskey{sort} key, since that
% is only provided for the benefit of \appname{makeindex}, and
% so will always be sanitized.)
%
% Before defining the \pkgopt{sanitize} package option, The 
% key-value list for the \pkgopt{sanitize} value needs to be defined.
% These are all boolean keys. If they are not given a value, assume
% \texttt{true}.
%
% Firstly the \gloskey{description}. If set, it will redefine
% \cs{@gls@sanitizedesc} to use \cs{@onelevel@sanitize},
% otherwise \cs{@gls@sanitizedesc} will do nothing.
%    \begin{macrocode}
\define@boolkey[gls]{sanitize}{description}[true]{%
\ifgls@sanitize@description
  \renewcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}%
\else
  \renewcommand*{\@gls@sanitizedesc}{}%
\fi
}
%    \end{macrocode}
% Similarly for the \gloskey{name} key:
%    \begin{macrocode}
\define@boolkey[gls]{sanitize}{name}[true]{%
\ifgls@sanitize@name
  \renewcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}%
\else
  \renewcommand*{\@gls@sanitizename}{}%
\fi}
%    \end{macrocode}
% and for the \gloskey{symbol} key:
%    \begin{macrocode}
\define@boolkey[gls]{sanitize}{symbol}[true]{%
\ifgls@sanitize@symbol
  \renewcommand*{\@gls@sanitizesymbol}{%
\@onelevel@sanitize\@glo@symbol}%
\else
  \renewcommand*{\@gls@sanitizesymbol}{}%
\fi}
%    \end{macrocode}
% Now define the \pkgopt{sanitize} option. It can either take
% a key-val list as its value, or it can take the keyword
% \texttt{none}, which is equivalent to \texttt{description=false,
% symbol=false, name=false}:
%    \begin{macrocode}
\define@key{glossaries.sty}{sanitize}[description=true,symbol=true,
name=true]{%
\ifthenelse{\equal{#1}{none}}{%
\renewcommand*{\@gls@sanitizedesc}{}%
\renewcommand*{\@gls@sanitizename}{}%
\renewcommand*{\@gls@sanitizesymbol}{}%
}{\setkeys[gls]{sanitize}{#1}}%
}
%    \end{macrocode}
%\changes{1.1}{2008 Feb 22}{translate option added}
% Define \pkgopt{translate} option. If false don't set up
% multi-lingual support.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[gls]{translate}[true]{}
%    \end{macrocode}
% Set the default value:
%    \begin{macrocode}
\glstranslatefalse
\@ifpackageloaded{translator}{\glstranslatetrue}{%
\@ifpackageloaded{babel}{\glstranslatetrue}{}}
%    \end{macrocode}
% Set the long form of the acronym in footnote on first use.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{%
\ifthenelse{\boolean{glsacrdescription}}{}%
{\renewcommand*{\@gls@sanitizedesc}{}}%
}
%    \end{macrocode}
% Allow acronyms to have a description (needs to be set using
% the \gloskey{description} key in the optional argument of
% \ics{newacronym}).
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{description}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
% Define \ics{newacronym} to set the short form in small capitals.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
% Define \ics{newacronym} to set the short form using \cs{smaller}
% which obviously needs to be defined by loading the appropriate
% package.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
% Define \ics{newacronym} to always use the long forms 
% (i.e.\ don't use acronyms)
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{%
  \renewcommand*{\@gls@sanitizesymbol}{}%
}
%    \end{macrocode}
% Define acronym shortcuts.
%    \begin{macrocode}
\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{}
%    \end{macrocode}
%
%
% Process package options:
%    \begin{macrocode}
\ProcessOptionsX
%    \end{macrocode}
%
% If chapters are defined and the user has requested the
% section counter as a package option, \cs{@chapter} will
% be modified so 
% that it adds a \texttt{section.}\meta{n}\texttt{.0} target, 
% otherwise entries placed before the first section of a chapter
% will have undefined links.
%
% The same problem will also occur if a lower sectional unit is
% used, but this is less likely to happen. If it does, or if
% you change \cs{glscounter} to "section" later, you
% will have to specify a different counter for the entries
% that give rise to a \texttt{name}"{"\meta{section-level}"."\meta{n}".0}"
% non-existent warning (e.g. "\gls[counter=chapter]{label}").
%    \begin{macrocode}
\ifthenelse{\equal{\glscounter}{section}}{%
\@ifundefined{chapter}{}{%
\let\@gls@old@chapter\@chapter
\def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}%
\@ifundefined{hyperdef}{}{\hyperdef{section}{\thesection}{}}}}}{}
%    \end{macrocode}
%
%\subsection{Default values}\label{sec:predefinednames}
% This section sets up default values that are used by this
% package. Some of the names may already be defined (e.g.\ by
% \isty{babel}) so \cs{providecommand} is used.
%
% Main glossary title:
%\begin{macro}{\glossaryname}
%    \begin{macrocode}
\providecommand*{\glossaryname}{Glossary}
%    \end{macrocode}
%\end{macro}
% The title for the "acronym" glossary type (which is defined if 
% \pkgopt{acronym} package option is used) is given by
% \cs{acronymname}. If the \pkgopt{acronym}
% package option is not used, \cs{acronymname} won't be used.
%\begin{macro}{\acronymname}
%    \begin{macrocode}
\providecommand*{\acronymname}{Acronyms}
%    \end{macrocode}
%\end{macro}
%
% The following commands provide text for the headers used by 
% some of the tabular-like glossary 
% styles. Whether or not they get used in the glossary depends on
% the glossary style.
%\begin{macro}{\entryname}
%    \begin{macrocode}
\providecommand*{\entryname}{Notation}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\descriptionname}
%    \begin{macrocode}
\providecommand*{\descriptionname}{Description}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\symbolname}
%    \begin{macrocode}
\providecommand*{\symbolname}{Symbol}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\pagelistname}
%    \begin{macrocode}
\providecommand*{\pagelistname}{Page List}
%    \end{macrocode}
%\end{macro}
% Labels for \appname{makeindex}'s symbol and number groups:
%\begin{macro}{\glssymbolsgroupname}
%    \begin{macrocode}
\providecommand*{\glssymbolsgroupname}{Symbols}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsnumbersgroupname}
%    \begin{macrocode}
\providecommand*{\glsnumbersgroupname}{Numbers}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glspluralsuffix}
% The default plural is formed by appending \cs{glspluralsuffix} to
% the singular form.
%    \begin{macrocode}
\newcommand*{\glspluralsuffix}{s}
%    \end{macrocode}
%\end{macro}
% Add multi-lingual support\changes{1.08}{2007 Oct 13}{Added 
% babel support}. Thanks to everyone who contributed to the
% translations from both comp.text.tex and via email.
%    \begin{macrocode}
\ifglstranslate
%    \end{macrocode}
% If \isty{translator} is not install, used standard 
% \isty{babel} captions, otherwise load \isty{translator}
% dictionary.
%\changes{1.1}{2008 Feb 22}{Added support for translator package}
%    \begin{macrocode}
  \@ifpackageloaded{translator}{\usedictionary{glossaries-dictionary}%
    \renewcommand*{\glossaryname}{\translate{Glossary}}%
    \renewcommand*{\acronymname}{\translate{Acronyms}}%
    \renewcommand*{\entryname}{\translate{Notation (glossaries)}}%
    \renewcommand*{\descriptionname}{%
      \translate{Description (glossaries)}}%
    \renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}%
    \renewcommand*{\pagelistname}{%
      \translate{Page List (glossaries)}}%
    \renewcommand*{\glssymbolsgroupname}{%
      \translate{Symbols (glossaries)}}%
    \renewcommand*{\glsnumbersgroupname}{%
      \translate{Numbers (glossaries)}}%
  }{%
    \@ifpackageloaded{babel}{\RequirePackage{glossaries-babel}}{}}
\fi
%    \end{macrocode}
% The description terminator is given by \cs{glspostdescription}
% (except for the 3 and 4 column styles). This is a full stop
% by default:
%\begin{macro}{\glspostdescription}
%    \begin{macrocode}
\newcommand*{\glspostdescription}{.}
%    \end{macrocode}
%\end{macro}
%
% The name of the \appname{makeindex} style file is given by
% \cs{istfilename}. This file is 
% created by \ics{writeist} (which is used by 
% \ics{makeglossaries}) so
% redefining this command will only have an effect if it is 
% done \emph{before} the \filetype{.ist} file is created.
%\begin{macro}{\istfilename}
%    \begin{macrocode}
\providecommand*{\istfilename}{\jobname.ist}
%    \end{macrocode}
%\end{macro}
% The \appname{makeglossaries} Perl script picks up this name
% from the auxiliary file and passes it to \appname{makeindex}
% using the \texttt{-s} option. Since its not required by
% \LaTeX, \cs{@istfilename} ignores its argument.
%\begin{macro}{\@istfilename}
%    \begin{macrocode}
\newcommand*{\@istfilename}[1]{}
%    \end{macrocode}
%\end{macro}
%
% This command is the value of the \istkey{page\_compositor}
% \appname{makeindex} key. Again, any redefinition of this command 
% must take place \emph{before} \cs{writeist} otherwise it 
% will have no effect.
%\begin{macro}{\glscompositor}
%    \begin{macrocode}
\newcommand{\glscompositor}{.}
%    \end{macrocode}
%\end{macro}
% (The page compositor is usually defined as a dash when using
% \appname{makeindex}, but most of the standard counters used
% by \LaTeX\ use a full stop as the compositor, which is why I
% have used it as the default.)
%
% The command \cs{glsnumberformat} indicates the default
% format for the page numbers in the glossary. (Note that this
% is not the same as \ics{glossaryentrynumbers}, but applies
% to individual numbers or groups of numbers within an entry's
% associated number list.) If hyperlinks are defined, it will use
% \ics{glshypernumber}, otherwise it will simply display its 
% argument ``as is''.
%\begin{macro}{\glsnumberformat}
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
\newcommand*{\glsnumberformat}[1]{#1}}{%
\newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
% Individual numbers in an entry's associated number list are
% delimited using \cs{delimN} (which corresponds to the 
% \istkey{delim\_n} \appname{makeindex} keyword.) The default value
% is a comma followed by a space.
%\begin{macro}{\delimN}
%    \begin{macrocode}
\newcommand{\delimN}{, }
%    \end{macrocode}
%\end{macro}
% A range of numbers within an entry's associated number list is
% delimited using \cs{delimR} (which corresponds to the
% \istkey{delim\_r} \appname{makeindex} keyword.) The default is
% an en-dash.
%\begin{macro}{\delimR}
%    \begin{macrocode}
\newcommand{\delimR}{--}
%    \end{macrocode}
%\end{macro}
%
% The glossary preamble is given by \cs{glossarypreamble}. This
% will appear after the glossary sectioning command, and before the
% \envname{theglossary} environment. It is designed to allow the
% user to add information pertaining to the glossary (e.g.\ ``page
% numbers in italic indicate the primary definition'') therefore 
% \cs{glossarypremable} shouldn't be affected by the glossary
% style. (So if you define your own glossary style, don't have it 
% change \cs{glossarypreamble}.) The preamble is empty by
% default. If you have multiple glossaries, and you want a 
% different preamble for each glossary, you will need to use
% \ics{printglossary} for each glossary type, instead of 
% \ics{printglossaries}, and redefine \cs{glossarypreamble}
% before each \ics{printglossary}.
%\begin{macro}{\glossarypreamble}
%    \begin{macrocode}
\newcommand*{\glossarypreamble}{}
%    \end{macrocode}
%\end{macro}
%
% The glossary postamble is given by \cs{glossarypostamble}.
% This is provided to allow the user to
% add something after the end of the \envname{theglossary}
% environment (again, this shouldn't be affected by the
% glossary style.) It is, of course, possible to simply add the
% text after \ics{printglossary}, but if you only want the
% postamble to appear after the first glossary, but not after 
% subsequent glossaries, you can do something like:
%\begin{verbatim}
%\renewcommand{\glossarypostamble}{For a complete list of terms
%see \cite{blah}\gdef\glossarypreamble{}}
%\end{verbatim}
%\begin{macro}{\glossarypostamble}
%    \begin{macrocode}
\newcommand*{\glossarypostamble}{}
%    \end{macrocode}
%\end{macro}
%
% The sectioning command that starts a glossary is given by
% \cs{glossarysection}. (This does not form part of the
% glossary style, and so should not be changed by a glossary
% style.) If \ics{phantomsection}
% is defined, it uses \cs{\@p@glossarysection}, otherwise it
% uses \cs{@glossarysection}.
%\changes{1.05}{2007 Aug 10}{added '@mkboth to 'glossarysection}
%\begin{macro}{\glossarysection}
%    \begin{macrocode}
\newcommand*{\glossarysection}[2][\@gls@title]{%
\def\@gls@title{#2}%
\@ifundefined{phantomsection}{%
\@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}%
\@mkboth{\glossarytoctitle}{\glossarytoctitle}%
}
%    \end{macrocode}
%\end{macro}
%
% The required sectional unit is given by \cs{@@glossarysec}
% which was defined by the \pkgopt{section} package option. The
% starred form of the command is chosen. If you don't want any sectional
% command, you will need to redefine \cs{glossarysection}.
% The sectional unit can be changed, if different sectional units
% are required.
%\begin{macro}{\setglossarysection}
%\changes{1.1}{2008 Feb 22}{new}
%    \begin{macrocode}
\newcommand*{\setglossarysection}[1]{%
\setkeys{glossaries.sty}{section=#1}}
%    \end{macrocode}
%\end{macro}
%
%The command \cs{@glossarysection} indicates how to start
% the glossary section if \ics{phantomsection} is not defined.
%\begin{macro}{\@glossarysection}
%\changes{1.1}{2008 Feb 22}{numbered sections and auto label added}
%    \begin{macrocode}
\newcommand*{\@glossarysection}[2]{%
\ifx\@@glossarysecstar\@empty
  \csname\@@glossarysec\endcsname{#2}%
\else
  \csname\@@glossarysec\endcsname*{#2}%
  \@gls@toc{#1}{\@@glossarysec}%
\fi
\@@glossaryseclabel}
%    \end{macrocode}
%\end{macro}
%
% As \cs{@glossarysection}, but put in 
% \ics{phantomsection}, and swap where \cs{@gls@toc} goes. 
% If using chapters do a \cs{clearpage}. This ensures that
% the hyper link from the table of contents leads to the line above
% the heading, rather than the line below it.
%\begin{macro}{\@p@glossarysection}
%\changes{1.1}{2008 Feb 22}{numbered sections and auto label added}
%    \begin{macrocode}
\newcommand*{\@p@glossarysection}[2]{%
\gls@doclearpage
\phantomsection
\ifx\@@glossarysecstar\@empty
  \csname\@@glossarysec\endcsname{#2}%
\else
  \@gls@toc{#1}{\@@glossarysec}%
  \csname\@@glossarysec\endcsname*{#2}%
\fi
\@@glossaryseclabel}
%    \end{macrocode}
%\end{macro}
%
%The \cs{gls@doclearpage} command is used to issue a
% \cs{clearpage} (or \cs{cleardoublepage}) depending
% on whether the glossary sectional unit is a chapter. If the
% sectional unit is something else, do nothing.
%\begin{macro}{\gls@doclearpage}
%    \begin{macrocode}
\newcommand{\gls@doclearpage}{%
\ifthenelse{\equal{\@@glossarysec}{chapter}}{%
\@ifundefined{cleardoublepage}{\clearpage}{\cleardoublepage}}{}%
}
%    \end{macrocode}
%\end{macro}
%
% The glossary is added to the table of contents if glstoc flag set.
% If it is set, \cs{@gls@toc} will add a line to the 
% \filetype{.toc} file, otherwise it will do nothing.
% (The first argument to \cs{@gls@toc} is the title for the
% table of contents, the second argument is the sectioning type.) 
%\begin{macro}{\@gls@toc}
%\changes{1.1}{2008 Feb 22}{numberline added}
%    \begin{macrocode}
\newcommand*{\@gls@toc}[2]{%
\ifglstoc
  \ifglsnumberline
    \addcontentsline{toc}{#2}{\numberline{}#1}%
  \else
    \addcontentsline{toc}{#2}{#1}%
  \fi
\fi}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Loops and conditionals}
% To iterate through all glossaries (or comma-separated list of
% glossary names given in optional argument) use:\\[10pt]
% \cs{forallglossaries}\oarg{glossary list}\marg{cmd}\marg{code}\\[10pt]
% where \meta{cmd} is
% a control sequence which will be set to the name of the
% glossary in the current iteration.
%\begin{macro}{\forallglossaries}
%    \begin{macrocode}
\newcommand*{\forallglossaries}[3][\@glo@types]{%
\@for#2:=#1\do{\ifthenelse{\equal{#2}{}}{}{#3}}}
%    \end{macrocode}
%\end{macro}
%
% To iterate through all entries in a given glossary use:\\[10pt]
%\cs{forglsentries}\oarg{type}\marg{cmd}\marg{code}\\[10pt]
%where \meta{type} is the glossary label and \meta{cmd} is a
% control sequence which will be set to the entry label in the
% current iteration.
%\begin{macro}{\forglsentries}
%    \begin{macrocode}
\newcommand*{\forglsentries}[3][\glsdefaulttype]{%
\edef\@@glo@list{\csname glolist@#1\endcsname}%
\@for#2:=\@@glo@list\do{%
\ifthenelse{\equal{#2}{}}{}{#3}}}
%    \end{macrocode}
%\end{macro}
%
% To iterate through all glossary entries over all glossaries listed
% in the optional argument (the default is all glossaries) use:\\[10pt] 
% \cs{forallglsentries}\oarg{glossary list}\marg{cmd}\marg{code}\\[10pt]
% Within \cs{forallglsentries}, the current glossary type
% is given by \cs{@@this@glo@}.
%\begin{macro}{\forallglsentries}
%    \begin{macrocode}
\newcommand*{\forallglsentries}[3][\@glo@types]{%
\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{%
\forglsentries[\@@this@glo@]{#2}{#3}}}
%    \end{macrocode}
%\end{macro}
%
% To check to see if a glossary exists use:\\[10pt]
%\cs{ifglossaryexists}\marg{type}\marg{true-text}\marg{false-text}\\[10pt]
%where \meta{type} is the glossary's label.
%\begin{macro}{\ifglossaryexists}
%    \begin{macrocode}
\newcommand{\ifglossaryexists}[3]{%
\@ifundefined{@glotype@#1@out}{#3}{#2}}
%    \end{macrocode}
%\end{macro}
%
% To check to see if a glossary entry has been defined use:\\[10pt]
% \cs{ifglsentryexists}\marg{label}\marg{true text}\marg{false text}\\[10pt]
%where \meta{label} is the entry's label.
%\begin{macro}{\ifglsentryexists}
%    \begin{macrocode}
\newcommand{\ifglsentryexists}[3]{%
\@ifundefined{glo@#1@name}{#3}{#2}}
%    \end{macrocode}
%\end{macro}
%
% To determine if given glossary entry has been 
% used in the document text yet use:\\[10pt]
% \cs{ifglsused}\marg{label}\marg{true text}\marg{false text}\\[10pt]
% where \meta{label} is the entry's label.
% If true it will do \meta{true text}
% otherwise it will do \meta{false text}.
%\begin{macro}{\ifglsused}
%    \begin{macrocode}
\newcommand*{\ifglsused}[3]{\ifthenelse{\boolean{glo@#1@flag}}{#2}{#3}}
%    \end{macrocode}
%\end{macro}
%The following two commands will cause an error if the given
% condition fails:
%
%\cs{glsdoifexists}\marg{label}\marg{code}\par
% Generate an error if entry specified by \meta{label} doesn't 
% exists, otherwise do \meta{code}.
%\begin{macro}{\glsdoifexists}
%    \begin{macrocode}
\newcommand{\glsdoifexists}[2]{\ifglsentryexists{#1}{#2}{%
\PackageError{glossaries}{Glossary entry `#1' has not been
defined.}{You need to define a glossary entry before you
can use it.}}}
%    \end{macrocode}
%\end{macro}
%
%\cs{glsdoifnoexists}\marg{label}\marg{code}\par
% The opposite: only do second argument if the entry doesn't
% exists. Generate an error message if it exists.
%\begin{macro}{\glsdoifnoexists}
%    \begin{macrocode}
\newcommand{\glsdoifnoexists}[2]{\ifglsentryexists{#1}{%
\PackageError{glossaries}{Glossary entry `#1' has already
been defined.}{}}{#2}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Defining new glossaries}\label{sec:newglos}
% A comma-separated list of glossary names is stored
% in \cs{@glo@types}. When a new glossary type
% is created, its identifying name is added to this list.
% This is used by commands that iterate through all glossaries
% (such as \ics{makeglossaries} and \ics{printglossaries}.)
%\begin{macro}{\@glo@types}
%    \begin{macrocode}
\newcommand*{\@glo@types}{,}
%    \end{macrocode}
%\end{macro}
%
% A new glossary type is defined using \cs{newglossary}.
% Syntax:\\[10pt]\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}%
%\marg{title}\oarg{counter}\\[10pt]%
% where \meta{log-ext} is the extension of the \appname{makeindex}
% transcript file, \meta{in-ext} is the extension of the glossary 
% input file (read in by \ics{printglossary} and created by
% \appname{makeindex}), \meta{out-ext} is the extension of the
% glossary output file which is read in by \appname{makeindex} 
% (lines are written to this file by the \ics{glossary} command),
% \meta{title} is the title of the glossary that is used in
% \ics{glossarysection} and
% \meta{counter} is the default counter to be used by entries
% belonging to this glossary. The \appname{makeglossaries} Perl
% script reads in the relevant extensions from the auxiliary file,
% and passes the appropriate file names and switches to 
% \appname{makeindex}.)
%\begin{macro}{\newglossary}
%    \begin{macrocode}
\newcommand*{\newglossary}[5][glg]{%
\ifglossaryexists{#2}{%
\PackageError{glossaries}{Glossary type `#2' already exists}{%
You can't define a new glossary called `#2' because it already
exists}%
}{%
%    \end{macrocode}
% Add this to the list of glossary types:
%    \begin{macrocode}
\toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}%
%    \end{macrocode}
% Define a comma-separated list of labels for this glossary type, 
% so that all the entries for this glossary can be reset with a 
% single command. When a new entry is created, its label is added
% to this list.
%    \begin{macrocode}
\expandafter\gdef\csname glolist@#2\endcsname{,}%
%    \end{macrocode}
% Store details of this new glossary type:
%    \begin{macrocode}
\expandafter\def\csname @glotype@#2@in\endcsname{#3}%
\expandafter\def\csname @glotype@#2@out\endcsname{#4}%
\expandafter\def\csname @glotype@#2@title\endcsname{#5}%
\protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}%
%    \end{macrocode}
% How to display this entry in the document text (uses
% \cs{glsdisplay} and \cs{glsdisplayfirst} by
% default). These can be redefined by the user later if required
% (see \ics{defglsdisplay} and \ics{defglsdisplayfirst})
%    \begin{macrocode}
\expandafter\gdef\csname gls@#2@display\endcsname{%
\glsdisplay}%
\expandafter\gdef\csname gls@#2@displayfirst\endcsname{%
\glsdisplayfirst}%
%    \end{macrocode}
% Find out if the final optional argument has been specified, and
% use it to set the counter associated with this glossary. (Uses
% \ics{glscounter} if no optional argument is present.)
%    \begin{macrocode}
\@ifnextchar[{\@gls@setcounter{#2}}{\@gls@setcounter{#2}[\glscounter]}}}
%    \end{macrocode}
%\end{macro}
% Only defined new glossaries in the preamble:
%    \begin{macrocode}
\@onlypreamble{\newglossary}
%    \end{macrocode}
%\cs{@newglossary} is used to specify the file extensions
% for the \appname{makeindex} input, output and transcript files.
% It is written to the auxiliary file by \ics{newglossary}.
% Since it is not used by \LaTeX, \cs{@newglossary} simply
% ignores its arguments.
%\begin{macro}{\@newglossary}
%    \begin{macrocode}
\newcommand*{\@newglossary}[4]{}
%    \end{macrocode}
%\end{macro}
% Store counter to be used for given glossary type (the first
% argument is the glossary label, the second argument is the name 
% of the counter):
%\begin{macro}{\@gls@setcounter}
%    \begin{macrocode}
\def\@gls@setcounter#1[#2]{%
\expandafter\def\csname @glotype@#1@counter\endcsname{#2}%
}
%    \end{macrocode}
%\end{macro}
% Get counter associated with given glossary (the argument is
% the glossary label):
%\begin{macro}{\@gls@getcounter}
%    \begin{macrocode}
\newcommand*{\@gls@getcounter}[1]{%
\csname @glotype@#1@counter\endcsname}
%    \end{macrocode}
%\end{macro}
%
% Define the main glossary. This will be the first glossary to
% be displayed when using \ics{printglossaries}.
%    \begin{macrocode}
\newglossary{main}{gls}{glo}{\glossaryname}
%    \end{macrocode}
%
%\subsection{Defining new entries}\label{sec:newentry}
% New glossary entries are defined using \cs{newglossaryentry}.
% This command requires a label and a key-value list that defines
% the relevant information for that entry. The definition for these
% keys follows. Note that the \gloskey{name},
% \gloskey{description} and \gloskey{symbol} keys will be
% sanitized later, depending on the value of the package option
% \pkgopt{sanitize} (this means that if some of the keys haven't
% been defined, they can be constructed from the \gloskey{name}
% and \gloskey{description} key before they are sanitized).
%
%
%The \gloskey{name} key indicates the name
% of the term being defined. This is how the term will appear in
% the glossary. The \gloskey{name} key is required when defining
% a new glossary entry.
%    \begin{macrocode}
\define@key{glossentry}{name}{%
\def\@glo@name{#1}%
}
%    \end{macrocode}
%
% The \gloskey{description} key is usually only used in
% the glossary, but can be made to appear in the text by redefining
% \ics{glsdisplay} and \ics{glsdisplayfirst} (or
% using \ics{defglsdisplay} and \ics{defglsdisplayfirst}), however,
% you will have to disable the sanitize option (using the 
% \pkgopt{sanitize} package option, 
% "sanitize={description=false}", and protect fragile
% commands.) The \gloskey{description} key is required when
% defining a new glossary entry. (Be careful not to make the
% description too long, because \appname{makeindex} has a limited
% buffer. \cs{@glo@desc} is defined to be a short command 
% to discourage lengthy descriptions
% for this reason. If you do have a very long description, or if
% you require paragraph breaks, define a separate command that 
% contains the description, and use it as the value to the 
% \gloskey{description} key.)
%    \begin{macrocode}
\define@key{glossentry}{description}{%
\def\@glo@desc{#1}%
}
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{descriptionplural key added}
%    \begin{macrocode}
\define@key{glossentry}{descriptionplural}{%
\def\@glo@descplural{#1}%
}
%    \end{macrocode}
%
% The \gloskey{sort} key needs to be sanitized here 
% (the sort key is provided for \appname{makeindex}'s benefit, 
% not for use in the document.) The \gloskey{sort} key is optional
% when defining a new glossary entry. If omitted, the value 
% is given by \meta{name} \meta{description}.
%    \begin{macrocode}
\define@key{glossentry}{sort}{%
\def\@glo@sort{#1}%
\@onelevel@sanitize\@glo@sort}
%    \end{macrocode}
%
% The \gloskey{text} key determines how the term should appear when
% used in the document (i.e.\ outside of the glossary). If omitted, 
% the value of the \gloskey{name} key is used instead.
%    \begin{macrocode}
\define@key{glossentry}{text}{%
\def\@glo@text{#1}%
}
%    \end{macrocode}
%
% The \gloskey{plural} key determines how the plural form of the term
% should be displayed in the document. If omitted, the plural is
% constructed by appending \ics{glspluralsuffix} to the value of the 
% \gloskey{text} key.
%    \begin{macrocode}
\define@key{glossentry}{plural}{%
\def\@glo@plural{#1}%
}
%    \end{macrocode}
%
% The \gloskey{first} key determines how the entry should be displayed
% in the document when it is first used. If omitted, it is taken
% to be the same as the value of the \gloskey{text} key.
%    \begin{macrocode}
\define@key{glossentry}{first}{%
\def\@glo@first{#1}%
}
%    \end{macrocode}
%
% The \gloskey{firstplural} key is used to set the plural form for
% first use, in the event that the plural is required the first 
% time the term is used. If omitted, it is constructed by 
% appending \ics{glspluralsuffix} to the value of the \gloskey{first} key.
%    \begin{macrocode}
\define@key{glossentry}{firstplural}{%
\def\@glo@firstplural{#1}%
}
%    \end{macrocode}
%
% The \gloskey{symbol} key is ignored by most of the predefined
% glossary styles, and defaults to \cs{relax} if omitted. 
% It is provided for glossary styles that require an associated 
% symbol, as well as a name and description. To make this value 
% appear in the glossary, you need to redefine 
% \ics{glossaryentryfield} so that it uses its fourth parameter.
% If you want this value to appear in the text when the term is used 
% by commands like \ics{gls}, you will need to change
% \ics{glsdisplay} and \ics{glsdisplayfirst} (either 
% explicitly for all glossaries or via \ics{defglsdisplay}
% and \ics{defglsdisplayfirst} for individual glossaries.)
%    \begin{macrocode}
\define@key{glossentry}{symbol}{%
\def\@glo@symbol{#1}%
}
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{symbolplural key added}
%    \begin{macrocode}
\define@key{glossentry}{symbolplural}{%
\def\@glo@symbolplural{#1}%
}
%    \end{macrocode}
%
% The \gloskey{type} key specifies to which glossary this
% entry belongs. If omitted, the default glossary is used.
%    \begin{macrocode}
\define@key{glossentry}{type}{%
\def\@glo@type{#1}}
%    \end{macrocode}
%
% The \gloskey{counter} key specifies the name of the counter 
% associated with this glossary entry:
%    \begin{macrocode}
\define@key{glossentry}{counter}{%
\@ifundefined{c@#1}{\PackageError{glossaries}{There is no counter
called `#1'}{The counter key should have the name of a valid 
counter as its value}}{%
\def\@glo@counter{#1}}}
%    \end{macrocode}
%
% Define \cs{newglossaryentry}%
% \marg{label} \marg{key-val list}. 
% There are two required fields in \meta{key-val list}: 
% \gloskey{name} and 
% \gloskey{description}. (See above.)
%\begin{macro}{\newglossaryentry}
%    \begin{macrocode}
\DeclareRobustCommand{\newglossaryentry}[2]{%
%    \end{macrocode}
% Check to see if this glossary entry has already been defined:
%    \begin{macrocode}
\glsdoifnoexists{#1}{%
%    \end{macrocode}
% Set up defaults. If the \gloskey{name} or \gloskey{description}
% keys are omitted, an error will be generated.
%\changes{1.05}{2007 Aug 10}{Changed the default value of the sort
% key to just the value of the name key}%
%\changes{1.08}{2007 Oct 13}{Fixed error message to say ``description
%key'' rather than ``desc key''}
%    \begin{macrocode}
\def\@glo@name{\PackageError{glossaries}{name key required in 
\string\newglossaryentry}{You haven't specified the entry name}}%
\def\@glo@desc{\PackageError{glossaries}{description key required in 
\string\newglossaryentry}{You haven't specified the entry description}}%
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{descriptionplural support added}
%    \begin{macrocode}
\def\@glo@descplural{\@glo@desc}%
%    \end{macrocode}
%    \begin{macrocode}
\def\@glo@type{\glsdefaulttype}%
\def\@glo@symbol{\relax}%
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{symbolplural support added}
%    \begin{macrocode}
\def\@glo@symbolplural{\@glo@symbol}%
%    \end{macrocode}
%    \begin{macrocode}
\def\@glo@text{\@glo@name}%
\def\@glo@plural{\@glo@text\glspluralsuffix}%
%    \end{macrocode}
% \changes{1.13}{2008 May 10}{Changed default first value}
%    \begin{macrocode}
\def\@glo@first{\relax}%
%    \end{macrocode}
% \changes{1.12}{2008 Mar 8}{Changed default first plural to be first
% key with s appended (was text key with s appended)}
% \changes{1.13}{2008 May 10}{Changed default firstplural value}
%    \begin{macrocode}
\def\@glo@firstplural{\relax}%
%    \end{macrocode}
%    \begin{macrocode}
\def\@glo@sort{\@glo@name}%
\def\@glo@counter{\@gls@getcounter{\@glo@type}}%
%    \end{macrocode}
% Extract key-val information from third parameter:
%    \begin{macrocode}
\setkeys{glossentry}{#2}%
%    \end{macrocode}
% Check to see if this glossary type has been defined, if it has,
% add this label to the relevant list, otherwise generate an error.
%    \begin{macrocode}
\@ifundefined{glolist@\@glo@type}{\PackageError{glossaries}{%
Glossary type '\@glo@type' has not been defined}{%
You need to define a new glossary type, before making entries
in it}}{%
\protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}%
\expandafter\xdef\csname glolist@\@glo@type\endcsname{\@glolist@{#1},}%
}%
%    \end{macrocode}
% Check if \gloskey{first} and \gloskey{firstplural} have been use.
% If \gloskey{firstplural} hasn't been specified, but \gloskey{first}
% has been specified, then form \gloskey{firstplural} by appending
% \cs{glspluralsuffix} to value of \gloskey{first} key, otherwise
% obtain the value from the \gloskey{plural} key.
%    \begin{macrocode}
\if\relax\@glo@firstplural\relax%
   \if\relax\@glo@first\relax%
      \def\@glo@firstplural{\@glo@plural}%
      \def\@glo@first{\@glo@text}%
   \else
      \def\@glo@firstplural{\@glo@first\glspluralsuffix}%
   \fi
\else
   \if\relax\@glo@first\relax%
      \def\@glo@first{\@glo@text}%
   \fi
\fi
%    \end{macrocode}
% Define commands associated with this entry:
%    \begin{macrocode}
\expandafter\protected@xdef\csname glo@#1@text\endcsname{\@glo@text}%
\expandafter\protected@xdef\csname glo@#1@plural\endcsname{\@glo@plural}%
\expandafter\protected@xdef\csname glo@#1@first\endcsname{\@glo@first}%
\expandafter\protected@xdef\csname glo@#1@firstpl\endcsname{\@glo@firstplural}%
\expandafter\protected@xdef\csname glo@#1@type\endcsname{\@glo@type}%
\expandafter\protected@xdef\csname glo@#1@counter\endcsname{\@glo@counter}%
\@gls@sanitizename
\expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}%
\@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}%
\@gls@sanitizesymbol
\expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}%
\expandafter\protected@xdef\csname glo@#1@symbolplural\endcsname{\@glo@symbolplural}%
%    \end{macrocode}
% Define an associated boolean variable to determine whether this
% entry has been used yet (needs to be defined globally):
%    \begin{macrocode}
\expandafter\gdef\csname glo@#1@flagfalse\endcsname{%
\expandafter\global\expandafter
\let\csname ifglo@#1@flag\endcsname\iffalse}%
\expandafter\gdef\csname glo@#1@flagtrue\endcsname{%
\expandafter\global\expandafter
\let\csname ifglo@#1@flag\endcsname\iftrue}%
\csname glo@#1@flagfalse\endcsname
}}
%    \end{macrocode}
%\end{macro}
%\changes{1.13}{2008 May 10}{Removed restriction on only using
% 'newglossaryentry in the preamble}
%
%\subsection{Resetting and unsetting entry flags}
% Each glossary entry is assigned a conditional of the form
%\cs{ifglo@}\meta{label}\texttt{@flag} which determines
% whether or not the entry has been used (see also 
% \ics{ifglsused} defined below.) These flags can
% be set and unset using the following macros:
%
% The command \cs{glsreset}\marg{label} can be used
% to set the entry flag to indicate that it hasn't been used yet. The
% required argument is the entry label.
%\begin{macro}{\glsreset}
%    \begin{macrocode}
\newcommand*{\glsreset}[1]{%
\glsdoifexists{#1}{%
\expandafter\global\csname glo@#1@flagfalse\endcsname}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalreset}
%    \begin{macrocode}
\newcommand*{\glslocalreset}[1]{%
\glsdoifexists{#1}{%
\expandafter\let\csname ifglo@#1@flag\endcsname\iffalse}}
%    \end{macrocode}
%\end{macro}
% The command \cs{glsunset}\marg{label} can be used to
% set the entry flag to indicate that it has been used. The required
% argument is the entry label.
%\begin{macro}{\glsunset}
%    \begin{macrocode}
\newcommand*{\glsunset}[1]{%
\glsdoifexists{#1}{%
\expandafter\global\csname glo@#1@flagtrue\endcsname}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalunset}
%    \begin{macrocode}
\newcommand*{\glslocalunset}[1]{%
\glsdoifexists{#1}{%
\expandafter\let\csname ifglo@#1@flag\endcsname\iftrue}}
%    \end{macrocode}
%\end{macro}
% Reset all entries for the named glossaries (supplied in a 
% comma-separated list). 
% Syntax: \cs{glsresetall}\oarg{glossary-list}
%\begin{macro}{\glsresetall}
%    \begin{macrocode}
\newcommand*{\glsresetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glsreset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalresetall}
%    \begin{macrocode}
\newcommand*{\glslocalresetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glslocalreset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
% Unset all entries for the named glossaries (supplied in a 
% comma-separated list). 
% Syntax: \cs{glsunsetall}\oarg{glossary-list}
%\begin{macro}{\glsunsetall}
%    \begin{macrocode}
\newcommand*{\glsunsetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glsunset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
% As above, but with only a local effect:
%\begin{macro}{\glslocalunsetall}
%    \begin{macrocode}
\newcommand*{\glslocalunsetall}[1][\@glo@types]{%
\forallglsentries[#1]{\@glsentry}{%
\glslocalunset{\@glsentry}}}
%    \end{macrocode}
%\end{macro}
%
% \subsection{Loading files containing glossary entries}
%\label{sec:load}
% Glossary entries can be defined in an external file.
% These external files can contain \ics{newglossaryentry}
% and \ics{newacronym} commands.\footnote{and any other valid 
%\LaTeX\ code that can be used in the preamble.}\\[10pt]
% \cs{loadglsentries}\oarg{type}\marg{filename}\\[10pt]
% This command will input the file using \cs{input}.
% The optional argument specifies to which glossary the
% entries should be assigned if they haven't used the \gloskey{type}
% key. If the optional argument is not specified, the default
% glossary is used. Only those entries used in the document (via
% \ics{glslink}, \ics{gls}, \ics{glspl} and uppercase
% variants or \ics{glsadd} and \ics{glsaddall} 
% will appear in the glossary.) The mandatory argument is 
% the filename (with or without .tex extension.)
%\begin{macro}{\loadglsentries}
%    \begin{macrocode}
\newcommand*{\loadglsentries}[2][\@gls@default]{%
\let\@gls@default\glsdefaulttype
\def\glsdefaulttype{#1}\input{#2}%
\let\glsdefaulttype\@gls@default}
%    \end{macrocode}
%\end{macro}
% \cs{loadglsentries} can only be used in the preamble:
%    \begin{macrocode}
\@onlypreamble{\loadglsentries}
%    \end{macrocode}
%
%\subsection{Using glossary entries in the text}
%\label{sec:code:glslink}
%
% Any term that has been defined using \ics{newglossaryentry}
% (or \ics{newacronym}) can be displayed in the text 
% (i.e.\ outside of the glossary) using
% one of the commands defined in this section. Unless you use
% \ics{glslink}, the way the term appears in the text is
% determined by \ics{glsdisplayfirst} (if it is the first
% time the term has been used) or \ics{glsdisplay} (for
% subsequent use.) Any formatting commands (such as \cs{textbf}
% is governed by \ics{glstextformat}. By default this just 
% displays the \term{link text} ``as is''.
%\changes{1.04}{2007 Aug 3}{Added 'glstextformat}%
%\begin{macro}{\glstextformat}
%    \begin{macrocode}
\newcommand*{\glstextformat}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% The first time an entry is used, the way in which it is
% displayed is governed by \cs{glsdisplayfirst}. This
% takes four parameters: \verb|#1| will be the value
% of the entry's \gloskey{first} or \gloskey{firstplural} key, 
% \verb|#2| will be the value of the entry's \gloskey{description}
% key, \verb|#3| will be the value of the entry's \gloskey{symbol}
% key and \verb|#4| is additional text supplied by the final optional
% argument to commands like \ics{gls} and \ics{glspl}.
% The default is to display the first parameter followed by the
% additional text.
%\begin{macro}{\glsdisplayfirst}
%    \begin{macrocode}
\newcommand*{\glsdisplayfirst}[4]{#1#4}
%    \end{macrocode}
%\end{macro}
%
% After the first use, the entry is displayed according to
% the format of \cs{glsdisplay}. Again, it takes four
% parameters: \verb|#1| will be the value of the
% entry's \gloskey{text} or \gloskey{plural} key, 
% \verb|#2| will be the value of the entry's \gloskey{description} 
% key, \verb|#3| will be the value of the entry's \gloskey{symbol}
% key and \verb|#4| is additional text supplied by the final optional
% argument to commands like \ics{gls} and \ics{glspl}.
%\begin{macro}{\glsdisplay}
%    \begin{macrocode}
\newcommand*{\glsdisplay}[4]{#1#4}
%    \end{macrocode}
%\end{macro}
%
% When a new glossary is created it uses \cs{glsdisplayfirst}
% and \cs{glsdisplay} as the default way of displaying its
% entry in the text. This can be changed for the entries belonging 
% to an individual glossary using 
% \ics{defglsdisplay} and \ics{defglsdisplayfirst}.
%\\[10pt]
% \cs{defglsdisplay}\oarg{type}\marg{definition}\\[10pt]%
% The glossary type is given by \meta{type} (the default glossary
% if omitted) and
% \meta{definition} should have at most \verb|#1|, \verb|#2|,
% \verb|#3| and \verb|#4|. These represent the same arguments
% as those described for \ics{glsdisplay}.
%\begin{macro}{\defglsdisplay}
%    \begin{macrocode}
\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{%
\expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
% \cs{defglsdisplayfirst}\oarg{type}\marg{definition}\\[10pt]%
% The glossary type is given by \meta{type} (the default glossary
% if omitted) and
% \meta{definition} should have at most \verb|#1|, \verb|#2|,
% \verb|#3| and \verb|#4|. These represent the same arguments
% as those described for \ics{glsdisplayfirst}.
%\begin{macro}{\defglsdisplayfirst}
%    \begin{macrocode}
\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{%
\expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Links to glossary entries}
% The links to glossary entries all have a first optional 
% argument that can be used to change the format and counter
% of the associated entry number. Except for \cs{glslink},
% the commands like \cs{gls} have a final optional
% argument that can be used to insert additional text in the
% link (this will usually be appended, but can be redefined using
% \ics{defglsdisplay} and \ics{defglsdisplayfirst}). 
% It goes against the \LaTeX\ norm to have an optional
% argument after the mandatory arguments, but it makes more
% sense to write, say, \verb|\gls{label}['s]| rather than, say,
% \verb|\gls[append='s]{label}|. Since these control sequences
% are defined to include the final square bracket, spaces
% will be ignored after them. This is likely to lead to
% confusion as most users would not expect, say, "\gls{"\meta{label}"}"
% to ignore following spaces, so \cs{new@ifnextchar} from the 
% \isty{amsgen} package is required.
%
% The following keys can be used in the first optional 
% argument. The \gloskey[glslink]{counter} key checks that the 
% value is the name of a valid counter.
%    \begin{macrocode}
\define@key{glslink}{counter}{%
\@ifundefined{c@#1}{\PackageError{glossaries}{There is no counter
called `#1'}{The counter key should have the name of a valid 
counter as its value}}{%
\def\@gls@counter{#1}}}
%    \end{macrocode}
% The value of the \gloskey[glslink]{format} key should be the name of a 
% command (without the initial backslash) that has a single mandatory 
% argument which can be used to format the associated entry
% number.
%    \begin{macrocode}
\define@key{glslink}{format}{%
\def\@glsnumberformat{#1}}
%    \end{macrocode}
% The \gloskey[glslink]{hyper} key is a boolean key, it can either have the 
% value true or false, and indicates whether or not to make a 
% hyperlink to the relevant glossary entry. If hyper is false, an 
% entry will still be made in the glossary, but the given text 
% won't be a hyperlink.
%    \begin{macrocode}
\define@boolkey{glslink}{hyper}[true]{}
%    \end{macrocode}
%
%Syntax:\\[10pt]
% \cs{glslink}\oarg{options}\marg{label}\marg{text}
%\\[10pt]
% Display \meta{text} in the document, and add the entry information
% for \meta{label} into the relevant glossary. The optional
% argument should be a key value list using the \texttt{glslink}
% keys defined above.
%
% There is also a starred version:\\[10pt]
% \cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt]
% which is equivalent to 
% \cs{glslink}"[hyper=false,"\meta{options}"]"\marg{label}\marg{text}
%
% First determine whether or not we are using the starred version:
%\begin{macro}{\glslink}
%    \begin{macrocode}
\newcommand{\glslink}{%
\@ifstar\@sgls@link\@gls@link}
%    \end{macrocode}
%\end{macro}
% Define the starred version:
%\begin{macro}{\@sgls@link}
%    \begin{macrocode}
\newcommand*{\@sgls@link}[1][]{\@gls@link[hyper=false,#1]}
%    \end{macrocode}
%\end{macro}
% Define the un-starred version:
%\begin{macro}{\@gls@link}
%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon}
%    \begin{macrocode}
\newcommand*{\@gls@link}[3][]{%
\glsdoifexists{#2}{%
\def\@glsnumberformat{glsnumberformat}%
\edef\@gls@counter{\csname glo@#2@counter\endcsname}%
\KV@glslink@hypertrue
\setkeys{glslink}{#1}%
\edef\theglsentrycounter{\expandafter\noexpand\csname the\@gls@counter\endcsname}%
\ifKV@glslink@hyper
\@glslink{glo:#2}{\glstextformat{#3}}%
\else
\glstextformat{#3}\relax
\fi
\protected@edef\@glo@sort{\csname glo@#2@sort\endcsname}%
\@gls@checkmkidxchars\@glo@sort
\protected@edef\@@glo@name{\csname glo@#2@name\endcsname}%
\@gls@checkmkidxchars\@@glo@name
\protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}%
\protected@edef\@glo@desc{\csname glo@#2@desc\endcsname}%
\@gls@checkmkidxchars\@glo@desc
\protected@edef\@glo@symbol{\csname glo@#2@symbol\endcsname}%
\@gls@checkmkidxchars\@glo@symbol
\@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat
\glossary[\csname glo@#2@type\endcsname]{%
\@glo@sort\@gls@actualchar
\string\glossaryentryfield{#2}{\@glo@name}{\@glo@desc
}{\@glo@symbol}\@gls@encapchar\@glo@numfmt}%
}}
%    \end{macrocode}
%\end{macro}
%\changes{1.01}{2007 May 17}{Added range facility in format key}%
% Set the formatting information in the format required by 
% \appname{makeindex}:
%\begin{macro}{\@set@glo@numformat}
%    \begin{macrocode}
\def\@set@glo@numformat#1#2#3{%
\expandafter\@glo@check@mkidxrangechar#3\@nil
\protected@edef#1{\@glo@prefix setentrycounter{#2}%
\expandafter\string\csname\@glo@suffix\endcsname}%
\@gls@checkmkidxchars#1}
%    \end{macrocode}
%\end{macro}
% Check to see if the given string starts with a ( or ). If it
% does set \cs{@glo@prefix} to the starting character,
% and \cs{@glo@suffix} to the rest (or "glsnumberformat"
% if there is nothing else),
% otherwise set \cs{@glo@prefix} to nothing and
% \cs{@glo@suffix} to all of it.
%    \begin{macrocode}
\def\@glo@check@mkidxrangechar#1#2\@nil{%
\if#1(\relax
  \def\@glo@prefix{(}%
  \if\relax#2\relax
    \def\@glo@suffix{glsnumberformat}%
  \else
    \def\@glo@suffix{#2}%
  \fi
\else
  \if#1)\relax
    \def\@glo@prefix{)}%
    \if\relax#2\relax
      \def\@glo@suffix{glsnumberformat}%
    \else
      \def\@glo@suffix{#2}%
  \fi
  \else
    \def\@glo@prefix{}\def\@glo@suffix{#1#2}%
  \fi
\fi}
%    \end{macrocode}
% Catch \appname{makeindex} special characters\mkidxspch:
%\begin{macro}{\@gls@checkmkidxchars}
%    \begin{macrocode}
\newcommand{\@gls@checkmkidxchars}[1]{%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checkquote#1\@nil""\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checkescquote#1\@nil\"\"\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checkescactual#1\@nil\?\?\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checkactual#1\@nil??\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checkbar#1\@nil||\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checkescbar#1\@nil\|\|\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
\def\@gls@checkedmkidx{}%
\expandafter\@gls@checklevel#1\@nil!!\null%
\expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
}
%    \end{macrocode}
%\end{macro}
% Update the control sequence and strip trailing \cs{@nil}:
%\begin{macro}{\@gls@updatechecked}
%    \begin{macrocode}
\def\@gls@updatechecked#1\@nil#2{\def#2{#1}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@tmpb}
%\changes{1.1}{2008 Feb 22}{changed \cs{toksdef} to \cs{newtoks}}
% Define temporary token
%    \begin{macrocode}
\newtoks\@gls@tmpb
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkquote}
% Replace \verb|"| with \verb|""| since \verb|"| is a makeindex
% special character\mkidxspch.
%    \begin{macrocode}
\def\@gls@checkquote#1"#2"#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkquote{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}%
  \def\@@gls@checkquote{\@gls@checkquote#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@quotechar}%
 \ifx\null#3\null
   \def\@@gls@checkquote{\@gls@checkquote#2""\null}%
 \else
   \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}%
 \fi
\fi
\@@gls@checkquote}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkescquote}
% Do the same for \verb|\"|:
%    \begin{macrocode}
\def\@gls@checkescquote#1\"#2\"#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkescquote{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@quotechar
    \@gls@quotechar\string\"\@gls@quotechar}%
  \def\@@gls@checkescquote{\@gls@checkescquote#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@quotechar}%
 \ifx\null#3\null
   \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}%
 \else
   \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}%
 \fi
\fi
\@@gls@checkescquote}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkescactual}
% Similarly for \verb|\?| (which is replaces @ as 
% \appname{makeindex}'s special character):
%    \begin{macrocode}
\def\@gls@checkescactual#1\?#2\?#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkescactual{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@actualchar
    \@gls@quotechar\string\"\@gls@actualchar}%
  \def\@@gls@checkescactual{\@gls@checkescactual#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@actualchar}%
 \ifx\null#3\null
  \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}%
 \else
  \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}%
 \fi
\fi
\@@gls@checkescactual}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkescbar}
% Similarly for \verb"\|":
%    \begin{macrocode}
\def\@gls@checkescbar#1\|#2\|#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkescbar{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@encapchar
    \@gls@quotechar\string\"\@gls@encapchar}%
  \def\@@gls@checkescbar{\@gls@checkescbar#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@encapchar}%
 \ifx\null#3\null
  \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}%
 \else
  \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}%
 \fi
\fi
\@@gls@checkescbar}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkesclevel}
% Similarly for \verb"\!":
%    \begin{macrocode}
\def\@gls@checkesclevel#1\!#2\!#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkesclevel{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\string\"\@gls@levelchar
    \@gls@quotechar\string\"\@gls@levelchar}%
  \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\string\"\@gls@levelchar}%
 \ifx\null#3\null
  \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}%
 \else
  \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}%
 \fi
\fi
\@@gls@checkesclevel}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkbar}
% and for \verb"|":
%    \begin{macrocode}
\def\@gls@checkbar#1|#2|#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkbar{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}%
  \def\@@gls@checkbar{\@gls@checkbar#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@encapchar}%
 \ifx\null#3\null
   \def\@@gls@checkbar{\@gls@checkbar#2||\null}%
 \else
   \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}%
 \fi
\fi
\@@gls@checkbar}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checklevel}
% and for \verb"!":
%    \begin{macrocode}
\def\@gls@checklevel#1!#2!#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checklevel{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}%
  \def\@@gls@checklevel{\@gls@checklevel#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@levelchar}%
 \ifx\null#3\null
   \def\@@gls@checklevel{\@gls@checklevel#2!!\null}%
 \else
   \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}%
 \fi
\fi
\@@gls@checklevel}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@gls@checkactual}
% and for \verb"?":
%    \begin{macrocode}
\def\@gls@checkactual#1?#2?#3\null{%
\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
\toks@={#1}%
\ifx\null#2\null%
 \ifx\null#3\null
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
  \def\@@gls@checkactual{\relax}%
 \else
  \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
    \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}%
  \def\@@gls@checkactual{\@gls@checkactual#3\null}%
 \fi
\else
 \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
   \@gls@quotechar\@gls@actualchar}%
 \ifx\null#3\null
   \def\@@gls@checkactual{\@gls@checkactual#2??\null}%
 \else
   \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}%
 \fi
\fi
\@@gls@checkactual}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@glslink}
% If \ics{hyperlink} is not defined \cs{@glslink} 
% ignores its first argument and just does the second argument,
% otherwise it is equivalent to \ics{hyperlink}.
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
  \gdef\@glslink#1#2{#2}%
}{%
  \gdef\@glslink#1#2{\hyperlink{#1}{#2}}%
}
%    \end{macrocode}
%\end{macro}
%\changes{1.12}{2008 Mar 8}{added check for 'hypertarget separate
% to 'hyperlink (memoir defines 'hyperlink but not 'hypertarget)}
%\begin{macro}{\@glstarget}
% If \ics{hypertarget} is not defined, \cs{@glstarget}
% ignores its first argument and just does the second argument,
% otherwise it is equivalent to \ics{hypertarget}.
%    \begin{macrocode}
\@ifundefined{hypertarget}{%
  \gdef\@glstarget#1#2{#2}%
}{%
  \gdef\@glstarget#1#2{\hypertarget{#1}{#2}}}
%    \end{macrocode}
%\end{macro}
%
% Glossary hyperlinks can be disabled using \cs{glsdisablehyper}
% (effect can be localised):
%\begin{macro}{\glsdisablehyper}
%    \begin{macrocode}
\newcommand{\glsdisablehyper}{%
\renewcommand*\@glslink[2]{##2}%
\renewcommand*\@glstarget[2]{##2}}
%    \end{macrocode}
%\end{macro}
% Glossary hyperlinks can be enabled using \cs{glsenablehyper}
% (effect can be localised):
%\begin{macro}{\glsenablehyper}
%    \begin{macrocode}
\newcommand{\glsenablehyper}{%
\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}%
\renewcommand*\@glstarget[2]{\hypertarget{##1}{##2}}}
%    \end{macrocode}
%\end{macro}
%
%Syntax:\\[10pt]
% \cs{gls}\oarg{options}\marg{label}\oarg{insert text}\\[10pt]
% Link to glossary entry using singular form. The link text
% is taken from the value of the \gloskey{text} or \gloskey{first}
% keys used when the entry was defined.
%
%  The first optional argument is a key-value list, the same as
% \ics{glslink}\igloskey[glslink]{hyper}\igloskey[glslink]{format}\igloskey[glslink]{counter}, 
% the mandatory argument is the entry label. 
% After the mandatory argument, there is another optional argument 
% to insert extra text in the link text (the location of the inserted
% text is governed by \ics{glsdisplay} and 
% \ics{glsdisplayfirst}). As with \cs{glslink}
% there is a starred version which is the same as the unstarred 
% version but with the \gloskey[glslink]{hyper} key set to \texttt{false}.
% (Additional options can also be specified 
% in the first optional argument.)
%
% First determine if we are using the starred form:
%\begin{macro}{\gls}
%    \begin{macrocode}
\newcommand*{\gls}{\@ifstar\@sgls\@gls}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%\begin{macro}{\@sgls}
%    \begin{macrocode}
\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]}
%    \end{macrocode}
%\end{macro}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%\begin{macro}{\@gls}
%    \begin{macrocode}
\newcommand*{\@gls}[2][]{%
\new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}}
%    \end{macrocode}
%\end{macro}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@gls@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}.
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\@glo@text}%
}{%
  \ifglsacrfootnote
    \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
  \else
    \@gls@link[#1]{#2}{\@glo@text}%
  \fi
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%
% \cs{Gls} behaves like \cs{gls}, but the first letter
% of the link text is converted to uppercase (note that if the
% first letter has an accent, the accented letter will need to
% be grouped when you define the entry.) It is mainly intended
% for terms that start a sentence:
%\begin{macro}{\Gls}
%    \begin{macrocode}
\newcommand*{\Gls}{\@ifstar\@sGls\@Gls}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGls}[1][]{\@Gls[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Gls}[2][]{%
\new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Gls@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
  \ifglsacrfootnote
    \@gls@link[#1,hyper=false]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
  \else
    \@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}}%
  \fi
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%
% \cs{GLS} behaves like \ics{gls}, but the link
% text is converted to uppercase:
%\begin{macro}{\GLS}
%    \begin{macrocode}
\newcommand*{\GLS}{\@ifstar\@sGLS\@GLS}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLS}[1][]{\@GLS[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLS}[2][]{%
\new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLS@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
  \ifglsacrfootnote
    \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
  \else
    \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
  \fi
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%
% \cs{glspl} behaves in the same way as \ics{gls} except
% it uses the plural form.
%\begin{macro}{\glspl}
%    \begin{macrocode}
\newcommand*{\glspl}{\@ifstar\@sglspl\@glspl}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglspl}[1][]{\@glspl[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glspl}[2][]{%
\new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glspl@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and
% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol}
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\@glo@text}%
}{%
  \ifglsacrfootnote
    \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
  \else
    \@gls@link[#1]{#2}{\@glo@text}%
  \fi
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%
% \cs{Glspl} behaves in the same way as \ics{glspl}, except
% that the first letter of the link text is converted to uppercase
% (as with \ics{Gls}, if the first letter has an accent, it
% will need to be grouped.)
%\begin{macro}{\Glspl}
%    \begin{macrocode}
\newcommand*{\Glspl}{\@ifstar\@sGlspl\@Glspl}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlspl}[1][]{\@Glspl[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glspl}[2][]{%
\new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glspl@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and
% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol}
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{%
    \expandafter\makefirstuc\expandafter{\@glo@text}}%
}{%
  \ifglsacrfootnote
    \@gls@link[#1,hyper=false]{#2}{%
      \expandafter\makefirstuc\expandafter{\@glo@text}}%
  \else
    \@gls@link[#1]{#2}{%
      \expandafter\makefirstuc\expandafter{\@glo@text}}%
  \fi
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%
% \cs{GLSpl} behaves like \ics{glspl} except that all the
% link text is converted to uppercase.
%\begin{macro}{\GLSpl}
%    \begin{macrocode}
\newcommand*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSpl}[1][]{\@GLSpl[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSpl}[2][]{%
\new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSpl@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label}
%    \begin{macrocode}
\def\@gls@link@opts{#1}%
\def\@gls@link@label{#2}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and
% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol}
%    \begin{macrocode}
\ifglsused{#2}{\protected@edef\@glo@text{%
\csname gls@\@glo@type @display\endcsname
{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}{%
\protected@edef\@glo@text{%
\csname gls@\@glo@type @displayfirst\endcsname
{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
\glsentrysymbolplural{#2}}{#3}}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% If \pkgopt{footnote} package option has been used, suppress 
% hyperlink for first use.
%    \begin{macrocode}
\ifglsused{#2}{%
  \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
}{%
  \ifglsacrfootnote
    \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
  \else
    \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
  \fi
}%
%    \end{macrocode}
% Indicate that this entry has now been used
%    \begin{macrocode}
\glsunset{#2}}%
}
%    \end{macrocode}
%
% \cs{glstext} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{text} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glstext}
%    \begin{macrocode}
\newcommand*{\glstext}{\@ifstar\@sglstext\@glstext}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glstext}[2][]{%
\new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glstext@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glstext shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrytext{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLStext} behaves like \cs{glstext} except the text is converted
% to uppercase.
%\begin{macro}{\GLStext}
%    \begin{macrocode}
\newcommand*{\GLStext}{\@ifstar\@sGLStext\@GLStext}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLStext}[2][]{%
\new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLStext@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLStext shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrytext{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{Glstext} behaves like \cs{glstext} except that the first letter
% of the text is converted to uppercase.
%\begin{macro}{\Glstext}
%    \begin{macrocode}
\newcommand*{\Glstext}{\@ifstar\@sGlstext\@Glstext}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glstext}[2][]{%
\new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glstext@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glstext shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrytext{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{glsfirst} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{first} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsfirst}
%    \begin{macrocode}
\newcommand*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsfirst}[2][]{%
\new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsfirst@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsfirst shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirst{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsfirst} behaves like \ics{glsfirst} except it displays the 
% first letter in uppercase.
%\begin{macro}{\Glsfirst}
%    \begin{macrocode}
\newcommand*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsfirst}[2][]{%
\new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsfirst@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsfirst shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirst{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSfirst} behaves like \ics{Glsfirst} except it displays the 
% text in uppercase.
%\begin{macro}{\GLSfirst}
%    \begin{macrocode}
\newcommand*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSfirst}[2][]{%
\new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSfirst@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSfirst shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirst{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{plural} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsplural}
%    \begin{macrocode}
\newcommand*{\glsplural}{\@ifstar\@sglsplural\@glsplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsplural}[1][]{\@glsplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsplural}[2][]{%
\new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsplural} behaves like \ics{glsplural} except that the first
% letter is converted to uppercase.
%\begin{macro}{\Glsplural}
%    \begin{macrocode}
\newcommand*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsplural}[1][]{\@Glsplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsplural}[2][]{%
\new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSplural} behaves like \ics{glsplural} except that the 
% text is converted to uppercase.
%\begin{macro}{\GLSplural}
%    \begin{macrocode}
\newcommand*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSplural}[2][]{%
\new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsfirstplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{firstplural} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsfirstplural}
%    \begin{macrocode}
\newcommand*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsfirstplural}[2][]{%
\new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsfirstplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsfirstplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsfirstplural} behaves like \ics{glsfirstplural} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsfirstplural}
%    \begin{macrocode}
\newcommand*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsfirstplural}[2][]{%
\new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsfirstplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsfirstplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSfirstplural} behaves like \ics{glsfirstplural} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSfirstplural}
%    \begin{macrocode}
\newcommand*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSfirstplural}[2][]{%
\new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSfirstplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSfirstplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsname} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{name} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glsname}
%    \begin{macrocode}
\newcommand*{\glsname}{\@ifstar\@sglsname\@glsname}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsname}[1][]{\@glsname[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsname}[2][]{%
\new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsname@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsname shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryname{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsname} behaves like \ics{glsname} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsname}
%    \begin{macrocode}
\newcommand*{\Glsname}{\@ifstar\@sGlsname\@Glsname}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsname}[1][]{\@Glsname[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsname}[2][]{%
\new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsname@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsname shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryname{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSname} behaves like \ics{glsname} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSname}
%    \begin{macrocode}
\newcommand*{\GLSname}{\@ifstar\@sGLSname\@GLSname}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSname}[2][]{%
\new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSname@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSname shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentryname{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsdesc} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{description} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsdesc}
%    \begin{macrocode}
\newcommand*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsdesc}[2][]{%
\new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsdesc@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glsdesc shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydesc{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsdesc} behaves like \ics{glsdesc} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsdesc}
%    \begin{macrocode}
\newcommand*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsdesc}[2][]{%
\new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsdesc@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsdesc shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydesc{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSdesc} behaves like \ics{glsdesc} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSdesc}
%    \begin{macrocode}
\newcommand*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSdesc}[2][]{%
\new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSdesc@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSdesc shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydesc{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glsdescplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{descriptionplural} key and it doesn't mark the entry
% as used.
%\begin{macro}{\glsdescplural}
%    \begin{macrocode}
\newcommand*{\glsdescplural}{\@ifstar\@sglsdescplural\@glsdescplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglsdescplural}[1][]{\@glsdescplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glsdescplural}[2][]{%
\new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glsdescplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydescplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glsdescplural} behaves like \ics{glsdescplural} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glsdescplural}
%    \begin{macrocode}
\newcommand*{\Glsdescplural}{\@ifstar\@sGlsdescplural\@Glsdescplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlsdescplural}[1][]{\@Glsdescplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glsdescplural}[2][]{%
\new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glsdescplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydescplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
  \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSdescplural} behaves like \ics{glsdescplural} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSdescplural}
%    \begin{macrocode}
\newcommand*{\GLSdescplural}{\@ifstar\@sGLSdescplural\@GLSdescplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSdescplural}[1][]{\@GLSdescplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSdescplural}[2][]{%
\new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSdescplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrydescplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glssymbol} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{symbol} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glssymbol}
%    \begin{macrocode}
\newcommand*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glssymbol}[2][]{%
\new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glssymbol@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glssymbol shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbol{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glssymbol} behaves like \ics{glssymbol} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glssymbol}
%    \begin{macrocode}
\newcommand*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glssymbol}[2][]{%
\new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glssymbol@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('Glssymbol shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbol{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSsymbol} behaves like \ics{glssymbol} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSsymbol}
%    \begin{macrocode}
\newcommand*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSsymbol}[2][]{%
\new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSsymbol@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSsymbol shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbol{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \cs{glssymbolplural} behaves like \ics{gls} except it always uses the value 
% given by the \gloskey{symbolplural} key and it doesn't mark the entry as
% used.
%\begin{macro}{\glssymbolplural}
%    \begin{macrocode}
\newcommand*{\glssymbolplural}{\@ifstar\@sglssymbolplural\@glssymbolplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sglssymbolplural}[1][]{\@glssymbolplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@glssymbolplural}[2][]{%
\new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@glssymbolplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
% \changes{1.12}{2008 Mar 8}{fixed bug ('glssymbolplural shouldn't use
% 'gls@\meta{type}@display)}
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\@glo@text#3}%
}%
}
%    \end{macrocode}
%
% \cs{Glssymbolplural} behaves like \ics{glssymbolplural} except that the
% first letter is converted to uppercase.
%\begin{macro}{\Glssymbolplural}
%    \begin{macrocode}
\newcommand*{\Glssymbolplural}{\@ifstar\@sGlssymbolplural\@Glssymbolplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGlssymbolplural}[1][]{\@Glssymbolplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@Glssymbolplural}[2][]{%
\new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@Glssymbolplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{%
   \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
}%
}
%    \end{macrocode}
%
% \cs{GLSsymbolplural} behaves like \ics{glssymbolplural} except that the
% link text is converted to uppercase.
%\begin{macro}{\GLSsymbolplural}
%    \begin{macrocode}
\newcommand*{\GLSsymbolplural}{\@ifstar\@sGLSsymbolplural\@GLSsymbolplural}
%    \end{macrocode}
%\end{macro}
% Define the starred form:
%    \begin{macrocode}
\newcommand*{\@sGLSsymbolplural}[1][]{\@GLSsymbolplural[hyper=false,#1]}
%    \end{macrocode}
% Defined the un-starred form. Need to determine if there is
% a final optional argument
%    \begin{macrocode}
\newcommand*{\@GLSsymbolplural}[2][]{%
\new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}}
%    \end{macrocode}
% Read in the final optional argument:
%    \begin{macrocode}
\def\@GLSsymbolplural@#1#2[#3]{%
\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
%    \end{macrocode}
% Determine what the link text should be (this is stored in 
% \cs{@glo@text})
%    \begin{macrocode}
\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
%    \end{macrocode}
% Call \cs{@gls@link}
% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter}
%    \begin{macrocode}
\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
}%
}
%    \end{macrocode}
%
% \subsubsection{Displaying entry details without adding
% information to the glossary}
% 
% These commands merely display entry information without adding
% entries in the associated file or having hyperlinks.
%
% Get the entry name (as specified by the \gloskey{name} key
% when the entry was defined.) The argument
% is the label associated with the entry. Note that unless you
% used \texttt{name=false} in the \pkgopt{sanitize} package option 
% you may get unexpected results if the \gloskey{name} key contains 
% any commands.
%\begin{macro}{\glsentryname}
%    \begin{macrocode}
\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryname}
%    \begin{macrocode}
\newcommand*{\Glsentryname}[1]{%
\protected@edef\@glo@text{\csname glo@#1@name\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the entry description (as specified by the 
% \gloskey{description} when the entry was defined.) The argument
% is the label associated with the entry. Note that unless you
% used \texttt{description=false} in the \pkgopt{sanitize} package 
% option you may get unexpected results if the \gloskey{description} 
% key contained any commands.
%\begin{macro}{\glsentrydesc}
%    \begin{macrocode}
\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrydesc}
%    \begin{macrocode}
\newcommand*{\Glsentrydesc}[1]{%
\protected@edef\@glo@text{\csname glo@#1@desc\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
% Plural form:
%\begin{macro}{\glsentrydescplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\glsentrydescplural}[1]{%
\csname glo@#1@descplural\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrydescplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\Glsentrydescplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@descplural\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the entry text, as specified by the \gloskey{text} key when
% the entry was defined. The argument
% is the label associated with the entry:
%\begin{macro}{\glsentrytext}
%    \begin{macrocode}
\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrytext}
%    \begin{macrocode}
\newcommand*{\Glsentrytext}[1]{%
\protected@edef\@glo@text{\csname glo@#1@text\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the plural form:
%\begin{macro}{\glsentryplural}
%    \begin{macrocode}
\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryplural}
%    \begin{macrocode}
\newcommand*{\Glsentryplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@plural\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the symbol associated with this entry. The argument
% is the label associated with the entry. Note that unless you
% used \texttt{symbol=false} in the \pkgopt{sanitize} package 
% option you may get unexpected results if the \gloskey{symbol} 
% key contained any commands.
%\begin{macro}{\glsentrysymbol}
%    \begin{macrocode}
\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrysymbol}
%    \begin{macrocode}
\newcommand*{\Glsentrysymbol}[1]{%
\protected@edef\@glo@text{\csname glo@#1@symbol\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
% Plural form:
%\begin{macro}{\glsentrysymbolplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\glsentrysymbolplural}[1]{%
\csname glo@#1@symbolplural\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentrysymbolplural}
%\changes{1.12}{2008 Mar 8}{New}
%    \begin{macrocode}
\newcommand*{\Glsentrysymbolplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@symbolplural\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the entry text to be used when the entry is first used in
% the document (as specified by the \gloskey{first} key when
% the entry was defined.)
%\begin{macro}{\glsentryfirst}
%    \begin{macrocode}
\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryfirst}
%    \begin{macrocode}
\newcommand*{\Glsentryfirst}[1]{%
\protected@edef\@glo@text{\csname glo@#1@first\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Get the plural form (as specified by the \gloskey{firstplural}
% key when the entry was defined.)
%\begin{macro}{\glsentryfirstplural}
%    \begin{macrocode}
\newcommand*{\glsentryfirstplural}[1]{%
\csname glo@#1@firstpl\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Glsentryfirstplural}
%    \begin{macrocode}
\newcommand*{\Glsentryfirstplural}[1]{%
\protected@edef\@glo@text{\csname glo@#1@firstpl\endcsname}%
\expandafter\makefirstuc\expandafter{\@glo@text}}
%    \end{macrocode}
%\end{macro}
%
% Display the glossary type with which this entry is associated
% (as specified by the \gloskey{type} key used when the entry was 
% defined)
%\begin{macro}{\glsentrytype}
%    \begin{macrocode}
\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname}
%    \end{macrocode}
%\end{macro}
%
% Display the sort text used for this entry. Note that the 
% \gloskey{sort} key is sanitize, so unexpected results may 
% occur if the \gloskey{sort} key contained commands.
%\begin{macro}{\glsentrysort}
%    \begin{macrocode}
\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Adding an entry to the glossary without generating
% text}
% The following keys are provided for \cs{glsadd} and 
% \cs{glsaddall}:
%    \begin{macrocode}
\define@key{glossadd}{counter}{\def\@glo@counter{#1}}
\define@key{glossadd}{format}{\def\@glo@format{#1}}
%    \end{macrocode}
% This key is only used by \cs{glsaddall}:
%    \begin{macrocode}
\define@key{glossadd}{types}{\def\@glo@type{#1}}
%    \end{macrocode}
%\vskip5pt
%\cs{glsadd}\oarg{options}\marg{label}\\[10pt]
% Add a term to the glossary without generating any link text. 
% The optional argument indicates which counter to use, 
% and how to format it (using a key-value list)
% the second argument is the entry label. Note that \meta{options}
% only has two keys: \gloskey[glsadd]{counter} and \gloskey[glsadd]{format} (the \gloskey[glsaddall]{types} key will be ignored).
%\begin{macro}{\glsadd}
%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon}
%    \begin{macrocode}
\newcommand*{\glsadd}[2][]{%
\glsdoifexists{#2}{%
\def\@glo@format{glsnumberformat}%
\edef\@glo@counter{\csname glo@#2@counter\endcsname}%
\setkeys{glossadd}{#1}%
\edef\theglsentrycounter{\expandafter\noexpand\csname the\@glo@counter\endcsname}%
\protected@edef\@glo@sort{\csname glo@#2@sort\endcsname}%
\@gls@checkmkidxchars\@glo@sort
\protected@edef\@@glo@name{\csname glo@#2@name\endcsname}%
\@gls@checkmkidxchars\@@glo@name
\protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}%
\protected@edef\@glo@desc{\csname glo@#2@desc\endcsname}%
\@gls@checkmkidxchars\@glo@desc
\protected@edef\@glo@symbol{\csname glo@#2@symbol\endcsname}%
\@gls@checkmkidxchars\@glo@symbol
\@set@glo@numformat\@glo@numfmt\@glo@counter\@glo@format
\glossary[\csname glo@#2@type\endcsname]{%
\@glo@sort\@gls@actualchar\string\glossaryentryfield
{#2}{\@glo@name}{\@glo@desc}{\@glo@symbol}\@gls@encapchar
\@glo@numfmt}%
}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
%\cs{glsaddall}\oarg{glossary list}\\[10pt]
% Add all terms defined for the listed glossaries (without displaying
% any text.) If \gloskey[glsaddall]{types} key is omitted, apply to all
% glossary types.
%\begin{macro}{\glsaddall}
%    \begin{macrocode}
\newcommand*{\glsaddall}[1][]{%
\def\@glo@type{\@glo@types}%
\setkeys{glossadd}{#1}%
\forallglsentries[\@glo@type]{\@glo@entry}{%
\glsadd[#1]{\@glo@entry}}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Creating associated files}
% The \cs{writeist} command creates the associated 
% customized \filetype{.ist} \appname{makeindex} style file.
% While defining this command, some characters have their 
% catcodes temporarily changed to ensure they get written to 
% the \filetype{.ist} file correctly. The \appname{makeindex} 
% actual character (usually "@") is redefined to be a "?", to allow 
% internal commands to be written to the glossary file output file.
%
% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar},
% \cs{@gls@encapchar}, \cs{@glsl@levelchar} and
% \cs{@gls@quotechar} to make them easier to use later,
% but don't change these values, because the characters are
% encoded in the command definitions that are used to escape
% the special characters (which means that the user no longer
% needs to worry about \appname{makeindex} special characters.)
%
% The symbols and numbers label for group headings are hardwired into
% the \filetype{.ist} file as \texttt{glssymbols} and 
% \texttt{glsnumbers}, the group titles can be translated 
% (so that \ics{glssymbolsgroupname} replaces \texttt{glssymbols}
% and \ics{glsnumbersgroupname} replaces \texttt{glsnumbers})
% using the command \ics{glsgetgrouptitle} which is
% defined in \isty{glossary-hypernav}. This is done to prevent
% any problem characters in \ics{glssymbolsgroupname}
% and \ics{glsnumbersgroupname} from breaking hyperlinks.
%
% Some of these lines are too long to fit on the page, but as I 
% have temporarily disabled the comment character, I can't split
% the lines. If you want to see the code in full, have a look at
% \texttt{glossaries.sty}.
%\changes{1.01}{2007 May 17}{Added spaces after 'delimN and 'delimR in ist file}%
%\begin{macro}{\writeist}
%    \begin{macrocode}
\newwrite\istfile
\bgroup
\catcode`\%12\relax
\catcode`\"12\relax
\catcode`\|12\relax
\catcode`\!12\relax
\catcode`\?12\relax
\gdef\@gls@actualchar{?}
\gdef\@gls@encapchar{|}
\gdef\@gls@levelchar{!}
\gdef\@gls@quotechar{"}
\gdef\writeist{\relax
\protected@write\@auxout{}{\string\@istfilename{\istfilename}}
\openout\istfile=\istfilename
\write\istfile{% makeindex style file created by the glossaries package}
\write\istfile{% for document '\jobname' on \the\year-\the\month-\the\day}
\write\istfile{actual '\@gls@actualchar'}
\write\istfile{encap '\@gls@encapchar'}
\write\istfile{level '\@gls@levelchar'}
\write\istfile{quote '\@gls@quotechar'}
\write\istfile{keyword "\string\\glossaryentry"}
\write\istfile{preamble "\string\\glossarysection[\string\\glossarytoctitle]{\string\\glossarytitle}\string\\glossarypreamble\string\n\string\\begin{theglossary}\string\\glossaryheader\string\n"}
\write\istfile{postamble "\string\n\string\\end{theglossary}\string\n\string\\glossarypostamble\string\n"}
\write\istfile{group_skip "\string\\glsgroupskip\string\n"}
\write\istfile{item_0 "\string\n"}
\write\istfile{delim_0 "\{\string\\glossaryentrynumbers\{\string\\relax "}
\write\istfile{delim_t "\}\}"}
\write\istfile{delim_n "\string\\delimN "}
\write\istfile{delim_r "\string\\delimR "}
\write\istfile{headings_flag 1}
\write\istfile{heading_prefix "\string\\glsgroupheading\{"}
\write\istfile{heading_suffix "\}"}
\write\istfile{symhead_positive "glssymbols"}
\write\istfile{numhead_positive "glsnumbers"}
\write\istfile{page_compositor "\glscompositor"}
\noist}
\egroup
%    \end{macrocode}
%\end{macro}
%
%The command \cs{noist} will suppress the creation of
% the \filetype{.ist} file (it simply redefines 
% \cs{writeist} to do nothing.) Obviously you need to use this
% command before \cs{writeist} to have any effect. Since
% the \filetype{.ist} file should only be created once, \cs{noist}
% is called at the end of \cs{writeist}.
%\begin{macro}{\noist}
%    \begin{macrocode}
\newcommand{\noist}{\let\writeist\relax}
%    \end{macrocode}
%\end{macro}
%
% \cs{@makeglossary} is an internal command that takes an 
% argument indicating the glossary type. This command will 
% create the glossary file required by \appname{makeindex} for the
% given glossary type, using the extension supplied by the
% \meta{out-ext} parameter used in \ics{newglossary} 
% (and it will also activate the \ics{glossary} command, 
% and create the customized \filetype{.ist} \appname{makeindex} 
% style file.) 
%
% Note that you can't use \cs{@makeglossary} for only some of the
% defined glossaries. You either need to have a \cs{makeglossary}
% for all glossaries or none (otherwise you will end up with a
% situation where \TeX\ is trying to write to a non-existant
% file.) The relevant glossary must be
% defined prior to using \cs{@makeglossary}.
%\begin{macro}{\@makeglossary}
%    \begin{macrocode}
\newcommand*{\@makeglossary}[1]{%
\ifglossaryexists{#1}{%
\edef\glo@out{\csname @glotype@#1@out\endcsname}%
\expandafter\newwrite\csname glo@#1@file\endcsname
\edef\@glo@file{\csname glo@#1@file\endcsname}%
\immediate\openout\@glo@file=\jobname.\glo@out
\@gls@renewglossary
\PackageInfo{glossaries}{Writing glossary file \jobname.\glo@out}
\writeist
}{\PackageError{glossaries}{%
Glossary type `#1' not defined}{New glossaries must be defined before
using \string\makeglossary}}}
%    \end{macrocode}
%\end{macro}
%
% \cs{makeglossaries} will use \cs{@makeglossary}
% for each glossary type that has been defined.  New glossaries
% need to be defined before using \cs{makeglossary}, so
% have \cs{makeglossaries} redefine \cs{newglossary}
% to prevent it being used afterwards.
%\begin{macro}{\makeglossaries}
%    \begin{macrocode}
\newcommand*{\makeglossaries}{%
\@for\@glo@type:=\@glo@types\do{%
\ifthenelse{\equal{\@glo@type}{}}{}{%
\@makeglossary{\@glo@type}}}%
\renewcommand*\newglossary[4][]{%
\PackageError{glossaries}{New glossaries
must be created before \string\makeglossaries}{You need
to move \string\makeglossaries\space after all your 
\string\newglossary\space commands}}%
\let\@makeglossary\empty
\let\makeglossary\empty}
%    \end{macrocode}
%\end{macro}
%
% The \cs{makeglossary} command is redefined to be
% identical to \cs{makeglossaries}. (This is done to 
% reinforce the message that you must either use 
% \cs{@makeglossary} for all the glossaries or for none 
% of them.)
%\begin{macro}{\makeglossary}
%    \begin{macrocode}
\let\makeglossary\makeglossaries
%    \end{macrocode}
%\end{macro}
%
%\subsection{Writing information to associated files}
% The \cs{glossary} command is redefined so that it takes an 
% optional argument \meta{type} to specify the glossary type (use 
% \cs{glsdefaulttype} glossary by default). 
% This shouldn't be used at user level
% as \cs{glslink} sets the correct format. The associated 
% number should be stored in \cs{theglsentrycounter}
% before using \cs{glossary}.
%\begin{macro}{\glossary}
%    \begin{macrocode}
\renewcommand*{\glossary}[1][\glsdefaulttype]{%
\@glossary[#1]}
%    \end{macrocode}
%\end{macro}
%
% Define internal \cs{@glossary} to ignore its argument.
% This gets redefined in \cs{@makeglossary}.
%\begin{macro}{\@glossary}
%    \begin{macrocode}
\def\@glossary[#1]{\@bsphack\begingroup\@sanitize\@index}
%    \end{macrocode}
%\end{macro}
% This is a convenience command to set \cs{@glossary}.
% It is used by \cs{@makeglossary} and then redefined to
% do nothing, as it only needs to be done once.
%\begin{macro}{@gls@renewglossary}
%    \begin{macrocode}
\newcommand{\@gls@renewglossary}{%
\gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}%
\let\@gls@renewglossary\@empty
}
%    \end{macrocode}
%\end{macro}
% The \cs{@wrglossary} command is redefined to have
% two arguments. The first argument is the glossary type, 
% the second argument is the glossary entry 
% (the format of which is set in \cs{glslink}.)
%\begin{macro}{\@wrglossary}
%    \begin{macrocode}
\renewcommand*{\@wrglossary}[2]{%
\expandafter\protected@write\csname glo@#1@file\endcsname{}{%
\string\glossaryentry{#2}{\theglsentrycounter}}\endgroup\@esphack}
%    \end{macrocode}
%\end{macro}
%
% \subsection{Displaying the glossary}\label{sec:printglos}
% An individual glossary is displayed in the text using
% \cs{printglossary}\oarg{key-val list}. If the 
% \gloskey[printglossary]{type} key is omitted, the default glossary is displayed.
% The optional argument can be used to specify an alternative
% glossary, and can also be used to set the style, title and
% entry in the table of contents. Available keys are defined below.
%\begin{macro}{\printglossary}
%    \begin{macrocode}
\newcommand*{\printglossary}[1][type=\glsdefaulttype]{%
\def\@glo@type{\glsdefaulttype}%
\def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}%
\def\glossarytoctitle{\glossarytitle}%
\def\@glossarystyle{}%
\bgroup
\setkeys{printgloss}{#1}%
\@glossarystyle
\makeatletter
\@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}%
\egroup
}
%    \end{macrocode}
%\end{macro}
%
% The \cs{printglossaries} command will do \cs{printglossary}
% for each glossary type that has been defined. It is better
% to use \cs{printglossaries} rather than individual
% \cs{printglossary} commands to ensure that you don't forget
% any new glossaries you may have created. It also makes it easier to
% chop and change the value of the \pkgopt{acronym} package option.
% However, if you want to list the glossaries in a different order,
% or if you want to set the title or table of contents entry, or
% if you want to use different glossary styles for each glossary, you
% will need to use \cs{printglossary} explicitly for each
% glossary type.
%\begin{macro}{\printglossaries}
%    \begin{macrocode}
\newcommand*{\printglossaries}{%
\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}}
%    \end{macrocode}
%\end{macro}
% The keys that can be used in the optional argument to
% \ics{printglossary} are as follows:
% The \gloskey[printglossary]{type} key sets the glossary type.
%    \begin{macrocode}
\define@key{printgloss}{type}{\def\@glo@type{#1}}
%    \end{macrocode}
% The \gloskey[printglossary]{title} key sets the title used in the glossary section
% header. This overrides the title used in \ics{newglossary}.
%    \begin{macrocode}
\define@key{printgloss}{title}{\def\glossarytitle{#1}}
%    \end{macrocode}
% The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry 
% in the table of contents.
%    \begin{macrocode}
\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}}
%    \end{macrocode}
% The \gloskey[printglossary]{style} key sets the glossary style (but only for
% the given glossary.)
%    \begin{macrocode}
\define@key{printgloss}{style}{%
\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary 
style `#1' undefined}{}}{%
\def\@glossarystyle{\csname @glsstyle@#1\endcsname}}}
%    \end{macrocode}
% \changes{1.14}{2008 June 17}{added numberedsection key to 'printglossary}
% The \gloskey[printglossary]{numberedsection} key determines if this
% glossary should be in a numbered section.
%    \begin{macrocode}
\define@choicekey{printgloss}{numberedsection}[\val\nr]{%
false,nolabel,autolabel}[nolabel]{%
\ifcase\nr\relax
  \renewcommand*{\@@glossarysecstar}{*}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{}%
\or
  \renewcommand*{\@@glossarysecstar}{}%
  \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}%
\fi}
%    \end{macrocode}
% \changes{1.14}{2008 June 17}{added nonumberlist key to 'printglossary}
% The \gloskey[printglossary]{nonumberlist} key determines if this
% glossary should have a number list.
%    \begin{macrocode}
\define@boolkey{printgloss}[gls]{nonumberlist}[true]{%
\ifglsnonumberlist
   \def\glossaryentrynumbers##1{}%
\else
   \def\glossaryentrynumbers##1{##1}%
\fi}
%    \end{macrocode}
%
%\DescribeEnv{theglossary}
% If the \envname{theglossary} environment has 
% already been defined, a warning will be issued. 
% This environment should be redefined by glossary styles.
%    \begin{macrocode}
\@ifundefined{theglossary}{%
\newenvironment{theglossary}{}{}}{%
\PackageWarning{glossaries}{overriding `theglossary' environment}%
\renewenvironment{theglossary}{}{}}
%    \end{macrocode}
%
% The glossary header is given by \cs{glossaryheader}. 
% This forms part of the glossary style, and
% must indicate what should appear immediately after the start of the
% \envname{theglossary} environment. (For example, if the glossary
% uses a tabular-like environment, it may be used to set the
% header row.) Note that if you don't want a header row, the glossary
% style must redefine \cs{glossaryheader} to do nothing.
%\begin{macro}{\glossaryheader}
%    \begin{macrocode}
\newcommand*{\glossaryheader}{}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
% \cs{glossaryentryfield}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt]
% This command governs how each entry row should be formatted 
% in the glossary. Glossary styles need to redefine this command.
% Most of the predefined styles ignore \meta{symbol}.
%\begin{macro}{\glossaryentryfield}
%    \begin{macrocode}
\newcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:#1}{#2} #4 #3. #5\par}
%    \end{macrocode}
%\end{macro}
%
% Within each glossary, the entries form 28 distinct groups
% which are determined by the first character of the \gloskey{sort} 
% key. There will be a maximum of 28 groups: symbols, numbers,
% and the 26 alphabetical groups A, \ldots, Z\@. 
% The command \cs{glsgroupskip} 
% specifies what to do between glossary groups. Glossary styles
% must redefine this command. (Note that \cs{glsgroupskip}
% only occurs between groups, not at the start or end of the
% glossary.)
%\begin{macro}{\glsgroupskip}
%    \begin{macrocode}
\newcommand*{\glsgroupskip}{}
%    \end{macrocode}
%\end{macro}
%
% Each of the 28 glossary groups described above is preceded by a 
% group heading.
% This is formatted by the command \cs{glsgroupheading}
% which takes one argument which is the \emph{label} assigned to that
% group (not the title). The corresponding labels are: \texttt{glssymbols},
% \texttt{glsnumbers}, \texttt{A}, \ldots, \texttt{Z}. 
% Glossary styles must redefined this command. (In between groups,
% \cs{glsgroupheading} comes immediately after \cs{glsgroupskip}.)
%\begin{macro}{\glsgroupheading}
%    \begin{macrocode}
\newcommand*{\glsgroupheading}[1]{}
%    \end{macrocode}
%\end{macro}
% It is possible to ``trick'' \appname{makeindex} into
% treating entries as though they belong to the same group, 
% even if the terms don't start with the same letter, by
% modifying the \gloskey{sort} key. For example, all entries 
% belonging to one
% group could be defined so that the \gloskey{sort} key starts with an
% "a", while entries belonging to another group could be defined
% so that the \gloskey{sort} key starts with a "b", and so on. If
% you want each group to have a heading, you would then need to
% modify the translation control sequences \cs{glsgetgrouptitle}
% and \cs{glsgetgrouplabel} so that the label is translated
% into the required title (and vice-versa.)
%\\[10pt]
%\cs{glsgetgrouptitle}\marg{label}\\[10pt]
% This command produces the title for the glossary group
% whose label is given by \meta{label}. By default, the group
% labelled \texttt{glssymbols} produces 
% \ics{glssymbolsgroupname}, the group labelled 
% \texttt{glsnumbers} produces \ics{glsnumbersgroupname}
% and all the other groups simply produce their label.
% As mentioned above, the group labels are: \texttt{glssymbols}, \texttt{glsnumbers},
% \texttt{A}, \ldots, \texttt{Z}\@. If you want to redefine
% the group titles, you will need to redefine this command.
%\begin{macro}{\glsgetgrouptitle}
%    \begin{macrocode}
\newcommand*{\glsgetgrouptitle}[1]{%
\@ifundefined{#1groupname}{#1}{\csname #1groupname\endcsname}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
%\cs{glsgetgrouplabel}\marg{title}\\[10pt]
%This command does the reverse to the previous command. The
% argument is the group title, and it produces the group label.
% Note that if you redefine \cs{glsgetgrouptitle}, you
% will also need to redefine \cs{glsgetgrouplabel}.
%\begin{macro}{\glsgetgrouplabel}
%    \begin{macrocode}
\newcommand*{\glsgetgrouplabel}[1]{%
\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{%
\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}}
%    \end{macrocode}
%\end{macro}
%
% The command \cs{setentrycounter} sets the entry's 
% associated counter (required by 
% \cs{glshypernumber} etc.) \ics{glslink} and
% \ics{glsadd} encode the
% \ics{glossary} argument so that the relevant counter is
% set prior to the formatting command.
%\begin{macro}{\setentrycounter}
%    \begin{macrocode}
\newcommand*{\setentrycounter}[1]{\def\glsentrycounter{#1}}
%    \end{macrocode}
%\end{macro}
%
% The current glossary style can be set using
% \cs{glossarystyle}\marg{style}.
%\begin{macro}{\glossarystyle}
%    \begin{macrocode}
\newcommand*{\glossarystyle}[1]{%
\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary 
style `#1' undefined}{}}{%
\csname @glsstyle@#1\endcsname}}
%    \end{macrocode}
%\end{macro}
%
% New glossary styles can be defined using:\\[10pt]
% \cs{newglossarystyle}\marg{name}\marg{definition}\\[10pt]
% The \meta{definition} argument should redefine 
% \envname{theglossary}, \ics{glossaryheader}, 
% \ics{glsgroupheading}, \ics{glossaryentryfield} and
% \ics{glsgroupskip} (see \autoref{sec:code:styles} for the
% definitions of predefined styles.) Glossary styles should not 
% redefine \ics{glossarypreamble} and 
% \ics{glossarypostamble}, as
% the user should be able to switch between styles without affecting
% the pre- and postambles.
%\begin{macro}{\newglossarystyle}
%    \begin{macrocode}
\newcommand*{\newglossarystyle}[2]{%
\@ifundefined{@glsstyle@#1}{%
\expandafter\def\csname @glsstyle@#1\endcsname{#2}}{%
\PackageError{glossaries}{Glossary style `#1' is already defined}{}}}
%    \end{macrocode}
%\end{macro}
%
% Glossary entries are encoded so that the second argument
% to \ics{glossaryentryfield} is always specified as
% \cs{glsnamefont}\marg{name}. This allows the
% user to change the font used to display the name term
% without having to redefine \ics{glossaryentryfield}.
% The default uses the surrounding font, so in the list type
% styles (which place the name in the optional argument to
% \ics{item}) the name will appear in bold.
%\begin{macro}{\glsnamefont}
%    \begin{macrocode}
\newcommand*{\glsnamefont}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Each glossary entry has an associated number list (usually page
% numbers) that indicate where in the document the entry has been
% used. The format for these number lists can be changed using the
% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \ics{glslink}.
% The default format is given by \cs{glshypernumber}. This takes
% a single argument which may be a single number, a number range
% or a number list. The number ranges are delimited with 
% \ics{delimR}, the number lists are delimited with 
% \ics{delimN}.
%
% If the document doesn't have hyperlinks, the numbers can be
% displayed just as they are, but if the document supports 
% hyperlinks, the numbers should link to the relevant location.
% This means extracting the individual numbers from the list or
% ranges. The \isty{hyperref} package does this with the
% \ics{hyperpage} command, but this is encoded for comma and
% dash delimiters and only for the page counter, but this code needs
% to be more general. So I have adapted the code used in the
% \isty{hyperref} package.
%\begin{macro}{\glshypernumber}
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
\def\glshypernumber#1{#1}}{%
\def\glshypernumber#1{%
\@delimR#1\delimR\delimR\\}}
%    \end{macrocode}
%\end{macro}
% \cs{@delimR} displays a range of numbers for the counter 
% whose name is given by 
% \cs{@gls@counter} (which must be set prior to using
% \cs{glshypernumber}.)
%\begin{macro}{\@delimR}
%    \begin{macrocode}
\def\@delimR#1\delimR #2\delimR #3\\{%
\ifx\\#2\\%
  \@delimN{#1}%
\else
  \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}%
\fi}
%    \end{macrocode}
%\end{macro}
% \cs{@delimN} displays a list of individual numbers, 
% instead of a range:
%\begin{macro}{\@delimN}
%    \begin{macrocode}
\def\@delimN#1{\@@delimN#1\delimN \delimN\\}
\def\@@delimN#1\delimN #2\delimN#3\\{%
\ifx\\#3\\%
  \@gls@numberlink{#1}%
\else
  \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}%
\fi
}
%    \end{macrocode}
%\end{macro}
% The following code is modified from hyperref's 
% \cs{HyInd@pagelink} where
% the name of the counter being used is given by 
% \cs{@gls@counter}.
%    \begin{macrocode}
\def\@gls@numberlink#1{%
\begingroup
 \toks@={}%
 \@gls@removespaces#1 \@nil
\endgroup}
%    \end{macrocode}
%    \begin{macrocode}
\def\@gls@removespaces#1 #2\@nil{%
 \toks@=\expandafter{\the\toks@#1}%
 \ifx\\#2\\%
   \edef\x{\the\toks@}%
   \ifx\x\empty
   \else
     \hyperlink{\glsentrycounter.\the\toks@}{\the\toks@}%
   \fi
 \else
   \@gls@ReturnAfterFi{%
     \@gls@removespaces#2\@nil
   }%
 \fi
}
\long\def\@gls@ReturnAfterFi#1\fi{\fi#1}
%    \end{macrocode}
%
% The following commands will switch to the
% appropriate font, and create a hyperlink, if hyperlinks are
% supported. If hyperlinks are not supported, they will just
% display their argument in the appropriate font.
%\begin{macro}{\hyperrm}
%    \begin{macrocode}
\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypersf}
%    \begin{macrocode}
\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypertt}
%    \begin{macrocode}
\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperbf}
%    \begin{macrocode}
\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypermd}
%    \begin{macrocode}
\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperit}
%    \begin{macrocode}
\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypersl}
%    \begin{macrocode}
\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperup}
%    \begin{macrocode}
\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hypersc}
%    \begin{macrocode}
\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\hyperemph}
%    \begin{macrocode}
\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Acronyms}\label{sec:acronym}
%If the \pkgopt{acronym} package option is used, a 
% new glossary called "acronym" is created
%    \begin{macrocode}
\ifglsacronym
  \newglossary[alg]{acronym}{acr}{acn}{\acronymname}
%    \end{macrocode}
%and \ics{acronymtype} is set to the name of this new glossary.
%    \begin{macrocode}
  \renewcommand{\acronymtype}{acronym}
%    \end{macrocode}
% In the event that the user redefines \ics{glsdisplay}
% and \ics{glsdisplayfirst}, the relevant commands for
% the new acronym glossary are set to match the format
% given by \ics{newacronym}. If you redefine 
% \ics{newacronym} you may need to set these to something
% else.
%    \begin{macrocode}
  \defglsdisplay[acronym]{#1#4}
  \defglsdisplayfirst[acronym]{#1#4}
\fi
%    \end{macrocode}
%\vskip5pt
% \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long}\\[10pt]
% This is a quick way of defining acronyms, all it does
% is call \ics{newglossaryentry} with the appropriate
% values. It sets the
% glossary type to \ics{acronymtype} which will be
% "acronym" if the package option \pkgopt{acronym} has
% been used, otherwise it will be the default glossary.
% Since \cs{newacronym} merely calls \ics{newglossaryentry},
% the acronym is treated like any other glossary entry.
%
% If you prefer a different format, you
% can redefine \cs{newacronym} as required. The optional 
% argument can be used to override any of the settings.
%\begin{macro}{\newacronym}
%    \begin{macrocode}
\newcommand{\newacronym}[4][]{%
\newglossaryentry{#2}{type=\acronymtype,%
name={#3},description={#4},text={#3},%
descriptionplural={#4\acrpluralsuffix},%
first={#4 (#3)},plural={#3\acrpluralsuffix},%
firstplural={\@glo@descplural\space (\@glo@plural)},%
#1}}
%    \end{macrocode}
%\end{macro}
%\changes{1.13}{2008 May 10}{Removed restriction on only using
% 'newacronym in the preamble}
% Set up some convenient short cuts. These need to be changed if
% \cs{newacronym} is changed (or if the \gloskey{description} key
% is changed).
%
%\begin{macro}{\acrpluralsuffix}
%\changes{1.13}{2008 May 10}{New}
% Plural suffix used by \cs{newacronym}. This just defaults to
% \cs{glspluralsuffix} but is changed to include \cs{textup} 
% if the smallcaps option is used, so that the suffix doesn't appear
% in small caps as it doesn't look right. For example, 
% \textsc{abcs} looks as though the ``s'' is part of the acronym, but
% \textsc{abc}s looks as though the ``s'' is a plural suffix. Since
% the entire text \texttt{abcs} is set in \cs{textsc}, \cs{textup}
% is need to cancel it out.
%    \begin{macrocode}
\newcommand*{\acrpluralsuffix}{\glspluralsuffix}
%    \end{macrocode}
%\end{macro}
%
% Make a note of the keys that are used to store the long and
% short forms:
%\begin{macro}{\glsshortkey}
%    \begin{macrocode}
\newcommand*{\glsshortkey}{text}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glsshortpluralkey}
%    \begin{macrocode}
\newcommand*{\glsshortpluralkey}{plural}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongkey}
%    \begin{macrocode}
\newcommand*{\glslongkey}{description}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glslongpluralkey}
%    \begin{macrocode}
\newcommand*{\glslongpluralkey}{descriptionplural}
%    \end{macrocode}
%\end{macro}
%
% Using the default definitions, \ics{acrshort} is the same as
% \ics{glstext}, which means that it will print the abbreviation.
%\begin{macro}{\acrshort}
%    \begin{macrocode}
\newcommand*{\acrshort}[2][]{%
\new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}}
\def\@acrshort#1#2[#3]{\@glstext@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrshort}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\Acrshort}[2][]{%
\new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}}
\def\@Acrshort#1#2[#3]{\@Glstext@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRshort}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\ACRshort}[2][]{%
\new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}}
\def\@ACRshort#1#2[#3]{\@GLStext@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
% Plural:
%\begin{macro}{\acrshortpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\acrshortpl}[2][]{%
\new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}}
\def\@acrshortpl#1#2[#3]{\@glsplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrshortpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\Acrshortpl}[2][]{%
\new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}}
\def\@Acrshortpl#1#2[#3]{\@Glsplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRshortpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\ACRshortpl}[2][]{%
\new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}}
\def\@ACRshortpl#1#2[#3]{\@GLSplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%
% \ics{acrlong} is set to \ics{glsdesc}, so it will print the long 
% form, unless the description key has been set to something else.
%\begin{macro}{\acrlong}
%    \begin{macrocode}
\newcommand*{\acrlong}[2][]{%
\new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}}
\def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrlong}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\Acrlong}[2][]{%
\new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}}
\def\@Acrlong#1#2[#3]{\@Glsdesc@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRlong}
%\changes{1.13}{2008 May 10}{fixed bug that used all lower case version}
%    \begin{macrocode}
\newcommand*{\ACRlong}[2][]{%
\new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}}
\def\@ACRlong#1#2[#3]{\@GLSdesc@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
% Plural:
%\begin{macro}{\acrlongpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\acrlongpl}[2][]{%
\new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}}
\def\@acrlongpl#1#2[#3]{\@glsdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrlongpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\Acrlongpl}[2][]{%
\new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}}
\def\@Acrlongpl#1#2[#3]{\@Glsdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRlongpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\ACRlongpl}[2][]{%
\new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}}
\def\@ACRlongpl#1#2[#3]{\@GLSdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%
%
% \ics{acrfull} is set to \ics{glsfirst}, so it should display the
% full form.
%\begin{macro}{\acrfull}
%    \begin{macrocode}
\newcommand*{\acrfull}[2][]{%
\new@ifnextchar[{\@acrfull{#1}{#2}}{\@acrfull{#1}{#2}[]}}
\def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrfull}
%    \begin{macrocode}
\newcommand*{\Acrfull}[2][]{%
\new@ifnextchar[{\@Acrfull{#1}{#2}}{\@Acrfull{#1}{#2}[]}}
\def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRfull}
%    \begin{macrocode}
\newcommand*{\ACRfull}[2][]{%
\new@ifnextchar[{\@ACRfull{#1}{#2}}{\@ACRfull{#1}{#2}[]}}
\def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
% Plural:
%\begin{macro}{\acrfullpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\acrfullpl}[2][]{%
\new@ifnextchar[{\@acrfullpl{#1}{#2}}{\@acrfullpl{#1}{#2}[]}}
\def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\Acrfullpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\Acrfullpl}[2][]{%
\new@ifnextchar[{\@Acrfullpl{#1}{#2}}{\@Acrfullpl{#1}{#2}[]}}
\def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ACRfullpl}
%\changes{1.13}{2008 May 10}{new}
%    \begin{macrocode}
\newcommand*{\ACRfullpl}[2][]{%
\new@ifnextchar[{\@ACRfullpl{#1}{#2}}{\@ACRfullpl{#1}{#2}[]}}
\def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Additional predefined acronym styles}
%\begin{macro}{\acronymfont}
%This is only used with the additional acronym styles:
%    \begin{macrocode}
\newcommand{\acronymfont}[1]{#1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\firstacronymfont}
%This is only used with the additional acronym styles:
%\changes{1.14}{2008 June 17}{new}
%    \begin{macrocode}
\newcommand{\firstacronymfont}[1]{\acronymfont{#1}}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\ifglsacrdescription
%    \end{macrocode}
%
% If a description and footnote are both required, store the long form 
% in the \gloskey{symbol} key. Store the short form in \gloskey{text}
% key.
%    \begin{macrocode}
  \ifglsacrfootnote
    \renewcommand{\newacronym}[4][]{%
    \newglossaryentry{#2}{type=\acronymtype,%
    name={\acronymfont{#3}},%
    sort={#3},%
    text={#3},%
    plural={#3\acrpluralsuffix},%
    symbol={#4},%
    symbolplural={#4\acrpluralsuffix},%
    #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
   \def\glsshortkey{text}%
   \def\glsshortpluralkey{plural}%
   \def\glslongkey{symbol}%
   \def\glslongpluralkey{symbolplural}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
   \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
   \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
   \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural form:
%    \begin{macrocode}
   \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
   \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
   \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
   \def\@acrlong#1#2[#3]{\@glssymbol@{#1}{#2}[#3]}
   \def\@Acrlong#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]}
   \def\@ACRlong#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
   \def\@acrlongpl#1#2[#3]{\@glssymbolplural@{#1}{#2}[#3]}
   \def\@Acrlongpl#1#2[#3]{\@Glssymbolplural@{#1}{#2}[#3]}
   \def\@ACRlongpl#1#2[#3]{\@GLSsymbolplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
   \def\@acrfull#1#2[#3]{\@glssymbol@{#1}{#2}[#3] 
     (\acronymfont{\@glstext@{#1}{#2}[#3]})}
   \def\@Acrfull#1#2[#3]{\@Glssymbol@{#1}{#2}[#3] 
     (\acronymfont{\@glstext@{#1}{#2}[#3]})}
   \def\@ACRfull#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3] 
     (\acronymfont{\@GLStext@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
   \def\@acrfullpl#1#2[#3]{\@glssymbolplural@{#1}{#2}[#3] 
     (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
   \def\@Acrfullpl#1#2[#3]{\@Glssymbolplural@{#1}{#2}[#3] 
     (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
   \def\@ACRfullpl#1#2[#3]{\@GLSsymbolplural@{#1}{#2}[#3] 
     (\acronymfont{\@GLSplural@{#1}{#2}[#3]})}
%    \end{macrocode}
%
% If \pkgopt{footnote} package option is specified, set the first
% use to append the long form (stored in \gloskey{symbol}) as a 
% footnote.
%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote
% and 'glslink}
%    \begin{macrocode}
   \defglsdisplayfirst[\acronymtype]{%
     \firstacronymfont{#1}#4\noexpand\protect\noexpand\footnote{%
     \noexpand\protect\noexpand\glslink
       [\@gls@link@opts]{\@gls@link@label}{#3}}}%
   \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}%
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%    \begin{macrocode}
   \ifglsacrsmallcaps
      \renewcommand*{\acronymfont}[1]{\textsc{#1}}%
      \renewcommand*{\acrpluralsuffix}{%
         \textup{\glspluralsuffix}}%
   \else
      \ifglsacrsmaller
         \renewcommand*{\acronymfont}[1]{{\smaller #1}}%
      \fi
   \fi
%    \end{macrocode}
% Check for package option clash
%    \begin{macrocode}
    \ifglsacrdua
       \PackageError{glossaries}{Option clash: `footnote' and `dua'
        can't both be set}{}%
    \fi
  \else
%    \end{macrocode}
% Footnote not required. Should the acronym always be expanded?
%    \begin{macrocode}
    \ifglsacrdua
      \ifglsacrsmallcaps
        \PackageError{glossaries}{Option clash: `smallcaps' and `dua'
         can't both be set}{}%
      \else
         \ifglsacrsmaller
            \PackageError{glossaries}{Option clash: `smaller' and `dua'
            can't both be set}{}%
         \fi
      \fi
      \renewcommand{\newacronym}[4][]{%
      \newglossaryentry{#2}{type=\acronymtype,%
      name={\acronymfont#4},%
      sort={#4},
      text={#4},%
      plural={#4\acrpluralsuffix},%
      symbol={#3},%
      symbolplural={#3\acrpluralsuffix},%
      #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
      \def\glsshortkey{symbol}%
      \def\glsshortpluralkey{symbolplural}%
      \def\glslongkey{first}%
      \def\glslongpluralkey{plural}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
      \def\@acrshort#1#2[#3]{\acronymfont{\@glssymbol@{#1}{#2}[#3]}}
      \def\@Acrshort#1#2[#3]{\acronymfont{\@Glssymbol@{#1}{#2}[#3]}}
      \def\@ACRshort#1#2[#3]{\acronymfont{\@GLSsymbol@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
      \def\@acrshortpl#1#2[#3]{%
        \acronymfont{\@glssymbolplural@{#1}{#2}[#3]}}
      \def\@Acrshortpl#1#2[#3]{%
        \acronymfont{\@Glssymbolplural@{#1}{#2}[#3]}}
      \def\@ACRshortpl#1#2[#3]{%
        \acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
      \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
      \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
      \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
      \def\@acrlongpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
      \def\@Acrlongpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
      \def\@ACRlongpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
      \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
      \def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]})}
%    \end{macrocode}
% Set display.
%    \begin{macrocode}
      \defglsdisplayfirst[\acronymtype]{#1#4}
      \defglsdisplay[\acronymtype]{#1#4}
    \else
%    \end{macrocode}
% (dua is not set.)
% Store long form in \gloskey{first} key
% and short form in \gloskey{text} and \gloskey{symbol} key.
%    \begin{macrocode}
      \renewcommand{\newacronym}[4][]{%
      \newglossaryentry{#2}{type=\acronymtype,%
      name={\acronymfont{#3}},%
      sort={#3},%
      first={#4},%
      firstplural={#4\acrpluralsuffix},%
      text={#3},%
      plural={#3\acrpluralsuffix},%
      symbol={\@glo@text},%
      symbolplural={\@glo@plural},%
      #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
      \def\glsshortkey{text}%
      \def\glsshortpluralkey{plural}%
      \def\glslongkey{first}%
      \def\glslongpluralkey{firstplural}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
      \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
      \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
      \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
      \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
      \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
      \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
      \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
      \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
      \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
      \def\@acrlongpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
      \def\@Acrlongpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
      \def\@ACRlongpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
      \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
      \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
      \def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
      \def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]})}
%    \end{macrocode}
% Set display.
%    \begin{macrocode}
      \defglsdisplayfirst[\acronymtype]{#1#4 (\firstacronymfont{#3})}
      \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%    \begin{macrocode}
      \ifglsacrsmallcaps
         \renewcommand{\acronymfont}[1]{\textsc{#1}}
         \renewcommand*{\acrpluralsuffix}{%
            \textup{\glspluralsuffix}}%
      \else
         \ifglsacrsmaller
            \renewcommand*{\acronymfont}[1]{{\smaller #1}}%
         \fi
      \fi
    \fi
  \fi
\else
%    \end{macrocode}
% If here, acronyms do not require additional description.
%    \begin{macrocode}
  \ifglsacrfootnote
%    \end{macrocode}
%
% If \pkgopt{footnote} package option is specified, set the first
% use to append the long form (stored in \gloskey{description}) as a 
% footnote.
% Use the \gloskey{description} key to store the long form.
%    \begin{macrocode}
    \renewcommand{\newacronym}[4][]{%
    \newglossaryentry{#2}{type=\acronymtype,%
    name={\acronymfont{#3}},%
    sort={#3},%
    text={#3},%
    plural={#3\acrpluralsuffix},%
    description={#4},%
    descriptionplural={#4\acrpluralsuffix},%
    #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
\def\glsshortkey{text}%
\def\glsshortpluralkey{plural}%
\def\glslongkey{description}%
\def\glslongpluralkey{descriptionplural}%
%    \end{macrocode}
% Set display
%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote and
% 'glslink}
%    \begin{macrocode}
    \defglsdisplayfirst[\acronymtype]{%
    \firstacronymfont{#1}#4\noexpand\protect\noexpand\footnote{%
       \noexpand\protect\noexpand\glslink
         [\@gls@link@opts]{\@gls@link@label}{#2}}}%
    \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}%
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
    \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
    \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
    \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
    \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
    \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
    \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
    \def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]}
    \def\@Acrlong#1#2[#3]{\@Glsdesc@{#1}{#2}[#3]}
    \def\@ACRlong#1#2[#3]{\@GLSdesc@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
    \def\@acrlongpl#1#2[#3]{\@glsdescplural@{#1}{#2}[#3]}
    \def\@Acrlongpl#1#2[#3]{\@Glsdescplural@{#1}{#2}[#3]}
    \def\@ACRlongpl#1#2[#3]{\@GLSdescplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
    \def\@acrfull#1#2[#3]{\@glsdesc@{#1}{#2}[#3] 
      (\@glstext@{#1}{#2}[#3])}
    \def\@Acrfull#1#2[#3]{\@Glsdesc@{#1}{#2}[#3] 
      (\@glstext@{#1}{#2}[#3])}
    \def\@ACRfull#1#2[#3]{\@GLSdesc@{#1}{#2}[#3] 
      (\@GLStext@{#1}{#2}[#3])}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
    \def\@acrfullpl#1#2[#3]{\@glsdescplural@{#1}{#2}[#3] 
      (\@glsplural@{#1}{#2}[#3])}
    \def\@Acrfullpl#1#2[#3]{\@Glsdesctext@{#1}{#2}[#3] 
      (\@glsplural@{#1}{#2}[#3])}
    \def\@ACRfullpl#1#2[#3]{\@GLSdesctext@{#1}{#2}[#3] 
      (\@GLSplural@{#1}{#2}[#3])}
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%    \begin{macrocode}
    \ifglsacrsmallcaps
       \renewcommand*{\acronymfont}[1]{\textsc{#1}}%
       \renewcommand*{\acrpluralsuffix}{%
          \textup{\glspluralsuffix}}%
    \else
       \ifglsacrsmaller
          \renewcommand*{\acronymfont}[1]{{\smaller #1}}%
       \fi
    \fi
%    \end{macrocode}
% Check for option clash
%    \begin{macrocode}
    \ifglsacrdua
       \PackageError{glossaries}{Option clash: `footnote' and `dua'
       can't both be set}{}%
    \fi
  \else
%    \end{macrocode}
% No footnotes required.
%    \begin{macrocode}
    \ifthenelse{\boolean{glsacrsmallcaps}\or\boolean{glsacrsmaller}}{%
%    \end{macrocode}
%
% Neither footnote nor description required.
% Use the \gloskey{symbol} key to store the short form and
% \gloskey{first} to store the long form.
%    \begin{macrocode}
      \renewcommand{\newacronym}[4][]{%
      \newglossaryentry{#2}{type=\acronymtype,%
      name={\acronymfont{#3}},%
      sort={#3},%
      text={\@glo@symbol},%
      plural={\@glo@symbolplural},%
      first={#4},%
      firstplural={#4\acrpluralsuffix},%
      description={\@glo@first},%
      descriptionplural={\@glo@firstplural},%
      symbol={#3},%
      symbolplural={#3\acrpluralsuffix},%
      #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
      \def\glsshortkey{symbol}%
      \def\glsshortpluralkey{symbolplural}%
      \def\glslongkey{first}%
      \def\glslongpluralkey{firstplural}%
%    \end{macrocode}
% Change the display since \gloskey{first} only contains long form.
%    \begin{macrocode}
      \defglsdisplayfirst[\acronymtype]{#1#4 (\firstacronymfont{#3})}
      \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}
%    \end{macrocode}
% Redefine \ics{acronymfont} if small caps required. The plural suffix
% is set in an upright font so that it remains in normal lower case,
% otherwise it looks as though it's part of the acronym.
%    \begin{macrocode}
      \ifglsacrsmallcaps
        \renewcommand*{\acronymfont}[1]{\textsc{#1}}
        \renewcommand*{\acrpluralsuffix}{%
           \textup{\glspluralsuffix}}%
      \else
        \renewcommand*{\acronymfont}[1]{{\smaller #1}}
      \fi
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
      \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}}
      \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}}
      \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
      \def\@acrshortpl#1#2[#3]{\acronymfont{\@glsplural@{#1}{#2}[#3]}}
      \def\@Acrshortpl#1#2[#3]{\acronymfont{\@Glsplural@{#1}{#2}[#3]}}
      \def\@ACRshortpl#1#2[#3]{\acronymfont{\@GLSplural@{#1}{#2}[#3]}}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
      \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]}
      \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]}
      \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
      \def\@acrlongpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3]}
      \def\@Acrlongpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3]}
      \def\@ACRlongpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
      \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glstext@{#1}{#2}[#3]})}
      \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] 
        (\acronymfont{\@glstext@{#1}{#2}[#3]})}
      \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] 
        (\acronymfont{\@GLStext@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
      \def\@acrfullpl#1#2[#3]{\@glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
      \def\@Acrfullpl#1#2[#3]{\@Glsfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@glsplural@{#1}{#2}[#3]})}
      \def\@ACRfullpl#1#2[#3]{\@GLSfirstplural@{#1}{#2}[#3] 
        (\acronymfont{\@GLSplural@{#1}{#2}[#3]})}
%    \end{macrocode}
% check for option clash
%    \begin{macrocode}
      \ifglsacrdua
        \ifglsacrsmallcaps
          \PackageError{glossaries}{Option clash: `smallcaps' and `dua'
          can't both be set}{}%
        \else
          \PackageError{glossaries}{Option clash: `smaller' and `dua'
          can't both be set}{}%
        \fi
      \fi
    }{%
%    \end{macrocode}
% Should acronyms always be expanded?
%    \begin{macrocode}
      \ifglsacrdua
        \renewcommand{\newacronym}[4][]{%
        \newglossaryentry{#2}{type=\acronymtype,%
        name={#3},%
        text={#4},%
        plural={#4\acrpluralsuffix},%
        description={#4},%
        symbol={#3},%
        symbolplural={#3\acrpluralsuffix},%
        #1}}
%    \end{macrocode}
% Set up the commands to make a note of the keys to store the long
% and short forms:
%    \begin{macrocode}
        \def\glsshortkey{symbol}%
        \def\glsshortpluralkey{symbolplural}%
        \def\glslongkey{text}%
        \def\glslongpluralkey{plural}%
%    \end{macrocode}
% Set the display
%    \begin{macrocode}
        \defglsdisplayfirst[\acronymtype]{#1#4}
        \defglsdisplay[\acronymtype]{#1#4}
%    \end{macrocode}
% Set up short cuts. Short form:
%    \begin{macrocode}
        \def\@acrshort#1#2[#3]{\@glssymbol@{#1}{#2}[#3]}
        \def\@Acrshort#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]}
        \def\@ACRshort#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural short form:
%    \begin{macrocode}
        \def\@acrshortpl#1#2[#3]{\@glssymbolplural@{#1}{#2}[#3]}
        \def\@Acrshortpl#1#2[#3]{\@Glssymbolplural@{#1}{#2}[#3]}
        \def\@ACRshortpl#1#2[#3]{\@GLSsymbolplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Long form:
%    \begin{macrocode}
        \def\@acrlong#1#2[#3]{\@glstext@{#1}{#2}[#3]}
        \def\@Acrlong#1#2[#3]{\@Glstext@{#1}{#2}[#3]}
        \def\@ACRlong#1#2[#3]{\@GLStext@{#1}{#2}[#3]}
%    \end{macrocode}
% Plural long form:
%    \begin{macrocode}
        \def\@acrlongpl#1#2[#3]{\@glsplural@{#1}{#2}[#3]}
        \def\@Acrlongpl#1#2[#3]{\@Glsplural@{#1}{#2}[#3]}
        \def\@ACRlongpl#1#2[#3]{\@GLSplural@{#1}{#2}[#3]}
%    \end{macrocode}
% Full form:
%    \begin{macrocode}
        \def\@acrfull#1#2[#3]{\@glstext@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
        \def\@Acrfull#1#2[#3]{\@Glstext@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbol@{#1}{#2}[#3]})}
        \def\@ACRfull#1#2[#3]{\@GLStext@{#1}{#2}[#3] 
          (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})}
%    \end{macrocode}
% Plural full form:
%    \begin{macrocode}
        \def\@acrfullpl#1#2[#3]{\@glsplural@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
        \def\@Acrfullpl#1#2[#3]{\@Glsplural@{#1}{#2}[#3] 
          (\acronymfont{\@glssymbolplural@{#1}{#2}[#3]})}
        \def\@ACRfullpl#1#2[#3]{\@GLSplural@{#1}{#2}[#3] 
          (\acronymfont{\@GLSsymbolplural@{#1}{#2}[#3]})}
      \fi
    }%
  \fi
\fi
%    \end{macrocode}
%
% Define synonyms if required
%    \begin{macrocode}
\ifglsacrshortcuts
%    \end{macrocode}
% Short form
%\begin{macro}{\acs}
%    \begin{macrocode}
  \let\acs\acrshort
%    \end{macrocode}
%\end{macro}
% First letter uppercase short form
%\begin{macro}{\Acs}
%    \begin{macrocode}
  \let\Acs\Acrshort
%    \end{macrocode}
%\end{macro}
% Plural short form
%\begin{macro}{\acsp}
%    \begin{macrocode}
  \let\acsp\acrshortpl
%    \end{macrocode}
%\end{macro}
% First letter uppercase plural short form
%\begin{macro}{\Acsp}
%    \begin{macrocode}
  \let\Acsp\Acrshortpl
%    \end{macrocode}
%\end{macro}
% Long form
%\begin{macro}{\acl}
%    \begin{macrocode}
  \let\acl\acrlong
%    \end{macrocode}
%\end{macro}
% Plural long form
%\begin{macro}{\aclp}
%    \begin{macrocode}
  \let\aclp\acrlongpl
%    \end{macrocode}
%\end{macro}
% First letter upper case long form
%\begin{macro}{\Acl}
%    \begin{macrocode}
  \let\Acl\Acrlong
%    \end{macrocode}
%\end{macro}
% First letter upper case plural long form
%\begin{macro}{\Aclp}
%    \begin{macrocode}
  \let\Aclp\Acrlongpl
%    \end{macrocode}
%\end{macro}
% Full form
%\begin{macro}{\acf}
%    \begin{macrocode}
  \let\acf\acrfull
%    \end{macrocode}
%\end{macro}
% Plural full form
%\begin{macro}{\acfp}
%    \begin{macrocode}
  \let\acfp\acrfullpl
%    \end{macrocode}
%\end{macro}
% First letter upper case full form
%\begin{macro}{\Acf}
%    \begin{macrocode}
  \let\Acf\Acrfull
%    \end{macrocode}
%\end{macro}
% First letter upper case plural full form
%\begin{macro}{\Acfp}
%    \begin{macrocode}
  \let\Acfp\Acrfullpl
%    \end{macrocode}
%\end{macro}
% Standard form
%\begin{macro}{\ac}
%    \begin{macrocode}
  \let\ac\gls
%    \end{macrocode}
%\end{macro}
% First upper case standard form
%\begin{macro}{\Ac}
%    \begin{macrocode}
  \let\Ac\Gls
%    \end{macrocode}
%\end{macro}
% Standard plural form
%\begin{macro}{\acp}
%    \begin{macrocode}
  \let\acp\glspl
%    \end{macrocode}
%\end{macro}
% Standard first letter upper case plural form
%\begin{macro}{\Acp}
%    \begin{macrocode}
  \let\Acp\Glspl
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \subsection{Predefined Glossary Styles}\label{sec:code:styles}
% The \sty{glossaries} bundle comes with some predefined glossary styles which
% are defined in the following packages:
%    \begin{macrocode}
\RequirePackage{glossary-hypernav}
\RequirePackage{glossary-list}
\RequirePackage{glossary-long}
\RequirePackage{glossary-super}
%    \end{macrocode}
% The default glossary style is set according to the \pkgopt{style} package
% option, but can be overridden by \ics{glossarystyle}.
%    \begin{macrocode}
\glossarystyle{\@glossary@default@style}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*mfirstuc.sty>
%    \end{macrocode}
%\fi
%\section{Mfirstuc Documented Code}
%\label{sec:code:mfirstuc}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mfirstuc}[2008/06/18 v1.02 (NLCT)]
%    \end{macrocode}
%\begin{macro}{\makefirstuc}
% Syntax:\\
% \cs{makefirstuc}\marg{text}\\
% Makes the first letter uppercase, but will
% skip initial control sequences if they are followed by a group
% and make the first thing in the group uppercase, unless the group
% is empty.
% Thus \verb|\makefirstuc{abc}| will produce: Abc, 
% \verb|\makefirstuc{\ae bc}| will produce: \AE bc, but
% \verb|\makefirstuc{\emph{abc}}| will produce \emph{Abc}.
% This is required by \ics{Gls} and \ics{Glspl}.
%    \begin{macrocode}
\newif\if@glscs
\def\makefirstuc#1{%
\def\gls@argi{#1}%
\ifx\gls@argi\@empty
\else
  \protected@edef\@gls@tmp{\ #1}%
  \@onelevel@sanitize\@gls@tmp
  \expandafter\@gls@checkcs\@gls@tmp\relax\relax
  \if@glscs
    \@gls@getbody #1{}\@nil
    \ifx\@gls@rest\@empty
      \@gls@makefirstuc{#1}%
    \else
      \expandafter\@gls@split\@gls@rest\@nil
      \ifx\@gls@first\@empty
         \@gls@makefirstuc{#1}%
      \else
         \@gls@body{\expandafter\@gls@makefirstuc\@gls@first}\@gls@rest%
      \fi
    \fi
  \else
    \@gls@makefirstuc{#1}%
  \fi
\fi
}
%    \end{macrocode}
%\end{macro}
% Put first argument in \cs{@gls@first} and second argument in
% \cs{@gls@rest}:
%    \begin{macrocode}
\def\@gls@split#1#2\@nil{\def\@gls@first{#1}\def\@gls@rest{#2}}
%    \end{macrocode}
%    \begin{macrocode}
\def\@gls@checkcs#1 #2#3\relax{%
\def\@gls@argi{#1}\def\@gls@argii{#2}%
\ifx\@gls@argi\@gls@argii
  \@glscstrue
\else
  \@glscsfalse
\fi
}
%    \end{macrocode}
% Make first thing upper case:
%    \begin{macrocode}
\def\@gls@makefirstuc#1{\MakeUppercase #1}
%    \end{macrocode}
%
% Get the first grouped argument and stores in \cs{@gls@body}.
%    \begin{macrocode}
\def\@gls@getbody#1#{\def\@gls@body{#1}\@gls@gobbletonil}
%    \end{macrocode}
% Scoup up everything to \cs{@nil} and store in \cs{@gls@rest}:
%    \begin{macrocode}
\def\@gls@gobbletonil#1\@nil{\def\@gls@rest{#1}}
%    \end{macrocode}
%
%\begin{macro}{\xmakefirstuc}
% Expand argument once before applying \cs{makefirstuc}
% (added v1.01).
%    \begin{macrocode}
\newcommand*{\xmakefirstuc}[1]{%
\expandafter\makefirstuc\expandafter{#1}}
%    \end{macrocode}
%\end{macro}
%\section{Glossary Styles}
%\iffalse
%    \begin{macrocode}
%</mfirstuc.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-hypernav.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary hyper-navigation definitions (glossary-hypernav package)}
% Package Definition:
%    \begin{macrocode}
\ProvidesPackage{glossary-hypernav}[2007/07/04 v1.01 (NLCT)]
%    \end{macrocode}
%
% The commands defined in this package are provided to 
% help navigate around the groups within a glossary 
% (see \autoref{sec:printglos}.)
% \ics{printglossary} (and \ics{printglossaries})
% set \cs{@glo@type} to the label of the current
% glossary. This is used to create a unique hypertarget in
% the event of multiple glossaries.
%\\[10pt]
% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text}\\[10pt]
% This command makes \meta{text} a hyperlink to the glossary group
% whose label is given by \meta{label} for the glossary given
% by \meta{type}.
%\begin{macro}{\glsnavhyperlink}
%\changes{1.14}{2008 June 17}{changed 'edef to 'protected@edef}
%    \begin{macrocode}
\@ifundefined{hyperlink}{%
\newcommand*{\glsnavhyperlink}[3][]{#3}}{%
\newcommand*{\glsnavhyperlink}[3][\@glo@type]{%
\edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}%
\hyperlink{glsn:#1@#2}{#3}}}
%    \end{macrocode}
%\end{macro}
%\vskip5pt
% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text}\\[10pt]
% This command makes \meta{text} a hypertarget for the glossary group
% whose label is given by \meta{label} in the glossary given
% by \meta{type}.
%\begin{macro}{\glsnavhypertarget}
%\changes{1.14}{2008 June 17}{added write to aux file}
%    \begin{macrocode}
\@ifundefined{hypertarget}{%
\newcommand*{\glsnavhypertarget}[3][\@glo@type]{%
\protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}%
#3}}{%
\newcommand*{\glsnavhypertarget}[3][\@glo@type]{%
\protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}%
\hypertarget{glsn:#1@#2}{#3}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@gls@hypergroup}
% This adds to (or creates) the command \cs{@gls@hypergrouplist@}\meta{glossary type} 
% which lists all groups for a given glossary, so that
% the navigation bar only contains those groups that are present.
% However it requires at least 2 runs to ensure the information is
% up-to-date.
%\changes{1.14}{2008 June 17}{new}
%    \begin{macrocode}
\newcommand*{\@gls@hypergroup}[2]{%
\@ifundefined{@gls@hypergrouplist@#1}{%
   \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}%
}{%
   \expandafter\let\expandafter\@gls@tmp
      \csname @gls@hypergrouplist@#1\endcsname
   \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{%
      \@gls@tmp,#2}%
}%
}
%    \end{macrocode}
%\end{macro}
%
% The \cs{glsnavigation} command displays a simple glossary 
% group navigation. 
% The symbol and number elements are defined separately, 
% so that they can be suppressed if need be. Note that this 
% command will produce a link to all 28 groups, but some groups
% may not be defined if there are groups that do not contain any
% terms, in which case you will get an undefined hyperlink warning.
% Now for the whole navigation bit:
%\begin{macro}{\glsnavigation}
% \changes{1.14}{2008 June 2008}{changed to only use labels for
% groups that are present}
%    \begin{macrocode}
\newcommand*{\glsnavigation}{%
\def\@gls@between{}%
\@ifundefined{@gls@hypergrouplist@\@glo@type}{%
   \def\@gls@list{}%
}{%
   \expandafter\let\expandafter\@gls@list
      \csname @gls@hypergrouplist@\@glo@type\endcsname
}%
\@for\@gls@tmp:=\@gls@list\do{%
   \@gls@between
   \glsnavhyperlink{\@gls@tmp}{\glsgetgrouptitle{\@gls@tmp}}%
   \let\@gls@between\glshypernavsep%
}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\glshypernavsep}
% Separator for the hyper navigation bar.
%    \begin{macrocode}
\newcommand*{\glshypernavsep}{\space\textbar\space}
%    \end{macrocode}
%\end{macro}
% The \cs{glssymbolnav} produces a simple navigation set of
% links for just the symbol and number groups. This used to be used at
% the start of \cs{glsnavigation}. This command is no longer needed.
%\begin{macro}{\glssymbolnav}
%    \begin{macrocode}
\newcommand*{\glssymbolnav}{%
\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}} \textbar\
\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}} \textbar\ 
}
%    \end{macrocode}
%\end{macro}
%\iffalse
%    \begin{macrocode}
%</glossary-hypernav.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-list.sty>
%    \end{macrocode}
%\fi
% \subsection{List Style (glossary-list package)}
% The \isty{glossary-list} package defines glossary styles
% that use the \envname{description} environment. Note that since
% the entry name is placed in the optional argument to the
% \ics{item} command, it will appear in a bold font by
% default.
%    \begin{macrocode}
\ProvidesPackage{glossary-list}[2008/02/16 v1.03 (NLCT)]
%    \end{macrocode}
% The \glostyle{list} glossary style 
% uses the \envname{description} environment. The group separator
% \ics{glsgroupskip} is redefined as \cs{indexspace}
% which produces a gap between groups. The glossary heading
% and the group headings do nothing. This is used as the default
% style for the \sty{glossaries} package.
%    \begin{macrocode}
\newglossarystyle{list}{%
\renewenvironment{theglossary}{\begin{description}}{\end{description}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5}%
\renewcommand*{\glsgroupskip}{\indexspace}}
%    \end{macrocode}
% The \glostyle{listgroup} style is like the \glostyle{list}
% style, but the glossary groups have headings.
%\changes{1.08}{2007 Oct 13}{changed listgroup style to use \cs{glsgetgrouptitle}}
%    \begin{macrocode}
\newglossarystyle{listgroup}{%
\glossarystyle{list}%
\renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}}
%    \end{macrocode}
% The \glostyle{listhypergroup} style is like the \glostyle{listgroup}
% style, but has a set of links to the groups at the
% start of the glossary.
%    \begin{macrocode}
\newglossarystyle{listhypergroup}{%
\glossarystyle{list}%
\renewcommand*{\glossaryheader}{%
\item[\glsnavigation]}%
\renewcommand*{\glsgroupheading}[1]{%
\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}}
%    \end{macrocode}
% The \glostyle{altlist} glossary style is like the \glostyle{list}
% style, but places the description on a new line.
%    \begin{macrocode}
\newglossarystyle{altlist}{%
\glossarystyle{list}%
\renewcommand*{\glossaryentryfield}[5]{%
\item[\@glstarget{glo:##1}{##2}]\mbox{}\newline ##3\glspostdescription\space ##5}%
}
%    \end{macrocode}
% The \glostyle{altlistgroup} glossary style is like the
% \glostyle{altlist} style, but the glossary groups have headings.
%\changes{1.08}{2007 Oct 13}{changed altlistgroup style to use \cs{glsgetgrouptitle}}
%    \begin{macrocode}
\newglossarystyle{altlistgroup}{%
\glossarystyle{altlist}%
\renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}}
%    \end{macrocode}
% The \glostyle{altlisthypergroup} glossary style is like the
% \glostyle{altlisthypergroup} style, but has a 
% set of links to the groups at the start of the glossary.
%    \begin{macrocode}
\newglossarystyle{altlisthypergroup}{%
\glossarystyle{altlist}%
\renewcommand*{\glossaryheader}{%
\item[\glsnavigation]}%
\renewcommand*{\glsgroupheading}[1]{%
\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}}
%    \end{macrocode}
% The \glostyle{listdotted} glossary style was supplied by 
% Axel~Menzel. I've modified it slightly so that the distance from
% the start of the name to the end of the dotted line is specified by 
% \cs{glslistdottedwidth}.
%\begin{macro}{\glslistdottedwidth}
%    \begin{macrocode}
\newlength\glslistdottedwidth
\setlength{\glslistdottedwidth}{.5\linewidth}
%    \end{macrocode}
%\end{macro}
% Note that this style ignores the page numbers as well as the
% symbol.
%    \begin{macrocode}
\newglossarystyle{listdotted}{%
\glossarystyle{list}%
\renewcommand*{\glossaryentryfield}[5]{%
\item[]\makebox[\glslistdottedwidth][l]{\@glstarget{glo:##1}{##2}%
\unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossary-list.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-long.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary Styles using longtable (the glossary-long
% package)}
% The glossary styles defined in the \isty{glossary-long} package
% used the \envname{longtable} environment in the glossary.
%    \begin{macrocode}
\ProvidesPackage{glossary-long}[2007/07/04 v1.01 (NLCT)]
%    \end{macrocode}
% Requires the \isty{longtable} package:
%    \begin{macrocode}
\RequirePackage{longtable}
%    \end{macrocode}
% This is a length that governs the width of the description column.
%\begin{macro}{\glsdescwidth}
%    \begin{macrocode}
\newlength\glsdescwidth
%    \end{macrocode}
%\end{macro}
% This is a length that governs the width of the page list column.
%\begin{macro}{\glspagelistwidth}
%    \begin{macrocode}
\newlength\glspagelistwidth
%    \end{macrocode}
%\end{macro}
% Default values:
%    \begin{macrocode}
\setlength{\glsdescwidth}{0.6\linewidth}
\setlength{\glspagelistwidth}{0.1\linewidth}
%    \end{macrocode}
% 
% The \glostyle{long} glossary style command which 
% uses the \envname{longtable} environment:
%    \begin{macrocode}
\newglossarystyle{long}{%
\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}}}{%
\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:##1}{##2} & ##3\glspostdescription\space ##5\\}%
\renewcommand*{\glsgroupskip}{ & \\}}
%    \end{macrocode}
% The \glostyle{longborder} style is like the above, but with horizontal and
% vertical lines:
%    \begin{macrocode}
\newglossarystyle{longborder}{%
\glossarystyle{long}%
\renewenvironment{theglossary}{%
\begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}%
\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
% The \glostyle{longheader} style is like the
% \glostyle{long} style but with a header:
%    \begin{macrocode}
\newglossarystyle{longheader}{%
\glossarystyle{long}%
\renewcommand*{\glossaryheader}{%
\bfseries \entryname & \bfseries \descriptionname\\
\endhead}}
%    \end{macrocode}
% The \glostyle{longheaderborder} style is
% like the \glostyle{long} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{longheaderborder}{%
\glossarystyle{longborder}%
\renewcommand*{\glossaryheader}{%
\hline\bfseries \entryname & \bfseries \descriptionname\\\hline
\endhead
\hline\endfoot}}
%    \end{macrocode}
% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns
%    \begin{macrocode}
\newglossarystyle{long3col}{%
\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}{%
\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:##1}{##2} & ##3 & ##5\\}%
\renewcommand*{\glsgroupskip}{ & &\\}}
%    \end{macrocode}
% The \glostyle{long3colborder} style is like the
% \glostyle{long3col} style but with a border:
%    \begin{macrocode}
\newglossarystyle{long3colborder}{%
\glossarystyle{long3col}%
\renewenvironment{theglossary}{%
\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{%
\end{longtable}}%
\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
% The \glostyle{long3colheader} style is like \glostyle{long3col} but with a header row:
%    \begin{macrocode}
\newglossarystyle{long3colheader}{%
\glossarystyle{long3col}%
\renewcommand*{\glossaryheader}{%
\bfseries\entryname&\bfseries\descriptionname&
\bfseries\pagelistname\\\endhead}%
}
%    \end{macrocode}
% The \glostyle{long3colheaderborder} style is like the above but with a border
%    \begin{macrocode}
\newglossarystyle{long3colheaderborder}{%
\glossarystyle{long3colborder}%
\renewcommand*{\glossaryheader}{%
\hline
\bfseries\entryname&\bfseries\descriptionname&
\bfseries\pagelistname\\\hline\endhead
\hline\endfoot}%
}
%    \end{macrocode}
% The \glostyle{long4col} style has four columns where the third column contains the value of the associated \gloskey{symbol} key.
%    \begin{macrocode}
\newglossarystyle{long4col}{%
\renewenvironment{theglossary}{%
\begin{longtable}{llll}}{%
\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:##1}{##2} & ##3 & ##4 & ##5\\}%
\renewcommand*{\glsgroupskip}{ & & &\\}}
%    \end{macrocode}
% The \glostyle{long4colheader} style is like \glostyle{long4col} but with a header row.
%    \begin{macrocode}
\newglossarystyle{long4colheader}{%
\glossarystyle{long4col}%
\renewcommand*{\glossaryheader}{%
\bfseries\entryname&\bfseries\descriptionname&
\bfseries \symbolname&
\bfseries\pagelistname\\\endhead}%
}
%    \end{macrocode}
% The \glostyle{long4colborder} style is like \glostyle{long4col} but with a border.
%    \begin{macrocode}
\newglossarystyle{long4colborder}{%
\glossarystyle{long4col}%
\renewenvironment{theglossary}{%
\begin{longtable}{|l|l|l|l|}}{%
\end{longtable}}%
\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
% The \glostyle{long4colheaderborder} style is like the above but with a border.
%    \begin{macrocode}
\newglossarystyle{long4colheaderborder}{%
\glossarystyle{long4col}%
\renewenvironment{theglossary}{%
\begin{longtable}{|l|l|l|l|}}{%
\end{longtable}}%
\renewcommand*{\glossaryheader}{%
\hline\bfseries\entryname&\bfseries\descriptionname&
\bfseries \symbolname&
\bfseries\pagelistname\\\hline\endhead\hline\endfoot}%
}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossary-long.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossary-super.sty>
%    \end{macrocode}
%\fi
% \subsection{Glossary Styles using supertabular environment (glossary-super package)}
% The glossary styles defined in the \isty{glossary-super} package
% use the \envname{supertabular} environment.
%    \begin{macrocode}
\ProvidesPackage{glossary-super}[2007/07/04 v1.01 (NLCT)]
%    \end{macrocode}
% Requires the \isty{supertabular} package:
%    \begin{macrocode}
\RequirePackage{supertabular}
%    \end{macrocode}
% The \glostyle{super} glossary style uses the
% \envname{supertabular} environment
% (it uses lengths defined in the \isty{glossary-long} package.)
%    \begin{macrocode}
\newglossarystyle{super}{%
\renewenvironment{theglossary}{%
\tablehead{}\tabletail{}%
\begin{supertabular}{lp{\glsdescwidth}}}{%
\end{supertabular}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:##1}{##2} & ##3\glspostdescription\space ##5\\}%
\renewcommand*{\glsgroupskip}{ & \\}}
%    \end{macrocode}
% The \glostyle{superborder} style is like the above, but with horizontal and
% vertical lines:
%    \begin{macrocode}
\newglossarystyle{superborder}{%
\glossarystyle{super}%
\renewenvironment{theglossary}{%
\tablehead{\hline}\tabletail{\hline}%
\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{superheader} style is like the
% \glostyle{super} style, but with a header:
%    \begin{macrocode}
\newglossarystyle{superheader}{%
\glossarystyle{super}%
\renewenvironment{theglossary}{%
\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}%
\tabletail{}%
\begin{supertabular}{lp{\glsdescwidth}}}{\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{superheaderborder} style is like
% the \glostyle{super} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{superheaderborder}{%
\glossarystyle{super}%
\renewenvironment{theglossary}{%
\tablehead{\hline\bfseries \entryname & \bfseries \descriptionname\\\hline}%
\tabletail{\hline}
\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{super3col} style is like the \glostyle{super} style, but with 3 columns:
%    \begin{macrocode}
\newglossarystyle{super3col}{%
\renewenvironment{theglossary}{%
\tablehead{}\tabletail{}%
\begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}{%
\end{supertabular}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:##1}{##2} & ##3 & ##5\\}%
\renewcommand*{\glsgroupskip}{ & &\\}}
%    \end{macrocode}
% The \glostyle{super3colborder} style is like the
% \glostyle{super3col} style, but with a border:
%    \begin{macrocode}
\newglossarystyle{super3colborder}{%
\glossarystyle{super3col}%
\renewenvironment{theglossary}{%
\tablehead{\hline}\tabletail{\hline}%
\begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{%
\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{super3colheader} style is like 
% the \glostyle{super3col} style but with a header row:
%    \begin{macrocode}
\newglossarystyle{super3colheader}{%
\glossarystyle{super3col}%
\renewenvironment{theglossary}{%
\tablehead{\bfseries\entryname&\bfseries\descriptionname&
\bfseries\pagelistname\\}\tabletail{}%
\begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}{%
\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{super3colheaderborder} style is like
% the \glostyle{super3col} style but with a header and border:
%    \begin{macrocode}
\newglossarystyle{super3colheaderborder}{%
\glossarystyle{super3colborder}%
\renewenvironment{theglossary}{%
\tablehead{\hline
\bfseries\entryname&\bfseries\descriptionname&
\bfseries\pagelistname\\\hline}%
\tabletail{\hline}%
\begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{%
\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{super4col} glossary style has four columns,
% where the third column contains the value of the
% corresponding \gloskey{symbol} key used when that entry
% was defined.
%    \begin{macrocode}
\newglossarystyle{super4col}{%
\renewenvironment{theglossary}{%
\tablehead{}\tabletail{}%
\begin{supertabular}{llll}}{%
\end{supertabular}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\@glstarget{glo:##1}{##2} & ##3 & ##4 & ##5\\}%
\renewcommand*{\glsgroupskip}{ & & &\\}}
%    \end{macrocode}
% The \glostyle{super4colheader} style is like
% the \glostyle{super4col} but with a header row.
%    \begin{macrocode}
\newglossarystyle{super4colheader}{%
\glossarystyle{super4col}%
\renewenvironment{theglossary}{%
\tablehead{\bfseries\entryname&\bfseries\descriptionname&
\bfseries\symbolname &
\bfseries\pagelistname\\}\tabletail{}%
\begin{supertabular}{llll}}{%
\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{super4colborder} style is like
% the \glostyle{super4col} but with a border.
%    \begin{macrocode}
\newglossarystyle{super4colborder}{%
\glossarystyle{super4col}%
\renewenvironment{theglossary}{%
\tablehead{\hline}\tabletail{\hline}%
\begin{supertabular}{|l|l|l|l|}}{%
\end{supertabular}}%
}
%    \end{macrocode}
% The \glostyle{super4colheaderborder} style is like
% the \glostyle{super4col} but with a header and border.
%    \begin{macrocode}
\newglossarystyle{super4colheaderborder}{%
\glossarystyle{super4col}%
\renewenvironment{theglossary}{%
\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname&
\bfseries\symbolname &
\bfseries\pagelistname\\}\tabletail{\hline}%
\begin{supertabular}{|l|l|l|l|}}{%
\end{supertabular}}%
}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossary-super.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-babel.sty>
%    \end{macrocode}
%\fi
%\section{Multi-Lingual Support}
% Many thanks to everyone who contributed to the translations both
% via email and on comp.text.tex.
%\subsection{Babel Captions}
% Define \isty{babel} captions if multi-lingual
% support is required, but the \isty{translator} package is not loaded.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glossaries-babel}[2008/02/22 v1.0 (NLCT)]
%    \end{macrocode}
% English:
%    \begin{macrocode}
\addto\captionsenglish{%
\renewcommand*{\glossaryname}{Glossary}%
\renewcommand*{\acronymname}{Acronyms}%
\renewcommand*{\entryname}{Notation}%
\renewcommand*{\descriptionname}{Description}%
\renewcommand*{\symbolname}{Symbol}%
\renewcommand*{\pagelistname}{Page List}%
\renewcommand*{\glssymbolsgroupname}{Symbols}%
\renewcommand*{\glsnumbersgroupname}{Numbers}%
}%
%    \end{macrocode}
% German (quite a few variations were suggested for German; 
% I settled on the following):
%    \begin{macrocode}
\addto\captionsgerman{% 
\renewcommand*{\glossaryname}{Glossar}%
\renewcommand*{\acronymname}{Akronyme}%
\renewcommand*{\entryname}{Bezeichnung}%
\renewcommand*{\descriptionname}{Beschreibung}%
\renewcommand*{\symbolname}{Symbol}%
\renewcommand*{\pagelistname}{Seiten}%
\renewcommand*{\glssymbolsgroupname}{Symbole}%
\renewcommand*{\glsnumbersgroupname}{Zahlen}} 
%    \end{macrocode}
% ngerman is identical to German:
%    \begin{macrocode}
\addto\captionsngerman{% 
\renewcommand*{\glossaryname}{Glossar}%
\renewcommand*{\acronymname}{Akronyme}%
\renewcommand*{\entryname}{Bezeichnung}%
\renewcommand*{\descriptionname}{Beschreibung}%
\renewcommand*{\symbolname}{Symbol}%
\renewcommand*{\pagelistname}{Seiten}%
\renewcommand*{\glssymbolsgroupname}{Symbole}%
\renewcommand*{\glsnumbersgroupname}{Zahlen}} 
%    \end{macrocode}
% Italian:
%    \begin{macrocode}
\addto\captionsitalian{%
\renewcommand*{\glossaryname}{Glossario}%
\renewcommand*{\acronymname}{Acronimi}%
\renewcommand*{\entryname}{Nomenclatura}%
\renewcommand*{\descriptionname}{Descrizione}%
\renewcommand*{\symbolname}{Simbolo}%
\renewcommand*{\pagelistname}{Elenco delle pagine}%
\renewcommand*{\glssymbolsgroupname}{Simboli}%
\renewcommand*{\glsnumbersgroupname}{Numeri}} 
%    \end{macrocode}
% Dutch:
%    \begin{macrocode}
\addto\captionsdutch{%
\renewcommand*{\glossaryname}{Woordenlijst}%
\renewcommand*{\acronymname}{Acroniemen}%
\renewcommand*{\entryname}{Benaming}%
\renewcommand*{\descriptionname}{Beschrijving}%
\renewcommand*{\symbolname}{Symbool}%
\renewcommand*{\pagelistname}{Pagina's}%
\renewcommand*{\glssymbolsgroupname}{Symbolen}%
\renewcommand*{\glsnumbersgroupname}{Cijfers}} 
%    \end{macrocode}
% Spanish:
%    \begin{macrocode}
\addto\captionsspanish{%
\renewcommand*{\glossaryname}{Glosario}%
\renewcommand*{\acronymname}{Siglas}%
\renewcommand*{\entryname}{Entrada}%
\renewcommand*{\descriptionname}{Descripci\'on}%
\renewcommand*{\symbolname}{S\'{\i}mbolo}%
\renewcommand*{\pagelistname}{Lista de p\'aginas}%
\renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}%
\renewcommand*{\glsnumbersgroupname}{N\'umeros}} 
%    \end{macrocode}
% French:
%    \begin{macrocode}
\addto\captionsfrench{%
\renewcommand*{\glossaryname}{Glossaire}%
\renewcommand*{\acronymname}{Acronymes}%
\renewcommand*{\entryname}{Terme}%
\renewcommand*{\descriptionname}{Description}%
\renewcommand*{\symbolname}{Symbole}%
\renewcommand*{\pagelistname}{Pages}%
\renewcommand*{\glssymbolsgroupname}{Symboles}%
\renewcommand*{\glsnumbersgroupname}{Nombres}} 
%    \end{macrocode}
% Danish:
%    \begin{macrocode}
\addto\captionsdanish{%
\renewcommand*{\glossaryname}{Ordliste}%
\renewcommand*{\acronymname}{Akronymer}%
\renewcommand*{\entryname}{Symbolforklaring}%
\renewcommand*{\descriptionname}{Beskrivelse}%
\renewcommand*{\symbolname}{Symbol}%
\renewcommand*{\pagelistname}{Side}%
\renewcommand*{\glssymbolsgroupname}{Symboler}%
\renewcommand*{\glsnumbersgroupname}{Tal}} 
%    \end{macrocode}
% Irish:
%    \begin{macrocode}
\addto\captionsirish{%
\renewcommand*{\glossaryname}{Gluais}%
\renewcommand*{\acronymname}{Acrainmneacha}%
%    \end{macrocode}
% wasn't sure whether to go for N\'ota (Note), Ciall (`Meaning',
% `sense') or Br\'{\i} (`Meaning'). In the end I chose Ciall.
%    \begin{macrocode}
\renewcommand*{\entryname}{Ciall}%
\renewcommand*{\descriptionname}{Tuairisc}%
%    \end{macrocode}
% Again, not sure whether to use Comhartha/Comhartha\'{\i} or
% Siombail/Siombaile, so have chosen the former.
%    \begin{macrocode}
\renewcommand*{\symbolname}{Comhartha}%
\renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}%
\renewcommand*{\pagelistname}{Leathanaigh}%
\renewcommand*{\glsnumbersgroupname}{Uimhreacha}} 
%    \end{macrocode}
% Hungarian:
%    \begin{macrocode}
\addto\captionsmagyar{%
\renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}%
\renewcommand*{\acronymname}{Bet\H uszavak}%
\renewcommand*{\entryname}{Kifejez\'es}%
\renewcommand*{\descriptionname}{Magyar\'azat}%
\renewcommand*{\symbolname}{Jel\"ol\'es}%
\renewcommand*{\pagelistname}{Oldalsz\'am}%
\renewcommand*{\glssymbolsgroupname}{Jelek}%
\renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}%
}
%    \end{macrocode}
% Polish
% \changes{1.13}{2008 May 10}{Add Polish support}
%    \begin{macrocode}
\addto\captionspolish{%
\renewcommand*{\glossaryname}{S{\l}ownik termin\'ow}%
\renewcommand*{\acronymname}{Skr\'ot}%
\renewcommand*{\entryname}{Termin}%
\renewcommand*{\descriptionname}{Opis}%
\renewcommand*{\symbolname}{Symbol}%
\renewcommand*{\pagelistname}{Strony}%
\renewcommand*{\glssymbolsgroupname}{Symbole}%
\renewcommand*{\glsnumbersgroupname}{Liczby}}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-babel.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Danish.dict>
%    \end{macrocode}
%\fi
%\subsection{Danish Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Danish}
%    \end{macrocode}
% Provide Danish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Ordliste}
\providetranslation{Acronyms}{Akronymer}
\providetranslation{Notation (glossaries)}{Symbolforklaring}
\providetranslation{Description (glossaries)}{Beskrivelse}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Side}
\providetranslation{Symbols (glossaries)}{Symboler}
\providetranslation{Numbers (glossaries)}{Tal}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Danish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Dutch.dict>
%    \end{macrocode}
%\fi
%\subsection{Dutch Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Dutch}
%    \end{macrocode}
% Provide Dutch translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Woordenlijst}
\providetranslation{Acronyms}{Acroniemen}
\providetranslation{Notation (glossaries)}{Benaming}
\providetranslation{Description (glossaries)}{Beschrijving}
\providetranslation{Symbol (glossaries)}{Symbool}
\providetranslation{Page List (glossaries)}{Pagina's}
\providetranslation{Symbols (glossaries)}{Symbolen}
\providetranslation{Numbers (glossaries)}{Cijfers}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Dutch.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-English.dict>
%    \end{macrocode}
%\fi
%\subsection{English Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{English}
%    \end{macrocode}
% Provide English translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glossary}
\providetranslation{Acronyms}{Acronyms}
\providetranslation{Notation (glossaries)}{Notation}
\providetranslation{Description (glossaries)}{Description}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Page List}
\providetranslation{Symbols (glossaries)}{Symbols}
\providetranslation{Numbers (glossaries)}{Numbers}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-English.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-French.dict>
%    \end{macrocode}
%\fi
%\subsection{French Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{French}
%    \end{macrocode}
% Provide French translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glossaire}
\providetranslation{Acronyms}{Acronymes}
\providetranslation{Notation (glossaries)}{Terme}
\providetranslation{Description (glossaries)}{Description}
\providetranslation{Symbol (glossaries)}{Symbole}
\providetranslation{Page List (glossaries)}{Pages}
\providetranslation{Symbols (glossaries)}{Symboles}
\providetranslation{Numbers (glossaries)}{Nombres}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-French.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-German.dict>
%    \end{macrocode}
%\fi
%\subsection{German Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{German}
%    \end{macrocode}
% Provide German translations (quite a few variations were suggested
% for German; I settled on the following):
%    \begin{macrocode}
\providetranslation{Glossary}{Glossar}
\providetranslation{Acronyms}{Akronyme}
\providetranslation{Notation (glossaries)}{Bezeichnung}
\providetranslation{Description (glossaries)}{Beschreibung}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Seiten}
\providetranslation{Symbols (glossaries)}{Symbole}
\providetranslation{Numbers (glossaries)}{Zahlen}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-German.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Irish.dict>
%    \end{macrocode}
%\fi
%\subsection{Irish Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Irish}
%    \end{macrocode}
% Provide Irish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Gluais}
\providetranslation{Acronyms}{Acrainmneacha}
\providetranslation{Notation (glossaries)}{Ciall}
\providetranslation{Description (glossaries)}{Tuairisc}
\providetranslation{Symbol (glossaries)}{Comhartha}
\providetranslation{Page List (glossaries)}{Leathanaigh}
\providetranslation{Symbols (glossaries)}{Comhartha\'{\i}}
\providetranslation{Numbers (glossaries)}{Uimhreacha}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Irish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Italian.dict>
%    \end{macrocode}
%\fi
%\subsection{Italian Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Italian}
%    \end{macrocode}
% Provide Italian translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glossario}
\providetranslation{Acronyms}{Acronimi}
\providetranslation{Notation (glossaries)}{Nomenclatura}
\providetranslation{Description (glossaries)}{Descrizione}
\providetranslation{Symbol (glossaries)}{Simbolo}
\providetranslation{Page List (glossaries)}{Elenco delle pagine}
\providetranslation{Symbols (glossaries)}{Simboli}
\providetranslation{Numbers (glossaries)}{Numeri}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Italian.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Magyar.dict>
%    \end{macrocode}
%\fi
%\subsection{Magyar Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Magyar}
%    \end{macrocode}
% Provide translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Sz\'ojegyz\'ek}
\providetranslation{Acronyms}{Bet\H uszavak}
\providetranslation{Notation (glossaries)}{Kifejez\'es}
\providetranslation{Description (glossaries)}{Magyar\'azat}
\providetranslation{Symbol (glossaries)}{Jel\"ol\'es}
\providetranslation{Page List (glossaries)}{Oldalsz\'am}
\providetranslation{Symbols (glossaries)}{Jelek}
\providetranslation{Numbers (glossaries)}{Sz\'amjegyek}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Magyar.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Polish.dict>
%    \end{macrocode}
%\fi
%\subsection{Polish Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Polish}
%    \end{macrocode}
% Provide Polish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{S{\l}ownik termin\'ow}
\providetranslation{Acronyms}{Skr\'ot}
\providetranslation{Notation (glossaries)}{Termin}
\providetranslation{Description (glossaries)}{Opis}
\providetranslation{Symbol (glossaries)}{Symbol}
\providetranslation{Page List (glossaries)}{Strony}
\providetranslation{Symbols (glossaries)}{Symbole}
\providetranslation{Numbers (glossaries)}{Liczby}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Polish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries-dictionary-Spanish.dict>
%    \end{macrocode}
%\fi
%\subsection{Spanish Dictionary}
% This is a dictonary file provided for use with the \isty{translator}
% package.
%    \begin{macrocode}
\ProvidesDictionary{glossaries-dictionary}{Spanish}
%    \end{macrocode}
% Provide Spanish translations:
%    \begin{macrocode}
\providetranslation{Glossary}{Glosario}
\providetranslation{Acronyms}{Siglas}
\providetranslation{Notation (glossaries)}{Entrada}
\providetranslation{Description (glossaries)}{Descripci\'on}
\providetranslation{Symbol (glossaries)}{S\'{\i}mbolo}
\providetranslation{Page List (glossaries)}{Lista de p\'aginas}
\providetranslation{Symbols (glossaries)}{S\'{\i}mbolos}
\providetranslation{Numbers (glossaries)}{N\'umeros}
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</glossaries-dictionary-Spanish.dict>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*minimalgls.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a minimal file for testing and debugging 
 % the glossaries package. Change the class file as 
 % desired, and add the relevant package options to
 % both the class file and the glossaries package.
 % Change the sample glossary entry and acronym if
 % required. If the problem occurs with an additional
 % glossary, add in the relevant \newglossary command
 % and a sample entry.
 %
 % Only add extra packages or commands if they 
 % contribute to whatever problem you are trying to
 % test.
 %
 % Remember that the document will not be complete
 % until you have successfully completed all of the
 % following steps:
 % 1. latex minimalgls
 % 2. makeglossaries minimalgls (note no extension)
 % 3. latex minimalgls
 % A further run through LaTeX will be required to ensure that
 % the table of contents is up to date if the toc option
 % is used.
\documentclass{article}
\listfiles

 %\usepackage{glossaries} % acronym will go in main glossary
 \usepackage[acronym]{glossaries} % make a separate list of acronyms

\makeglossaries

\newglossaryentry{sample}{name={sample},
description={a sample entry}}

% This contrived acronym has non-standard plural forms.
% These are specified in the optional argument.
\newacronym[\glsshortpluralkey=cas,\glslongpluralkey=contrived 
acronyms]{aca}{aca}{a contrived acronym}

\begin{document}
A \gls{sample} entry and \gls{aca}. Second use: \gls{aca}.

Plurals: \glspl{sample}. Reset acronym\glsreset{aca}.
First use: \glspl{aca}. Second use: \glspl{aca}.

\printglossaries
\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</minimalgls.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sample.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{report}

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage[style=altlist]{glossaries}

\makeglossaries

\newglossaryentry{glossary}{name=glossary,
description={1) list of technical words, 2) collection of 
glosses},
plural={glossaries}}

\newglossaryentry{Perl}{name=\texttt{Perl},
sort=Perl, % need a sort key because name contains a command
description=A scripting language}

\newglossaryentry{pagelist}{name=page list,
 % description value has to be enclosed in braces
 % because it contains commas
description={a list of individual pages or page ranges 
(e.g.\ 1,2,4,7-9)}}

\newglossaryentry{mtrx}{name=matrix,
description={rectangular array of quantities},
 % plural is not simply obtained by appending an s, so specify
plural=matrices}

\newcommand{\pardescription}{distinct section of piece of 
writing.\par Beginning on new, usually indented, line}
\newglossaryentry{par}{name=paragraph,
description=\pardescription}

\begin{document}

\title{Sample Document Using glossary Package}
\author{Nicola Talbot}
\pagenumbering{alph}% prevent duplicate page link names if using PDF
\maketitle

\pagenumbering{roman}
\tableofcontents

\chapter{Introduction}
\pagenumbering{arabic}

A \gls{glossary} is a very useful addition to any
technical document, although a \gls{glossary} can 
also simply be a collection of glosses, which is
another thing entirely. Some documents have
multiple \glspl{glossary}.

Once you have run your document through \LaTeX, you
will then need to run the \texttt{.glo} file through
\texttt{makeindex}.  You will need to set the output
file so that it creates a \texttt{.gls} file instead
of an \texttt{.ind} file, and change the name of 
the log file so that it doesn't overwrite the index
log file (if you have an index for your document).  
Rather than having to remember all the command line
switches, you can call the \gls{Perl} script
\texttt{makeglossaries} which provides a convenient
wrapper.

If a comma appears within the name or description, grouping
must be used, e.g.\ in the description of \gls{pagelist}.

Plurals are assumed to have the letter s appended, but if
this is not the case, as in \glspl{mtrx}, then you need
to specify the plural when you define the entry.

\Glspl{par} can cause a problem in commands.

\printglossaries

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sample4col.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{article}

\usepackage[style=long4colheaderborder]{glossaries}

\makeglossaries

\newglossaryentry{w}{name={$w$},
sort=w,
description={width},
symbol=m}

\newglossaryentry{M}{name={$M$},
sort=M,
description={mass},
symbol=kg}

\begin{document}

\printglossaries

The width, \gls{w}, is measured in meters. The mass, \gls{M} is
measured in kilograms.

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample4col.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleAcr.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{report}

\usepackage[colorlinks,plainpages=false]{hyperref}
\usepackage[style=long,toc]{glossaries}

\makeglossaries

\newacronym{svm}% label
{svm}% abbreviation
{support vector machine}% long form

\newacronym{ksvm}{ksvm}{kernel support vector machine}

\newacronym{rna}{rna}{ribonukleins\"aure}

\begin{document}
\tableofcontents

\chapter{Support Vector Machines}

\Glspl{svm} are used widely in the area of pattern recognition.

This is the text produced without a link: \glsentrytext{svm}.
This is the text produced on first use without a link:
\glsentryfirst{svm}. This is the entry's description without
a link: \glsentrydesc{svm}.

This is the entry in uppercase: \GLS{svm}.

\chapter{Kernel Support Vector Machines}

The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses
the so called ``kernel trick''. Plural: \glspl{ksvm}.

\glsresetall
Possessive: \gls{ksvm}['s].
Make the glossary entry number bold for this 
one \gls[format=hyperbf]{svm}.

\chapter{Another chapter}

You don't need to worry about makeindex's special characters:
\gls{rna}.

\printglossary[title={Acronyms}]

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleAcr.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleAcrDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper]{report}

\usepackage[colorlinks,plainpages=false]{hyperref}

\usepackage[style=altlist, % use altlist style
            toc, % add the glossary to the table of contents
            sanitize={description=false},% want to use description in main document
            description% acronyms have a user-supplied description
           ]{glossaries}

\makeglossaries

\newacronym[description={Statistical pattern recognition 
technique~\protect\cite{svm}}, % acronym's description
name={Support vector machine (svm)}% change the default way of displaying the entry name in the list of acronyms
]{svm}{svm}{support vector machine}

\newacronym[description={Statistical pattern recognition technique
using the ``kernel trick'' (see also SVM)},% acronym's description
name={Kernel support vector machine (ksvm)}% change the default way of displaying the entry name in the list of acronyms
]{ksvm}{ksvm}{kernel 
support vector machine}

\begin{document}
\tableofcontents

\chapter{Support Vector Machines}

The \gls{svm} is used widely in the area of pattern recognition.
 % plural form with initial letter in uppercase:
\Glspl{svm} are \ldots

This is the text produced without a link: \glsentrytext{svm}.
This is the text produced on first use without a link:
\glsentryfirst{svm}. This is the entry's description without
a link: \glsentrydesc{svm}.

This is the entry in uppercase: \GLS{svm}.

\chapter{Kernel Support Vector Machines}

The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses
the so called ``kernel trick''.

\glsresetall
Possessive: \gls{ksvm}['s].
Make the glossary entry number bold for this 
one \gls[format=hyperbf]{svm}.

\begin{thebibliography}{1}
\bibitem{svm} \ldots
\end{thebibliography}

\printglossary

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleAcrDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleDB.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{article}

\usepackage[colorlinks,plainpages=false]{hyperref}
\usepackage[nonumberlist]{glossaries}

\newglossary[nlg]{symbols}{not}{ntn}{Symbols}

\makeglossaries

\loadglsentries{database1}
\loadglsentries[symbols]{database2}

\begin{document}

Adding all entries\glsaddall.

\printglossaries

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleDB.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
% See also sampleAcrDesc.tex
\documentclass[a4paper]{report}

\usepackage[colorlinks,plainpages=false]{hyperref}

\usepackage[style=altlist, % use altlist style
            toc, % add the glossary to the table of contents
            sanitize={description=false}% don't sanitize description
           ]{glossaries}

\makeglossaries

\newglossaryentry{svm}{
 % how the entry name should appear in the glossary
name={Support vector machine (SVM)},
 % how the description should appear in the glossary
 % since I have used sanitize={description=false}
 % I have to protect fragile commands
description={Statistical pattern recognition
technique~\protect\cite{svm}},
 % how the entry should appear in the document text
text={svm},
 % how the entry should appear the first time it is
 % used in the document text
first={support vector machine (svm)}}

\newglossaryentry{ksvm}{
name={Kernel support vector machine (KSVM)},
description={Statistical pattern recognition technique
using the ``kernel trick'' (see also SVM)},
text={ksvm},
first={kernel support vector machine}}

\begin{document}
\tableofcontents

\chapter{Support Vector Machines}

The \gls{svm} is used widely in the area of pattern recognition.
 % plural form with initial letter in uppercase:
\Glspl{svm} are \ldots

This is the text produced without a link: \glsentrytext{svm}.
This is the text produced on first use without a link:
\glsentryfirst{svm}. This is the entry's description without
a link: \glsentrydesc{svm}.

This is the entry in uppercase: \GLS{svm}.

\chapter{Kernel Support Vector Machines}

The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses
the so called ``kernel trick''.

\glsresetall
Possessive: \gls{ksvm}['s].
Make the glossary entry number bold for this 
one \gls[format=hyperbf]{svm}.

\begin{thebibliography}{1}
\bibitem{svm} \ldots
\end{thebibliography}

\printglossary[title={Acronyms}]

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleDesc.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleEq.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper,12pt]{report}

\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage[style=long3colheader,counter=equation]{glossaries}

\newcommand{\erf}{\operatorname{erf}}
\newcommand{\erfc}{\operatorname{erfc}}

\makeglossaries

 % Change the glossary headings

\renewcommand{\entryname}{Notation}
\renewcommand{\descriptionname}{Function Name}
\renewcommand{\pagelistname}{Number of Formula}

 % define glossary entries

\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)},
description=Gamma function,
sort=Gamma}

\newglossaryentry{gamma}{name={\ensuremath{\gamma(\alpha,x)}},
description=Incomplete gamma function,
sort=gamma}

\newglossaryentry{iGamma}{name={\ensuremath{\Gamma(\alpha,x)}},
description=Incomplete gamma function,
sort=Gamma}

\newglossaryentry{psi}{name=\ensuremath{\psi(x)},
description=Psi function,sort=psi}

\newglossaryentry{erf}{name=\ensuremath{\erf(x)},
description=Error function,sort=erf}

\newglossaryentry{erfc}{name=\ensuremath{\erfc},
description=Complementary error function,sort=erfc}

\newglossaryentry{B}{name={\ensuremath{B(x,y)}},
description=Beta function,sort=B}

\newglossaryentry{Bx}{name={\ensuremath{B_x(p,q)}},
description=Incomplete beta function,sort=Bx}

\newglossaryentry{Tn}{name=\ensuremath{T_n(x)},
description=Chebyshev's polynomials of the first kind,sort=Tn}

\newglossaryentry{Un}{name=\ensuremath{U_n(x)},
description=Chebyshev's polynomials of the second kind,sort=Un}

\newglossaryentry{Hn}{name=\ensuremath{H_n(x)},
description=Hermite polynomials,sort=Hn}

\newglossaryentry{Ln}{name=\ensuremath{L_n^\alpha(x)},
description=Laguerre polynomials,sort=Lna}

\newglossaryentry{Znu}{name=\ensuremath{Z_\nu(z)},
description=Bessel functions,sort=Z}

\newglossaryentry{Phi}{name={\ensuremath{\Phi(\alpha,\gamma;z)}},
description=confluent hypergeometric function,sort=Pagz}

\newglossaryentry{knu}{name=\ensuremath{k_\nu(x)},
description=Bateman's function,sort=kv}

\newglossaryentry{Dp}{name=\ensuremath{D_p(z)},
description=Parabolic cylinder functions,sort=Dp}

\newglossaryentry{F}{name={\ensuremath{F(\phi,k)}},
description=Elliptical integral of the first kind,sort=Fpk}

\newglossaryentry{C}{name=\ensuremath{C},
description=Euler's constant,sort=C}

\newglossaryentry{G}{name=\ensuremath{G},
description=Catalan's constant,sort=G}

\begin{document}
\title{A Sample Document Using glossaries.sty}
\author{Nicola Talbot}
\maketitle

\begin{abstract}
This is a sample document illustrating the use of the \textsf{glossaries}
package.  The functions here have been taken from ``Tables of
Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik.
The glossary is a list of special functions, so 
the equation number has been used rather than the page number.  This 
can be done using the \texttt{counter=equation} package
option.
\end{abstract}

\printglossary[title={Index of Special Functions and Notations}]

\chapter{Gamma Functions}

\begin{equation}
\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
\end{equation}

\verb|\ensuremath| is only required here if using 
hyperlinks.
\begin{equation}
\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x)
\end{equation}

\begin{equation}
\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt
\end{equation}

\begin{equation}
\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
\end{equation}

\newpage

\begin{equation}
\gls{Gamma} = \Gamma(\alpha, x) + \gamma(\alpha, x)
\end{equation}

\begin{equation}
\gls{psi} = \frac{d}{dx}\ln\Gamma(x)
\end{equation}

\chapter{Error Functions}

\begin{equation}
\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
\end{equation}

\begin{equation}
\gls{erfc} = 1 - \erf(x)
\end{equation}

\chapter{Beta Function}

\begin{equation}
\gls{B} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
\end{equation}
Alternatively:
\begin{equation}
\gls{B} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
\end{equation}

\begin{equation}
\gls{B} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
\end{equation}

\begin{equation}
\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
\end{equation}

\chapter{Polynomials}

\section{Chebyshev's polynomials}

\begin{equation}
\gls{Tn} = \cos(n\arccos x)
\end{equation}

\begin{equation}
\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
\end{equation}

\section{Hermite polynomials}

\begin{equation}
\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
\end{equation}

\section{Laguerre polynomials}

\begin{equation}
L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} 
\frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
\end{equation}

\chapter{Bessel Functions}

Bessel functions $Z_\nu$ are solutions of
\begin{equation}
\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} 
+ \frac{1}{z}\,\frac{dZ_\nu}{dz} + 
\left( 1-\frac{\nu^2}{z^2}Z_\nu = 0 \right)
\end{equation}

\chapter{Confluent hypergeometric function}

\begin{equation}
\gls{Phi} = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!}
+ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!}
+\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\,
\frac{z^3}{3!} + \cdots
\end{equation}

\begin{equation}
\gls{knu} = \frac{2}{\pi}\int_0^{\pi/2}
\cos(x \tan\theta - \nu\theta)\,d\theta
\end{equation}

\chapter{Parabolic cylinder functions}

\begin{equation}
\gls{Dp} = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}}
\left\{
\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)}
\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right)
-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)}
\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right)
\right\}
\end{equation}

\chapter{Elliptical Integral of the First Kind}

\begin{equation}
\gls{F} = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
\end{equation}

\chapter{Constants}

\begin{equation}
\gls{C} = 0.577\,215\,664\,901\ldots
\end{equation}

\begin{equation}
\gls{G} = 0.915\,965\,594\ldots
\end{equation}

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleEq.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleEqPg.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass[a4paper,12pt]{report}

\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\usepackage[style=long3colheader,toc,
            counter=equation]{glossaries}

\newcommand{\erf}{\operatorname{erf}}
\newcommand{\erfc}{\operatorname{erfc}}

\renewcommand{\glossaryname}{Index of Special Functions and Notations}

\renewcommand{\glossarypreamble}{Numbers in italic indicate the equation number,
numbers in bold indicate page numbers where the main definition occurs.\par}

 % set the glossary number style to italic
 % hyperit is used instead of textit because
 % the hyperref package is being used.
\renewcommand{\glsnumberformat}[1]{\hyperit{#1}}

 % 1st column heading
\renewcommand{\entryname}{Notation}

 % 2nd column heading
\renewcommand{\descriptionname}{Function Name}

 % 3rd column heading
\renewcommand{\pagelistname}{}

 % Redefine header row so that it
 % adds a blank row after the title row
\renewcommand{\glossaryheader}{\bfseries\entryname &
\bfseries\descriptionname&\bfseries\pagelistname\\
& & \\\endhead}

 % Define glossary entries

\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)},
description=Gamma function,sort=Gamma}

\newglossaryentry{gamma}{name=\ensuremath{\gamma(\alpha,x)},
description=Incomplete gamma function,sort=gamma}

\newglossaryentry{iGamma}{name=\ensuremath{\Gamma(\alpha,x)},
description=Incomplete gamma function,sort=Gamma}

\newglossaryentry{psi}{name=\ensuremath{\psi(x)},
description=Psi function,sort=psi}

\newglossaryentry{erf}{name=\ensuremath{\erf(x)},
description=Error function,sort=erf}

\newglossaryentry{erfc}{name=\ensuremath{\erfc(x)},
description=Complementary error function,sort=erfc}

\newglossaryentry{beta}{name=\ensuremath{B(x,y)},
description=Beta function,sort=B}

\newglossaryentry{Bx}{name=\ensuremath{B_x(p,q)},
description=Incomplete beta function,sort=Bx}

\newglossaryentry{Tn}{name=\ensuremath{T_n(x)},
description=Chebyshev's polynomials of the first kind,
sort=Tn}

\newglossaryentry{Un}{name=\ensuremath{U_n(x)},
description=Chebyshev's polynomials of the second kind,
sort=Un}

\newglossaryentry{Hn}{name=\ensuremath{H_n(x)},
description=Hermite polynomials,sort=Hn}

\newglossaryentry{Lna}{name=\ensuremath{L_n^\alpha(x)},
description=Laguerre polynomials,sort=Lna}

\newglossaryentry{Znu}{name=\ensuremath{Z_\nu(z)},
description=Bessel functions,sort=Z}

\newglossaryentry{Pagz}{name=\ensuremath{\Phi(\alpha,\gamma;z)},
description=confluent hypergeometric function,sort=Pagz}

\newglossaryentry{kv}{name=\ensuremath{k_\nu(x)},
description=Bateman's function,sort=kv}

\newglossaryentry{Dp}{name=\ensuremath{D_p(z)},
description=Parabolic cylinder functions,sort=Dp}

\newglossaryentry{Fpk}{name=\ensuremath{F(\phi,k)},
description=Elliptical integral of the first kind,sort=Fpk}

\newglossaryentry{C}{name=\ensuremath{C},
description=Euler's constant,sort=C}

\newglossaryentry{G}{name=\ensuremath{G},
description=Catalan's constant,sort=G}

\makeglossaries

\pagestyle{headings}

\begin{document}

\title{Sample Document Using Interchangable Numbering}
\author{Nicola Talbot}
\maketitle

\begin{abstract}
This is a sample document illustrating the use of the \textsf{glossaries}
package.  The functions here have been taken from ``Tables of
Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik.

The glossary lists both page numbers and equation numbers.  
Since the majority of the entries use the equation number,
\texttt{counter=equation} was used as a package option.
Note that this example will only work where the
page number and equation number compositor is the same. So 
it won't work if, say, the page numbers are of the form 
2-4 and the equation numbers are of the form 4.6.  
As most of the glossary entries should have an italic 
format, it is easiest to set the default format to 
italic.

\end{abstract}

\tableofcontents

\printglossary[toctitle={Special Functions}]

\chapter{Gamma Functions}

The \glslink[format=hyperbf,counter=page]{Gamma}{gamma function} is 
defined as
\begin{equation}
\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
\end{equation}

\begin{equation}
\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x)
\end{equation}

\begin{equation}
\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt
\end{equation}

\begin{equation}
\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
\end{equation}

\newpage

\begin{equation}
\glslink{Gamma}{\ensuremath{\Gamma(\alpha)}} = 
\Gamma(\alpha, x) + \gamma(\alpha, x)
\end{equation}

\begin{equation}
\gls{psi} = \frac{d}{dx}\ln\Gamma(x)
\end{equation}

\chapter{Error Functions}

The \glslink[format=hyperbf,counter=page]{erf}{error function} is defined as:
\begin{equation}
\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
\end{equation}

\begin{equation}
\gls{erfc} = 1 - \erf(x)
\end{equation}

\chapter{Beta Function}

\begin{equation}
\gls{beta} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
\end{equation}
Alternatively:
\begin{equation}
\gls{beta} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
\end{equation}

\begin{equation}
\gls{beta} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
\end{equation}

\begin{equation}
\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
\end{equation}

\chapter{Chebyshev's polynomials}

\begin{equation}
\gls{Tn} = \cos(n\arccos x)
\end{equation}

\begin{equation}
\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
\end{equation}

\chapter{Hermite polynomials}

\begin{equation}
\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
\end{equation}

\chapter{Laguerre polynomials}

\begin{equation}
\gls{Lna} = \frac{1}{n!}e^x x^{-\alpha} 
\frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
\end{equation}

\chapter{Bessel Functions}

Bessel functions $Z_\nu(z)$ are solutions of
\begin{equation}
\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} + 
\left(
1-\frac{\nu^2}{z^2}Z_\nu = 0
\right)
\end{equation}

\chapter{Confluent hypergeometric function}

\begin{equation}
\gls{Pagz} = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!}
+ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!}
+\frac{\alpha(\alpha+1)(\alpha+2)}
      {\gamma(\gamma+1)(\gamma+2)}
\,\frac{z^3}{3!}
+ \cdots
\end{equation}

\begin{equation}
\gls{kv} = \frac{2}{\pi}\int_0^{\pi/2}
\cos(x \tan\theta - \nu\theta)\,d\theta
\end{equation}

\chapter{Parabolic cylinder functions}

\begin{equation}
\gls{Dp} = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}}
\left\{
\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)}
\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right)
-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)}
\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right)
\right\}
\end{equation}

\chapter{Elliptical Integral of the First Kind}

\begin{equation}
\gls{Fpk} = \int_0^\phi 
\frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
\end{equation}

\chapter{Constants}

\begin{equation}
\gls{C} = 0.577\,215\,664\,901\ldots
\end{equation}

\begin{equation}
\gls{G} = 0.915\,965\,594\ldots
\end{equation}

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleEqPg.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleNtn.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{report}

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage{html}
\usepackage[toc]{glossaries}

 % Define a new glossary type called notation
\newglossary[nlg]{notation}{not}{ntn}{Notation}

\makeglossaries

 % Notation definitions

\newglossaryentry{not:set}{type=notation, % glossary type
name={$\mathcal{S}$},
description={A set},
sort={S}}

\newglossaryentry{not:U}{type=notation,
name={$\mathcal{U}$},
description={The universal set},
sort=U}

\newglossaryentry{not:card}{type=notation,
name={$|\mathcal{S}|$},
description={cardinality of $\mathcal{S}$},
sort=cardinality}

\newglossaryentry{not:fact}{type=notation,
name={$!$},
description={factorial},
sort=factorial}

 % Main glossary definitions

\newglossaryentry{gls:set}{name=set,
description={A collection of distinct objects}}

\newglossaryentry{gls:card}{name=cardinality,
description={The number of elements in the specified set}}

\begin{document}
\title{Sample Document using the glossaries Package}
\author{Nicola Talbot}
\pagenumbering{alph}
\maketitle

\begin{abstract}
 %stop hyperref complaining about duplicate page identifiers:
\pagenumbering{Alph}
This is a sample document illustrating the use of the
\textsf{glossaries} package.  In this example, a new glossary type
called \texttt{notation} is defined, so that the document can have a 
separate glossary of terms and index of notation. The index of notation
doesn't have associated numbers.
\end{abstract}


\pagenumbering{roman}
\tableofcontents

\printglossaries
 %\printglossary
 %\setglossarysection{section}
 %\printglossary[type=notation]

\chapter{Introduction}
\pagenumbering{arabic}

\glslink{gls:set}{Sets} 
are denoted by a caligraphic font 
e.g.\ \gls{not:set}.

Let \gls[format=hyperit]{not:U} denote the universal set.

The \gls{gls:card} of a set $\mathcal{S}$ is denoted 
\gls{not:card}.

\chapter{Another Chapter}

Another mention of the universal set \gls{not:U}.

The factorial symbol: \gls{not:fact}.

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleNtn.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sampleSec.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
\documentclass{report}

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage[style=altlist,toc,counter=section]{glossaries}

\makeglossaries

\newglossaryentry{ident}{name=identity matrix,
description=diagonal matrix with 1s along the leading diagonal,
plural=identity matrices}

\newglossaryentry{diag}{name=diagonal matrix,
description=matrix whose only non-zero entries are along
the leading diagonal,
plural=diagonal matrices}

\newglossaryentry{sing}{name=singular matrix,
description=matrix with zero determinant,
plural=singular matrices}

\begin{document}

\pagenumbering{roman}
\tableofcontents

\printglossaries

\chapter{Introduction}
\pagenumbering{arabic}
This is a sample document illustrating the use of the
\textsf{glossaries} package.

\chapter{Diagonal matrices}

A \gls[format=hyperit]{diag} is a matrix where all elements not on the
leading diagonal are zero.  This is the
primary definition, so an italic font is used for the page number.

\newpage
\section{Identity matrix}
The \gls[format=hyperit]{ident} is a \gls{diag} whose leading
diagonal elements are all equal to 1.

Here is another entry for a \gls{diag}. And this is the
plural: \glspl{ident}.

This adds an entry into the glossary with a bold number, but
it doesn't create a hyperlink: \gls*[format=hyperbf]{ident}.

\chapter{Singular Matrices}

A \gls{sing} is a matrix with zero determinant.
\Glspl{sing} are non-invertible. Possessive:
a \gls{sing}['s] dimensions are not necessarily equal.

Another \gls{ident} entry.

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sampleSec.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*database1.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a sample database of glossary entries
 % Only those entries used in the document with \glslink, \gls,
 % \glspl, and uppercase variants will have entries in the
 % glossary. Note that the type key is not used, as the
 % glossary type can be specified in \loadglsentries

\newglossaryentry{array}{name=array,
description={A list of values identified by a numeric value}}

\newglossaryentry{binary}{name=binary,
description={Pertaining to numbers represented in base 2}}

\newglossaryentry{comment}{name=comment,
description={A remark that doesn't affect the meaning of the 
code}}

\newglossaryentry{global}{name=global,
description={Something that maintains its state when it leaves
the current group}}

\newglossaryentry{local}{name=local,
description={Something that only maintains its state until
it leaves the group in which it was defined/changed}}

%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</database1.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*database2.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
 % This is a sample database of glossary entries
 % Only those entries used in the document with \glslink, \gls,
 % \glspl, and uppercase variants will have entries in the
 % glossary. Note that the type key is not used, as the
 % glossary type can be specified in \loadglsentries

 % Don't need to worry about makeindex special characters
\newglossaryentry{quote}{name={"},
description={the double quote symbol}}

\newglossaryentry{at}{name={@},
description={the ``at'' symbol}}

\newglossaryentry{excl}{name={!},
description={the exclamation mark symbol}}

\newglossaryentry{bar}{name={$|$},
description={the vertical bar symbol}}

\newglossaryentry{hash}{name={\#},
description={the hash symbol}}

%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</database2.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*glossaries.perl>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
# File          : glossaries.perl
# Author        : Nicola L.C. Talbot
# Date          : 14th June 2007
# Last Modified : 22 February 2008
# Version       : 1.03
# Description   : LaTeX2HTML (limited!) implementation of glossaries 
#                  package. Note that not all the glossaries.sty
#                  macros have been implemented.

# This is a LaTeX2HTML style implementing the glossaries package, and
# is distributed as part of that package.
# Copyright 2007 Nicola L.C. Talbot
# This work may be distributed and/or modified under the
# conditions of the LaTeX Project Public License, either version 1.3
# of this license of (at your option) any later version.
# The latest version of this license is in
#   http://www.latex-project.org/lppl.txt
# and version 1.3 or later is part of all distributions of LaTeX
# version 2005/12/01 or later.
#
# This work has the LPPL maintenance status `maintained'.
#
# The Current Maintainer of this work is Nicola Talbot.

# This work consists of the files glossaries.dtx and glossaries.ins 
# and the derived files glossaries.sty, glossary-hypernav.sty, 
# glossary-list.sty, glossary-long.sty, glossary-super.sty, 
# glossaries.perl. Also makeglossaries and makeglossaries.bat


package main;

# These are the only package options implemented.

sub do_glossaries_style_altlist{
}

sub do_glossaries_toc{
}

sub do_glossaries_toc_true{
}

$GLSCURRENTFORMAT="textrm";

sub do_cmd_glossaryname{
   "Glossary$_[0]"
}

$gls_mark{'main'} = "<tex2html_gls_main_mark>";
$gls_file_mark{'main'} = "<tex2html_gls_main_file_mark>";
$gls_title{'main'} = "\\glossaryname";
$delimN{'main'} = ", ";
$glsnumformat{'main'} = $GLSCURRENTFORMAT;
@{$gls_entries{'main'}} = ();
$gls_displayfirst{'main'} = "glsdisplayfirst";
$gls_display{'main'} = "glsdisplay";

 %glsentry = ();

$acronymtype = 'main';

sub do_glossaries_acronym{
   &do_glossaries_acronym_true
}

sub do_glossaries_acronym_true{
   &make_newglossarytype("acronym", "\\acronymname");
   $acronymtype = 'acronym';
}

sub do_glossary_acronym_false{
   $acronymtype = 'main';
}

sub do_cmd_acronymname{
   join('', 'Acronyms', $_[0]);
}

sub do_cmd_acronymtype{
   join('', $acronymtype, $_[0]);
}

# modify set_depth_levels so that glossary is added

sub replace_glossary_markers{
   foreach $type (keys %gls_mark)
   {
      if (defined &add_gls_hook)
        {&add_gls_hook if (/$gls_mark{$type}/);}
      else
        {&add_gls($type) if (/$gls_mark{$type}/);}

      s/$gls_file_mark{$type}/$glsfile{$type}/g;
   }
}

# there must be a better way of doing this
# other than copying the orginal code and adding to it.
sub replace_general_markers {
    if (defined &replace_infopage_hook) {&replace_infopage_hook if (/$info_page_mark/);}
    else { &replace_infopage if (/$info_page_mark/); }
    if (defined &add_idx_hook) {&add_idx_hook if (/$idx_mark/);}
    else {&add_idx if (/$idx_mark/);}
    &replace_glossary_markers;

    if ($segment_figure_captions) {
s/$lof_mark/$segment_figure_captions/o
    } else { s/$lof_mark/$figure_captions/o }
    if ($segment_table_captions) {
s/$lot_mark/$segment_table_captions/o
    } else { s/$lot_mark/$table_captions/o }
    &replace_morelinks();
    if (defined &replace_citations_hook) {&replace_citations_hook if /$bbl_mark/;}
    else {&replace_bbl_marks if /$bbl_mark/;}
    if (defined &add_toc_hook) {&add_toc_hook if (/$toc_mark/);}
    else {&add_toc if (/$toc_mark/);}
    if (defined &add_childs_hook) {&add_childs_hook if (/$childlinks_on_mark/);}
    else {&add_childlinks if (/$childlinks_on_mark/);}
    &remove_child_marks;

    if (defined &replace_cross_references_hook) {&replace_cross_references_hook;}
    else {&replace_cross_ref_marks if /$cross_ref_mark||$cross_ref_visible_mark/;}
    if (defined &replace_external_references_hook) {&replace_external_references_hook;}
    else {&replace_external_ref_marks if /$external_ref_mark/;}
    if (defined &replace_cite_references_hook) {&replace_cite_references_hook;}
    else { &replace_cite_marks if /$cite_mark/; }
    if (defined &replace_user_references) {
  &replace_user_references if /$user_ref_mark/; }

}

sub add_gls{
    local($sidx_style, $eidx_style) =('<STRONG>','</STRONG>');
    if ($INDEX_STYLES) {
if ($INDEX_STYLES =~/,/) {
local(@styles) = split(/\s*,\s*/,$INDEX_STYLES);
    $sidx_style = join('','<', join('><',@styles) ,'>');
    $eidx_style = join('','</', join('></',reverse(@styles)) ,'>');
} else {
    $sidx_style = join('','<', $INDEX_STYLES,'>');
    $eidx_style = join('','</', $INDEX_STYLES,'>');
}
    }
    &add_real_gls
}

sub gloskeysort{
   local($x, $y) = ($a, $b);
   $x=~s/^(.*)###(\d+)$/\l\1/;
   local($x_id) = $2;
   $y=~s/^(.*)###(\d+)$/\l\1/;
   local($y_id) = $2;

   local($n) = ($x cmp $y);

   if ($n == 0)
   {
      $n = ($x_id <=> $y_id);
   }

   $n;
}

sub add_real_gls{
   local($type) = @_;
   print "\nDoing glossary '$type' ...";
   local($key, $str, @keys, $glossary, $level, $count,
   @previous, @current, $id, $linktext, $delimN);

   @keys = keys %{$glossary{$type}};

   @keys = sort gloskeysort @keys;

   $level = 0;

   $delimN = $delimN{$type};

   foreach $key (@keys)
   {
      $current = $key;
      $str = $current;
      $str =~ s/\#\#\#\d+$//o; # Remove the unique id's
      #$linktext = $cross_ref_visible_mark;
      $id = ++$global{'max_id'};
      $linktext = "\\$glossary_format{$type}{$key}${OP}$id${CP}$glossary_linktext{$type}{$key}${OP}$id${CP}";
      $linktext = &translate_commands($linktext);

      local($entry) = $glossary_entry{$type}{$key};

      $id = ++$global{'max_id'};
      local($name) = &translate_commands(
         "\\glsnamefont $OP$id$CP$glsentry{$entry}{name}$OP$id$CP");

      local($symbol) = ($glsentry{$entry}{'symbol'} ?
                     " $glsentry{$entry}{symbol}" : '');

      $glossary .=
      # If it's the same string don't start a new line
         (&index_key_eq($current, $previous) ?
               $delimN
               . $glossary{$type}{$key}
               . $linktext
               . "</A>\n"
            : "<DT>"
                   . $name
                   . "<DD>"
                   . $glsentry{$entry}{'description'} 
                   . $symbol . '. '
                   . $glossary{$type}{$key}
         . $linktext. "</A>\n");
      $previous = $current;
   }
    $glossary = '<DD>'.$glossary unless ($glossary =~ /^\s*<D(T|D)>/);

    $glossary =~ s/(<A [^>]*>)(<D(T|D)>)/$2$1/g;

    $str = &translate_commands("\\glossarypostamble");
    s/$gls_mark{$type}/$preglossary\n<DL COMPACT>\n$glossary<\/DL>$str\n/s;
}

sub set_depth_levels {
    # Sets $outermost_level
    local($level);
    # scan the document body, not the preamble, for use of sectioning commands
    my ($contents) = $_;
    if ($contents =~ /\\begin\s*((?:$O|$OP)\d+(?:$C|$CP))document\1|\\startdocument/s) {
$contents = $';
    }
    foreach $level ("part", "chapter", "section", "subsection",
    "subsubsection", "paragraph") {
last if (($outermost_level) = $contents =~ /\\($level)$delimiter_rx/);
last if (($outermost_level) = $contents =~ /\\endsegment\s*\[\s*($level)\s*\]/s);
if ($contents =~ /\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)\s*($level)\s*\2/s)
{ $outermost_level = $3; last };
    }
    $level = ($outermost_level ? $section_commands{$outermost_level} :
      do {$outermost_level = 'section'; 3;});

    if ($REL_DEPTH && $MAX_SPLIT_DEPTH) {
$MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH;
    } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 };

    %unnumbered_section_commands = (
          'tableofcontents', $level
, 'listoffigures', $level
, 'listoftables', $level
, 'bibliography', $level
, 'textohtmlindex', $level
, 'textohtmlglossary', $level
, 'textohtmlglossaries', $level
        , %unnumbered_section_commands
        );

    %section_commands = (
  %unnumbered_section_commands
        , %section_commands
        );
}

sub add_bbl_and_idx_dummy_commands {
    local($id) = $global{'max_id'};

    s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg;
    ## if ($bbl_cnt == 1) {
s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo;
    #}
    $global{'max_id'} = $id;
    s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
    s/[\\]printindex/\\textohtmlindex /o;
    &add_gls_dummy_commands;
    &lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands);
}

sub add_gls_dummy_commands{
   s/[\\]printglossary/\\textohtmlglossary/sg;
   s/[\\]printglossaries/\\textohtmlglossaries/sg;
}

sub get_firstkeyval{
   local($key,$_) = @_;
   local($value);

   s/\b$key\s*=$OP(\d+)$CP(.*)$OP\1$CP\s*(,|$)/$value=$2;','/es;
   undef($value) if $`=~/\b$key\s*=/;

   unless (defined($value))
   {
      s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s;
      $value=$2;
   }

   ($value,$_);
}

# need to get the value of the last key of a given name
# in the event of multiple occurences.
sub get_keyval{
   local($key,$_) = @_;
   local($value);

   while (/\b$key\s*=/)
   {
      ($value,$_) = &get_firstkeyval($key, $_);
      last unless defined($value);
   }

   ($value,$_);
}

# This is modified from do_cmd_textohtmlindex

sub do_cmd_textohtmlglossary{
   local($_) = @_;

   local($keyval,$pat) = &get_next_optional_argument;

   local($type,$title,$toctitle,$style);

   ($type,$keyval) = &get_keyval('type', $keyval);
   ($title,$keyval) = &get_keyval('title', $keyval);
   ($toctitle,$keyval) = &get_keyval('toctitle', $keyval);
   ($style,$keyval) = &get_keyval('style', $keyval);

   &make_textohtmlglossary($type,$toctitle,$title,$style).$_;
}

sub make_textohtmlglossary{
   local($type,$toctitle,$title,$style) = @_;

   unless (defined($type)) {$type = 'main';}

   unless (defined $gls_mark{$type})
   {
      &write_warnings("glossary type '$type' not implemented");
   }

   unless (defined($title) and $title) {$title = $gls_title{$type};}
   unless (defined($toctitle) and $toctitle) {$toctitle = $title;}

   $toc_sec_title = $toctitle;
   $glsfile{$type} = $CURRENT_FILE;

   $TITLE=&translate_commands($toctitle);

   if (%glossary_labels) { &make_glossary_labels(); }

   if (($SHORT_INDEX) && (%glossary_segment))
   {
      &make_preglossary();
   }
   else
   {
      $preglossary = &translate_commands("\\glossarypreamble");
   }

   local $idx_head = $section_headings{'textohtmlindex'};
   local($heading) = join(''
        , &make_section_heading($title, $idx_head)
        , $gls_mark{$type} );
   local($pre,$post) = &minimize_open_tags($heading);
   join('',"<BR>\n" , $pre);
}

sub do_cmd_textohtmlglossaries{
   local($_) = @_;

   foreach $type (keys %gls_mark)
   {
      $id = ++$global{'max_id'};
      $_ = &make_textohtmlglossary($type,$gls_title{'main'}).$_;
   }

   $_;
}

sub make_glossary_labels {
    local($key, @keys);
    @keys = keys %glossary_labels;
    foreach $key (@keys) {
        if (($ref_files{$key}) && !($ref_files{$key} eq "$glsfile{'main'}")) {
            local($tmp) = $ref_files{$key};
            &write_warnings("\nmultiple label $key , target in $glsfile{'main'} masks $tmp ");
        }
        $ref_files{$key} .= $glsfile{'main'};
    }
}

sub make_preglossary{ &make_real_preglossary }
sub make_real_preglossary{
    local($key, @keys, $head, $body);
    $head = "<HR>\n<H4>Legend:</H4>\n<DL COMPACT>";
    @keys = keys %glossary_segment;
    foreach $key (@keys) {
        local($tmp) = "segment$key";
        $tmp = $ref_files{$tmp};
        $body .= "\n<DT>$key<DD>".&make_named_href('',$tmp,$glossary_segment{$key});
    }
    $preglossary = join('', $head, $body, "\n</DL>") if ($body);
}

sub do_cmd_glossary { &do_real_glossary(@_) }
sub do_real_glossary {
   local($_) = @_;
   local($type) = "main";
   local($anchor,$entry);

   local($type,$pat) = &get_next_optional_argument;

   $entry = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($entry=$2));

   $anchor = &make_glossary_entry($entry,$anchor_invisible_mark,$type);

   join('', $anchor, $_);
}

sub make_glossary_entry { &make_real_glossary_entry(@_) }
sub make_real_glossary_entry {
    local($entry,$text,$type) = @_;
    local($this_file) = $CURRENT_FILE;
    $TITLE = $saved_title if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title)));

    local($sort) = $glsentry{$entry}{'sort'};

    # Save the reference
    local($str) = "$sort###" . ++$global{'max_id'}; # Make unique
    # concatenate multiple spaces into a single space
    # otherwise keys won't sort properly
    $str=~s/\s+/ /gs;
    local($br_id) = ++$global{'max_id'};
    $glossary{$type}{$str} .= &make_half_href($this_file."#$br_id");
    $glossary_format{$type}{$str} = $GLSCURRENTFORMAT;
    $glossary_entry{$type}{$str} = $entry;
    $glossary_linktext{$type}{$str} = $TITLE;
    "<A HREF=$gls_file_mark{$type}#tex2html$href_name NAME=\"$br_id\">$text<\/A>";
}

sub do_cmd_newglossary{
   local($_) = @_;
   local($type,$out,$in,$opt,$pat,$title);

   ($opt,$pat) = &get_next_optional_argument;

   $type = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($type=$2));
   $in = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($in=$2));
   $out = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($out=$2));
   $title = &missing_braces unless 
           (s/$next_pair_pr_rx//o&&($title=$2));

   ($opt,$pat) = &get_next_optional_argument;

   &make_newglossarytype($type, $title);

   $_;
}

sub make_newglossarytype{
   local($type, $title) = @_;

   $gls_mark{$type} = "<tex2html_gls_${type}_mark>";
   $gls_file_mark{$type} = "<tex2html_gls_${type}_file_mark>";
   $gls_title{$type} = $title;
   $delimN{$type} = ", ";
   $glsnumformat{$type} = $GLSCURRENTFORMAT;
   @{$gls_entries{$type}} = ();
   $gls_displayfirst{$type} = "glsdisplayfirst";
   $gls_display{$type} = "glsdisplay";
}

sub do_cmd_glsdisplay{
   local($_) = @_;
   local($text,$description,$symbol,$insert);

   $text = &missing_braces unless
        (s/$next_pair_pr_rx/$text=$2;''/eo);

   $description = &missing_braces unless
        (s/$next_pair_pr_rx/$description=$2;''/eo);

   $symbol = &missing_braces unless
        (s/$next_pair_pr_rx/$symbol=$2;''/eo);

   $insert = &missing_braces unless
        (s/$next_pair_pr_rx/$insert=$2;''/eo);

   "$text$insert" . $_;
}

sub do_cmd_glsdisplayfirst{
   local($_) = @_;
   local($text,$description,$symbol,$insert);

   $text = &missing_braces unless
        (s/$next_pair_pr_rx/$text=$2;''/eo);

   $description = &missing_braces unless
        (s/$next_pair_pr_rx/$description=$2;''/eo);

   $symbol = &missing_braces unless
        (s/$next_pair_pr_rx/$symbol=$2;''/eo);

   $insert = &missing_braces unless
        (s/$next_pair_pr_rx/$insert=$2;''/eo);

   "$text$insert" . $_;
}

sub gls_get_displayfirst{
   local($type) = @_;
   local($display)= $gls_displayfirst{$type};

   if (not defined($display))
   {
      &write_warnings("Glossary '$type' is not defined");
      $display='';
   }
   elsif ($display eq '')
   {
      &write_warnings("glsdisplayfirst not set for glossary '$type'");
   }
   else
   {
      $display = "\\$display ";
   }

   $display;
}

sub gls_get_display{
   local($type) = @_;
   local($display)= $gls_display{$type};

   if (not defined($display))
   {
      &write_warnings("Glossary '$type' is not defined");
      $display = '';
   }
   elsif ($display eq '')
   {
      &write_warnings("glsdisplay not set for glossary '$type'");
   }
   else
   {
      $display = "\\$display ";
   }

   $display;
}

sub do_cmd_glsnamefont{
   local($_) = @_;
   local($text);

   $text = &missing_braces unless
        (s/$next_pair_pr_rx/$text=$2;''/eo);

   "<B>$text</B>$_";
}

sub do_cmd_newacronym{
   local($_) = @_;
   local($label,$abbrev,$long,$opt);

   ($opt,$pat) = &get_next_optional_argument;

   $label = &missing_braces unless
        (s/$next_pair_pr_rx/$label=$2;''/eo);
   $abbrv = &missing_braces unless
        (s/$next_pair_pr_rx/$abbrv=$2;''/eo);
   $long = &missing_braces unless
        (s/$next_pair_pr_rx/$long=$2;''/eo);

   local($cmd) = "\\newglossaryentry";
   local($id);
   $id = ++$global{'max_id'};
   $cmd .= "$OP$id$CP$label$OP$id$CP";
   $id = ++$global{'max_id'};
   local($entry) = "type=$OP$id$CP\\acronymtype$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "name=$OP$id$CP$abbrv$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "description=$OP$id$CP$long$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "text=$OP$id$CP$abbrv$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "first=$OP$id$CP$long ($abbrv)$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "plural=$OP$id$CP${abbrv}s$OP$id$CP,";
   $id = ++$global{'max_id'};
   $entry .= "firstplural=$OP$id$CP${long}s (${abbrv}s)$OP$id$CP";

   $id = ++$global{'max_id'};
   $cmd .= "$OP$id$CP$entry,$opt$OP$id$CP";

   &translate_commands($cmd).$_;
}

sub gls_entry_init{
   local($label, $type, $name, $desc) = @_;

   %{$glsentry{$label}} = 
     ( type => $type,
       name => $name,
       'sort' => $name,
       description => $description,
       text => $name,
       first => $name,
       plural => "${name}s",
       firstplural => "${name}s",
       symbol => '',
       flag => 0
     );
}

sub gls_get_type{
   local($label) = @_;
   local($type) = '';

   if (&gls_entry_defined($label))
   {
      $type = $glsentry{$label}{'type'};
   }
   else
   {
      &write_warnings("gls_get_type: glossary entry '$label' has not been defined");
   }

   $type;
}

sub gls_set_type{
   local($label, $type) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'type'} = $type;
   }
   else
   {
      &write_warnings("gls_set_type: glossary entry '$label' has not been defined");
   }
}

sub gls_get_name{
   local($label) = @_;
   local($name) = '';

   if (&gls_entry_defined($label))
   {
      $name = $glsentry{$label}{'name'};
   }
   else
   {
      &write_warnings("gls_get_name: glossary entry '$label' has not been defined");
   }

   $name;
}

sub gls_set_name{
   local($label, $name) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'name'} = $name;
   }
   else
   {
      &write_warnings("gls_set_name: glossary entry '$label' has not been defined");
   }
}

sub gls_get_description{
   local($label) = @_;
   local($description) = '';

   if (&gls_entry_defined($label))
   {
      $description = $glsentry{$label}{'description'};
   }
   else
   {
      &write_warnings("gls_get_description: glossary entry '$label' has not been defined");
   }

   $description;
}

sub gls_set_description{
   local($label, $description) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'description'} = $description;
   }
   else
   {
      &write_warnings("gls_set_description: glossary entry '$label' has not been defined");
   }
}

sub gls_get_symbol{
   local($label) = @_;
   local($symbol) = '';

   if (&gls_entry_defined($label))
   {
      $symbol = $glsentry{$label}{'symbol'};
   }
   else
   {
      &write_warnings("gls_get_symbol: glossary entry '$label' has not been defined");
   }

   $symbol;
}

sub gls_set_symbol{
   local($label, $symbol) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'symbol'} = $symbol;
   }
   else
   {
      &write_warnings("gls_set_symbol: glossary entry '$label' has not been defined");
   }
}

sub gls_get_sort{
   local($label) = @_;
   local($sort) = '';

   if (&gls_entry_defined($label))
   {
      $sort = $glsentry{$label}{'sort'};
   }
   else
   {
      &write_warnings("gls_get_sort: glossary entry '$label' has not been defined");
   }

   $sort;
}

sub gls_set_sort{
   local($label, $sort) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'sort'} = $sort;
   }
   else
   {
      &write_warnings("gls_set_sort: glossary entry '$label' has not been defined");
   }
}

sub gls_get_text{
   local($label) = @_;
   local($text) = '';

   if (&gls_entry_defined($label))
   {
      $text = $glsentry{$label}{'text'};
   }
   else
   {
      &write_warnings("gls_get_text: glossary entry '$label' has not been defined");
   }

   $text;
}

sub gls_set_text{
   local($label, $text) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'text'} = $text;
   }
   else
   {
      &write_warnings("gls_set_text: glossary entry '$label' has not been defined");
   }
}

sub gls_get_plural{
   local($label) = @_;
   local($plural) = '';

   if (&gls_entry_defined($label))
   {
      $plural = $glsentry{$label}{'plural'};
   }
   else
   {
      &write_warnings("gls_get_plural: glossary entry '$label' has not been defined");
   }

   $plural;
}

sub gls_set_plural{
   local($label, $plural) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'plural'} = $plural;
   }
   else
   {
      &write_warnings("gls_set_plural: glossary entry '$label' has not been defined");
   }
}

sub gls_get_firstplural{
   local($label) = @_;
   local($firstplural) = '';

   if (&gls_entry_defined($label))
   {
      $firstplural = $glsentry{$label}{'firstplural'};
   }
   else
   {
      &write_warnings("gls_get_firstplural: glossary entry '$label' has not been defined");
   }

   $firstplural;
}

sub gls_set_firstplural{
   local($label, $firstplural) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'firstplural'} = $firstplural;
   }
   else
   {
      &write_warnings("gls_set_firstplural: glossary entry '$label' has not been defined");
   }
}

sub gls_get_first{
   local($label) = @_;
   local($first) = '';

   if (&gls_entry_defined($label))
   {
      $first = $glsentry{$label}{'first'};
   }
   else
   {
      &write_warnings("gls_get_first: glossary entry '$label' has not been defined");
   }

   $first;
}

sub gls_set_first{
   local($label, $first) = @_;

   if (&gls_entry_defined($label))
   {
      $glsentry{$label}{'first'} = $first;
   }
   else
   {
      &write_warnings("gls_set_first: glossary entry '$label' has not been defined");
   }
}

sub gls_used{
   local($label) = @_;
   local($flag) = 0;

   if (&gls_entry_defined($label))
   {
      $flag = $glsentry{$label}{'flag'};
   }
   else
   {
      &write_warnings("gls_used: glossary entry '$label' has not been defined");
   }

   $flag;
}

sub gls_entry_defined{
   local($label) = @_;

   defined(%{$glsentry{$label}});
}

sub do_cmd_newglossaryentry{
   local($_) = @_;
   local($label,$name,$description,$symbol,$sort,$text,$first,
     $plural,$firstplural,$type,$keyval);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   $keyval = &missing_braces unless
              s/$next_pair_pr_rx/$keyval=$2;''/eo;

   ($name,$keyval) = &get_keyval('name', $keyval);
   ($description,$keyval) = &get_keyval('description', $keyval);
   ($symbol,$keyval) = &get_keyval('symbol', $keyval);
   ($sort,$keyval) = &get_keyval('sort', $keyval);
   ($text,$keyval) = &get_keyval('text', $keyval);
   ($first,$keyval) = &get_keyval('first', $keyval);
   ($firstplural,$keyval) = &get_keyval('firstplural', $keyval);
   ($plural,$keyval) = &get_keyval('plural', $keyval);
   ($type,$keyval) = &get_keyval('type', $keyval);

   if (defined($type))
   {
      $type = &translate_commands($type);
   }
   else
   {
      $type = 'main';
   }

   &gls_entry_init($label, $type, $name, $description);

   &gls_set_symbol($label, defined($symbol)?$symbol:'');

   $sort = "$name $description" unless (defined($sort) and $sort);

   &gls_set_sort($label, $sort);

   $text = $name unless (defined($text) and $text);

   &gls_set_text($label, $text);

   $first = $text unless (defined($first) and $first);

   &gls_set_first($label, $first);

   $plural = "${text}s" unless (defined($plural) and $plural);

   &gls_set_plural($label, $plural);

   $firstplural = "${first}s" unless (defined($firstplural) and $firstplural);

   &gls_set_firstplural($label, $firstplural);

   push @{$gls_entries{$type}}, $label;

   $_;
}

sub reset_entry{
   local($label) = @_;

   $glsentry{$label}{'flag'} = 0;
}

sub unset_entry{
   local($label) = @_;

   $glsentry{$label}{'flag'} = 1;
}

sub do_cmd_glsreset{
   local($_) = @_;
   local($label);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   &reset_entry($label);

   $_;
}

sub do_cmd_glsunset{
   local($_) = @_;
   local($label);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   &unset_entry($label);

   $_;
}

sub do_cmd_ifglsused{
   local($_) = @_;
   local($label,$true,$false);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   $true = &missing_braces unless
              s/$next_pair_pr_rx/$true=$2;''/eo;

   $false = &missing_braces unless
              s/$next_pair_pr_rx/$false=$2;''/eo;

   (&gls_used($label) ? $true : $false) . $_;
}

sub do_cmd_ifglsentryexists{
   local($_) = @_;
   local($label,$true,$false);

   $label = &missing_braces unless
              s/$next_pair_pr_rx/$label=$2;''/eo;

   $true = &missing_braces unless
              s/$next_pair_pr_rx/$true=$2;''/eo;

   $false = &missing_braces unless
              s/$next_pair_pr_rx/$false=$2;''/eo;

   (&gls_entry_defined($label) ? $true : $false) . $_;
}

sub gls_add_entry{
   local($type, $label, $format, $text) = @_;

   local($oldfmt) = $GLSCURRENTFORMAT;

   if (defined($format))
   {
      $format=~s/[\(\)]//;

      if ($format)
      {
         $GLSCURRENTFORMAT=$format;
      }
   }

   $id = ++$global{'max_id'};

   local($str) = &make_real_glossary_entry($label,$text,$type);
   $GLSCURRENTFORMAT = $oldfmt;

   $str;
}

sub do_cmd_glsadd{
   local($_) = @_;
   local($optarg,$pat,$label,$str,$id,$type,$format);
   ($optarg,$pat) = &get_next_optional_argument;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   $type = &gls_get_type($label);

   if (defined $type)
   {
      ($format,$optarg) = &get_keyval('format', $optarg);
      $format='' unless(defined($format));

      &gls_add_entry($type,$label,$format,"");
   }
   else
   {
      &write_warnings("gls_add: glossary entry '$label' undefined");
      $str = '';
   }

   $str . $_;
}

sub do_cmd_glsaddall{
   local($_) = @_;
   local($optarg,$pat) = &get_next_optional_argument;

   local($format,$types);

   ($type,$optarg) = &get_keyval('types', $optarg);

   ($format,$optarg) = &get_keyval('format', $optarg);
   $format='' unless(defined($format));

   local(@types) = keys(%gls_mark);

   if (defined($types))
   {
      @types = split /,/, $types;
   }

   foreach $type (@types)
   {
      # strip leasing and trailing spaces
      $type=~s/^\s*([^\s]+)\s*$/\1/;

      foreach $label (@{$gls_entries{$type}})
      {
         &gls_add_entry($type,$label,$format,"");
      }
   }

   $_;
}

sub do_cmd_glsresetall{
   local($_) = @_;
   local($types,$pat) = &get_next_optional_argument;

   local(@types) = keys(%gls_mark);

   if (defined($types) and $types)
   {
      @types = split /,/, $types;
   }

   foreach $type (@types)
   {
      # strip leasing and trailing spaces
      $type=~s/^\s*([^\s]+)\s*$/\1/;

      foreach $label (@{$gls_entries{$type}})
      {
         &reset_entry($label);
      }
   }

   $_;
}

sub do_cmd_glsunsetall{
   local($_) = @_;
   local($types,$pat) = &get_next_optional_argument;

   local(@types) = keys(%gls_mark);

   if (defined($types) and $types)
   {
      @types = split /,/, $types;
   }

   foreach $type (@types)
   {
      # strip leasing and trailing spaces
      $type=~s/^\s*([^\s]+)\s*$/\1/;

      foreach $label (@{$gls_entries{$type}})
      {
         &reset_entry($label);
      }
   }

   $_;
}

sub make_glslink{
   local($type,$label,$format,$text) = @_;
   local($str) = '';

   if (defined $type)
   {
      $str = &gls_add_entry($type,$label,$format,$text);
   }
   else
   {
      &write_warnings("glossary '$type' undefined");
   }

   $str;
}

sub do_cmd_glslink{
   local($_) = @_;
   local($optarg,$pat,$label,$text,$type,$format,$str);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   $text = &missing_braces unless
             (s/$next_pair_pr_rx/$text=$2;''/eo);

   # v1.01 removed following lines (\glslink doesn't have
   # a final optional argument!
   #local ($space) = '';
   #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}
   #($optarg,$pat) = &get_next_optional_argument;

   $type = &gls_get_type($label);

   #&make_glslink($type, $label, $format, $text).$space . $_;
   &make_glslink($type, $label, $format, $text) . $_;
}

sub do_cmd_glsentrydesc{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_description($label).$_;
}

sub do_cmd_Glsentrydesc{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_description($label)).$_;
}

sub do_cmd_glsentrytext{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_text($label).$_;
}

sub do_cmd_Glsentrytext{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_text($label)).$_;
}

sub do_cmd_glsentryname{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_name($label).$_;
}

sub do_cmd_Glsentryname{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_name($label)).$_;
}

sub do_cmd_glsentryfirst{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_first($label).$_;
}

sub do_cmd_Glsentryfirst{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_first($label)).$_;
}

sub do_cmd_glsentryplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_plural($label).$_;
}

sub do_cmd_Glsentryplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_plural($label)).$_;
}

sub do_cmd_glsentryfirstplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local($text)=$glsentry{$label}{'firstplural'};

   unless (defined($text))
   {
      &write_warnings("glossary entry '$label' has not been defined");
      $text = '';
   }

   "$text$_";
   &gls_get_firstplural($label).$_;
}

sub do_cmd_Glsentryfirstplural{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_firstplural($label)).$_;
}

sub do_cmd_glsentrysymbol{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   &gls_get_symbol($label).$_;
}

sub do_cmd_Glsentrysymbol{
   local($_) = @_;

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   ucfirst(&gls_get_symbol($label)).$_;
}

sub do_cmd_gls{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, $link_text) .$space . $_;
}

sub do_cmd_glspl{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, $link_text) . $space . $_;
}

sub do_cmd_Gls{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_;
}

sub do_cmd_Glspl{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_;
}

sub do_cmd_GLS{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_text($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_first($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, uc($link_text)).$space . $_;
}

sub do_cmd_GLSpl{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = $glsentry{$label}{'type'};

   if (&gls_used($label))
   {
      # entry has already been used

      $text = &gls_get_plural($label);
      $display = &gls_get_display($type);;
   }
   else
   {
      # entry hasn't been used

      $text = &gls_get_firstplural($label);
      $display = &gls_get_displayfirst($type);

      &unset_entry($label);
   }

   local($args) = '';

   local($id) = ++$global{'max_id'};
   $args .= "$OP$id$CP$text$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP";

   $id = ++$global{'max_id'};
   $args .= "$OP$id$CP$insert$OP$id$CP";

   local($link_text) = &translate_commands("$display$args");

   &make_glslink($type, $label, $format, uc($link_text)).$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glstext{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_text($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glstext{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_text($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLStext{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_text($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsname{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_name($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsname{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_name($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSname{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_name($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsfirst{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_first($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsfirst{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_first($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSfirst{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_first($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsfirstplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_firstplural($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsfirstplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_firstplural($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSfirstplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_firstplural($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_plural($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_plural($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSplural{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_plural($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glsdesc{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_description($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glsdesc{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_description($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSdesc{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_description($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_glssymbol{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_symbol($label);

   &make_glslink($type, $label, $format, $text) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_Glssymbol{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_symbol($label);

   &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_;
}

# added 22 Feb 2008
sub do_cmd_GLSsymbol{
   local($_) = @_;
   local($optarg,$pat,$label,$text, $format, $insert);

   ($optarg,$pat) = &get_next_optional_argument;

   ($format,$optarg) = &get_keyval('format', $optarg);

   $label = &missing_braces unless
             (s/$next_pair_pr_rx/$label=$2;''/eo);

   local ($space) = '';
   if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';}

   $insert = '';
   ($insert,$pat) = &get_next_optional_argument;

   local($display) = '';

   local($type) = &gls_get_type($label);

   $text = &gls_get_symbol($label);

   &make_glslink($type, $label, $format, uc($text)) .$space . $_;
}

sub do_cmd_acrshort{
  &do_cmd_glstext(@_)
}

sub do_cmd_Acrshort{
  &do_cmd_Glstext(@_)
}

sub do_cmd_ACRshort{
  &do_cmd_GLStext(@_)
}

sub do_cmd_acrlong{
  &do_cmd_glsdesc(@_)
}

sub do_cmd_Acrlong{
  &do_cmd_Glsdesc(@_)
}

sub do_cmd_ACRlong{
  &do_cmd_GLSdesc(@_)
}

sub do_cmd_acrfull{
  &do_cmd_glsfirst(@_)
}

sub do_cmd_Acrfull{
  &do_cmd_Glsfirst(@_)
}

sub do_cmd_ACRfull{
  &do_cmd_GLSfirst(@_)
}

sub do_cmd_glossarypreamble{
   local($_) = @_;
   $_[0];
}

sub do_cmd_glossarypostamble{
   local($_) = @_;
   $_[0];
}

sub do_cmd_glsnumformat{
   local($_) = @_;

   $_;
}

sub do_cmd_hyperit{
   join('', "\\textit ", $_[0]);
}

sub do_cmd_hyperrm{
   join('', "\\textrm ", $_[0]);
}

sub do_cmd_hypertt{
   join('', "\\texttt ", $_[0]);
}

sub do_cmd_hypersf{
   join('', "\\textsf ", $_[0]);
}

sub do_cmd_hyperbf{
   join('', "\\textbf ", $_[0]);
}

&ignore_commands( <<_IGNORED_CMDS_ );
makeglossary
makeglossaries
glossarystyle {}
_IGNORED_CMDS_

1;
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</glossaries.perl>
%    \end{macrocode}
%\fi
%\Finale
\endinput
