diff options
Diffstat (limited to 'Master/texmf-dist')
24 files changed, 7594 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/README b/Master/texmf-dist/doc/latex/glossaries/README new file mode 100644 index 00000000000..6ec00e14365 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/README @@ -0,0 +1,40 @@ +LaTeX Package : glossaries v 1.0 + +Last Modified : 16 May 2007 + +Author : Nicola Talbot + +This package is provided to assist generating glossaries. +The package supports acronyms and multiple glossaries. +New entries are defined to have a name and description (and +optionally an associated symbol.) Plural forms can also be +specified. New glossary styles can be defined, and preambles +and postambles can be specified. There is provision for loading +a database of terms, only terms used in the text will be added +to the relevant glossary. + +*This package replaces the glossary package which is now obsolete.* + +The package is supplied using the TeX Directory Structure (TDS). +Files in texmf directory should go in the corresponding +$LOCALTEXMF directories. Files in texmf/bin should go in the +relevant binary directory, which should be somewhere on your +operating system's PATH. + +*Remember to refresh TeX's database* + +This package comes with a LaTeX2HTML style file glossaries.perl. +This is located in latex2html/styles and should be placed in +the relevant LaTeX2HTML styles directory, but note that +glossaries.perl only supplies a sub-set of the commands provided +by glossary.sty, so some commands may not be implemented, or +may be implemented in a different way. + +The package and documentation source code is also supplied as a +dtx and ins file located in texmf/source. + +This material is subject to the LaTeX Project Public License. +See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the details of that license. + +http://theoval.cmp.uea.ac.uk/~nlct/ + diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/database1.tex b/Master/texmf-dist/doc/latex/glossaries/doc/database1.tex new file mode 100644 index 00000000000..8a78ad6d785 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/database1.tex @@ -0,0 +1,24 @@ +% 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}} + diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/database2.tex b/Master/texmf-dist/doc/latex/glossaries/doc/database2.tex new file mode 100644 index 00000000000..032b2d2b586 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/database2.tex @@ -0,0 +1,22 @@ +% 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}} + diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/glossaries.pdf b/Master/texmf-dist/doc/latex/glossaries/doc/glossaries.pdf Binary files differnew file mode 100644 index 00000000000..3660f84f9c5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/glossaries.pdf diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sample.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sample.tex new file mode 100644 index 00000000000..516cb248421 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sample.tex @@ -0,0 +1,68 @@ +\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} + +\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. + +\printglossaries + +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex new file mode 100644 index 00000000000..67b78bc4575 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex @@ -0,0 +1,24 @@ +\documentclass[a4paper]{article} + +\usepackage[style=long4colheader]{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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcr.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcr.tex new file mode 100644 index 00000000000..02531ff49a0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcr.tex @@ -0,0 +1,47 @@ +\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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcrDesc.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcrDesc.tex new file mode 100644 index 00000000000..4a54c674943 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcrDesc.tex @@ -0,0 +1,65 @@ +\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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleDB.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleDB.tex new file mode 100644 index 00000000000..7d58e32e2af --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleDB.tex @@ -0,0 +1,19 @@ +\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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleEq.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleEq.tex new file mode 100644 index 00000000000..4fb888c6cb9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleEq.tex @@ -0,0 +1,231 @@ +\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 glossary.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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleEqPg.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleEqPg.tex new file mode 100644 index 00000000000..19531e3897e --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleEqPg.tex @@ -0,0 +1,267 @@ +\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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleNtn.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleNtn.tex new file mode 100644 index 00000000000..04af87e3562 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleNtn.tex @@ -0,0 +1,82 @@ +\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 glossary 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 + +\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} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sampleSec.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sampleSec.tex new file mode 100644 index 00000000000..ccefe8c19e1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/doc/sampleSec.tex @@ -0,0 +1,58 @@ +\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} diff --git a/Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl b/Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl new file mode 100644 index 00000000000..67f04090aa1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl @@ -0,0 +1,1689 @@ +# File : glossaries.perl +# Author : Nicola Talbot +# Date : 16 May 2007 +# Version : 1.0 +# Description : LaTeX2HTML (limited!) implementation of glossaries +# package. Note that not all the glossaries.sty +# macros have been implemented. + +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, $_); + } + + ($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) and $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); + + 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 . $_; +} + +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 . $_; +} + +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 +_IGNORED_CMDS_ + +1; diff --git a/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries b/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries new file mode 100755 index 00000000000..8da802b1791 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries @@ -0,0 +1,210 @@ +#!/usr/bin/perl + +# File : makeglossaries +# Author : Nicola Talbot +# Version : 1.0 (2007/05/10) +# Description: simple Perl script that calls makeindex. +# Intended for use with "glossaries.sty" (saves having to remember +# all the various switches) + +use Getopt::Std; + +if ($#ARGV < 0) +{ + die "Syntax : $0 [-ilqrcg] [-s sty] [-o gls] [-t log] [-p num] <filename>\n"; +} + +getopt('sotp'); +getopts('ilqrcg'); + +# define known extensions + + %exttype = ( + main => {in=>'glo', out=>'gls', 'log'=>'glg'}, + ); + +$ext = ''; + +if (length(@ARGV[0]) < 4) +{ + $name = @ARGV[0]; +} +elsif (substr(@ARGV[0],-4,1) eq ".") +{ + $name = substr(@ARGV[0],0,length(@ARGV[0])-4); + + $ext = substr(@ARGV[0],-3,3); +} +else +{ + $name = @ARGV[0]; +} + +$istfile = "$name.ist"; + +# check log file for other glossary types +# and for ist file name + +if (open AUXFILE, "$name.aux") +{ + while (<AUXFILE>) + { + if (m/\\\@newglossary\s*\{(.*)\}{(.*)}{(.*)}{(.*)}/ + and ($1 ne 'main')) + { + $exttype{$1}{'log'} = $2; + $exttype{$1}{'out'} = $3; + $exttype{$1}{'in'} = $4; + + if (!$opt_q) + { + print "added glossary type '$1' ($2,$3,$4)\n"; + } + } + + if (m/\\\@istfilename\s*{([^}]*)}/) + { + $istfile = $1; + } + } + + close AUXFILE; +} +else +{ + print "unable to open $name.aux\n"; +} + +# save all the general makeindex switches + +$mkidxopts = ''; + +if ($opt_i) +{ + $mkidxopts .= " -i"; +} + +if ($opt_l) +{ + $mkidxopts .= " -l"; +} + +if ($opt_q) +{ + $mkidxopts .= " -q"; +} + +if ($opt_r) +{ + $mkidxopts .= " -r"; +} + +if ($opt_c) +{ + $mkidxopts .= " -c"; +} + +if ($opt_g) +{ + $mkidxopts .= " -g"; +} + +unless ($opt_p eq "") +{ + $mkidxopts .= " -p $opt_p"; +} + +unless ($opt_s eq "") +{ + $istfile = $opt_s; +} + +if ($ext ne '') +{ + %thistype = %{$exttype{'main'}}; #default + + foreach $type (keys %exttype) + { + if ($exttype{$type}{'in'} eq $ext) + { + %thistype = %{$exttype{$type}}; + + last; + } + } + + if ($opt_o eq "") + { + $outfile = "$name.$thistype{out}"; + } + else + { + $outfile = $opt_o; + } + + if ($opt_t eq "") + { + $transcript = "$name.$thistype{'log'}"; + } + else + { + $transcript = $opt_t; + } + + &makeindex("$name.$ext",$outfile,$transcript,$istfile, + $mkidxopts,$opt_q); +} +else +{ + foreach $type (keys %exttype) + { + %thistype = %{$exttype{$type}}; + + $inputfile = "$name.$thistype{in}"; + + if (-r $inputfile) + { + if ($opt_o eq "") + { + $outfile = "$name.$thistype{out}"; + } + else + { + $outfile = $opt_o; + } + + if ($opt_t eq "") + { + $transcript = "$name.$thistype{'log'}"; + } + else + { + $transcript = $opt_t; + } + + &makeindex($inputfile,$outfile,$transcript, + $istfile,$mkidxopts,$opt_q); + } + elsif (!$opt_q) + { + print "no read access for '$inputfile'\n"; + } + } +} + +sub makeindex{ + local($in,$out,$trans,$ist,$rest,$quiet) = @_; + local($name,$cmdstr,$buffer,$n,$i,$j); + local(@stuff,@item); + + $cmdstr = "$rest -s $ist -t $trans -o $out $in"; + + unless ($quiet) + { + print "makeindex $cmdstr\n"; + } + + `makeindex $cmdstr`; +} + +1; diff --git a/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries.bat b/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries.bat new file mode 100755 index 00000000000..64a6a20750c --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries.bat @@ -0,0 +1,3 @@ +@rem = '-*- Perl -*-
+@echo off
+perl -S "%~dp0makeglossaries" %*
diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx new file mode 100644 index 00000000000..c1f5e081b92 --- /dev/null +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -0,0 +1,3413 @@ +%\iffalse +% glossaries.dtx generated using makedtx version 0.91b (c) Nicola Talbot +% Command line args: +% -src "glossaries.sty=>glossaries.sty" +% -src "(glossary-.+)\.(sty)\Z=>\1.\2" +% -doc "manual.tex" +% -author "Nicola Talbot" +% -dir "source" +% glossaries +% Created on 2007/5/16 17:33 +%\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) 2007 Nicola Talbot, all rights reserved. +% \fi +% \iffalse +%<*driver> +\documentclass[a4paper]{ltxdoc} +\usepackage{ifthen} +\usepackage[colorlinks, + bookmarks, + hyperindex=false, + pdfauthor={N.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{2769} +\CodelineNumbered + + +\newcommand{\cmdname}[1]{\texttt{\char`\\#1}} + +\newcommand*{\istkey}[1]{\texttt{#1}\index{makeindex=\texttt{makeindex}>#1=\texttt{#1}|hyperpage}} +\newcommand*{\icmdname}[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=\cmdname{#1} options>#2=\textsf{#2}|hyperpage}} +\newcommand*{\gloskey}[2][newglossaryentry]{\textsf{#2}\igloskey[#1]{#2}} +\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>#1|hyperpage}} +\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles>#1|hyperpage}} +\newcommand*{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}} +\newcommand*{\styname}[1]{\textsf{#1}\index{#1 package=\textsf{#1} package|hyperpage}} +\newcommand*{\envname}[1]{\textsf{#1}} + + +\begin{document} +\DocInput{glossaries.dtx} +\end{document} +%</driver> +%\fi +%\MakeShortVerb{"} +%\DeleteShortVerb{\|} +% +% \title{glossaries.sty v 1.0: \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{16th May 2007} +% \maketitle +%\tableofcontents +% +% \section{Introduction} +% +% \changes{1.0}{2007 May 16}{Initial version} +%The \styname{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, +%define new glossary styles, and multiple glossaries. It +%also supports acronyms, and glossary styles which +%include symbols in addition to a name and description for a +%given glossary entry. 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 \styname{glossary} package which is now +%obsolete. +% +%The \styname{glossaries} package comes with the Perl script +%\appname{makeglossaries} which will run \appname{makeindex} on +%all the glossary files using a customized \appname{makeindex} +%style file (which is created by \icmdname{makeglossaries}). +%The relevant extensions are obtained from the +%auxiliary file, so you only need to 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. +% +%\section{A Quick Guide For The Impatient} +% +%This section is for people who don't have the time or patience to +%read the manual. If you want more detail, you will have to +%read the rest of the manual. +% +%\begin{enumerate} +%\item Load \styname{glossaries} \emph{after} \styname{hyperref}: +%\begin{verbatim} +%\usepackage{hyperref} +%\usepackage{glossaries} +%\end{verbatim} +%Similarly for the \styname{html} package: +%\begin{verbatim} +%\usepackage{html} +%\usepackage{glossaries} +%\end{verbatim} +% +%\item Always use \icmdname{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 \icmdname{makeglossaries}, your glossaries will +%not appear in the document! +% +%\item Use \icmdname{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} +%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 +%\icmdname{newglossary}% +%\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. Example: +%\begin{verbatim} +%\newglossary{notation}{not}{ntn}{Notation} +%\end{verbatim} +%This glossary's label is \texttt{notation} and its title +%will be Notation. +% +%\item Any new glossaries must be defined before +%\cmdname{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 +%\styname{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 \icmdname{glscompositor} +%\emph{before} \icmdname{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 +%\icmdname{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 \icmdname{Gls} and \icmdname{Glspl}): +%\begin{verbatim} +%\newglossaryentry{elite}{name={{\'e}lite}, +%description={select group or class}} +%\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 +%``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 Matrix in the +%glossary, and either matrix or 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 Singular Matrix in +%the glossary, and in the text it appears as singular matrix (SM) +%or singular matrices (SMs) the first time the entry is used, +%and subsequently appears as SM or SMs. +% +%\item The quick and easy way to define an acronym is to use:\par +%\icmdname{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 \icmdname{acronymtype} varies depending on whether +%the glossary package option \pkgopt{acronym} is used or not. +%The optional argument \meta{key-val list} can be used to +%override any of the \icmdname{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 \icmdname{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 +%\styname{glossary-list} package place the entry name in +%the optional argument to \icmdname{item}, so they will +%appear in bold, unless you redefine \icmdname{glsnamefont}. +% +%\item In the document use \icmdname{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 \icmdname{Gls}\marg{label} : like \cmdname{gls}, +%but with first letter in upper case +%\item \icmdname{GLS}\marg{label} : like \cmdname{gls}, +%but all upper case. +%\item \icmdname{glspl}\marg{label} : use plural +%\item \icmdname{Glspl}\marg{label} : use plural with +%first letter in upper case +%\item \icmdname{GLSpl}\marg{label} : use plural but +%all upper case +%\item \icmdname{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 are not necessarily equal. +%\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 \cmdname{textbf}) but +%it will no longer have a hyperlink (if hyperlinks are enabled.) +% +%\item The \styname{glossaries} package provides commands to +%change the font whilst ensuring that the number remains a +%hyperlink. These are of the form \cmdname{hyper}\meta{xx} and +%are equivalent to the standard font changing commands of the +%form \cmdname{text}\meta{xx}, as well as \icmdname{hyperemph} +%(which uses \icmdname{emph}.) For example: +%\begin{verbatim} +%The primary definition of \glspl[format=hyperbf]{singmtx}. +%\end{verbatim} +% +%\item Entries can be added to the glossary without producing +%any text using \icmdname{glsadd}\marg{label} or +%\icmdname{glsaddall}. +% +%\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 \icmdname{glslink} +%or \icmdname{gls} and related commands, or via \icmdname{glsadd} +%or \icmdname{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]{glossary} +%\end{verbatim} +%or using \icmdname{glossarystyle}\marg{style}. For example: +%\begin{verbatim} +%\glossarystyle{altlist} +%\end{verbatim} +%The predefined glossary styles provided by the \styname{glossaries} +%bundle are detailed 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} +% +% \StopEventually{\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex} +% +% +% +% +%\section{The Code} +%\iffalse +% \begin{macrocode} +%<*glossaries.sty> +% \end{macrocode} +%\fi +% \subsection{Package Definition} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries}[2007/05/16 v1.0 (NLCT)] +% \end{macrocode} +% Required packages: +% \begin{macrocode} +\RequirePackage{ifthen} +\RequirePackage{xkeyval}[2006/11/18] +\RequirePackage{xspace} +% \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} +% +%\DescribeMacro{\@@glossarysec} +% The sectional unit used to start the glossary is stored in +% \cmdname{@@glossarysec}. If chapters are defined, this +% is initialised to \texttt{chapter}, otherwise it is +% initialised to \texttt{section}. +% \begin{macrocode} +\@ifundefined{chapter}{\newcommand*{\@@glossarysec}{section}}{% +\newcommand*{\@@glossarysec}{chapter}} +% \end{macrocode} +% 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 +% \icmdname{glossarysection}. +% \begin{macrocode} +\define@choicekey{glossaries.sty}{section}{part,chapter,section,% +subsection,subsubsection,paragraph,subparagraph}[section]{% +\renewcommand*{\@@glossarysec}{#1}} +% \end{macrocode} +% +%\DescribeMacro{\@glossary@default@style} +% The default glossary style is stored in +% \cmdname{@glossary@default@style}. This is initialised to +% \texttt{list}. (The \glostyle{list} style is +% defined in the accompanying \styname{glossary-list} package +% described in \autoref{sec:styles}.) +% \begin{macrocode} +\newcommand*{\@glossary@default@style}{list} +% \end{macrocode} +% 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: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'': +%\DescribeMacro{\glossaryentrynumbers} +% \begin{macrocode} +\newcommand*{\glossaryentrynumbers}[1]{#1} +% \end{macrocode} +% Note that the entire number list for a given entry will be +% passed to \cmdname{glossaryentrynumbers} so any font changes +% will also be applied to the delimiters. +% The \pkgopt{nonumberlist} package option suppresses the +% number lists (this simply redefines +% \cmdname{glossaryentrynumbers} to ignores its argument.) +% \begin{macrocode} +\DeclareOptionX{nonumberlist}{% +\renewcommand*{\glossaryentrynumbers}[1]{}} +% \end{macrocode} +% +%\DescribeMacro{\glsdefaulttype} +% 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 +% \icmdname{loadglsentries} can temporarily change +% \cmdname{glsdefaulttype} while it loads a file containing +% new glossary entries (see \autoref{sec:load}). +% \begin{macrocode} +\newcommand{\glsdefaulttype}{main} +% \end{macrocode} +%\DescribeMacro{\acronymtype} +% Keep track of which glossary the acronyms are in. This is +% initialised to \cmdname{glsdefaulttype}, but is changed by +% the \pkgopt{acronym} package option. +% \begin{macrocode} +\newcommand{\acronymtype}{\glsdefaulttype} +% \end{macrocode} +% 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} +% +%\DescribeMacro{\glscounter} +% The default counter associated with the numbers in the glossary +% is stored in \cmdname{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 \icmdname{newglossary} (see +% \autoref{sec:newglos}). +% \begin{macrocode} +\newcommand{\glscounter}{page} +% \end{macrocode} +% The \pkgopt{counter} option changes the default counter. (This +% just redefines \cmdname{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 +% \icmdname{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 \icmdname{glsdisplay} or by using commands like +% \icmdname{glsentrydesc}) you will have to switch off the +% sanitization using the \pkgopt{sanitize} package option, but +% you will then have to use \icmdname{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{macrocode} +\newcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc} +\newcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name} +\newcommand*{\@gls@sanitizesymbol}{\@onelevel@sanitize\@glo@symbol} +% \end{macrocode} +% (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 +% \cmdname{@gls@sanitizedesc} to use \cmdname{@onelevel@sanitize}, +% otherwise \cmdname{@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} +% Process package options: +% \begin{macrocode} +\ProcessOptionsX +% \end{macrocode} +% +% If chapters are defined and the user has requested the +% section counter as a package option, \cmdname{@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 \cmdname{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} +% This section sets up default values that are used by this +% package. Some of the names may already be defined (e.g.\ by +% \styname{babel}) so \cmdname{providecommand} is used. +% +% Main glossary title: +%\DescribeMacro{\glossaryname} +% \begin{macrocode} +\providecommand*{\glossaryname}{Glossary} +% \end{macrocode} +%\DescribeMacro{\acronymname} +% The title for the "acronym" glossary type (which is defined if +% \pkgopt{acronym} package option is used) is given by +% \cmdname{acronymname}. If the \pkgopt{acronym} +% package option is not used, \cmdname{acronymname} won't be used. +% \begin{macrocode} +\providecommand*{\acronymname}{Acronyms} +% \end{macrocode} +% +% 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. +%\DescribeMacro{\entryname} +%\DescribeMacro{\descriptionname} +%\DescribeMacro{\symbolname} +%\DescribeMacro{\pagelistname} +% \begin{macrocode} +\providecommand*{\entryname}{Notation} +\providecommand*{\descriptionname}{Description} +\providecommand*{\symbolname}{Symbol} +\providecommand*{\pagelistname}{Page List} +% \end{macrocode} +% Labels for \appname{makeindex}'s symbol and number groups: +%\DescribeMacro{\glssymbolsgroupname}\DescribeMacro{\glsnumbersgroupname} +% \begin{macrocode} +\providecommand*{\glssymbolsgroupname}{Symbols} +\providecommand*{\glsnumbersgroupname}{Numbers} +% \end{macrocode} +% +%\DescribeMacro{\istfilename} +% The name of the \appname{makeindex} style file is given by +% \cmdname{istfilename}. This file is +% created by \icmdname{writeist} (which is used by +% \icmdname{makeglossaries}) so +% redefining this command will only have an effect if it is +% done \emph{before} the \filetype{ist} file is created. +% \begin{macrocode} +\providecommand*{\istfilename}{\jobname.ist} +% \end{macrocode} +% 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, \cmdname{@istfilename} ignores its argument. +%\DescribeMacro{\@istfilename} +% \begin{macrocode} +\newcommand*{\@istfilename}[1]{} +% \end{macrocode} +% +%\DescribeMacro{\glscompositor} +% This command is the value of the \istkey{page\_compositor} +% \appname{makeindex} key. Again, any redefinition of this command +% must take place \emph{before} \cmdname{writeist} otherwise it +% will have no effect. +% \begin{macrocode} +\newcommand{\glscompositor}{.} +% \end{macrocode} +% (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.) +% +%\DescribeMacro{\glsnumberformat} +% The command \cmdname{glsnumberformat} indicates the default +% format for the page numbers in the glossary. (Note that this +% is not the same as \icmdname{glossaryentrynumbers}, but applies +% to individual numbers or groups of numbers within an entry's +% associated number list.) If hyperlinks are defined, it will use +% \icmdname{glshypernumber}, otherwise it will simply display its +% argument ``as is''. +% \begin{macrocode} +\@ifundefined{hyperlink}{% +\newcommand*{\glsnumberformat}[1]{#1}}{% +\newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\delimN} +% Individual numbers in an entry's associated number list are +% delimited using \cmdname{delimN} (which corresponds to the +% \istkey{delim\_n} \appname{makeindex} keyword.) The default value +% is a comma followed by a space. +% \begin{macrocode} +\newcommand{\delimN}{, } +% \end{macrocode} +%\DescribeMacro{\delimR} +% A range of numbers within an entry's associated number list is +% delimited using \cmdname{delimR} (which corresponds to the +% \istkey{delim\_r} \appname{makeindex} keyword.) The default is +% an en-dash. +% \begin{macrocode} +\newcommand{\delimR}{--} +% \end{macrocode} +% +%\DescribeMacro{\glossarypreamble} +% The glossary preamble is given by \cmdname{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 +% \cmdname{glossarypremable} shouldn't be affected by the glossary +% style. (So if you define your own glossary style, don't have it +% change \cmdname{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 +% \icmdname{printglossary} for each glossary type, instead of +% \icmdname{printglossaries}, and redefine \cmdname{glossarypreamble} +% before each \icmdname{printglossary}. +% \begin{macrocode} +\newcommand*{\glossarypreamble}{} +% \end{macrocode} +% +%\DescribeMacro{\glossarypostamble} +% The glossary postamble is given by \cmdname{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 \icmdname{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{macrocode} +\newcommand*{\glossarypostamble}{} +% \end{macrocode} +% +%\DescribeMacro{\glossarysection} +% The sectioning command that starts a glossary is given by +% \cmdname{glossarysection}. (This does not form part of the +% glossary style, and so should not be changed by a glossary +% style.) If \icmdname{phantomsection} +% is defined, it uses \cmdname{\@p@glossarysection}, otherwise it +% uses \cmdname{@glossarysection}. +% \begin{macrocode} +\newcommand*{\glossarysection}[2][\@gls@title]{% +\def\@gls@title{#2}% +\@ifundefined{phantomsection}{% +\@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}% +} +% \end{macrocode} +% +% The required sectional unit is given by \cmdname{@@glossarysec} +% which was defined by the \pkgopt{section} package option. The +% starred form of the command is chosen. If you want a numbered +% section for the glossary or if you don't want any sectional +% command, you will need to redefine \cmdname{glossarysection}. +% +%\DescribeMacro{\@glossarysection} +%The command \cmdname{@glossarysection} indicates how to start +% the glossary section if \icmdname{phantomsection} is not defined. +% \begin{macrocode} +\newcommand*{\@glossarysection}[2]{% +\csname\@@glossarysec\endcsname*{#2} +\@gls@toc{#1}{\@@glossarysec}} +% \end{macrocode} +% +%\DescribeMacro{\@p@glossarysection} +% As \cmdname{@glossarysection}, but put in +% \icmdname{phantomsection}, and swap where \cmdname{@gls@toc} goes. +% If using chapters do a \cmdname{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{macrocode} +\newcommand*{\@p@glossarysection}[2]{% +\gls@doclearpage +\phantomsection\@gls@toc{#1}{\@@glossarysec}% +\csname\@@glossarysec\endcsname*{#2}} +% \end{macrocode} +% +%\DescribeMacro{\gls@doclearpage} +%The \cmdname{gls@doclearpage} command is used to issue a +% \cmdname{clearpage} (or \cmdname{cleardoublepage}) depending +% on whether the glossary sectional unit is a chapter. If the +% sectional unit is something else, do nothing. +% \begin{macrocode} +\newcommand{\gls@doclearpage}{% +\ifthenelse{\equal{\@@glossarysec}{chapter}}{% +\@ifundefined{cleardoublepage}{\clearpage}{\cleardoublepage}}{}% +} +% \end{macrocode} +% +%\DescribeMacro{\@gls@toc} +% The glossary is added to the table of contents if glstoc flag set. +% If it is set, \cmdname{@gls@toc} will add a line to the +% \filetype{toc} file, otherwise it will do nothing. +% (The first argument to \cmdname{@gls@toc} is the title for the +% table of contents, the second argument is the sectioning type.) +% \begin{macrocode} +\newcommand*{\@gls@toc}[2]{% +\ifglstoc \addcontentsline{toc}{#2}{#1}\fi} +% \end{macrocode} +% +%\subsection{Loops and conditionals} +%\DescribeMacro{\forallglossaries} +% To iterate through all glossaries (or comma-separated list of +% glossary names given in optional argument) use:\\[10pt] +% \cmdname{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{macrocode} +\newcommand*{\forallglossaries}[3][\@glo@types]{% +\@for#2:=#1\do{\ifthenelse{\equal{#2}{}}{}{#3}}} +% \end{macrocode} +% +%\DescribeMacro{\forglsentries} +% To iterate through all entries in a given glossary use:\\[10pt] +%\cmdname{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{macrocode} +\newcommand*{\forglsentries}[3][\glsdefaulttype]{% +\edef\@@glo@list{\csname glolist@#1\endcsname}% +\@for#2:=\@@glo@list\do{% +\ifthenelse{\equal{#2}{}}{}{#3}}} +% \end{macrocode} +% +%\DescribeMacro{\forallglsentries} +% To iterate through all glossary entries over all glossaries listed +% in the optional argument (the default is all glossaries) use:\\[10pt] +% \cmdname{forallglsentries}\oarg{glossary list}\marg{cmd}\marg{code}\\[10pt] +% Within \cmdname{forallglsentries}, the current glossary type +% is given by \cmdname{@@this@glo@}. +% \begin{macrocode} +\newcommand*{\forallglsentries}[3][\@glo@types]{% +\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{% +\forglsentries[\@@this@glo@]{#2}{#3}}} +% \end{macrocode} +% +%\DescribeMacro{\ifglossaryexists} +% To check to see if a glossary exists use:\\[10pt] +%\cmdname{ifglossaryexists}\marg{type}\marg{true-text}\marg{false-text}\\[10pt] +%where \meta{type} is the glossary's label. +% \begin{macrocode} +\newcommand{\ifglossaryexists}[3]{% +\@ifundefined{@glotype@#1@out}{#3}{#2}} +% \end{macrocode} +% +%\DescribeMacro{\ifglsentryexists} +% To check to see if a glossary entry has been defined use:\\[10pt] +% \cmdname{ifglsentryexists}\marg{label}\marg{true text}\marg{false text}\\[10pt] +%where \meta{label} is the entry's label. +% \begin{macrocode} +\newcommand{\ifglsentryexists}[3]{% +\@ifundefined{glo@#1@name}{#3}{#2}} +% \end{macrocode} +% +%\DescribeMacro{\ifglsused} +% To determine if given glossary entry has been +% used in the document text yet use:\\[10pt] +% \cmdname{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{macrocode} +\newcommand*{\ifglsused}[3]{\ifthenelse{\boolean{glo@#1@flag}}{#2}{#3}} +% \end{macrocode} +%The following two commands will cause an error if the given +% condition fails: +% +%\DescribeMacro{\glsdoifexists} +%\cmdname{glsdoifexists}\marg{label}\marg{code}\par +% Generate an error if entry specified by \meta{label} doesn't +% exists, otherwise do \meta{code}. +% \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} +% +%\DescribeMacro{\glsdoifnoexists} +%\cmdname{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{macrocode} +\newcommand{\glsdoifnoexists}[2]{\ifglsentryexists{#1}{% +\PackageError{glossaries}{Glossary entry `#1' has already +been defined.}{}}{#2}} +% \end{macrocode} +% +%\subsection{Defining new glossaries}\label{sec:newglos} +%\DescribeMacro{\@glo@types} +% A comma-separated list of glossary names is stored +% in \cmdname{@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 \icmdname{makeglossaries} and \icmdname{printglossaries}.) +% \begin{macrocode} +\newcommand*{\@glo@types}{,} +% \end{macrocode} +% +%\DescribeMacro{\newglossary} +% A new glossary type is defined using \cmdname{newglossary}. +% Syntax:\\[10pt]\cmdname{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 \icmdname{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 \icmdname{glossary} command), +% \meta{title} is the title of the glossary that is used in +% \icmdname{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{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 +% \cmdname{glsdisplay} and \cmdname{glsdisplayfirst} by +% default). These can be redefined by the user later if required +% (see \icmdname{defglsdisplay} and \icmdname{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 +% \icmdname{glscounter} if no optional argument is present.) +% \begin{macrocode} +\@ifnextchar[{\@gls@setcounter{#2}}{\@gls@setcounter{#2}[\glscounter]}}} +% \end{macrocode} +% Only defined new glossaries in the preamble: +% \begin{macrocode} +\@onlypreamble{\newglossary} +% \end{macrocode} +%\DescribeMacro{\@newglossary} +%\cmdname{@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 \icmdname{newglossary}. +% Since it is not used by \LaTeX, \cmdname{@newglossary} simply +% ignores its arguments. +% \begin{macrocode} +\newcommand*{\@newglossary}[4]{} +% \end{macrocode} +%\DescribeMacro{\@gls@setcounter} +% 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{macrocode} +\def\@gls@setcounter#1[#2]{% +\expandafter\def\csname @glotype@#1@counter\endcsname{#2}% +} +% \end{macrocode} +%\DescribeMacro{\@gls@getcounter} +% Get counter associated with given glossary (the argument is +% the glossary label): +% \begin{macrocode} +\newcommand*{\@gls@getcounter}[1]{% +\csname @glotype@#1@counter\endcsname} +% \end{macrocode} +% +% Define the main glossary. This will be the first glossary to +% be displayed when using \icmdname{printglossaries}. +% \begin{macrocode} +\newglossary{main}{gls}{glo}{\glossaryname} +% \end{macrocode} +% +%\subsection{Defining new entries}\label{sec:newentry} +% New glossary entries are defined using \cmdname{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 +% \icmdname{glsdisplay} and \icmdname{glsdisplayfirst} (or +% using \icmdname{defglsdisplay} and \icmdname{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. \cmdname{@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} +% +% 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 an ``s'' 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 an ``s'' 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 \cmdname{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 +% \icmdname{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 \icmdname{gls}, you will need to change +% \icmdname{glsdisplay} and \icmdname{glsdisplayfirst} (either +% explicitly for all glossaries or via \icmdname{defglsdisplay} +% and \icmdname{defglsdisplayfirst} for individual glossaries.) +% \begin{macrocode} +\define@key{glossentry}{symbol}{% +\def\@glo@symbol{#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} +% +%\DescribeMacro{\newglossaryentry} +% Define \cmdname{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{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. +% \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}{desc key required in +\string\newglossaryentry}{You haven't specified the entry description}}% +\def\@glo@type{\glsdefaulttype}% +\def\@glo@symbol{\relax}% +\def\@glo@text{\@glo@name}% +\def\@glo@plural{\@glo@text s}% +\def\@glo@first{\@glo@text}% +\def\@glo@firstplural{\@glo@plural}% +\def\@glo@sort{\@glo@name\space\@glo@desc}% +\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} +% 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@sort\endcsname{\@glo@sort}% +\@gls@sanitizesymbol +\expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}% +% \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} +% Only defined new glossary entries in the preamble: +% \begin{macrocode} +\@onlypreamble{\newglossaryentry} +% \end{macrocode} +% +%\subsection{Resetting and unsetting entry flags} +% Each glossary entry is assigned a conditional of the form +%\cmdname{ifglo@}\meta{label}\texttt{@flag} which determines +% whether or not the entry has been used (see also +% \icmdname{ifglsused} defined below.) These flags can +% be set and unset using the following macros: +% +%\DescribeMacro{\glsreset} +% The command \cmdname{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{macrocode} +\newcommand*{\glsreset}[1]{% +\glsdoifexists{#1}{% +\expandafter\global\csname glo@#1@flagfalse\endcsname}} +% \end{macrocode} +%\DescribeMacro{\glslocalreset} +% As above, but with only a local effect: +% \begin{macrocode} +\newcommand*{\glslocalreset}[1]{% +\glsdoifexists{#1}{% +\expandafter\let\csname ifglo@#1@flag\endcsname\iffalse}} +% \end{macrocode} +%\DescribeMacro{\glsunset} +% The command \cmdname{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{macrocode} +\newcommand*{\glsunset}[1]{% +\glsdoifexists{#1}{% +\expandafter\global\csname glo@#1@flagtrue\endcsname}} +% \end{macrocode} +%\DescribeMacro{\glslocalunset} +% As above, but with only a local effect: +% \begin{macrocode} +\newcommand*{\glslocalunset}[1]{% +\glsdoifexists{#1}{% +\expandafter\let\csname ifglo@#1@flag\endcsname\iftrue}} +% \end{macrocode} +%\DescribeMacro{\glsresetall} +% Reset all entries for the named glossaries (supplied in a +% comma-separated list). +% Syntax: \cmdname{glsresetall}\oarg{glossary-list} +% \begin{macrocode} +\newcommand*{\glsresetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glsreset{\@glsentry}}} +% \end{macrocode} +%\DescribeMacro{\glslocalresetall} +% As above, but with only a local effect: +% \begin{macrocode} +\newcommand*{\glslocalresetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glslocalreset{\@glsentry}}} +% \end{macrocode} +%\DescribeMacro{\glsunsetall} +% Unset all entries for the named glossaries (supplied in a +% comma-separated list). +% Syntax: \cmdname{glsunsetall}\oarg{glossary-list} +% \begin{macrocode} +\newcommand*{\glsunsetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glsunset{\@glsentry}}} +% \end{macrocode} +%\DescribeMacro{\glslocalunsetall} +% As above, but with only a local effect: +% \begin{macrocode} +\newcommand*{\glslocalunsetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glslocalunset{\@glsentry}}} +% \end{macrocode} +% +% \subsection{Loading files containing glossary entries} +%\label{sec:load} +% Glossary entries can be defined in an external file. +% These external files can contain \icmdname{newglossaryentry} +% and \icmdname{newacronym} commands.\footnote{and any other valid +%\LaTeX\ code that can be used in the preamble.}\\[10pt] +%\DescribeMacro{\loadglsentries} +% \cmdname{loadglsentries}\oarg{type}\marg{filename}\\[10pt] +% This command will input the file using \cmdname{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 +% \icmdname{glslink}, \icmdname{gls}, \icmdname{glspl} and uppercase +% variants or \icmdname{glsadd} and \icmdname{glsaddall} +% will appear in the glossary.) The mandatory argument is +% the filename (with or without .tex extension.) +% \begin{macrocode} +\newcommand*{\loadglsentries}[2][\@gls@default]{% +\let\@gls@default\glsdefaulttype +\def\glsdefaulttype{#1}\input{#2}% +\let\glsdefaulttype\@gls@default} +% \end{macrocode} +% \cmdname{loadglsentries} can only be used in the preamble: +% \begin{macrocode} +\@onlypreamble{\loadglsentries} +% \end{macrocode} +% +%\subsection{Using glossary entries in the text} +% +% Any term that has been defined using \icmdname{newglossaryentry} +% (or \icmdname{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 +% \icmdname{glslink}, the way the term appears in the text is +% determined by \icmdname{glsdisplayfirst} (if it is the first +% time the term has been used) or \icmdname{glsdisplay} (for +% subsequent use.) +% +%\DescribeMacro{\glsdisplayfirst} +% The first time an entry is used, the way in which it is +% displayed is governed by \cmdname{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 \icmdname{gls} and \icmdname{glspl}. +% The default is to display the first parameter followed by the +% additional text. +% \begin{macrocode} +\newcommand*{\glsdisplayfirst}[4]{#1#4} +% \end{macrocode} +% +%\DescribeMacro{\glsdisplay} +% After the first use, the entry is displayed according to +% the format of \cmdname{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 \icmdname{gls} and \icmdname{glspl}. +% \begin{macrocode} +\newcommand*{\glsdisplay}[4]{#1#4} +% \end{macrocode} +% +% When a new glossary is created it uses \cmdname{glsdisplayfirst} +% and \cmdname{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 +% \icmdname{defglsdisplay} and \icmdname{defglsdisplayfirst}. +%\\[10pt] +%\DescribeMacro{\defglsdisplay} +% \cmdname{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 \icmdname{glsdisplay}. +% \begin{macrocode} +\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% +\expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}} +% \end{macrocode} +%\vskip5pt +%\DescribeMacro{\defglsdisplayfirst} +% \cmdname{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 \icmdname{glsdisplayfirst}. +% \begin{macrocode} +\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% +\expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}} +% \end{macrocode} +% +%\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 \cmdname{glslink}, +% the commands like \cmdname{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 +% \icmdname{defglsdisplay} and \icmdname{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 \icmdname{xspace} is used. +% +% 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} +% +%\DescribeMacro{\glslink} +%Syntax:\\[10pt] +% \cmdname{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:\DescribeMacro{\glslink*}\\[10pt] +% \cmdname{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt] +% which is equivalent to +% \cmdname{glslink}"[hyper=false,"\meta{options}"]"\marg{label}\marg{text} +% +% First determine whether or not we are using the starred version: +% \begin{macrocode} +\newcommand{\glslink}{% +\@ifstar\@sgls@link\@gls@link} +% \end{macrocode} +% Define the starred version: +% \begin{macrocode} +\newcommand*{\@sgls@link}[1][]{\@gls@link[hyper=false,#1]} +% \end{macrocode} +% Define the un-starred version: +% \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{\csname the\@gls@counter\endcsname}% +\ifKV@glslink@hyper +\@glslink{glo:#2}{#3}% +\else +#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 +\protected@edef\@glo@numfmt{setentrycounter{\@gls@counter}% +\expandafter\string\csname\@glsnumberformat\endcsname}% +\@gls@checkmkidxchars\@glo@numfmt +\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} +% Catch \appname{makeindex} special characters\mkidxspch: +% \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} +% Update the control sequence and strip trailing \cmdname{@nil}: +% \begin{macrocode} +\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} +% \end{macrocode} +% Replace \verb|"| with \verb|""| since \verb|"| is a makeindex +% special character\mkidxspch. +% \begin{macrocode} +\toksdef\@gls@tmpb=2 +\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} +% 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} +% 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} +% 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} +% 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} +% 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} +% 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} +% 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} +% +%\DescribeMacro{\@glslink}\DescribeMacro{\@glstarget} +% If \icmdname{hyperlink} +% is not defined, \cmdname{@glslink} and \cmdname{@glstarget} +% ignore their first argument, and just do the second argument, +% otherwise they are equivalent to \icmdname{hyperlink} and +%\icmdname{hypertarget}. +% \begin{macrocode} +\@ifundefined{hyperlink}{% +\gdef\@glslink#1#2{#2}\gdef\@glstarget#1#2{#2}% +}{\gdef\@glslink#1#2{\hyperlink{#1}{#2}}% +\gdef\@glstarget#1#2{\hypertarget{#1}{#2}}} +% \end{macrocode} +% +%\DescribeMacro{\glsdisablehyper} +% Glossary hyperlinks can be disabled using \cmdname{glsdisablehyper} +% (effect can be localised): +% \begin{macrocode} +\newcommand{\glsdisablehyper}{% +\renewcommand*\@glslink[2]{##2}% +\renewcommand*\@glstarget[2]{##2}} +% \end{macrocode} +%\DescribeMacro{\glsenablehyper} +% Glossary hyperlinks can be enabled using \cmdname{glsenablehyper} +% (effect can be localised): +% \begin{macrocode} +\newcommand{\glsenablehyper}{% +\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}% +\renewcommand*\@glstarget[2]{\hypertarget{##1}{##2}}} +% \end{macrocode} +% +%\DescribeMacro{\gls} +%Syntax:\\[10pt] +% \cmdname{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 +% \icmdname{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 \icmdname{glsdisplay} and +% \icmdname{glsdisplayfirst}). As with \cmdname{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{macrocode} +\newcommand*{\gls}{\@ifstar\@sgls\@gls} +% \end{macrocode} +% 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][]{% +\@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} +% Determine what the link text should be (this is stored in +% \cmdname{@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 \cmdname{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\@glo@text}% +% \end{macrocode} +% Indicate that this entry has now been used, and add a space if +% appropriate +% \begin{macrocode} +\glsunset{#2}}% +\xspace} +% \end{macrocode} +% +%\DescribeMacro{\Gls} +% \cmdname{Gls} behaves like \cmdname{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{macrocode} +\newcommand*{\Gls}{\@ifstar\@sGls\@Gls} +% \end{macrocode} +% 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][]{% +\@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} +% Determine what the link text should be (this is stored in +% \cmdname{@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 \cmdname{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +% \end{macrocode} +% Indicate that this entry has now been used, and add a space if +% appropriate +% \begin{macrocode} +\glsunset{#2}}% +\xspace} +% \end{macrocode} +% +%\DescribeMacro{\GLS} +% \cmdname{GLS} behaves like \icmdname{gls}, but the link +% text is converted to uppercase: +% \begin{macrocode} +\newcommand*{\GLS}{\@ifstar\@sGLS\@GLS} +% \end{macrocode} +% 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][]{% +\@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} +% Determine what the link text should be (this is stored in +% \cmdname{@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 \cmdname{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +% \end{macrocode} +% Indicate that this entry has now been used, and add a space if +% appropriate +% \begin{macrocode} +\glsunset{#2}}% +\xspace} +% \end{macrocode} +% +%\DescribeMacro{\glspl} +% \cmdname{glspl} behaves in the same way as \icmdname{gls} except +% it uses the plural form. +% \begin{macrocode} +\newcommand*{\glspl}{\@ifstar\@sglspl\@glspl} +% \end{macrocode} +% 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][]{% +\@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} +% Determine what the link text should be (this is stored in +% \cmdname{@glo@text}) +% \begin{macrocode} +\ifglsused{#2}{\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @displayfirst\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +% \end{macrocode} +% Call \cmdname{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\@glo@text}% +% \end{macrocode} +% Indicate that this entry has now been used, and add a space if +% appropriate +% \begin{macrocode} +\glsunset{#2}}% +\xspace} +% \end{macrocode} +% +%\DescribeMacro{\Glspl} +% \cmdname{Glspl} behaves in the same way as \icmdname{glspl}, except +% that the first letter of the link text is converted to uppercase +% (as with \icmdname{Gls}, if the first letter has an accent, it +% will need to be grouped.) +% \begin{macrocode} +\newcommand*{\Glspl}{\@ifstar\@sGlspl\@Glspl} +% \end{macrocode} +% 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][]{% +\@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} +% Determine what the link text should be (this is stored in +% \cmdname{@glo@text}) +% \begin{macrocode} +\ifglsused{#2}{\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @displayfirst\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +% \end{macrocode} +% Call \cmdname{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +% \end{macrocode} +% Indicate that this entry has now been used, and add a space if +% appropriate +% \begin{macrocode} +\glsunset{#2}}% +\xspace} +% \end{macrocode} +% +%\DescribeMacro{\GLSpl} +% \cmdname{GLSpl} behaves like \icmdname{glspl} except that all the +% link text is converted to uppercase. +% \begin{macrocode} +\newcommand*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl} +% \end{macrocode} +% 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][]{% +\@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} +% Determine what the link text should be (this is stored in +% \cmdname{@glo@text}) +% \begin{macrocode} +\ifglsused{#2}{\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @displayfirst\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +% \end{macrocode} +% Call \cmdname{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +% \end{macrocode} +% Indicate that this entry has now been used, and add a space if +% appropriate +% \begin{macrocode} +\glsunset{#2}}% +\xspace} +% \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. +% +%\DescribeMacro{\glsentryname}\DescribeMacro{\Glsentryname} +% 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 contained +% any commands. +% \begin{macrocode} +\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} +\newcommand*{\Glsentryname}[1]{\expandafter +\MakeUppercase\csname glo@#1@name\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentrydesc}\DescribeMacro{\Glsentrydesc} +% 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{macrocode} +\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname} +\newcommand*{\Glsentrydesc}[1]{\expandafter +\MakeUppercase\csname glo@#1@desc\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentrytext}\DescribeMacro{\Glsentrytext} +% 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{macrocode} +\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname} +\newcommand*{\Glsentrytext}[1]{\expandafter +\MakeUppercase\csname glo@#1@text\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentryplural}\DescribeMacro{\Glsentryplural} +% Get the plural form: +% \begin{macrocode} +\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname} +\newcommand*{\Glsentryplural}[1]{\expandafter +\MakeUppercase\csname glo@#1@plural\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentrysymbol}\DescribeMacro{\Glsentrysymbol} +% 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{macrocode} +\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname} +\newcommand*{\Glsentrysymbol}[1]{\expandafter +\MakeUppercase\csname glo@#1@symbol\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentryfirst}\DescribeMacro{\Glsentryfirst} +% 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{macrocode} +\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} +\newcommand*{\Glsentryfirst}[1]{\expandafter +\MakeUppercase\csname glo@#1@first\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentryfirstplural}\DescribeMacro{\Glsentryfirstplural} +% Get the plural form (as specified by the \gloskey{firstplural} +% key when the entry was defined.) +% \begin{macrocode} +\newcommand*{\glsentryfirstplural}[1]{% +\csname glo@#1@firstpl\endcsname} +\newcommand*{\Glsentryfirstplural}[1]{% +\expandafter\MakeUppercase\csname glo@#1@firstpl\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentrytype} +% Display the glossary type with which this entry is associated +% (as specified by the \gloskey{type} key used when the entry was +% defined) +% \begin{macrocode} +\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname} +% \end{macrocode} +% +%\DescribeMacro{\glsentrysort} +% 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{macrocode} +\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname} +% \end{macrocode} +% +%\subsection{Adding an entry to the glossary without generating +% text} +% The following keys are provided for \cmdname{glsadd} and +% \cmdname{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 \cmdname{glsaddall}: +% \begin{macrocode} +\define@key{glossadd}{types}{\def\@glo@type{#1}} +% \end{macrocode} +%\vskip5pt +%\DescribeMacro{\glsadd} +%\cmdname{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{macrocode} +\newcommand*{\glsadd}[2][]{% +\glsdoifexists{#2}{% +\def\@glo@format{glsnumberformat}% +\edef\@glo@counter{\csname glo@#2@counter\endcsname}% +\setkeys{glossadd}{#1}% +\edef\theglsentrycounter{\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 +\protected@edef\@glo@numfmt{setentrycounter{\@glo@counter}% +\expandafter\string\csname\@glo@format\endcsname}% +\@gls@checkmkidxchars\@glo@numfmt +\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} +%\vskip5pt +%\DescribeMacro{\glsaddall} +%\cmdname{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{macrocode} +\newcommand*{\glsaddall}[1][]{% +\def\@glo@type{\@glo@types}% +\setkeys{glossadd}{#1}% +\forallglsentries[\@glo@type]{\@glo@entry}{% +\glsadd[#1]{\@glo@entry}}% +} +% \end{macrocode} +% +%\subsection{Creating associated files} +%\DescribeMacro{\writeist} +% The \cmdname{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 \cmdname{@gls@actualchar}, +% \cmdname{@gls@encapchar}, \cmdname{@glsl@levelchar} and +% \cmdname{@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 \icmdname{glssymbolsgroupname} replaces \texttt{glssymbols} +% and \icmdname{glsnumbersgroupname} replaces \texttt{glsnumbers}) +% using the command \icmdname{glsgetgrouptitle} which is +% defined in \styname{glossary-hypernav}. This is done to prevent +% any problem characters in \icmdname{glssymbolsgroupname} +% and \icmdname{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}. +% \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} +% +%\DescribeMacro{\noist} +%The command \cmdname{noist} will suppress the creation of +% the \filetype{ist} file (it simply redefines +% \cmdname{writeist} to do nothing.) Obviously you need to use this +% command before \cmdname{writeist} to have any effect. Since +% the \filetype{ist} file should only be created once, \cmdname{noist} +% is called at the end of \cmdname{writeist}. +% \begin{macrocode} +\newcommand{\noist}{\let\writeist\relax} +% \end{macrocode} +% +%\DescribeMacro{\@makeglossary} +% \cmdname{@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 \icmdname{newglossary} +% (and it will also activate the \icmdname{glossary} command, +% and create the customized \filetype{ist} \appname{makeindex} +% style file.) +% +% Note that you can't use \cmdname{@makeglossary} for only some of the +% defined glossaries. You either need to have a \cmdname{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 \cmdname{@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} +% +%\DescribeMacro{\makeglossaries} +% \cmdname{makeglossaries} will use \cmdname{@makeglossary} +% for each glossary type that has been defined. New glossaries +% need to be defined before using \cmdname{makeglossary}, so +% have \cmdname{makeglossaries} redefine \cmdname{newglossary} +% to prevent it being used afterwards. +% \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} +% +%\DescribeMacro{\makeglossary} +% The \cmdname{makeglossary} command is redefined to be +% identical to \cmdname{makeglossaries}. (This is done to +% reinforce the message that you must either use +% \cmdname{@makeglossary} for all the glossaries or for none +% of them.) +% \begin{macrocode} +\let\makeglossary\makeglossaries +% \end{macrocode} +% +%\subsection{Writing information to associated files} +%\DescribeMacro{\glossary} +% The \cmdname{glossary} command is redefined so that it takes an +% optional argument \meta{type} to specify the glossary type (use +% \cmdname{glsdefaulttype} glossary by default). +% This shouldn't be used at user level +% as \cmdname{glslink} sets the correct format. The associated +% number should be stored in \cmdname{theglsentrycounter} +% before using \cmdname{glossary}. +% \begin{macrocode} +\renewcommand*{\glossary}[1][\glsdefaulttype]{% +\@glossary[#1]} +% \end{macrocode} +% +%\DescribeMacro{\@glossary} +% Define internal \cmdname{@glossary} to ignore its argument. +% This gets redefined in \cmdname{@makeglossary}. +% \begin{macrocode} +\def\@glossary[#1]{\@bsphack\begingroup\@sanitize\@index} +% \end{macrocode} +%\DescribeMacro{@gls@renewglossary} +% This is a convenience command to set \cmdname{@glossary}. +% It is used by \cmdname{@makeglossary} and then redefined to +% do nothing, as it only needs to be done once. +% \begin{macrocode} +\newcommand{\@gls@renewglossary}{% +\gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}% +\let\@gls@renewglossary\@empty +} +% \end{macrocode} +%\DescribeMacro{\@wrglossary} +% The \cmdname{@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 \cmdname{glslink}.) +% \begin{macrocode} +\renewcommand*{\@wrglossary}[2]{% +\expandafter\protected@write\csname glo@#1@file\endcsname{}{% +\string\glossaryentry{#2}{\theglsentrycounter}}\endgroup\@esphack} +% \end{macrocode} +% +% \subsection{Displaying the glossary}\label{sec:printglos} +%\DescribeMacro{\printglossary} +% An individual glossary is displayed in the text using +% \cmdname{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{macrocode} +\newcommand*{\printglossary}[1][type=\glsdefaulttype]{% +\def\@glo@type{\glsdefaulttype}% +\def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% +\def\glossarytoctitle{\glossarytitle}% +\def\@glossarystyle{}% +\setkeys{printgloss}{#1}% +\bgroup +\@glossarystyle +\makeatletter +\@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% +\egroup +} +% \end{macrocode} +% +%\DescribeMacro{\printglossaries} +% This command will do \cmdname{printglossary} +% for each glossary type that has been defined. It is better +% to use \cmdname{printglossaries} rather than individual +% \cmdname{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 \cmdname{printglossary} explicitly for each +% glossary type. +% \begin{macrocode} +\newcommand*{\printglossaries}{% +\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}} +% \end{macrocode} +% The keys that can be used in the optional argument to +% \icmdname{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 \icmdname{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} +% +%\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} +% +%\DescribeMacro{\glossaryheader} +% The glossary header is given by \cmdname{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 \cmdname{glossaryheader} to do nothing. +% \begin{macrocode} +\newcommand*{\glossaryheader}{} +% \end{macrocode} +%\vskip5pt +%\DescribeMacro{\glossaryentryfield} +% \cmdname{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{macrocode} +\newcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:#1}{#2} #4 #3. #5\par} +% \end{macrocode} +% +%\DescribeMacro{\glsgroupskip} +% 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 \cmdname{glsgroupskip} +% specifies what to do between glossary groups. Glossary styles +% must redefine this command. (Note that \cmdname{glsgroupskip} +% only occurs between groups, not at the start or end of the +% glossary.) +% \begin{macrocode} +\newcommand*{\glsgroupskip}{} +% \end{macrocode} +% +%\DescribeMacro{\glsgroupheading} +% Each of the 28 glossary groups described above is preceded by a +% group heading. +% This is formatted by the command \cmdname{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, +% \cmdname{glsgroupheading} comes immediately after \cmdname{glsgroupskip}.) +% \begin{macrocode} +\newcommand*{\glsgroupheading}[1]{} +% \end{macrocode} +% It is therefore 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 \cmdname{glsgetgrouptitle} +% and \cmdname{glsgetgrouplabel} so that the label is translated +% into the required title (and vice-versa.) +%\\[10pt] +%\DescribeMacro{\glsgetgrouptitle} +%\cmdname{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 +% \icmdname{glssymbolsgroupname}, the group labelled +% \texttt{glsnumbers} produces \icmdname{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{macrocode} +\newcommand*{\glsgetgrouptitle}[1]{% +\@ifundefined{#1groupname}{#1}{\csname #1groupname\endcsname}} +% \end{macrocode} +%\vskip5pt +%\DescribeMacro{\glsgetgrouplabel} +%\cmdname{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 \cmdname{glsgetgrouptitle}, you +% will also need to redefine \cmdname{glsgetgrouplabel}. +% \begin{macrocode} +\newcommand*{\glsgetgrouplabel}[1]{% +\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{% +\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} +% \end{macrocode} +% +%\DescribeMacro{\setentrycounter} +% The command \cmdname{setentrycounter} sets the entry's +% associated counter (required by +% \cmdname{glshypernumber} etc.) \icmdname{glslink} and +% \icmdname{glsadd} encode the +% \icmdname{glossary} argument so that the relevant counter is +% set prior to the formatting command. +% \begin{macrocode} +\newcommand*{\setentrycounter}[1]{\def\glsentrycounter{#1}} +% \end{macrocode} +% +%\DescribeMacro{\glossarystyle} +% The current glossary style can be set using +% \cmdname{glossarystyle}\marg{style}. +% \begin{macrocode} +\newcommand*{\glossarystyle}[1]{% +\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary +style `#1' undefined}{}}{% +\csname @glsstyle@#1\endcsname}} +% \end{macrocode} +% +%\DescribeMacro{\newglossarystyle} +% New glossary styles can be defined using:\\[10pt] +% \cmdname{newglossarystyle}\marg{name}\marg{definition}\\[10pt] +% The \meta{definition} argument should redefine +% \envname{theglossary}, \icmdname{glossaryheader}, +% \icmdname{glsgroupheading}, \icmdname{glossaryentryfield} and +% \icmdname{glsgroupskip} (see \autoref{sec:styles} for the +% definitions of predefined styles.) Glossary styles should not +% redefine \icmdname{glossarypreamble} and +% \icmdname{glossarypostamble}, as +% the user should be able to switch between styles without affecting +% the pre- and postambles. +% \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} +% +%\DescribeMacro{\glsnamefont} +% Glossary entries are encoded so that the second argument +% to \icmdname{glossaryentryfield} is always specified as +% \cmdname{glsnamefont}\marg{name}. This allows the +% user to change the font used to display the name term +% without having to redefine \icmdname{glossaryentryfield}. +% The default uses the surrounding font, so in the list type +% styles (which place the name in the optional argument to +% \icmdname{item}) the name will appear in bold. +% \begin{macrocode} +\newcommand*{\glsnamefont}[1]{#1} +% \end{macrocode} +% +%\DescribeMacro{\glshypernumber} +% 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 \icmdname{glslink}. +% The default format is given by \cmdname{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 +% \icmdname{delimR}, the number lists are delimited with +% \icmdname{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 \styname{hyperref} package does this with the +% \icmdname{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 +% \styname{hyperref} package. +% \begin{macrocode} +\@ifundefined{hyperlink}{% +\def\glshypernumber#1{#1}}{% +\def\glshypernumber#1{% +\@delimR#1\delimR\delimR\\}} +% \end{macrocode} +%\DescribeMacro{@delimR} +% \cmdname{@delimR} displays a range of numbers for the counter +% whose name is given by +% \cmdname{@gls@counter} (which must be set prior to using +% \cmdname{glshypernumber}.) +% \begin{macrocode} +\def\@delimR#1\delimR #2\delimR #3\\{% +\ifx\\#2\\% + \@delimN{#1}% +\else + \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% +\fi} +% \end{macrocode} +%\DescribeMacro{\@delimN} +% \cmdname{@delimN} displays a list of individual numbers, +% instead of a range: +% \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} +% The following code is modified from hyperref's +% \cmdname{HyInd@pagelink} where +% the name of the counter being used is given by +% \cmdname{@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. +%\DescribeMacro{\hyperrm} +% \begin{macrocode} +\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hypersf} +% \begin{macrocode} +\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hypertt} +% \begin{macrocode} +\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hyperbf} +% \begin{macrocode} +\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hypermd} +% \begin{macrocode} +\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hyperit} +% \begin{macrocode} +\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hypersl} +% \begin{macrocode} +\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hyperup} +% \begin{macrocode} +\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hypersc} +% \begin{macrocode} +\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} +% \end{macrocode} +%\DescribeMacro{\hyperemph} +% \begin{macrocode} +\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} +% \end{macrocode} +% +%\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 \icmdname{acronymtype} is set to the name of this new glossary. +% \begin{macrocode} +\renewcommand{\acronymtype}{acronym} +% \end{macrocode} +% In the event that the user redefines \icmdname{glsdisplay} +% and \icmdname{glsdisplayfirst}, the relevant commands for +% the new acronym glossary are set to match the format +% given by \icmdname{newacronym}. If you redefine +% \icmdname{newacronym} you may need to set these to something +% else. +% \begin{macrocode} +\defglsdisplay[acronym]{#1#4}\defglsdisplayfirst[acronym]{#1#4} +\fi +% \end{macrocode} +%\vskip5pt +%\DescribeMacro{\newacronym} +% \cmdname{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 \icmdname{newglossaryentry} with the appropriate +% values. It sets the +% glossary type to \icmdname{acronymtype} which will be +% "acronym" if the package option \pkgopt{acronym} has +% been used, otherwise it will be the default glossary. +% Since \cmdname{newacronym} merely calls \icmdname{newglossaryentry}, +% the acronym is treated like any other glossary entry. +% +% If you prefer a different format, you +% can redefine \cmdname{newacronym} as required. The optional +% argument can be used to override any of the settings. +% \begin{macrocode} +\newcommand{\newacronym}[4][]{% +\newglossaryentry{#2}{type=\acronymtype, +name={#3},description={#4},text={#3}, +first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} +% \end{macrocode} +% New acronyms can only be defined in the preamble: +% \begin{macrocode} +\@onlypreamble{\newacronym} +% \end{macrocode} +% +% \subsection{Predefined Styles}\label{sec:styles} +% The \styname{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 \icmdname{glossarystyle}. +% \begin{macrocode} +\glossarystyle{\@glossary@default@style} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +%</glossaries.sty> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-hypernav.sty> +% \end{macrocode} +%\fi +% \subsubsection{Glossary hyper-navigation definitions (glossary-hypernav package)} +% Package Definition: +% \begin{macrocode} +\ProvidesPackage{glossary-hypernav}[2007/05/16 v1.0 (NLCT)] +% \end{macrocode} +% +% The commands defined in this package are provided to +% help navigate around the groups within a glossary +% (see \autoref{sec:printglos}.) +% \icmdname{printglossary} (and \icmdname{printglossaries}) +% set \cmdname{@glo@type} to the label of the current +% glossary. This is used to create a unique hypertarget in +% the event of multiple glossaries. +%\\[10pt] +%\DescribeMacro{\glsnavhyperlink} +% \cmdname{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{macrocode} +\@ifundefined{hyperlink}{% +\newcommand*{\glsnavhyperlink}[3][]{#3}}{% +\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% +\edef\gls@grplabel{#2}\edef\@gls@grptitle{#3}% +\hyperlink{glsn:#1@#2}{#3}}} +% \end{macrocode} +%\vskip5pt +%\DescribeMacro{\glsnavhypertarget} +% \cmdname{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{macrocode} +\@ifundefined{hypertarget}{% +\newcommand*{\glsnavhypertarget}[3][]{#3}}{% +\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% +\hypertarget{glsn:#1@#2}{#3}}} +% \end{macrocode} +% +%\DescribeMacro{\glsnavigation} +% The \cmdname{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{macrocode} +\newcommand*{\glsnavigation}{% +\glssymbolnav +\glsnavhyperlink{A}{\glsgetgrouptitle{A}} \textbar\ +\glsnavhyperlink{B}{\glsgetgrouptitle{B}} \textbar\ +\glsnavhyperlink{C}{\glsgetgrouptitle{C}} \textbar\ +\glsnavhyperlink{D}{\glsgetgrouptitle{D}} \textbar\ +\glsnavhyperlink{E}{\glsgetgrouptitle{E}} \textbar\ +\glsnavhyperlink{F}{\glsgetgrouptitle{F}} \textbar\ +\glsnavhyperlink{G}{\glsgetgrouptitle{G}} \textbar\ +\glsnavhyperlink{H}{\glsgetgrouptitle{H}} \textbar\ +\glsnavhyperlink{I}{\glsgetgrouptitle{I}} \textbar\ +\glsnavhyperlink{J}{\glsgetgrouptitle{J}} \textbar\ +\glsnavhyperlink{K}{\glsgetgrouptitle{K}} \textbar\ +\glsnavhyperlink{L}{\glsgetgrouptitle{L}} \textbar\ +\glsnavhyperlink{M}{\glsgetgrouptitle{M}} \textbar\ +\glsnavhyperlink{N}{\glsgetgrouptitle{N}} \textbar\ +\glsnavhyperlink{O}{\glsgetgrouptitle{O}} \textbar\ +\glsnavhyperlink{P}{\glsgetgrouptitle{P}} \textbar\ +\glsnavhyperlink{Q}{\glsgetgrouptitle{Q}} \textbar\ +\glsnavhyperlink{R}{\glsgetgrouptitle{R}} \textbar\ +\glsnavhyperlink{S}{\glsgetgrouptitle{S}} \textbar\ +\glsnavhyperlink{T}{\glsgetgrouptitle{T}} \textbar\ +\glsnavhyperlink{U}{\glsgetgrouptitle{U}} \textbar\ +\glsnavhyperlink{V}{\glsgetgrouptitle{V}} \textbar\ +\glsnavhyperlink{W}{\glsgetgrouptitle{W}} \textbar\ +\glsnavhyperlink{X}{\glsgetgrouptitle{X}} \textbar\ +\glsnavhyperlink{Y}{\glsgetgrouptitle{Y}} \textbar\ +\glsnavhyperlink{Z}{\glsgetgrouptitle{Z}}} +% \end{macrocode} +%\DescribeMacro{\glssymbolnav} +% The \cmdname{glssymbolnav} produces a simple navigation set of +% links for just the symbol and number groups. This is used at +% the start of \cmdname{glsnavigation}. If your glossary doesn't +% contain any symbol or navigation groups, you can redefine this +% command to do nothing. +% \begin{macrocode} +\newcommand*{\glssymbolnav}{% +\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}} \textbar\ +\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}} \textbar\ +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +%</glossary-hypernav.sty> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-list.sty> +% \end{macrocode} +%\fi +% \subsubsection{List Style (glossary-list package)} +% The \styname{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 +% \icmdname{item} command, it will appear in a bold font by +% default. +% \begin{macrocode} +\ProvidesPackage{glossary-list}[2007/05/16 v1.0 (NLCT)] +% \end{macrocode} +% The \glostyle{list} glossary style +% uses the \envname{description} environment. The group separator +% \icmdname{glsgroupskip} is redefined as \cmdname{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 \styname{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. ##5}% +\renewcommand*{\glsgroupskip}{\indexspace}} +% \end{macrocode} +% The \glostyle{listgroup} style is like the \glostyle{list} +% style, but the glossary groups have headings. +% \begin{macrocode} +\newglossarystyle{listgroup}{% +\glossarystyle{list}% +\renewcommand*{\glsgroupheading}[1]{\item[##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. ##5}% +} +% \end{macrocode} +% The \glostyle{altlistgroup} glossary style is like the +% \glostyle{altlist} style, but the glossary groups have headings. +% \begin{macrocode} +\newglossarystyle{altlistgroup}{% +\glossarystyle{altlist}% +\renewcommand*{\glsgroupheading}[1]{\item[##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} +%\iffalse +% \begin{macrocode} +%</glossary-list.sty> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-long.sty> +% \end{macrocode} +%\fi +% \subsubsection{Glossary Styles using longtable (the glossary-long +% package)} +% The glossary styles defined in the \styname{glossary-long} package +% used the \envname{longtable} environment in the glossary. +% \begin{macrocode} +\ProvidesPackage{glossary-long}[2007/05/16 v1.0 (NLCT)] +% \end{macrocode} +% Requires the \styname{longtable} package: +% \begin{macrocode} +\RequirePackage{longtable} +% \end{macrocode} +%\DescribeMacro{\glsdescwidth} +% This is a length that governs the width of the description column. +% \begin{macrocode} +\newlength\glsdescwidth +% \end{macrocode} +%\DescribeMacro{\glspagelistwidth} +% This is a length that governs the width of the page list column. +% \begin{macrocode} +\newlength\glspagelistwidth +% \end{macrocode} +% 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. ##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 +% \subsubsection{Glossary Styles using supertabular environment (glossary-super package)} +% The glossary styles defined in the \styname{glossary-super} package +% use the \envname{supertabular} environment. +% \begin{macrocode} +\ProvidesPackage{glossary-super}[2007/05/16 v1.0 (NLCT)] +% \end{macrocode} +% Requires the \styname{supertabular} package: +% \begin{macrocode} +\RequirePackage{supertabular} +% \end{macrocode} +% The \glostyle{super} glossary style uses the +% \envname{supertabular} environment +% (it uses lengths defined in the \styname{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. ##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 +%\Finale +\endinput diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins new file mode 100644 index 00000000000..7af4cbdb771 --- /dev/null +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.ins @@ -0,0 +1,27 @@ +% glossaries.ins generated using makedtx version 0.91b 2007/5/16 17:33 +\input docstrip + +\preamble +Copyright (C) 2007 Nicola Talbot, all rights reserved. +If you modify this file, you must change its name first. +You are NOT ALLOWED to distribute this file alone. You are NOT +ALLOWED to take money for the distribution or use of either this +file or a changed version, except for a nominal charge for copying +etc. +\endpreamble + +\askforoverwritefalse + +\generate{\file{glossaries.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries.sty,package}} +\file{glossary-long.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-long.sty,package}} +\file{glossary-super.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-super.sty,package}} +\file{glossary-hypernav.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-hypernav.sty,package}} +\file{glossary-list.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-list.sty,package}} +} + +\endbatchfile diff --git a/Master/texmf-dist/tex/latex/glossaries/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/glossaries.sty new file mode 100644 index 00000000000..8d0023a00f3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/glossaries.sty @@ -0,0 +1,865 @@ +%% +%% This is file `glossaries.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries.sty,package') +%% Copyright (C) 2007 Nicola Talbot, all rights reserved. +%% If you modify this file, you must change its name first. +%% You are NOT ALLOWED to distribute this file alone. You are NOT +%% ALLOWED to take money for the distribution or use of either this +%% file or a changed version, except for a nominal charge for copying +%% etc. +%% \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 \~} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries}[2007/05/16 v1.0 (NLCT)] +\RequirePackage{ifthen} +\RequirePackage{xkeyval}[2006/11/18] +\RequirePackage{xspace} +\define@boolkey{glossaries.sty}[gls]{toc}[true]{} +\@ifundefined{chapter}{\newcommand*{\@@glossarysec}{section}}{% +\newcommand*{\@@glossarysec}{chapter}} +\define@choicekey{glossaries.sty}{section}{part,chapter,section,% +subsection,subsubsection,paragraph,subparagraph}[section]{% +\renewcommand*{\@@glossarysec}{#1}} +\newcommand*{\@glossary@default@style}{list} +\define@key{glossaries.sty}{style}{% +\renewcommand*{\@glossary@default@style}{#1}} +\newcommand*{\glossaryentrynumbers}[1]{#1} +\DeclareOptionX{nonumberlist}{% +\renewcommand*{\glossaryentrynumbers}[1]{}} +\newcommand{\glsdefaulttype}{main} +\newcommand{\acronymtype}{\glsdefaulttype} +\define@boolkey{glossaries.sty}[gls]{acronym}[true]{} +\newcommand{\glscounter}{page} +\define@key{glossaries.sty}{counter}{% +\renewcommand*{\glscounter}{#1}} +\newcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc} +\newcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name} +\newcommand*{\@gls@sanitizesymbol}{\@onelevel@sanitize\@glo@symbol} +\define@boolkey[gls]{sanitize}{description}[true]{% +\ifgls@sanitize@description + \renewcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}% +\else + \renewcommand*{\@gls@sanitizedesc}{}% +\fi +} +\define@boolkey[gls]{sanitize}{name}[true]{% +\ifgls@sanitize@name + \renewcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}% +\else + \renewcommand*{\@gls@sanitizename}{}% +\fi} +\define@boolkey[gls]{sanitize}{symbol}[true]{% +\ifgls@sanitize@symbol + \renewcommand*{\@gls@sanitizesymbol}{% +\@onelevel@sanitize\@glo@symbol}% +\else + \renewcommand*{\@gls@sanitizesymbol}{}% +\fi} +\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}}% +} +\ProcessOptionsX +\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}{}}}}}{} +\providecommand*{\glossaryname}{Glossary} +\providecommand*{\acronymname}{Acronyms} +\providecommand*{\entryname}{Notation} +\providecommand*{\descriptionname}{Description} +\providecommand*{\symbolname}{Symbol} +\providecommand*{\pagelistname}{Page List} +\providecommand*{\glssymbolsgroupname}{Symbols} +\providecommand*{\glsnumbersgroupname}{Numbers} +\providecommand*{\istfilename}{\jobname.ist} +\newcommand*{\@istfilename}[1]{} +\newcommand{\glscompositor}{.} +\@ifundefined{hyperlink}{% +\newcommand*{\glsnumberformat}[1]{#1}}{% +\newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}} +\newcommand{\delimN}{, } +\newcommand{\delimR}{--} +\newcommand*{\glossarypreamble}{} +\newcommand*{\glossarypostamble}{} +\newcommand*{\glossarysection}[2][\@gls@title]{% +\def\@gls@title{#2}% +\@ifundefined{phantomsection}{% +\@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}% +} +\newcommand*{\@glossarysection}[2]{% +\csname\@@glossarysec\endcsname*{#2} +\@gls@toc{#1}{\@@glossarysec}} +\newcommand*{\@p@glossarysection}[2]{% +\gls@doclearpage +\phantomsection\@gls@toc{#1}{\@@glossarysec}% +\csname\@@glossarysec\endcsname*{#2}} +\newcommand{\gls@doclearpage}{% +\ifthenelse{\equal{\@@glossarysec}{chapter}}{% +\@ifundefined{cleardoublepage}{\clearpage}{\cleardoublepage}}{}% +} +\newcommand*{\@gls@toc}[2]{% +\ifglstoc \addcontentsline{toc}{#2}{#1}\fi} +\newcommand*{\forallglossaries}[3][\@glo@types]{% +\@for#2:=#1\do{\ifthenelse{\equal{#2}{}}{}{#3}}} +\newcommand*{\forglsentries}[3][\glsdefaulttype]{% +\edef\@@glo@list{\csname glolist@#1\endcsname}% +\@for#2:=\@@glo@list\do{% +\ifthenelse{\equal{#2}{}}{}{#3}}} +\newcommand*{\forallglsentries}[3][\@glo@types]{% +\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{% +\forglsentries[\@@this@glo@]{#2}{#3}}} +\newcommand{\ifglossaryexists}[3]{% +\@ifundefined{@glotype@#1@out}{#3}{#2}} +\newcommand{\ifglsentryexists}[3]{% +\@ifundefined{glo@#1@name}{#3}{#2}} +\newcommand*{\ifglsused}[3]{\ifthenelse{\boolean{glo@#1@flag}}{#2}{#3}} +\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.}}} +\newcommand{\glsdoifnoexists}[2]{\ifglsentryexists{#1}{% +\PackageError{glossaries}{Glossary entry `#1' has already +been defined.}{}}{#2}} +\newcommand*{\@glo@types}{,} +\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}% +}{% +\toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}% +\expandafter\gdef\csname glolist@#2\endcsname{,}% +\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}}% +\expandafter\gdef\csname gls@#2@display\endcsname{% +\glsdisplay}% +\expandafter\gdef\csname gls@#2@displayfirst\endcsname{% +\glsdisplayfirst}% +\@ifnextchar[{\@gls@setcounter{#2}}{\@gls@setcounter{#2}[\glscounter]}}} +\@onlypreamble{\newglossary} +\newcommand*{\@newglossary}[4]{} +\def\@gls@setcounter#1[#2]{% +\expandafter\def\csname @glotype@#1@counter\endcsname{#2}% +} +\newcommand*{\@gls@getcounter}[1]{% +\csname @glotype@#1@counter\endcsname} +\newglossary{main}{gls}{glo}{\glossaryname} +\define@key{glossentry}{name}{% +\def\@glo@name{#1}% +} +\define@key{glossentry}{description}{% +\def\@glo@desc{#1}% +} +\define@key{glossentry}{sort}{% +\def\@glo@sort{#1}% +\@onelevel@sanitize\@glo@sort} +\define@key{glossentry}{text}{% +\def\@glo@text{#1}% +} +\define@key{glossentry}{plural}{% +\def\@glo@plural{#1}% +} +\define@key{glossentry}{first}{% +\def\@glo@first{#1}% +} +\define@key{glossentry}{firstplural}{% +\def\@glo@firstplural{#1}% +} +\define@key{glossentry}{symbol}{% +\def\@glo@symbol{#1}% +} +\define@key{glossentry}{type}{% +\def\@glo@type{#1}} +\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}}} +\DeclareRobustCommand{\newglossaryentry}[2]{% +\glsdoifnoexists{#1}{% +\def\@glo@name{\PackageError{glossaries}{name key required in +\string\newglossaryentry}{You haven't specified the entry name}}% +\def\@glo@desc{\PackageError{glossaries}{desc key required in +\string\newglossaryentry}{You haven't specified the entry description}}% +\def\@glo@type{\glsdefaulttype}% +\def\@glo@symbol{\relax}% +\def\@glo@text{\@glo@name}% +\def\@glo@plural{\@glo@text s}% +\def\@glo@first{\@glo@text}% +\def\@glo@firstplural{\@glo@plural}% +\def\@glo@sort{\@glo@name\space\@glo@desc}% +\def\@glo@counter{\@gls@getcounter{\@glo@type}}% +\setkeys{glossentry}{#2}% +\@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},}% +}% +\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@sort\endcsname{\@glo@sort}% +\@gls@sanitizesymbol +\expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}% +\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 +}} +\@onlypreamble{\newglossaryentry} +\newcommand*{\glsreset}[1]{% +\glsdoifexists{#1}{% +\expandafter\global\csname glo@#1@flagfalse\endcsname}} +\newcommand*{\glslocalreset}[1]{% +\glsdoifexists{#1}{% +\expandafter\let\csname ifglo@#1@flag\endcsname\iffalse}} +\newcommand*{\glsunset}[1]{% +\glsdoifexists{#1}{% +\expandafter\global\csname glo@#1@flagtrue\endcsname}} +\newcommand*{\glslocalunset}[1]{% +\glsdoifexists{#1}{% +\expandafter\let\csname ifglo@#1@flag\endcsname\iftrue}} +\newcommand*{\glsresetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glsreset{\@glsentry}}} +\newcommand*{\glslocalresetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glslocalreset{\@glsentry}}} +\newcommand*{\glsunsetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glsunset{\@glsentry}}} +\newcommand*{\glslocalunsetall}[1][\@glo@types]{% +\forallglsentries[#1]{\@glsentry}{% +\glslocalunset{\@glsentry}}} +\newcommand*{\loadglsentries}[2][\@gls@default]{% +\let\@gls@default\glsdefaulttype +\def\glsdefaulttype{#1}\input{#2}% +\let\glsdefaulttype\@gls@default} +\@onlypreamble{\loadglsentries} +\newcommand*{\glsdisplayfirst}[4]{#1#4} +\newcommand*{\glsdisplay}[4]{#1#4} +\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% +\expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}} +\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% +\expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}} +\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}}} +\define@key{glslink}{format}{% +\def\@glsnumberformat{#1}} +\define@boolkey{glslink}{hyper}[true]{} +\newcommand{\glslink}{% +\@ifstar\@sgls@link\@gls@link} +\newcommand*{\@sgls@link}[1][]{\@gls@link[hyper=false,#1]} +\newcommand*{\@gls@link}[3][]{% +\glsdoifexists{#2}{% +\def\@glsnumberformat{glsnumberformat}% +\edef\@gls@counter{\csname glo@#2@counter\endcsname}% +\KV@glslink@hypertrue +\setkeys{glslink}{#1}% +\edef\theglsentrycounter{\csname the\@gls@counter\endcsname}% +\ifKV@glslink@hyper +\@glslink{glo:#2}{#3}% +\else +#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 +\protected@edef\@glo@numfmt{setentrycounter{\@gls@counter}% +\expandafter\string\csname\@glsnumberformat\endcsname}% +\@gls@checkmkidxchars\@glo@numfmt +\glossary[\csname glo@#2@type\endcsname]{% +\@glo@sort\@gls@actualchar +\string\glossaryentryfield{#2}{\@glo@name}{\@glo@desc +}{\@glo@symbol}\@gls@encapchar\@glo@numfmt}% +}} +\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}% +} +\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} +\toksdef\@gls@tmpb=2 +\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} +\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} +\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} +\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} +\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} +\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} +\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} +\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} +\@ifundefined{hyperlink}{% +\gdef\@glslink#1#2{#2}\gdef\@glstarget#1#2{#2}% +}{\gdef\@glslink#1#2{\hyperlink{#1}{#2}}% +\gdef\@glstarget#1#2{\hypertarget{#1}{#2}}} +\newcommand{\glsdisablehyper}{% +\renewcommand*\@glslink[2]{##2}% +\renewcommand*\@glstarget[2]{##2}} +\newcommand{\glsenablehyper}{% +\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}% +\renewcommand*\@glstarget[2]{\hypertarget{##1}{##2}}} +\newcommand*{\gls}{\@ifstar\@sgls\@gls} +\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]} +\newcommand*{\@gls}[2][]{% +\@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}} +\def\@gls@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\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}}}% +\@gls@link[#1]{#2}{\@glo@text}% +\glsunset{#2}}% +\xspace} +\newcommand*{\Gls}{\@ifstar\@sGls\@Gls} +\newcommand*{\@sGls}[1][]{\@Gls[hyper=false,#1]} +\newcommand*{\@Gls}[2][]{% +\@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}} +\def\@Gls@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\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}}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\glsunset{#2}}% +\xspace} +\newcommand*{\GLS}{\@ifstar\@sGLS\@GLS} +\newcommand*{\@sGLS}[1][]{\@GLS[hyper=false,#1]} +\newcommand*{\@GLS}[2][]{% +\@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}} +\def\@GLS@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\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}}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +\glsunset{#2}}% +\xspace} +\newcommand*{\glspl}{\@ifstar\@sglspl\@glspl} +\newcommand*{\@sglspl}[1][]{\@glspl[hyper=false,#1]} +\newcommand*{\@glspl}[2][]{% +\@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}} +\def\@glspl@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\ifglsused{#2}{\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @displayfirst\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +\@gls@link[#1]{#2}{\@glo@text}% +\glsunset{#2}}% +\xspace} +\newcommand*{\Glspl}{\@ifstar\@sGlspl\@Glspl} +\newcommand*{\@sGlspl}[1][]{\@Glspl[hyper=false,#1]} +\newcommand*{\@Glspl}[2][]{% +\@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}} +\def\@Glspl@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\ifglsused{#2}{\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @displayfirst\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\glsunset{#2}}% +\xspace} +\newcommand*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl} +\newcommand*{\@sGLSpl}[1][]{\@GLSpl[hyper=false,#1]} +\newcommand*{\@GLSpl}[2][]{% +\@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}} +\def\@GLSpl@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\ifglsused{#2}{\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @displayfirst\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +\glsunset{#2}}% +\xspace} +\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} +\newcommand*{\Glsentryname}[1]{\expandafter +\MakeUppercase\csname glo@#1@name\endcsname} +\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname} +\newcommand*{\Glsentrydesc}[1]{\expandafter +\MakeUppercase\csname glo@#1@desc\endcsname} +\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname} +\newcommand*{\Glsentrytext}[1]{\expandafter +\MakeUppercase\csname glo@#1@text\endcsname} +\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname} +\newcommand*{\Glsentryplural}[1]{\expandafter +\MakeUppercase\csname glo@#1@plural\endcsname} +\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname} +\newcommand*{\Glsentrysymbol}[1]{\expandafter +\MakeUppercase\csname glo@#1@symbol\endcsname} +\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} +\newcommand*{\Glsentryfirst}[1]{\expandafter +\MakeUppercase\csname glo@#1@first\endcsname} +\newcommand*{\glsentryfirstplural}[1]{% +\csname glo@#1@firstpl\endcsname} +\newcommand*{\Glsentryfirstplural}[1]{% +\expandafter\MakeUppercase\csname glo@#1@firstpl\endcsname} +\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname} +\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname} +\define@key{glossadd}{counter}{\def\@glo@counter{#1}} +\define@key{glossadd}{format}{\def\@glo@format{#1}} +\define@key{glossadd}{types}{\def\@glo@type{#1}} +\newcommand*{\glsadd}[2][]{% +\glsdoifexists{#2}{% +\def\@glo@format{glsnumberformat}% +\edef\@glo@counter{\csname glo@#2@counter\endcsname}% +\setkeys{glossadd}{#1}% +\edef\theglsentrycounter{\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 +\protected@edef\@glo@numfmt{setentrycounter{\@glo@counter}% +\expandafter\string\csname\@glo@format\endcsname}% +\@gls@checkmkidxchars\@glo@numfmt +\glossary[\csname glo@#2@type\endcsname]{% +\@glo@sort\@gls@actualchar\string\glossaryentryfield +{#2}{\@glo@name}{\@glo@desc}{\@glo@symbol}\@gls@encapchar +\@glo@numfmt}% +}} +\newcommand*{\glsaddall}[1][]{% +\def\@glo@type{\@glo@types}% +\setkeys{glossadd}{#1}% +\forallglsentries[\@glo@type]{\@glo@entry}{% +\glsadd[#1]{\@glo@entry}}% +} +\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 +\newcommand{\noist}{\let\writeist\relax} +\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}}} +\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} +\let\makeglossary\makeglossaries +\renewcommand*{\glossary}[1][\glsdefaulttype]{% +\@glossary[#1]} +\def\@glossary[#1]{\@bsphack\begingroup\@sanitize\@index} +\newcommand{\@gls@renewglossary}{% +\gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}% +\let\@gls@renewglossary\@empty +} +\renewcommand*{\@wrglossary}[2]{% +\expandafter\protected@write\csname glo@#1@file\endcsname{}{% +\string\glossaryentry{#2}{\theglsentrycounter}}\endgroup\@esphack} +\newcommand*{\printglossary}[1][type=\glsdefaulttype]{% +\def\@glo@type{\glsdefaulttype}% +\def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% +\def\glossarytoctitle{\glossarytitle}% +\def\@glossarystyle{}% +\setkeys{printgloss}{#1}% +\bgroup +\@glossarystyle +\makeatletter +\@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% +\egroup +} +\newcommand*{\printglossaries}{% +\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}} +\define@key{printgloss}{type}{\def\@glo@type{#1}} +\define@key{printgloss}{title}{\def\glossarytitle{#1}} +\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}} +\define@key{printgloss}{style}{% +\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary +style `#1' undefined}{}}{% +\def\@glossarystyle{\csname @glsstyle@#1\endcsname}}} +\@ifundefined{theglossary}{% +\newenvironment{theglossary}{}{}}{% +\PackageWarning{glossaries}{overriding `theglossary' environment}% +\renewenvironment{theglossary}{}{}} +\newcommand*{\glossaryheader}{} +\newcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:#1}{#2} #4 #3. #5\par} +\newcommand*{\glsgroupskip}{} +\newcommand*{\glsgroupheading}[1]{} +\newcommand*{\glsgetgrouptitle}[1]{% +\@ifundefined{#1groupname}{#1}{\csname #1groupname\endcsname}} +\newcommand*{\glsgetgrouplabel}[1]{% +\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{% +\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} +\newcommand*{\setentrycounter}[1]{\def\glsentrycounter{#1}} +\newcommand*{\glossarystyle}[1]{% +\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary +style `#1' undefined}{}}{% +\csname @glsstyle@#1\endcsname}} +\newcommand*{\newglossarystyle}[2]{% +\@ifundefined{@glsstyle@#1}{% +\expandafter\def\csname @glsstyle@#1\endcsname{#2}}{% +\PackageError{glossaries}{Glossary style `#1' is already defined}{}}} +\newcommand*{\glsnamefont}[1]{#1} +\@ifundefined{hyperlink}{% +\def\glshypernumber#1{#1}}{% +\def\glshypernumber#1{% +\@delimR#1\delimR\delimR\\}} +\def\@delimR#1\delimR #2\delimR #3\\{% +\ifx\\#2\\% + \@delimN{#1}% +\else + \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% +\fi} +\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 +} +\def\@gls@numberlink#1{% +\begingroup + \toks@={}% + \@gls@removespaces#1 \@nil +\endgroup} +\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} +\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} +\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} +\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} +\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} +\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} +\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} +\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} +\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} +\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} +\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} +\ifglsacronym +\newglossary[alg]{acronym}{acr}{acn}{\acronymname} +\renewcommand{\acronymtype}{acronym} +\defglsdisplay[acronym]{#1#4}\defglsdisplayfirst[acronym]{#1#4} +\fi +\newcommand{\newacronym}[4][]{% +\newglossaryentry{#2}{type=\acronymtype, +name={#3},description={#4},text={#3}, +first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} +\@onlypreamble{\newacronym} +\RequirePackage{glossary-hypernav} +\RequirePackage{glossary-list} +\RequirePackage{glossary-long} +\RequirePackage{glossary-super} +\glossarystyle{\@glossary@default@style} +\endinput +%% +%% End of file `glossaries.sty'. diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty new file mode 100644 index 00000000000..3b61b9c3880 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty @@ -0,0 +1,73 @@ +%% +%% This is file `glossary-hypernav.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossary-hypernav.sty,package') +%% Copyright (C) 2007 Nicola Talbot, all rights reserved. +%% If you modify this file, you must change its name first. +%% You are NOT ALLOWED to distribute this file alone. You are NOT +%% ALLOWED to take money for the distribution or use of either this +%% file or a changed version, except for a nominal charge for copying +%% etc. +%% \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 \~} +\ProvidesPackage{glossary-hypernav}[2007/05/16 v1.0 (NLCT)] +\@ifundefined{hyperlink}{% +\newcommand*{\glsnavhyperlink}[3][]{#3}}{% +\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% +\edef\gls@grplabel{#2}\edef\@gls@grptitle{#3}% +\hyperlink{glsn:#1@#2}{#3}}} +\@ifundefined{hypertarget}{% +\newcommand*{\glsnavhypertarget}[3][]{#3}}{% +\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% +\hypertarget{glsn:#1@#2}{#3}}} +\newcommand*{\glsnavigation}{% +\glssymbolnav +\glsnavhyperlink{A}{\glsgetgrouptitle{A}} \textbar\ +\glsnavhyperlink{B}{\glsgetgrouptitle{B}} \textbar\ +\glsnavhyperlink{C}{\glsgetgrouptitle{C}} \textbar\ +\glsnavhyperlink{D}{\glsgetgrouptitle{D}} \textbar\ +\glsnavhyperlink{E}{\glsgetgrouptitle{E}} \textbar\ +\glsnavhyperlink{F}{\glsgetgrouptitle{F}} \textbar\ +\glsnavhyperlink{G}{\glsgetgrouptitle{G}} \textbar\ +\glsnavhyperlink{H}{\glsgetgrouptitle{H}} \textbar\ +\glsnavhyperlink{I}{\glsgetgrouptitle{I}} \textbar\ +\glsnavhyperlink{J}{\glsgetgrouptitle{J}} \textbar\ +\glsnavhyperlink{K}{\glsgetgrouptitle{K}} \textbar\ +\glsnavhyperlink{L}{\glsgetgrouptitle{L}} \textbar\ +\glsnavhyperlink{M}{\glsgetgrouptitle{M}} \textbar\ +\glsnavhyperlink{N}{\glsgetgrouptitle{N}} \textbar\ +\glsnavhyperlink{O}{\glsgetgrouptitle{O}} \textbar\ +\glsnavhyperlink{P}{\glsgetgrouptitle{P}} \textbar\ +\glsnavhyperlink{Q}{\glsgetgrouptitle{Q}} \textbar\ +\glsnavhyperlink{R}{\glsgetgrouptitle{R}} \textbar\ +\glsnavhyperlink{S}{\glsgetgrouptitle{S}} \textbar\ +\glsnavhyperlink{T}{\glsgetgrouptitle{T}} \textbar\ +\glsnavhyperlink{U}{\glsgetgrouptitle{U}} \textbar\ +\glsnavhyperlink{V}{\glsgetgrouptitle{V}} \textbar\ +\glsnavhyperlink{W}{\glsgetgrouptitle{W}} \textbar\ +\glsnavhyperlink{X}{\glsgetgrouptitle{X}} \textbar\ +\glsnavhyperlink{Y}{\glsgetgrouptitle{Y}} \textbar\ +\glsnavhyperlink{Z}{\glsgetgrouptitle{Z}}} +\newcommand*{\glssymbolnav}{% +\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}} \textbar\ +\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}} \textbar\ +} +\endinput +%% +%% End of file `glossary-hypernav.sty'. diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty new file mode 100644 index 00000000000..f175c92300f --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty @@ -0,0 +1,62 @@ +%% +%% This is file `glossary-list.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossary-list.sty,package') +%% Copyright (C) 2007 Nicola Talbot, all rights reserved. +%% If you modify this file, you must change its name first. +%% You are NOT ALLOWED to distribute this file alone. You are NOT +%% ALLOWED to take money for the distribution or use of either this +%% file or a changed version, except for a nominal charge for copying +%% etc. +%% \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 \~} +\ProvidesPackage{glossary-list}[2007/05/16 v1.0 (NLCT)] +\newglossarystyle{list}{% +\renewenvironment{theglossary}{\begin{description}}{\end{description}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\item[\@glstarget{glo:##1}{##2}] ##3. ##5}% +\renewcommand*{\glsgroupskip}{\indexspace}} +\newglossarystyle{listgroup}{% +\glossarystyle{list}% +\renewcommand*{\glsgroupheading}[1]{\item[##1]}} +\newglossarystyle{listhypergroup}{% +\glossarystyle{list}% +\renewcommand*{\glossaryheader}{% +\item[]\glsnavigation}% +\renewcommand*{\glsgroupheading}[1]{% +\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +\newglossarystyle{altlist}{% +\glossarystyle{list}% +\renewcommand*{\glossaryentryfield}[5]{% +\item[\@glstarget{glo:##1}{##2}]\mbox{}\newline ##3. ##5}% +} +\newglossarystyle{altlistgroup}{% +\glossarystyle{altlist}% +\renewcommand*{\glsgroupheading}[1]{\item[##1]}} +\newglossarystyle{altlisthypergroup}{% +\glossarystyle{altlist}% +\renewcommand*{\glossaryheader}{% +\item[]\glsnavigation}% +\renewcommand*{\glsgroupheading}[1]{% +\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +\endinput +%% +%% End of file `glossary-list.sty'. diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-long.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-long.sty new file mode 100644 index 00000000000..0800c24419d --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-long.sty @@ -0,0 +1,124 @@ +%% +%% This is file `glossary-long.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossary-long.sty,package') +%% Copyright (C) 2007 Nicola Talbot, all rights reserved. +%% If you modify this file, you must change its name first. +%% You are NOT ALLOWED to distribute this file alone. You are NOT +%% ALLOWED to take money for the distribution or use of either this +%% file or a changed version, except for a nominal charge for copying +%% etc. +%% \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 \~} +\ProvidesPackage{glossary-long}[2007/05/16 v1.0 (NLCT)] +\RequirePackage{longtable} +\newlength\glsdescwidth +\newlength\glspagelistwidth +\setlength{\glsdescwidth}{0.6\linewidth} +\setlength{\glspagelistwidth}{0.1\linewidth} +\newglossarystyle{long}{% +\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3. ##5\\}% +\renewcommand*{\glsgroupskip}{ & \\}} +\newglossarystyle{longborder}{% +\glossarystyle{long}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% +\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{longheader}{% +\glossarystyle{long}% +\renewcommand*{\glossaryheader}{% +\bfseries \entryname & \bfseries \descriptionname\\ +\endhead}} +\newglossarystyle{longheaderborder}{% +\glossarystyle{longborder}% +\renewcommand*{\glossaryheader}{% +\hline\bfseries \entryname & \bfseries \descriptionname\\\hline +\endhead +\hline\endfoot}} +\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}{ & &\\}} +\newglossarystyle{long3colborder}{% +\glossarystyle{long3col}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\newglossarystyle{long3colheader}{% +\glossarystyle{long3col}% +\renewcommand*{\glossaryheader}{% +\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\\endhead}% +} +\newglossarystyle{long3colheaderborder}{% +\glossarystyle{long3colborder}% +\renewcommand*{\glossaryheader}{% +\hline +\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\\hline\endhead +\hline\endfoot}% +} +\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}{ & & &\\}} +\newglossarystyle{long4colheader}{% +\glossarystyle{long4col}% +\renewcommand*{\glossaryheader}{% +\bfseries\entryname&\bfseries\descriptionname& +\bfseries \symbolname& +\bfseries\pagelistname\\\endhead}% +} +\newglossarystyle{long4colborder}{% +\glossarystyle{long4col}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|l|l|l|}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +\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}% +} +\endinput +%% +%% End of file `glossary-long.sty'. diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty new file mode 100644 index 00000000000..95143f9be2b --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty @@ -0,0 +1,133 @@ +%% +%% This is file `glossary-super.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossary-super.sty,package') +%% Copyright (C) 2007 Nicola Talbot, all rights reserved. +%% If you modify this file, you must change its name first. +%% You are NOT ALLOWED to distribute this file alone. You are NOT +%% ALLOWED to take money for the distribution or use of either this +%% file or a changed version, except for a nominal charge for copying +%% etc. +%% \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 \~} +\ProvidesPackage{glossary-super}[2007/05/16 v1.0 (NLCT)] +\RequirePackage{supertabular} +\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. ##5\\}% +\renewcommand*{\glsgroupskip}{ & \\}} +\newglossarystyle{superborder}{% +\glossarystyle{super}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}% +} +\newglossarystyle{superheader}{% +\glossarystyle{super}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}% +\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}}}{\end{supertabular}}% +} +\newglossarystyle{superheaderborder}{% +\glossarystyle{super}% +\renewenvironment{theglossary}{% +\tablehead{\hline\bfseries \entryname & \bfseries \descriptionname\\\hline}% +\tabletail{\hline} +\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}% +} +\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}{ & &\\}} +\newglossarystyle{super3colborder}{% +\glossarystyle{super3col}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% +\end{supertabular}}% +} +\newglossarystyle{super3colheader}{% +\glossarystyle{super3col}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\}\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}{% +\end{supertabular}}% +} +\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}}% +} +\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}{ & & &\\}} +\newglossarystyle{super4colheader}{% +\glossarystyle{super4col}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries\entryname&\bfseries\descriptionname& +\bfseries\symbolname & +\bfseries\pagelistname\\}\tabletail{}% +\begin{supertabular}{llll}}{% +\end{supertabular}}% +} +\newglossarystyle{super4colborder}{% +\glossarystyle{super4col}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|l|l|l|}}{% +\end{supertabular}}% +} +\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}}% +} +\endinput +%% +%% End of file `glossary-super.sty'. diff --git a/Master/texmf-dist/tpm/glossaries.tpm b/Master/texmf-dist/tpm/glossaries.tpm new file mode 100644 index 00000000000..3b8b357b5cb --- /dev/null +++ b/Master/texmf-dist/tpm/glossaries.tpm @@ -0,0 +1,48 @@ +<!DOCTYPE rdf:RDF SYSTEM "../../support/tpm.dtd"> +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:TPM="http://texlive.dante.de/"> + <rdf:Description about="http://texlive.dante.de/texlive/Package/glossaries.zip"> + <TPM:Name>glossaries</TPM:Name> + <TPM:Type>Package</TPM:Type> + <TPM:Date>2007/05/16 16:42:48</TPM:Date> + <TPM:Version></TPM:Version> + <TPM:Creator>karl</TPM:Creator> + <TPM:Title>The glossaries package.</TPM:Title> + <TPM:Description></TPM:Description> + <TPM:Author></TPM:Author> + <TPM:Size>631316</TPM:Size> + <TPM:License></TPM:License> + <TPM:Build/> + <TPM:RunFiles size="49940"> +texmf-dist/tex/latex/glossaries/glossaries.sty +texmf-dist/tex/latex/glossaries/glossary-hypernav.sty +texmf-dist/tex/latex/glossaries/glossary-list.sty +texmf-dist/tex/latex/glossaries/glossary-long.sty +texmf-dist/tex/latex/glossaries/glossary-super.sty +texmf-dist/tpm/glossaries.tpm + </TPM:RunFiles> + <TPM:DocFiles size="452234"> +texmf-dist/doc/latex/glossaries/README +texmf-dist/doc/latex/glossaries/doc/database1.tex +texmf-dist/doc/latex/glossaries/doc/database2.tex +texmf-dist/doc/latex/glossaries/doc/glossaries.pdf +texmf-dist/doc/latex/glossaries/doc/sample.tex +texmf-dist/doc/latex/glossaries/doc/sample4col.tex +texmf-dist/doc/latex/glossaries/doc/sampleAcr.tex +texmf-dist/doc/latex/glossaries/doc/sampleAcrDesc.tex +texmf-dist/doc/latex/glossaries/doc/sampleDB.tex +texmf-dist/doc/latex/glossaries/doc/sampleEq.tex +texmf-dist/doc/latex/glossaries/doc/sampleEqPg.tex +texmf-dist/doc/latex/glossaries/doc/sampleNtn.tex +texmf-dist/doc/latex/glossaries/doc/sampleSec.tex +texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl +texmf-dist/doc/latex/glossaries/scripts/makeglossaries +texmf-dist/doc/latex/glossaries/scripts/makeglossaries.bat + </TPM:DocFiles> + <TPM:SourceFiles size="131174"> +texmf-dist/source/latex/glossaries/glossaries.dtx +texmf-dist/source/latex/glossaries/glossaries.ins + </TPM:SourceFiles> + <TPM:Provides>Package/glossaries</TPM:Provides> + </rdf:Description> +</rdf:RDF> + |