From 65df837d29600b7980f1e49aa2bcee6da454bae0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 7 Mar 2008 19:18:57 +0000 Subject: glossaries update, including makeglossaries.bat in bin/win32 (4mar08) git-svn-id: svn://tug.org/texlive/trunk@6879 c570f23f-e606-0410-a88d-b1316a301751 --- Master/bin/win32/makeglossaries.bat | 3 + Master/texmf-dist/doc/latex/glossaries/CHANGES | 89 + Master/texmf-dist/doc/latex/glossaries/INSTALL | 107 + Master/texmf-dist/doc/latex/glossaries/README | 84 +- Master/texmf-dist/doc/latex/glossaries/doc/CHANGES | 37 - .../doc/latex/glossaries/doc/database1.tex | 24 - .../doc/latex/glossaries/doc/database2.tex | 22 - .../doc/latex/glossaries/doc/glossaries.pdf | Bin 500567 -> 0 bytes .../latex/glossaries/doc/glossary2glossaries.html | 746 -- .../latex/glossaries/doc/glossary2glossaries.pdf | Bin 158711 -> 0 bytes .../texmf-dist/doc/latex/glossaries/doc/sample.tex | 75 - .../doc/latex/glossaries/doc/sample4col.tex | 24 - .../doc/latex/glossaries/doc/sampleAcr.tex | 49 - .../doc/latex/glossaries/doc/sampleAcrDesc.tex | 65 - .../doc/latex/glossaries/doc/sampleDB.tex | 19 - .../doc/latex/glossaries/doc/sampleEq.tex | 231 - .../doc/latex/glossaries/doc/sampleEqPg.tex | 267 - .../doc/latex/glossaries/doc/sampleNtn.tex | 82 - .../doc/latex/glossaries/doc/sampleSec.tex | 58 - .../doc/latex/glossaries/glossaries-manual.html | 3270 +++++++ .../doc/latex/glossaries/glossaries-manual.tex | 1947 ++++ .../texmf-dist/doc/latex/glossaries/glossaries.pdf | Bin 0 -> 452641 bytes .../doc/latex/glossaries/glossaries.perl | 1713 ---- .../doc/latex/glossaries/glossary2glossaries.html | 764 ++ .../doc/latex/glossaries/glossary2glossaries.pdf | Bin 0 -> 170241 bytes .../doc/latex/glossaries/glossary2glossaries.tex | 529 ++ .../latex/glossaries/latex2html/glossaries.perl | 1713 ---- .../doc/latex/glossaries/samples/database1.tex | 24 + .../doc/latex/glossaries/samples/database2.tex | 22 + .../doc/latex/glossaries/samples/minimalgls.tex | 39 + .../doc/latex/glossaries/samples/sample.tex | 75 + .../doc/latex/glossaries/samples/sample4col.tex | 24 + .../doc/latex/glossaries/samples/sampleAcr.tex | 49 + .../doc/latex/glossaries/samples/sampleAcrDesc.tex | 65 + .../doc/latex/glossaries/samples/sampleDB.tex | 19 + .../doc/latex/glossaries/samples/sampleEq.tex | 231 + .../doc/latex/glossaries/samples/sampleEqPg.tex | 267 + .../doc/latex/glossaries/samples/sampleNtn.tex | 85 + .../doc/latex/glossaries/samples/sampleSec.tex | 58 + .../doc/latex/glossaries/scripts/makeglossaries | 229 - .../latex/glossaries/scripts/makeglossaries.bat | 3 - .../texmf-dist/scripts/glossaries/makeglossaries | 284 + .../scripts/glossaries/makeglossaries.bat | 3 + .../source/latex/glossaries/glossaries.dtx | 9605 ++++++++++++++------ .../source/latex/glossaries/glossaries.ins | 50 +- .../source/latex/glossaries/glossaries.perl | 2322 +++++ .../dict/glossaries-dictionary-Danish.dict | 52 + .../dict/glossaries-dictionary-Dutch.dict | 52 + .../dict/glossaries-dictionary-English.dict | 52 + .../dict/glossaries-dictionary-French.dict | 52 + .../dict/glossaries-dictionary-German.dict | 52 + .../dict/glossaries-dictionary-Irish.dict | 52 + .../dict/glossaries-dictionary-Italian.dict | 52 + .../dict/glossaries-dictionary-Magyar.dict | 52 + .../dict/glossaries-dictionary-Spanish.dict | 52 + .../tex/latex/glossaries/glossaries-babel.sty | 137 + .../texmf-dist/tex/latex/glossaries/glossaries.sty | 728 +- .../tex/latex/glossaries/glossary-hypernav.sty | 4 +- .../tex/latex/glossaries/glossary-list.sty | 13 +- .../tex/latex/glossaries/glossary-long.sty | 4 +- .../tex/latex/glossaries/glossary-super.sty | 4 +- Master/tlpkg/bin/ctan2tds | 9 + Master/tlpkg/tlpsrc/glossaries.tlpsrc | 1 + 63 files changed, 18428 insertions(+), 8312 deletions(-) create mode 100755 Master/bin/win32/makeglossaries.bat create mode 100644 Master/texmf-dist/doc/latex/glossaries/CHANGES create mode 100644 Master/texmf-dist/doc/latex/glossaries/INSTALL delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/CHANGES delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/database1.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/database2.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/glossaries.pdf delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.html delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.pdf delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sample.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleAcr.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleAcrDesc.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleDB.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleEq.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleEqPg.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleNtn.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/doc/sampleSec.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/glossaries-manual.html create mode 100644 Master/texmf-dist/doc/latex/glossaries/glossaries-manual.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/glossaries.pdf delete mode 100644 Master/texmf-dist/doc/latex/glossaries/glossaries.perl create mode 100644 Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html create mode 100644 Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.pdf create mode 100644 Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.tex delete mode 100644 Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/database1.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/database2.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/minimalgls.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sample.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sample4col.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleAcr.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleAcrDesc.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleDB.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleEq.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleEqPg.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleNtn.tex create mode 100644 Master/texmf-dist/doc/latex/glossaries/samples/sampleSec.tex delete mode 100755 Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries delete mode 100755 Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries.bat create mode 100755 Master/texmf-dist/scripts/glossaries/makeglossaries create mode 100755 Master/texmf-dist/scripts/glossaries/makeglossaries.bat create mode 100644 Master/texmf-dist/source/latex/glossaries/glossaries.perl create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Danish.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Dutch.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-English.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-French.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-German.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Irish.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Italian.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Magyar.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Spanish.dict create mode 100644 Master/texmf-dist/tex/latex/glossaries/glossaries-babel.sty (limited to 'Master') diff --git a/Master/bin/win32/makeglossaries.bat b/Master/bin/win32/makeglossaries.bat new file mode 100755 index 00000000000..64a6a20750c --- /dev/null +++ b/Master/bin/win32/makeglossaries.bat @@ -0,0 +1,3 @@ +@rem = '-*- Perl -*- +@echo off +perl -S "%~dp0makeglossaries" %* diff --git a/Master/texmf-dist/doc/latex/glossaries/CHANGES b/Master/texmf-dist/doc/latex/glossaries/CHANGES new file mode 100644 index 00000000000..c54ec6c055a --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/CHANGES @@ -0,0 +1,89 @@ +glossaries change log: + +v1.11 (2 March 2008): + * Fixed error in manual (glossary style is set using \glossarystyle + not \setglossarystyle). + + * Changed the way the package is archived to make it compatible + with TeX Live. + + * Improved error handling of makeglossaries and added --version + and --help options. + +v1.1 (22 Feb 2008): + + * New package options: + + - numberline: + inserts \numberline{} in \addcontentsline when used with + the toc option. + + - numberedsection: + puts glossaries in numbered chapters/sections + + - translate: + translate=false option prevents glossaries package from + using pre-supplied translations. + + - description: + changes definition of \newacronym to allow a description + + - footnote: + changes definition of \newacronym to use a footnote on + first use + + - smallcaps: + changes definition of \newacronym to set acronyms in + small capitals + + - dua: + changes definition of \newacronym to always expand + acronyms + + * Added \setglossarysection + - changes the section type used by the glossaries + + * Added listdotted glossary style. + + * No longer uses xspace package; uses amsgen instead. + + * Added \glsname, \glsdesc, \glssymbol, \glsfirst, \glstext, + \glsplural and \glsfirstplural. + + * Added support for translator package. + +v1.08 (13 Oct 2007): + * Added multilingual support + * Fixed bug in listgroup and altlistgroup styles so that + \glsgroupheading uses \glsgetgrouptitle to get the group title + instead of displaying the label + * Fixed typo in error message text when the description key + is missing to \newglossaryentry. + +v1.07 (13 Sep 2007): + * Fixed bug causing incorrect page number for entries in the + first paragraph of a page. + +v1.06 (21 Aug 2007): + * Changed the license text + +v1.05 (10 Aug 2007): + * Changed the default value of the sort key to just use the + name key + * Added \@mkboth to \glossarysection + +v1.04 (3 Aug 2007): + * Added \glstextformat + +v1.03 (4 July 2007): + * Added \glspostdescription + +v1.02 (25 May 2007): + * Added overview section in the documentation + +v1.01 (17 May 2007): + * Added number range facility (equivalent to makeindex's |( and |) + formatting commands.) + * Added a space after \delimN and \delimR in the ist file. + +v1.0 (16 May 2007): Initial release diff --git a/Master/texmf-dist/doc/latex/glossaries/INSTALL b/Master/texmf-dist/doc/latex/glossaries/INSTALL new file mode 100644 index 00000000000..054c8ab7a25 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/INSTALL @@ -0,0 +1,107 @@ +INSTALLATION + +If you have downloaded the glossaries package using the TeX Directory +Structure (TDS), that is you have downloaded an archive containing +doc, tex, scripts and source directories, you need to follow the +"Installing from TDS" instructions below. + +If you have downloaded the following files: + +glossaries.dtx +glossaries.ins +makeglossaries +makeglossaries.bat + +You need to follow the "Installing from DTX and INS" instructions +below. + +For further information on installing LaTeX packages see: + +http://www.tex.ac.uk/cgi-bin/texfaq2html?label=installthings + +INSTALLING FROM TDS +=================== + +Files in tex and doc directories should go in the +corresponding TEXMF directories (for example, /usr/share/texmf-local/ +or C:\localtexmf\). The scripts/glossaries/ directory +contains the Perl script makeglossaries and the batch file +makeglossaries.bat which should go somewhere on your operating system's +PATH. (Both files are required for Windows, but only the Perl script is +required for other operating systems.) + +*Remember to refresh TeX's database* + +A minimal example file called minimalgls.tex is provided for testing +and debugging purposes and can be found in the package documentation +samples directory (doc/latex/glossaries/samples/). To test your +installation do: + +latex minimalgls +makeglossaries minimalgls +latex minimalgls + +The LaTeX2HTML style file, glossaries.perl, is located in +source/latex/glossaries and should go in the LaTeX2HTML styles +directory. + +INSTALLING FROM DTX AND INS +=========================== + +Run LaTeX on glossaries.ins to generate the package style files, +sample files and LaTeX2HTML style file: + +latex glossaries.ins + +To create the package documentation (glossaries.pdf): + +pdflatex glossaries.dtx +makeindex -s gind.ist glossaries +makeindex -s gglo.ist -o glossaries.gls glossaries.glo +pdflatex glossaries.dtx +pdflatex glossaries.dtx + +If TEXMF denotes the base directory of your local TeX installation (e.g. +/usr/share/texmf-local/ or C:\localtexmf\) then create the following +directories (if they don't already exist): + +TEXMF/doc/latex/glossaries +TEXMF/doc/latex/glossaries/samples +TEXMF/tex/latex/glossaries +TEXMF/tex/latex/glossaries/base +TEXMF/tex/latex/glossaries/styles +TEXMF/tex/latex/glossaries/dict + +Move the sample files (*.tex) to TEXMF/doc/latex/glossaries/sample/ + +Move the documentation (*.pdf) to TEXMF/doc/latex/glossaries/ + +Move glossaries.sty to TEXMF/tex/latex/glossaries/base/ + +Move the other style files (*.sty) to TEXMF/tex/latex/glossaries/styles/ + +Move the dictionary files (*.dic) to TEXMF/tex/latex/glossaries/dict/ + +Move makeglossaries to somewhere on your path, e.g. /usr/bin/. You +may need to edit the first line of makeglossaries if perl is +located somewhere other than /usr/bin/. + +If you are a Windows user, you will also need to move makeglossaries.bat +to the same location as makeglossaries, but you will need to have +Perl installed to be able to use makeglossaries. (It is possible +to use makeindex directly if you don't have Perl installed. See +the manual, glossaries.pdf, for details.) + +*Remember to refresh TeX's database* + +A minimal example file called minimalgls.tex is provided for testing +and debugging purposes. This file is created along with all the other +sample files when you run glossaries.ins through LaTeX. To test your +installation do: + +latex minimalgls +makeglossaries minimalgls +latex minimalgls + +If you want to use the glossaries package with LaTeX2HTML: +move glossaries.perl to the LaTeX2HTML styles directory. diff --git a/Master/texmf-dist/doc/latex/glossaries/README b/Master/texmf-dist/doc/latex/glossaries/README index 4e57293dab8..a03181fb5f6 100644 --- a/Master/texmf-dist/doc/latex/glossaries/README +++ b/Master/texmf-dist/doc/latex/glossaries/README @@ -1,42 +1,42 @@ -LaTeX Package : glossaries v 1.08 - -Last Modified : 13 October 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. The scripts directory contains the Perl -script makeglossaries and the batch file makeglossaries.bat -which should go somewhere on your operating system's PATH. (Both -files are required for Windows, only the Perl script is -required for other operating systems.) - -*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/ - +LaTeX Package : glossaries v 1.11 + +Last Modified : 2 March 2008 + +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.* + +INSTALLATION + +See INSTALL file for installation instructions. + +REQUIREMENTS + +The glossaries package requires at least version 2.5f (2006/11/18) of +the xkeyval package. + +LaTeX2HTML + +This package comes with a LaTeX2HTML style file glossaries.perl +which should be placed in the relevant LaTeX2HTML styles directory, but +note that glossaries.perl only supplies a sub-set of the commands +provided by glossaries.sty, so some commands may not be implemented or +may be implemented in a different way. + +LICENCE + +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. + +Author's home page: http://theoval.cmp.uea.ac.uk/~nlct/ + diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/CHANGES b/Master/texmf-dist/doc/latex/glossaries/doc/CHANGES deleted file mode 100644 index 4f3111053bc..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/CHANGES +++ /dev/null @@ -1,37 +0,0 @@ -glossaries change log: - -v1.08 (13 Oct 2007): - * Added multilingual support - * Fixed bug in listgroup and altlistgroup styles so that - \glsgroupheading uses \glsgetgrouptitle to get the group title - instead of displaying the label - * Fixed typo in error message text when the description key - is missing to \newglossaryentry. - -v1.07 (13 Sep 2007): - * Fixed bug causing incorrect page number for entries in the - first paragraph of a page. - -v1.06 (21 Aug 2007): - * Changed the license text - -v1.05 (10 Aug 2007): - * Changed the default value of the sort key to just use the - name key - * Added \@mkboth to \glossarysection - -v1.04 (3 Aug 2007): - * Added \glstextformat - -v1.03 (4 July 2007): - * Added \glspostdescription - -v1.02 (25 May 2007): - * Added overview section in the documentation - -v1.01 (17 May 2007): - * Added number range facility (equivalent to makeindex's |( and |) - formatting commands.) - * Added a space after \delimN and \delimR in the ist file. - -v1.0 (16 May 2007): Initial release diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/database1.tex b/Master/texmf-dist/doc/latex/glossaries/doc/database1.tex deleted file mode 100644 index 8a78ad6d785..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/database1.tex +++ /dev/null @@ -1,24 +0,0 @@ -% 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 deleted file mode 100644 index 032b2d2b586..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/database2.tex +++ /dev/null @@ -1,22 +0,0 @@ -% 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 deleted file mode 100644 index f43e59e629d..00000000000 Binary files a/Master/texmf-dist/doc/latex/glossaries/doc/glossaries.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.html b/Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.html deleted file mode 100644 index 235ac5000db..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.html +++ /dev/null @@ -1,746 +0,0 @@ - - - - - -Upgrading from the glossary package to the glossaries -package - - - - - - - - - - - - - -

Upgrading from the glossary package to the glossaries -package

-

Nicola L.C. Talbot

-
- -

-Contents -

- - - - -

- -

Abstract:

-
-The purpose of this document is to provide advice if you want -to convert a LaTeX document from using the obsolete -glossary package to the replacement glossaries package. -
-

- -

- -

-1 Package Options -

- -

-When converting a document that currently uses the obsolete -glossary package to the replacement glossaries package, -it should be fairly obvious that the first thing you need to do is -replace \usepackage{glossary} with -\usepackage{glossaries}, however some of the package options -are different, so you may need to change those as well. -Table 1 shows the mappings from the glossary -to the glossaries package options. - -

-

-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 1: -Mappings from glossary to glossaries -package options
glossary option glossaries option
style=liststyle=list
style=altliststyle=altlist
style=long,header=none,border=none,cols=2style=long
style=long,header=plain,border=none,cols=2style=longheader
style=long,header=none,border=plain,cols=2style=longborder
style=long,header=plain,border=plain,cols=2style=longheaderborder
style=long,header=none,border=none,cols=3style=long3col
style=long,header=plain,border=none,cols=3style=long3colheader
style=long,header=none,border=plain,cols=3style=long3colborder
style=long,header=plain,border=plain,cols=3style=long3colheaderborder
style=super,header=none,border=none,cols=2style=super
style=super,header=plain,border=none,cols=2style=superheader
style=super,header=none,border=plain,cols=2style=superborder
style=super,header=plain,border=plain,cols=2style=superheaderborder
style=super,header=none,border=none,cols=3style=super3col
style=super,header=plain,border=none,cols=3style=super3colheader
style=super,header=none,border=plain,cols=3style=super3colborder
style=super,header=plain,border=plain,cols=3style=super3colheaderborder
number=nonenonumberlist
number=<counter name>counter=<counter name>
toctoc
hypertoctoc
hyperno corresponding option
section=truesection
section=falseno corresponding option
acronymacronym
globalno corresponding option
-
-
-
- -

- -

-2 Defining new glossary types -

- -

-If you have created new glossary types, you will need to -replace all instances of - -

-\newglossarytype[<log-ext>]{<type>}{<out-ext>}{<in-ext>}[<style list>] -
-\newcommand{\<type>name}{<title>}
-

-with - -

-\newglossary[<log-ext>]{<type>}{<out-ext>}{<in-ext>}{<title>} -

-in the preamble, and - -

-\glossarystyle{<new style list>} -

-immediately before \printglossary[type=<type>], -if the new glossary requires a different style to the main (default) -glossary. - -

-The <style list> optional argument can be converted to -<new style list> using the same mapping given in -Table 1. - -

-For example, if your document contains the following: -

-\newglossarytype[nlg]{notation}{not}{ntn}[style=long,header]
-\newcommand{\notationname}{Index of Notation}
-
-You will need to replace the above two lines with: -
-\newglossary[nlg]{notation}{not}{ntn}{Index of Notation}
-
-in the preamble, and -
-\glossarystyle{style=longheader}
-
-immediately prior to displaying this glossary new type. - -

-Note that the glossary title is no longer specified using -\<glossary-type>name (except for \glossaryname -and \acronymname) but is instead specified in the <title> -argument of \newglossary. The short title which is specified -in the glossary package by the command -\short<glossary-name>name is now specified -using the toctitle key in the optional argument to -\printglossary. - -

- -

-3 \make<glossary name> -

- -

-All instances of \make<glossary name> (e.g. -\makeglossary and \makeacronym) should be replaced -by the single command \makeglossaries. For example, if -your document contained the following: -

-\makeglossary
-\makeacronym
-
-then you should replace both lines with the single line: -
-\makeglossaries
-
- -

- -

-4 Storing glossary information -

- -

-With the old glossary package you could optionally store -glossary information for later use, or you could simply use -\glossary whenever you wanted to add information to the glossary. -With the new glossaries package, the latter option is no longer -available1. If -you have stored all the glossary information using -\storeglosentry, then you will need to convert these commands -into the equivalent \newglossaryentry. If you haven't used -\storeglosentry, then you'll have a bit more work to do! - -

-The former approach requires substituting all instances of - -

-\storeglosentry{<label>}{<gls-entry>} -

-with - -

-\newglossaryentry{<label>}{<gls-entry>} -

-This should be fairly easy to do using the search and replace -facility in your editor (but see notes below). - -

-If you have used the optional argument of \storeglosentry -(i.e. you have multiple glossaries) then you will need to -substitute - -

-\storeglosentry[<gls-type>]{<label>}{<gls-entry>} -

-with - -

-\newglossaryentry{<label>}{<gls-entry>,type=<gls-type>} -

- -

-The glossary entry information <gls-entry> may also need -changing. If <gls-entry> contains any of makeindex's -special characters (i.e. @ ! " or -|) then they should no longer be escaped with " -since the glossaries package deals with these characters -internally. For example, if your document contains the following: -

-\storeglosentry{card}{name={$"|\mathcal{S}"|$},
-description={The cardinality of the set $\mathcal{S}$}}
-
-then you will need to replace it with: -
-\newglossaryentry{card}{name={$|\mathcal{S}|$},
-description={The cardinality of the set $\mathcal{S}$}}
-
- -

-The format and number keys available in -\storeglosentry are not available with \newglossaryentry. -Note also that the glossary package allowed you to use -\storeglosentry in the document, but \newglossaryentry -may only be used in the preamble. - -

- -

-5 Adding an entry to the glossary -

- -

-The glossary package provided two basic means to add -information to the glossary: firstly, the term was defined -using \storeglosentry and the entries for that term were -added using \useglosentry, \useGlosentry and \gls. -Secondly, the term was added to the glossary using \glossary. -This second approach is unavailable with the glossaries -package. - -

- -

- -
-5.1 \useglosentry -

- -

-The glossary package allows you to add information to the -glossary for a predefined term without producing any text -in the document using - -

-\useglosentry[<old options>]{<label>} -

-Any occurrences of this command will need to be replaced with - -

-\glsadd[<new options>]{<label>} -

-The format key in <old options> remains the same -in <new options>, the number=<counter name> -key in <old options> should be replaced with -
counter=<counter name> in <new options>. - -

- -

-5.2 \useGlosentry -

- -

-The glossary package allows you to add information to the -glossary for a predefined term with the given text using - -

-\useGlosentry[<old options>]{<label>}{<text>} -

-Any occurrences if this command will need to be replaced with - -

-\glslink[<new options>]{<label>}{<text>} -

-The mapping from <old options> to <new options> is -the same as that given in section 5.1 above. - -

- -

-5.3 \gls -

- -

-Both the glossary and the glossaries packages define -the command \gls. In this case, the only thing you need to -change is the number key in the optional argument -to counter. - -

- -

-5.4 \glossary -

- -

-If you have opted to explicitly use \glossary instead of storing -the glossary information with \storeglosentry, then converting -from glossary to glossaries will be more time-consuming, -although in the end, I hope you will see the benefits! Using -\glossary throughout the document is time consuming, and if you -use it more than once for the same term, there's a chance extra -spaces may creep in which will cause makeindex to treat the -two entries as different terms, even though they look the same in the -document. However, if you have used \glossary, you will need -to define the term using \newglossaryentry, and then use -\glsadd{<label>} (or \glslink{<label>}{<text>} -if you have used \xglossary.) - -

-If you don't like the idea of continually scrolling back to the -preamble to type all your \newglossaryentry commands, you may -prefer to create a new file, in which to store all these commands, -and then input that file in your document's preamble. Most text -editors and front-ends allow you to have multiple files open, and -you can tab back and forth between them. - -

- -

-6 Acronyms -

- -

-In the glossary package, acronyms were treated differently -to glossary entries. This resulted in inconsistencies and sprawling -unmaintainable code. The new glossaries package treats -acronyms in exactly the same way as normal glossary terms. In fact, -in the glossaries package: - -

-\newacronym[<options>]{<label>}{<abbrv>}{<long>} -

-is a shortcut for: - -

-\newglossaryentry{<label>}{type=\acronymtype, -name={<abbrv>}, -description={<long>}, -text={<abbrv>}, -first={<long> (<abbrv>)}, -plural={<abbrv>s}, -firstplural={<long>s (<abbrv>s)}, -<options>} -

- -

-This is different to the glossary package which set the -name key to <long> (<abbrv>) and allowed you -to set a description using the description key. If you want -your document to remain like this, you can redefine \newacronym -as follows: -

-\renewcommand{\newacronym}[4][]{%
-\newglossaryentry{#2}{type=\acronymtype,
-name={#4 (#3)},
-text={#3},
-first={#4 (#3)},
-plural={#3s},
-firstplural={#4s (#3s)},#1}}
-
-The description key will then need to be entered using the -optional argument. - -

-For example, if your document originally had the following: -

-\newacronym{SVM}{Support Vector Machine}{description=Statistical
-pattern recognition technique}
-
-Then you would need to redefine \newacronym as shown above, -and change the above to: -
-\newacronym[description=Statistical pattern recognition 
-technique]{svm}{SVM}{Support Vector Machine}
-
-You will also need to replace all occurrences of \SVM with -\gls{svm}. Alternatively, you can define \SVM: -
-\newcommand{\SVM}{\gls{svm}}
-
- -

-If you have used \useacronym instead of \<acr-name>, -then you will need to replace all occurrences of - -

-\useacronym[<insert>]{<acr-name>} -

-with - -

-\gls{<label>}[<insert>] -

-Note that the starred versions of \useacronym and -\<acr-name> (which make the first letter uppercase) should -be replaced with \Gls{<label>}. - -

- -

-6.1 \acrln and \acrsh -

- -

-In the glossary package, it is possible to produce the -long and short forms of an acronym without adding an entry to -the glossary using \acrln and \acrsh. With the -glossaries package, you can replace - -

-\acrsh{<acr-name>} -

-with - -

-\glsentrytext{<label>} -

-However the glossaries package provides no direct equivalent -of \acrln. Instead it provides \glsentryfirst which -produces the ``first use'' text without adding an entry to the -glossary, or affecting the first use flag. - -

-Alternatively, if you haven't changed the definition of -\newacronym, the long form by itself can be obtained using -\glsentrydesc, since by default the description key is -set to the long form (but read the notes in the glossaries -manual regarding the sanitize package option). - -

-If you want to be able to set a description, and be able to -independently access the description, the long form and the -short form, you can redefine \newacronym so that it uses -the symbol key and use \defglsdisplayfirst -so that it uses this value on first use, as follows: -

-\renewcommand{\newacronym}[4][]{\newglossaryentry{#2}{%
-name={#4 (#3)},
-text={#3},
-first={#4},
-symbol={#3},
-}}
-\defglsdisplayfirst{\acronymtype}{##1 (##3)##4}
-
-As before, you can access the short name via -\glsentrytext{<label>}, but you can now access just the long -form via \glsentryfirst{<label>} and the description via -\glsentrydesc{<label>}. - -

-See -the section ``Using -glossary entries in the text'' of the glossaries -manual for further details of how to use these commands. - -

- -

-6.2 \ifacronymfirstuse -

- -

-The glossary package command - -

-\ifacronymfirstuse{<acr-name>}{<text1>}{<text2>} -

-can be replaced by the glossaries command: - -

-\ifglsused{<label>}{<text2>}{<text1>} -

-Note that \ifglsused evaluates the opposite condition to -that of \ifacronymfirstuse which is why the last two arguments -have been reversed. - -

- -

-6.3 \resetacronym and \unsetacronym -

- -

-The glossary package allows you to reset and unset the -acronym flag which is used to determine whether the acronym has -been used in the document. The glossaries package also -provides a means to do this on either a local or global level. -To reset an acronym, you will need to replace: - -

-\resetacronym{<acr-name>} -

-with either - -

-\glsreset{<label>} -

-or - -

-\glslocalreset{<label>} -

- -

-To unset an acronym, you will need to replace: - -

-\unsetacronym{<acr-name>} -

-with either - -

-\glsunset{<label>} -

-or - -

-\glslocalunset{<label>} -

- -

- -

-7 Displaying the glossary -

- -

-The glossary package provides the command \printglossary -(or \print<type> for other glossary types) which -can be used to print individual glossaries. The glossaries -package provides the command \printglossaries which -will print all the glossaries which have been defined, or -\printglossary[<options>] to print individual glossaries. -So if you just have \printglossary, then you can leave it as -it is, but if you have, say: -

-\printglossary
-\printglossary[acronym]
-
-or -
-\printglossary
-\printacronym
-
-then you will need to either replace this with either -
-\printglossaries
-
-or -
-\printglossary
-\printglossary[type=\acronymtype]
-
- -

-The glossary package allows you to specify a short title -(for the table of contents and page header) by defining a command -of the form \short<glossary-type>name. The -glossaries package doesn't do this, but instead provides -the toctitle key which can be used in the optional -argument to \printglossary. For example, if you have created -a new glossary type called notation, and you had -defined -

-\newcommand{\shortnotationname}{Notation}
-
-then you would need to use the toctitle key: -
-\printglossary[type=notation,toctitle=Notation]
-
-The glossaries package will ignore \shortnotationname, -so unless you have used it elsewhere in the document, you may -as well remove the definition. - -

- -

-8 Using makeindex -

- -

-If you convert your document from using the glossary package -to the glossaries package, you will need to delete any of -the additional files, such as the .glo file, that were -created by the glossary package, as the glossaries -package uses a different makeindex style file. -Remember also, that if you used the makeglos Perl script, -you will need to use the makeglossaries Perl script -instead. - -

-


Footnotes

-
-
... -available1
-
mainly because having a key value list in -\glossary caused problems, but it also helps consistency. - -
-
-

-
-Nicola L. C. Talbot. -School of Computing Sciences. -University of East Anglia. -Last Modified: 2007-09-15 -
- - diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.pdf b/Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.pdf deleted file mode 100644 index fd9d18c7c63..00000000000 Binary files a/Master/texmf-dist/doc/latex/glossaries/doc/glossary2glossaries.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sample.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sample.tex deleted file mode 100644 index 1555f0c31d3..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sample.tex +++ /dev/null @@ -1,75 +0,0 @@ -\documentclass[a4paper]{report} - -\usepackage[plainpages=false,colorlinks]{hyperref} -\usepackage[style=altlist]{glossaries} - -\makeglossaries - -\newglossaryentry{glossary}{name=glossary, -description={1) list of technical words, 2) collection of -glosses}, -plural={glossaries}} - -\newglossaryentry{Perl}{name=\texttt{Perl}, -sort=Perl, % need a sort key because name contains a command -description=A scripting language} - -\newglossaryentry{pagelist}{name=page list, -% description value has to be enclosed in braces -% because it contains commas -description={a list of individual pages or page ranges -(e.g.\ 1,2,4,7-9)}} - -\newglossaryentry{mtrx}{name=matrix, -description={rectangular array of quantities}, -% plural is not simply obtained by appending an s, so specify -plural=matrices} - -\newcommand{\pardescription}{distinct section of piece of -writing.\par Beginning on new, usually indented, line} -\newglossaryentry{par}{name=paragraph, -description=\pardescription} - -\begin{document} - -\title{Sample Document Using glossary Package} -\author{Nicola Talbot} -\pagenumbering{alph}% prevent duplicate page link names if using PDF -\maketitle - -\pagenumbering{roman} -\tableofcontents - -\chapter{Introduction} -\pagenumbering{arabic} - -A \gls{glossary} is a very useful addition to any -technical document, although a \gls{glossary} can -also simply be a collection of glosses, which is -another thing entirely. Some documents have -multiple \glspl{glossary}. - -Once you have run your document through \LaTeX, you -will then need to run the \texttt{.glo} file through -\texttt{makeindex}. You will need to set the output -file so that it creates a \texttt{.gls} file instead -of an \texttt{.ind} file, and change the name of -the log file so that it doesn't overwrite the index -log file (if you have an index for your document). -Rather than having to remember all the command line -switches, you can call the \gls{Perl} script -\texttt{makeglossaries} which provides a convenient -wrapper. - -If a comma appears within the name or description, grouping -must be used, e.g.\ in the description of \gls{pagelist}. - -Plurals are assumed to have the letter s appended, but if -this is not the case, as in \glspl{mtrx}, then you need -to specify the plural when you define the entry. - -\Glspl{par} can cause a problem in commands. - -\printglossaries - -\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex b/Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex deleted file mode 100644 index 67b78bc4575..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sample4col.tex +++ /dev/null @@ -1,24 +0,0 @@ -\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 deleted file mode 100644 index 2b26e982be0..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcr.tex +++ /dev/null @@ -1,49 +0,0 @@ -\documentclass[a4paper]{report} - -\usepackage[colorlinks,plainpages=false]{hyperref} -\usepackage[style=long,toc]{glossaries} - -\makeglossaries - -\renewcommand*{\glstextformat}[1]{\textsf{#1}} - -\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 deleted file mode 100644 index 4a54c674943..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleAcrDesc.tex +++ /dev/null @@ -1,65 +0,0 @@ -\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 deleted file mode 100644 index 7d58e32e2af..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleDB.tex +++ /dev/null @@ -1,19 +0,0 @@ -\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 deleted file mode 100644 index 4fb888c6cb9..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleEq.tex +++ /dev/null @@ -1,231 +0,0 @@ -\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 deleted file mode 100644 index 19531e3897e..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleEqPg.tex +++ /dev/null @@ -1,267 +0,0 @@ -\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 deleted file mode 100644 index 04af87e3562..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleNtn.tex +++ /dev/null @@ -1,82 +0,0 @@ -\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 deleted file mode 100644 index ccefe8c19e1..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/doc/sampleSec.tex +++ /dev/null @@ -1,58 +0,0 @@ -\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/glossaries-manual.html b/Master/texmf-dist/doc/latex/glossaries/glossaries-manual.html new file mode 100644 index 00000000000..d442c01dab1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/glossaries-manual.html @@ -0,0 +1,3270 @@ + + + + + +glossaries.sty v 1.11: LaTeX2e Package to Assist Generating Glossaries + + + + + + + + + + + + + + + +

+ +

+ +

glossaries.sty v 1.11: LaTeX2e Package to Assist Generating Glossaries

+

Nicola L.C. Talbot +
+
+School of Computing Sciences +
+University of East Anglia +
+Norwich. Norfolk +
+NR4 7TJ. United Kingdom. +
http://theoval.cmp.uea.ac.uk/~nlct/

+

2nd March 2008

+
+ +

+Contents +

+ + + + +

+ +

+Introduction +

+ +

+The glossaries package is provided to assist generating +glossaries. It has a certain amount of flexibility, allowing the user +to customize the format of the glossary and define multiple glossaries. +It also supports acronyms and glossary styles that include +symbols (in addition to a name and description) for glossary +entries. There is provision for loading a database of glossary terms +where only those terms used in the text are added to the glossary. +This package replaces the glossary package which is now +obsolete. + +

+As from version 1.08, the glossaries package now has +limited multi-lingual support, thanks to all the people who have sent +me the relevant translations either via email or via comp.text.tex. +However you must load babel before +glossaries to enable this. +As from version 1.1, the glossaries package also supports +Till Tantau's translator package provided it is loaded +before the glossaries package. This makes it easier to change +the default translations or add new dictionaries. +If you don't want to use the predefined translations, you can use the +package option translate=false and supply your own translations. + +

+This documentation is structured as follows: A Quick Guide For The Impatient is for +people who want a few quick pointers of how to get started, +without having to read through lengthy descriptions, +and Overview gives an overview of available commands +and their syntax. +

+Top + +

+ +

+ +
+Generating the associated glossary files +

+ +

+The glossaries package comes with the Perl script +makeglossaries which will run makeindex on +all the glossary files using a customized makeindex +.ist style file (which is created by \makeglossaries). +The relevant extensions are obtained from the +auxiliary file, so you should only pass the basename as the +argument. For example, if your document is called +myfile.tex, do: +

+latex myfile
+makeglossaries myfile
+latex myfile
+
+You may need to explicitly load makeglossaries into +Perl: +
+perl makeglossaries myfile
+
+There is a batch file called makeglossaries.bat which +does this for Windows users. + +

+If you don't have Perl installed, you will have to run +makeindex for each glossary type you have defined. +For example, if you have used the acronym package option +then you will have both a main glossary as well as a list of acronyms, so you +will need to do (assuming your document is called myfile.tex): +

+makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo
+makeindex -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn
+
+This requires remembering all extensions for each of the glossaries +defined in your document, so where possible you should use +makeglossaries instead to reduce the possibility of error. +Don't pass all the glossary files in a single call to +makeindex or it will merge all your glossaries into a +single glossary. + +

+If any problems occur, remember to check the transcript files +(e.g. .glg or .alg) for messages. +

+Top + +

+ +

+Troubleshooting +

+ +

+The glossaries package comes with a minimal file called +minimalgls.tex which can be used for testing. This +should be located in texmf/doc/latex/glossaries/samples/. Further +information on debugging LaTeX code is available at +http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/. + +

+There is a list of frequently asked questions for the +glossaries package available at +http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html. +

+Top + +

+ +

+ +
+A Quick Guide For The Impatient +

+ +

+This section is for people who want a few quick pointers +of how to get started, without having to read through +lengthy descriptions. + +

+ +

    +
  1. Load glossaries after hyperref: +
    +\usepackage{hyperref}
    +\usepackage{glossaries}
    +
    +Similarly for the html package: +
    +\usepackage{html}
    +\usepackage{glossaries}
    +
    + +

    +

  2. +
  3. Always use \makeglossaries if you want the glossary +entries to be written to the glossary file: +
    +\documentclass{article}
    +\usepackage{glossaries}
    +\makeglossaries
    +
    +If you don't use \makeglossaries, your glossaries will +not appear in the document! + +

    +

  4. +
  5. Use \printglossaries to make your glossaries appear +in the document at that point. For example: +
    +\maketitle
    +\printglossaries
    +\section{Introduction}
    +
    +Note that only the glossary entries that have been used in the +document text will appear in the glossary. + +

    +

  6. +
  7. When you have created your document, run LaTeX on it, +then the Perl script makeglossaries, then run LaTeX on it again: +
    +latex myfile
    +makeglossaries myfile
    +latex myfile
    +
    +(You may need to run LaTeX again if you have used the toc +package option.) +If you use Windows, there is a batch file called +makeglossaries.bat which you can use, but you will +still need Perl installed. + +

    +

  8. +
  9. New glossaries can be defined using: +

    +\newglossary[log-ext]{label}{in-ext}{out-ext}{title} +

    +where label is an identifying label, +in-ext is the extension of the file to be created +by makeindex (called by makeglossaries), +out-ext is the extension of the file to be read by +makeindex and title is the title for this +new glossary. The first optional argument log-ext specifies +the extension of the makeindex transcript file. Example: +

    +\newglossary[nlg]{notation}{not}{ntn}{Notation}
    +
    +This glossary's label is notation and its title +will be Notation. If you use makeglossaries, the +makeindex transcript will be written to a file with the +extension .nlg. If log-ext is omitted, the extension +.glg will be used. + +

    +

  10. +
  11. Any new glossaries must be defined before +\makeglossaries +
    +\documentclass{article}
    +\usepackage{glossaries}
    +\newglossary{notation}{not}{ntn}{Notation}
    +\makeglossaries
    +
    + +

    +

  12. +
  13. If you use the acronym package option, the +glossaries package +will automatically create a new glossary type labelled +acronym: +
    +\usepackage[acronym]{glossaries}
    +
    + +

    +

  14. +
  15. If your pages have a hyphen compositor (i.e. your page +numbers appear in the form 2-1), redefine \glscompositor +before \makeglossaries: +
    +\documentclass{article}
    +\usepackage{glossaries}
    +\renewcommand{\glscompositor}{-}
    +\makeglossaries
    +
    + +

    +

  16. +
  17. To add the glossaries to the table of contents use the +toc package option: +
    +\usepackage[toc]{glossaries}
    +
    + +

    +

  18. +
  19. Define a new entry with: +

    +\newglossaryentry{label}{key-val list} +

    +The key-val list must at least contain a name +key and a description key. +For example: +

    +\newglossaryentry{perl}{name=Perl,
    +description=A scripting language}
    +
    +In this example, I have given the entry the label perl. +Whenever I want to use this entry, that is the label I need +to use to identify it. + +

    +

  20. +
  21. If the entry name starts with an accented letter, you will +need to group the first letter (otherwise it will cause a +problem for \Gls and \Glspl): +
    +\newglossaryentry{elite}{name={{\'e}lite},
    +description={select group or class}}
    +
    + +

    +

  22. +
  23. If you have multiple glossaries, use the type +key to specify in which glossary the entry belongs. For example: +
    +\newglossary{languages}{lan}{lng}{Index of Languages}
    +
    +\makeglossaries
    +
    +\newglossaryentry{perl}{name=Perl,
    +description=A scripting language,
    +type=languages}
    +
    +If type is omitted, the default glossary is used. + +

    +

  24. +
  25. Remember to group values that have a comma or equal sign. +For example: +
    +\newglossaryentry{pagelist}{name=page list,
    +description={A list of individual pages or page ranges
    +(e.g.\ 1,2,4,7--9)}}
    +
    + +

    +

  26. +
  27. Plural forms are assumed to be the singular form with an +"s" appended, unless otherwise specified. To specify an +irregular plural, use the plural key. For example: +
    +\newglossaryentry{matrix}{name=matrix,
    +description=rectangular array of quantities,
    +plural=matrices}
    +
    + +

    +

  28. +
  29. The way the term appears in the main text can be different +from the way the term appears in the glossary: +
    +\newglossaryentry{matrix}{name=Matrix,
    +description=rectangular array of quantities,
    +text=matrix,
    +plural=matrices}
    +
    +In this example, the entry name appears as "Matrix" in the +glossary, and either "matrix" or "matrices" in the text. + +

    +

  30. +
  31. The way the term appears on first use can be different +to the way it appears subsequently: +
    +\newglossaryentry{singmtx}{name=Singular Matrix,
    +description=A matrix with a zero determinant,
    +first=singular matrix (SM),
    +text=SM,
    +firstplural=singular matrices (SMs)}
    +
    +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". + +

    +

  32. +
  33. The quick and easy way to define an acronym is to use: +

    +\newacronym[key-val list]{label}{abbrev}{long} +

    +For example: +

    +\newacronym{svm}{SVM}{support vector machine}
    +
    +This is equivalent to: +
    +\newglossaryentry{svm}{type=\acronymtype,
    +name={SVM},
    +description={support vector machine},
    +text={SVM},
    +first={support vector machine (SVM)},
    +plural={SVMs},
    +firstplural={support vector machines (SVMs)}}
    +
    +(The value of \acronymtype varies depending on whether +the acronym package option is used or not. +The optional argument key-val list can be used to +override any of the \newglossaryentry keys; for +example, if the acronym has an irregular plural.) + +

    +

  34. +
  35. The font used to display the entry name in the glossary +is governed by \glsnamefont. This can be redefined +as required. For example, to make the entry names appear +in a medium sans-serif font do: +
    +\renewcommand{\glsnamefont}[1]{\textsf{\mdseries #1}}
    +
    +Note that the list-like glossary styles defined in the +glossary-list package place the entry name in +the optional argument to \item, so they will +appear in bold, unless you redefine \glsnamefont to counteract the +bold font. + +

    +

  36. +
  37. In the document use \gls{label} +to use a predefined term (this will also enter the term into +the associated glossary output file). For example: +
    +A \gls{singmtx} is a matrix with a zero determinant.
    +
    + +

    +

  38. +
  39. Other variations: + +
      +
    • \Gls{label} : like \gls, +but with first letter in upper case +
    • +
    • \GLS{label} : like \gls, +but all upper case. +
    • +
    • \glspl{label} : use plural +
    • +
    • \Glspl{label} : use plural with +first letter in upper case +
    • +
    • \GLSpl{label} : use plural but +all upper case +
    • +
    • \glslink{label}{link text} : +use link text to link to the given entry in the glossary. +
    • +
    +For example, the following will produce the plural form with +the first letter in uppercase: +
    +\Glspl{singmtx} are matrices with a zero determinant.
    +
    + +

    +

  40. +
  41. Additional text can be appended to the link using the +end optional argument. For example, to form the possessive: +
    +The \gls{singmtx}['s] dimensions \ldots
    +
    + +

    +

  42. +
  43. The format of the associated entry number can be +changed using the format key in the optional argument. +Note that the value of the format key should be the +name of a command without the initial backslash. For +example: +
    +The primary definition of \glspl[format=textbf]{singmtx}.
    +
    +In this example the relevant glossary entry will have the +page number in bold (since it uses \textbf) but +it will no longer have a hyperlink (if hyperlinks are enabled.) + +

    +

  44. +
  45. The glossaries package provides commands to +change the font whilst ensuring that the number remains a +hyperlink. These are of the form \hyperxx and +are equivalent to the standard font changing commands of the +form \textxx, as well as \hyperemph +(which uses \emph.) For example: +
    +The primary definition of \glspl[format=hyperbf]{singmtx}.
    +
    + +

    +

  46. +
  47. Don't use declarations in format as this can +cause unpredictable results, as there is no guarantee that the effect +will be localised to the required text. + +

    +

  48. +
  49. Entries can be added to the glossary without producing +any text using \glsadd{label} or +\glsaddall. These commands also taken an optional +argument where you can specify the format. For example +
    +\glsadd[format=hyperbf]{singmtx}
    +
    +will add a line to the +glossary file for the specified term, but will not produce +any text where the command occurs. + +

    +

  50. +
  51. A number range can be entered using format=( and +format=) to mark the beginning and ending of the +range1. For example: +
    + \glsadd[format=(]{singmtx}
    + This is a very long section all about \glspl{singmtx}.
    +
    + % lots of text omitted
    +
    + \glsadd[format=)]{singmtx}
    +
    +This is equivalent to makeindex's |( and |) +formats. + +

    +

  52. +
  53. You can combine the range markers with a formatting command +(again without the preceding backslash). For example: +
    + This is the start of a very long section all 
    + about \glspl[format=(hyperbf]{singmtx}.
    +
    + % lots of text omitted
    +
    + This is the end a very long section all about 
    + \glspl[format=)hyperbf]{singmtx}.
    +
    + +

    +

  54. +
  55. 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 \glslink +or \gls and related commands, or via \glsadd +or \glsaddall.) + +

    +

  56. +
  57. To change the sorting order, use the sort key. +For example: +
    +\newglossaryentry{universal}{name={\ensuremath{\mathcal{U}}},
    +description=The universal set,
    +sort=U}
    +
    + +

    +

  58. +
  59. You don't need to escape makeindex's special characters: +
    +\newglossaryentry{quote}{name={"},
    +description={Double quote character}}
    +
    +\newglossaryentry{exclam}{name={!},
    +description={Exclamation mark}}
    +
    +\newacronym{rna}{RNA}{ribonukleins\"aure}
    +
    + +

    +

  60. +
  61. Associated symbols can also be specified, but whether the +symbol appears in the glossary depends on the glossary style. +For example: +
    +\newglossaryentry{metre}{name={metre},
    +description={A metric measurement of length},
    +symbol={m}}
    +
    +The predefined glossary styles that display the entry symbol +are: long4col, long4colheader, +long4colborder, long4colheaderborder, +super4col, super4colheader, +super4colborder and super4colheaderborder. +All the other styles supplied by this package ignore the associated +symbol. + +

    +

  62. +
  63. Glossary styles can be set using the style +package option. For example: +
    +\usepackage[style=long3col]{glossaries}
    +
    +or using \glossarystyle{style}. For example: +
    +\glossarystyle{altlist}
    +
    +The predefined glossary styles provided by the glossaries +bundle are listed in Glossary Styles. + +

    +

  64. +
  65. The list of numbers associated with each glossary entry +can be suppressed using the package option nonumberlist: +
    +\usepackage[nonumberlist]{glossaries}
    +
    + +

    +

  66. +
  67. 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 section package +option. For example, to make the glossaries appear in an unnumbered +section, even if chapters are defined, do: +
    +\usepackage[section]{glossaries}
    +
    +Other sectional units can also be specified as +section=value. For example, to make the glossaries +appear in unnumbered subsections: +
    +\usepackage[section=subsection]{glossaries}
    +
    + +

    +

  68. +
+

+Top + +

+ +

+
+Overview +

+ +

+ +

+Package Options +

+ +

+The glossaries package options are as follows: +

+
toc
+
Add the glossaries to the table of contents. + +

+

+
numberline
+
When used with toc, this will +add \numberline{} in the final argument of +\addcontentsline. This will align the table of contents entry +with the numbered section titles. Note that this option has no +effect if the toc option is omitted. If toc is +used without numberline, the title will be aligned with +the section numbers rather than the section titles. + +

+

+
acronym
+
Make a separate glossary for acronyms. + +

+

+
section
+
This is a key=value option. Its +value should be the name of a sectional unit (e.g. chapter). +This will make the glossaries appear in the named sectional unit, +otherwise each glossary will appear in a chapter, if chapters +exists, otherwise in a section. Unnumbered sectional units will be used +by default. Example: +
+\usepackage[section=subsection]{glossaries}
+
+You can omit the value if you want to use sections, i.e.
+\usepackage[section]{glossaries}
+
+is equivalent to +
+\usepackage[section=section]{glossaries}
+
+You can change this value later in the document using +\setglossarysection{type}. + +

+

+
numberedsection
+
The glossaries are placed in unnumbered sectional units by default, +but this can be changed using numberedsection. This option can take +three possible values: false (no +number, i.e. use starred form), nolabel +(numbered, i.e. unstarred form, but not labelled) and +autolabel (numbered with automatic +labelling). If numberedsection=autolabel is used, each +glossary is given a label that matches the glossary type, so the +main (default) glossary is labelled main, the list of +acronyms is labelled acronym2 and additional glossaries are labelled +using the value specified in the first mandatory argument to +\newglossary. For example, if you load glossaries +using: +
+\usepackage[section,numberedsection=autolabel]{glossaries}
+
+then each glossary will appear in a numbered section, and can +be referenced using something like: +
+The main glossary is in section~\ref{main} and the list of
+acronyms is in section~\ref{acronym}.
+
+If you can't decide whether to have the acronyms in the main +glossary or a separate list of acronyms, you can use +\acronymtype which is set to main if the +acronym option is not used and is set to acronym +if the acronym option is used. For example: +
+The list of acronyms is in section~\ref{\acronymtype}.
+
+ +

+

+
style
+
This is a key=value option. Its +value should be the name of the glossary style to use. Predefined +glossary styles are listed later. + +

+

+
nonumberlist
+
This option will suppress the +associated number lists in the glossaries (see also +Number Lists.) + +

+

+
counter
+
This is a key=value option. The +value should be the name of the default counter to use in the number +lists. + +

+ +

+
sanitize
+
This is a key=value option whose +value is also a key=value list. By default, the +glossaries package sanitizes the values of the +name, description and symbol keys used +when defining a new glossary entry. This may lead to unexpected results +if you try to display these values within the document text. This +sanitization can be switched off using the sanitize package +option. For example, to switch off the sanitization for the +description and name keys, but not for the +symbol key, do: +
+\usepackage[sanitize={name=false,description=false,%
+symbol=true}]{glossaries}
+
+ +

+Note: this sanitization only applies to the name, +description and symbol keys. It doesn't apply +to any of the other keys (except the sort key which is +always sanitized) so fragile commands contained in the value of +the other keys must always be protected using \protect. +Since the value of the text key is obtained from the +name key, you will still need to protect fragile commands +in the name key if you don't use the text key. + +

+

+
babel
+
This is a boolean key and is for use when +the glossaries package is used in conjunction with the +babel package. The default is babel=true, which +adds the glossary translations to babel's captions. If +you don't like the translations provided by the glossaries +package, you can set babel=false and provide your own +translations. + +

+

+
description
+
This option changes the definition of +\newacronym to allow a description. See later +for further details. + +

+

+
footnote
+
This option changes the definition of +\newacronym and the way that acronyms are displayed. See later +for further details. + +

+

+
smallcaps
+
This option changes the definition of +\newacronym and the way that acronyms are displayed. See later +for further details. + +

+

+
dua
+
This option changes the definition of +\newacronym so that acronyms are always expanded. +See later +for further details. + +

+

+
+

+Top + +

+ +

+ +
+Defining Glossary Entries +

+ +

+All glossary entries that are used in a document must be defined in +the preamble. Only those entries that occur in the document +(using any of the commands described in Links to Glossary Entries and +Adding an entry to the glossary without generating text) will appear in the glossary. Each time an entry +is used in this way, a line is added to an associated glossary +(.glo) file, which then needs to be converted into a +corresponding .gls file which contains the typeset glossary +which is input by \printglossary or +\printglossaries. The Perl script makeglossaries +can be used to call makeindex, using a customised +.ist style file, for each of the glossaries that are defined +in the document. Note that there should be no need for you to +explicitly edit or input any of these external files. + +

+The command \makeglossaries must be placed in the preamble in +order to create the customised makeindex .ist +style file and to ensure that glossary entries are written to the +appropriate output file. If you omit \makeglossaries none of the +glossaries will be created. Note that if your page numbers use a +hyphen compositor, you must set this by redefining +\glscompositor before +using \makeglossaries: +

+\renewcommand*{\glscompositor}{-}
+
+(The default value of \glscompositor is a full stop.) + +

+New glossary entries are defined using the command: +
+
\newglossaryentry{label}{key-val list} +
+
+The first +argument, label, must be a unique label with which to identify +this entry. The second argument, key-val list, is a +key=value list that supplies the relevant information +about this entry. There are two required fields: name and +description. Available fields are listed below: + +

+

+
name
+
The name of the entry (as it will appear in the +glossary). + +

+

+
description
+
A brief description of this term (to +appear in the glossary). + +

+

+
text
+
How this entry will appear in the document text +when using \gls (or one of its uppercase variants). If this +field is omitted, the value of the name key is used. + +

+

+
first
+
How the entry will appear in the document text +the first time it is used with \gls (or one of its uppercase +variants). If this field is omitted, the value of the text +key is used. + +

+

+
plural
+
How the entry will appear in the document text +when using \glspl (or one of its uppercase variants). +If this field is omitted, the value is obtained by appending an +"s" to the value of the text field. + +

+

+
firstplural
+
How the entry will appear in the document +text the first time it is used with \glspl (or one of +its uppercase variants). If this field is omitted, the value is +obtained by appending an "s" to the value of the first +field. + +

+

+
symbol
+
This field is provided to allow the user to +specify an associated symbol, but most glossary styles ignore +this value. If omitted, the value is set to \relax. + +

+

+
sort
+
This value indicates how makeindex +should sort this entry. If omitted, the value is given by the +name field. This value is equivalent to +makeindex's "actual" character (which is usually the +at-sign @ although the glossaries package uses a different +symbol). + +

+

+
type
+
This is the glossary type to which this entry +belongs. If omitted, the default glossary is assumed +(type=main). The list of acronyms type is given by +\acronymtype which will either be main or +acronym, depending on whether the acronym package +option was used. +
+
+Note that if the text key (or the name key, if the +text key is omitted) starts with an accented letter, +you must group the accented letter, otherwise it will cause a +problem for \Gls and \Glspl. For example: +
+\newglossaryentry{elite}{name={{\'e}lite},
+description={select group or class}}
+
+(Likewise for the plural, first and +firstplural keys.) + +

+You can store all your glossary entry definitions in another +file, and use: +
+
\loadglsentries[type]{filename} +
+
+where filename is the name of the file containing all the +\newglossaryentry commands. The optional argument +type is the name of the glossary to which those entries +should belong, for those entries where the type key has +been omitted. Note that only those entries that have been used +in the text will appear in the relevant glossaries. +

+Top + +

+ +

+ +
+Number lists +

+ +

+Each entry in the glossary has an associated number list. +By default, +these numbers refer to the pages on which that entry has been used +(using any of the commands described in Links to Glossary Entries +and Adding an entry to the glossary without generating text). The number list can be suppressed using +the nonumberlist package option, or an alternative counter +can be set as the default using the counter package option. +

+Top + +

+ +

+ +
+Links to Glossary Entries +

+ +

+Once you have defined a glossary entry using +\newglossaryentry, you can refer to that entry in the +document using one of the commands listed in this section. The +text which appears at that point in the document when using +one of these commands is referred to as the +link text (even if there are no hyperlinks). + +

+The way the link text is displayed +depends on \glstextformat{text}. +For example, to make all link text appear in a sans-serif +font, do: +

+\renewcommand*{\glstextformat}[1]{\textsf{#1}}
+
+ +

+The command: +
+
\glslink[options]{label}{text} +
+
+will place text in the document at that point and add +a line into the associated glossary file for the glossary entry +given by label. If hyperlinks are supported, text +will be a hyperlink to the relevant line in the glossary. The +optional argument options must be a key=value +list which can take any of the following keys: + +

+

+
format
+
This specifies how to format the +associated number for this entry in the glossary. This value is +equivalent to the makeindex encap value, and (as with +\index) the value needs to be the name of a command without +the initial backslash. As with \index, the characters ( and +) can also be used to specify the beginning and ending of a +number range. Again as with \index, the command should be the name +of a command which takes an argument (which will be the associated +number). Be careful not to use a declaration (such as \bfseries) +instead of a text block command (such as \textbf) as the effect is +not guaranteed to be localised. If you want to apply more than one +style to a given entry (e.g. bold and italic) you will +need to create a command that applies both formats, e.g. +
+\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}}
+
+and use that command. + +

+If you are using hyperlinks and you want to change the font of the +hyperlink, don't use \hyperpage (provided by the hyperref +package) as the numbers may not refer to a page number. +Instead, the glossaries package provides the following +number formats: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
hyperrmThe number is a serif hyperlink to the relevant part of the +document
hypersfThe number is a sans-serif hyperlink to the relevant part +of the document
hyperttThe number is a monospaced hyperlink to the relevant part +of the document
hyperbfThe number is a bold hyperlink to the relevant part of the +document
hypermdThe number is a medium weight hyperlink to the relevant +part of the document
hyperitThe number is an italic hyperlink to the relevant +part of the document
hyperslThe number is a slanted hyperlink to the relevant +part of the document
hyperupThe number is an upright hyperlink to the relevant +part of the document
hyperscThe number is a small caps hyperlink to the relevant +part of the document
hyperemphThe number is an emphasized hyperlink to the relevant +part of the document
+ +
+Note that if the \hyperlink command hasn't been defined, +the hyperxx formats are equivalent to the +analogous \textxx font commands. If you want to +make a new format, you will need to define a command which takes +one argument and use that; for example, if you want the associated +number in the glossary to be in a bold sans-serif font, you can define a +command called, say, \hyperbsf: +
+\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}}
+
+and then use hyperbsf as the value for the format +key. + +

+

+
counter
+
This specifies which counter +to use for the associated number for this glossary entry. (See also +Number Lists.) + +

+

+
hyper
+
This is a boolean key which can +be used to enable/disable the hyperlink to the relevant entry +in the glossary. (Note that setting hyper=true will have no +effect if \hyperlink has not been defined.) The default +value is hyper=true. + +

+

+
+ +There is also a starred version: +
+
\glslink*[options]{label}{text} +
+
+which is equivalent to \glslink, except it sets +hyper=false. + +

+The command: +
+
\gls[options]{label}[insert] +
+
+is the same as \glslink, except that the link text +is determined from the values of the text and +first keys supplied when the entry was defined using +\newglossaryentry. There are two uppercase variants: +
+
+\Gls[options]{label}[insert] +
+
+and +
+
+\GLS[options]{label}[insert] +
+
+which make the first letter of the link or all the link text +uppercase, respectively. + +

+The final optional argument insert, allows you to insert +some additional text into the link text. By default, this will +append insert at the end of the link text. The first optional +argument options is the same as the optional argument to +\glslink. As with \glslink, these commands also have +a starred version that disable the hyperlink. + +

+There are also analogous plural forms: +
+
+\glspl[options]{label}[insert] +
+
+\Glspl[options]{label}[insert] +
+
+\GLSpl[options]{label}[insert] +
+
+These determine the link text from the plural and +firstplural keys supplied when the entry was first +defined. As before, these commands also have +a starred version that disable the hyperlink. + +

+The command: +
+
\glstext[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the text key and does not mark the entry as +having been used. + +

+There are also analogous commands: +
+
+\Glstext[options]{text}[insert] +
+
+\GLStext[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+The command: +
+
\glsfirst[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the first key and does not mark the entry as +having been used. + +

+There are also analogous commands: +
+
+\Glsfirst[options]{text}[insert] +
+
+\GLSfirst[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+The command: +
+
\glsplural[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the plural key and does not mark the entry as +having been used. + +

+There are also analogous commands: +
+
+\Glsplural[options]{text}[insert] +
+
+\GLSplural[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+The command: +
+
\glsfirstplural[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the firstplural key and does not mark the entry as +having been used. + +

+There are also analogous commands: +
+
+\Glsfirstplural[options]{text}[insert] +
+
+\GLSfirstplural[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+The command: +
+
\glsname[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the name key and does not mark the entry as +having been used. Note: if you want to use this command and the +name key contains commands, you will have to disable the +sanitization +of the name key and protect fragile commands. + +

+There are also analogous commands: +
+
+\Glsname[options]{text}[insert] +
+
+\GLSname[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+The command: +
+
\glssymbol[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the symbol key and does not mark the entry as +having been used. Note: if you want to use this command and the +symbol key contains commands, you will have to disable the +sanitization +of the symbol key and protect fragile commands. + +

+There are also analogous commands: +
+
+\Glssymbol[options]{text}[insert] +
+
+\GLSsymbol[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+The command: +
+
\glsdesc[options]{label}[insert] +
+
+is similar to \gls except that it always uses the value +of the description key and does not mark the entry as +having been used. Note: if you want to use this command and the +description key contains commands, you will have to disable the +sanitization +of the description key and protect fragile commands. + +

+There are also analogous commands: +
+
+\Glsdesc[options]{text}[insert] +
+
+\GLSdesc[options]{text}[insert] +
+
+As before, these commands also have a starred version that disable +the hyperlink. + +

+ +

+Top + +

+ +

+ +
+Changing the format of the link text +

+ +

+The format of the link text for \gls, \glspl +and their uppercase variants is governed by two commands: +\glsdisplayfirst, which is used the +first time a glossary entry is used in the text and +\glsdisplay, which is used subsequently. +Both commands take four arguments: the first is either the singular or +plural form given by the text, plural, +first or firstplural keys (used when the term was +defined) depending on context; the second argument is the term's +description (as supplied by the description key); the third +argument is the symbol associated with the term (as supplied by the +symbol key) and the fourth argument is the additional text +supplied in the final optional argument to \gls or +\glspl (or their uppercase variants). The default definitions +of \glsdisplay and \glsdisplayfirst simply +print the first argument immediately followed by the fourth argument. +The remaining arguments are ignored. + +

+For example, suppose you want a glossary of measurements and +units, you can use the symbol key to store the unit: +

+\newglossaryentry{distance}{name=distance,
+description={The length between two points},
+symbol={km}}
+
+and now suppose you want \gls{distance} to produce +"distance (km)" on first use, then you can redefine +\glsdisplayfirst as follows: +
+\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}
+
+Note that the additional text is placed after #1, so +\gls{distance}['s] will produce "distance's (km)" +rather than "distance (km)'s" which looks a bit odd (even though +it may be in the context of "the distance (km) is measured between +the two points" -- but in this instance it may be better not to +use a contraction). + +

+Note also that all of the link text will be formatted according +to \glstextformat (described earlier). So if you do, say: +

+\renewcommand{\glstextformat}[1]{\textbf{#1}}
+\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}
+
+then \gls{distance} will produce "distance (km)". + +

+If you have multiple glossaries, changing \glsdisplayfirst and +\glsdisplay will change the way entries for all of the +glossaries appear when using commands \gls, \glspl and their +uppercase variants. If you only +want the change to affect entries for a given glossary, then you need +to use \defglsdisplay and +\defglsdisplayfirst instead +of redefining \glsdisplay and \glsdisplayfirst. + +

+Both \defglsdisplay and \defglsdisplayfirst take two arguments: +the first (which is optional) is the glossary name3 and the second is how the term should be +displayed when it is invoked using commands \gls, +\glspl and their uppercase variants. This is similar to the way \glsdisplayfirst was +redefined above. + +

+For example, suppose you have created a new glossary called +notation and you want to change the way the entry is +displayed on first use so that it includes the symbol, you can +do: +

+\defglsdisplayfirst[notation]{#1#4 (denoted #3)}
+
+Now suppose you have defined an entry as follows: +
+\newglossaryentry{set}{type=notation,
+name=set,
+description={A collection of objects},
+symbol={$S$},
+}
+
+The first time you reference this entry using \gls it +will be displayed as: "set (denoted S)" +(similarly for \glspl and the uppercase variants). + +

+Remember that if you use the symbol key, you need to use a +glossary style that displays the symbol, as many of the styles ignore +it. In addition, if you want either the description or symbol to appear +in the link text, you will have to disable the +sanitization +of these keys and protect fragile commands. +

+Top + +

+ +

+Enabling and disabling hyperlinks to glossary entries +

+ +

+If you load the hyperref or html packages prior to +loading the glossaries package, commands such as \glslink +and \gls, described above, will automatically have hyperlinks +to the relevant glossary entry, unless the hyper +option has been set to false. You can disable or enable links using: +
+
\glsdisablehyper +
+
+and +
+
\glsenablehyper +
+
+respectively. The effect can be localised by placing the commands +within a group. Note that you should only use \glsenablehyper +if the commands \hyperlink and \hypertarget have been +defined (for example, by the hyperref package). + +

+ +

+ +
+Adding an entry to the glossary without generating text +

+ +

+It is possible to add a line in the glossary file without +generating any text at that point in the document using: +
+
\glsadd[options]{label} +
+
+This is similar to \glslink, only it doesn't produce +any text (so therefore, there is no hyper key +available in options but all the other options that can +be used with \glslink can be passed to \glsadd). + +

+To add all entries that have been defined, use: +
+
\glsaddall[glossary list] +
+
+If there are multiple glossaries, you can specify to add only +those entries which belong to the glossaries listed in +glossary list (which must be a comma separated list of +glossary names). For example: +

+\glsaddall[notation]
+
+will add all the entries that have been defined for the glossary +labelled "notation". +

+Top + +

+ +

+Displaying a glossary +

+ +

+The command \printglossaries will display all the +defined glossaries. Note that no glossaries will appear until +you have either used the Perl script makeglossaries +or have directly used makeindex (as described in +Generating the Associated Glossary Files). If the glossary still +does not appear after you re-LaTeX your document, check +the makeindex log files to see if there is a problem. +Remember that you also need to use the command \makeglossaries in +the preamble to enable the glossaries. + +

+An individual glossary is displayed using: +
+
\printglossary[options] +
+
+where options is a key=value list of options. +The following keys are available: +

+
type
+
The value of this key +specifies which glossary to print. If omitted, the default +glossary is assumed. For example, to print the list of acronyms: +
+\printglossary[type=\acronymtype]
+
+ +

+

+
title
+
This is the glossary's +title (overriding the title specified when the glossary was +defined). + +

+

+
toctitle
+
This is the title +to use for the table of contents (if the toc package +option has been used). If omitted, the glossary title is used. + +

+

+
style
+
This specifies which +glossary style to use for this glossary, overriding the effect +of the style option or \glossarystyle. +
+
+ +

+Information can be added to the start of the glossary by redefining +\glossarypreamble. For example: +

+\renewcommand{\glossarypreamble}{Numbers in italic indicate
+primary definitions.}
+
+This needs to be done before the glossary is displayed using +\printglossaries or \printglossary. Note that if you +want a different preamble for each glossary, you will need to +use a separate \printglossary for each glossary and change +the definition of \glossarypreamble between each glossary. +For example: +
+\renewcommand{\glossarypreamble}{Numbers in italic indicate
+primary definitions.}
+\printglossary
+\renewcommand{\glossarypreamble}{}
+\printglossary[type=acronym]
+
+Alternatively, you can do something like: +
+\renewcommand{\glossarypreamble}{Numbers in italic indicate
+primary definitions.\gdef\glossarypreamble{}}
+\printglossaries
+
+which will print the preamble text for the first glossary and +change the preamble to do nothing for subsequent glossaries. +(Note that \gdef is required as the glossary is placed within +a group.) + +

+There is an analogous command +called \glossarypostamble which is placed at the end of each +glossary. +

+Top + +

+ +

+ +
+Changing the way the entry name appears in the glossary +

+ +

+Within each glossary, each entry name is +formatted according to \glsnamefont which takes one argument: the +entry name. This command is always used regardless of the glossary +style. By default, \glsnamefont simply displays its argument in +whatever the surrounding font happens to be. This means that in the +list styles the name will appear in bold, since the name is placed in +the optional argument of \item, whereas in the tabular styles the +name will appear in the normal font. + +

+For example, suppose you want all the entry names to appear in +medium weight small caps, then you can do: +

+\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}}
+
+ +

+Top + +

+ +

+Defining New Glossaries +

+ +

+A new glossary can be defined using: +
+
\newglossary[log-ext]{name}{in-ext}{out-ext}{title}[counter] +
+
+where name is label to assign to this glossary. The arguments +in-ext and out-ext specify the extensions to give to the +input and output files for that glossary, title is the default +title for this new glossary and the final optional argument +counter specifies which counter to use for the associated number +lists (see also Number Lists.) The +first optional argument specifies the extension for the +makeindex transcript file (this information is only used by +makeglossaries which picks up the information from the +auxiliary file.) + +

+Note that the main (default) glossary is automatically created as: +

+\newglossary{main}{gls}{glo}{\glossaryname}
+
+so it can be identified by the label main. Using the +acronym package option is equivalent to: +
+\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
+
+so it can be identified by the label acronym. If you are +not sure whether the acronym option has been used, you +can identify the list of acronyms by the command +\acronymtype which is set to +acronym, if the acronym option has been used, +otherwise it is set to main. +

+Top + +

+ +

+ +
+Acronyms +

+ +

+As you may have noticed in Defining Glossary Entries, when you +specify a new entry, you can specify alternate text to use when +the term is first used in the document. This provides a useful +means to define acronyms. The glossaries package defines +the command: +
+
\newacronym[key-val list]{label}{abbrv}{long} +
+
+This is equivalent to: +

+ +\newglossaryentry {label}{type=\acronymtype, +
+name=
{abbrv}, +
+description=
{long}, +
+text=
{abbrv}, +
+first={
long ( abbrv)}, +
+plural={
abbrvs}, +
+firstplural={
longs ( abbrvs)}, +
key-val list} +

+As mentioned in the previous section, the command \acronymtype is +the name of the glossary in which the acronyms should appear. If the +acronym package option has been used, this will be +acronym, otherwise it will be main. The acronyms can +then be used in exactly the same way as any other glossary entry. +For example, the following defines the acronym IDN: +

+\newacronym{idn}{IDN}{identification number}
+
+This is equivalent to: +
+\newglossaryentry{idn}{type=\acronymtype,
+name={IDN},
+description={identification number},
+text={IDN},
+first={identification number (IDN)},
+plural={IDNs},
+firstplural={identification numbers (IDNs)}}
+
+so \gls{idn} will produce "identification number (IDN)" on +first use and "IDN" on subsequent uses. + +

+The glossaries package has options that change the +definition of \newacronym for common acronym formats. These +options also change the way the link text is displayed for the +acronyms. + +

+Table 1 lists the package options and +how the keys are used to store long (the long form) and +abbrv (the short form). Note that the smallcaps +option redefines \acronymfont so that it sets its argument +in small captials otherwise \acronymfont simply displays its +argument in the surrounding font. Note also that if none of +the package options smallcaps, description +or footnote are used, \acronymfont is not used, so +changing the definition of \acronymfont will have no effect +under such circumstances. + +

+

+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1: +Package options governing acronyms and how the information +is stored in the glossary keys
Package Option firsttextdescriptionsymbol
description,footnoteabbrvabbrvuser suppliedlong
description,dualonglonguser suppliedabbrv
descriptionlongabbrvuser suppliedabbrv
footnoteabbrvabbrvlong 
smallcapslongabbrvlongabbrv
dualonglonglongabbrv
None of the abovelong (abbrv)abbrvlong 
+
+
+
+ +

+Each of the package options smallcaps, footnote +and description use \defglsdisplay and +\defglsdisplayfirst (described earlier) +to change the way the link text is displayed. + +

+

+
description,footnote
+
+When these two options are used together, the first use displays +the entry as: +
+
\acronymfont{abbrv}insert\footnote{long} +
+
+while subsequent use displays the entry as: +
+
\acronymfont{abbrv}insert +
+
+where insert indicates the text supplied in the final +optional argument to \gls, \glspl or their uppercase +variants. + +

+Note also that when these two package options are used (in the +given order), the glossaries package additionally implements the +sanitize option using +sanitize={description=false,symbol=false}, so +remember to protect fragile commands when defining acronyms. + +

+

+
dua
+
+The dua package option always displays the expanded +form and so may not be used with footnote or +smallcaps. Both first use and subsequent use displays the +entry in the form: +
+
longinsert +
+
+If the description option is also used, the name +key is set to the long form, otherwise the name key is +set to the short form and the description key is set to +the long form. + +

+

+
description
+
+This option displays the entry on first use as: +
+
longinsert (\acronymfont{abbrv}) +
+
+while subsequent use displays the entry as: +
+
\acronymfont{abbrv}insert +
+
+Note also that if this package option is used, the glossaries +package additionally implements the option +sanitize={symbol=false}, so +remember to protect fragile commands when defining acronyms. + +

+

+
footnote
+
+This option displays the entry on first use as: +
+
\acronymfont{abbrv}insert\footnote{long} +
+
+while subsequent use displays the entry as: +
+
\acronymfont{abbrv}insert + +

+Note also that if this package option is used, the glossaries +package additionally implements the option +sanitize={description=false}, so +remember to protect fragile commands when defining acronyms. + +

+

+
smallcaps
+
+If neither the footnote nor description options +have been set, this option displays the entry on first use as: +
+
longinsert (\acronymfont{abbrv}) +
+
+while subsequent use displays the entry as: +
+
\acronymfont{abbrv}insert +
+
+where \acronymfont is set to \textsc. + +

+Note also that if this package option is used, the glossaries +package additionally implements the option +sanitize={symbol=false}, so +remember to protect fragile commands when defining acronyms. + +

+

+
None of the above
+
+If none of the package options smallcaps, footnote +or description are used, then on first use the entry is +displayed as: +
+
long (abbrv)insert +
+
+while subsequent use displays the entry as: +
+
\acronymfont{abbrv}insert +
+
abbrvinsert +
+
+ +

+Recall from earlier +that you can access the values of individual keys using commands +like \glstext, so it is possible to use these commands to +print just the long form or just the abbreviation without affecting +the flag that determines whether the entry has been used. However +the keys that store the long and short form vary depending on +the acronym style, so the glossaries package provides +commands that are set according to the package options. These are +as follows: +
+
+

+ +\acrshort[options]{label}[insert] +
+\ACRshort[options]{label}[insert] +
+\ACRshort[options]{label}[insert] +
+
+Print the abbreviated version with a hyperlink (if necessary) to the +relevant entry in the glossary. This is usually equivalent to +\glstext (or its uppercase variants) but may additionally +put the link text within the argument to \acronymfont. +
+
+

+ +\acrlong[options]{label}[insert] +
+\ACRlong[options]{label}[insert] +
+\ACRlong[options]{label}[insert] +
+
+Print the long version with a hyperlink (if necessary) to the +relevant entry in the glossary. This is may be equivalent to +\glsdesc, \glssymbol or \glsfirst (or their uppercase +variants), depending on package options. +
+
+

+ +\acrfull[options]{label}[insert] +
+\ACRfull[options]{label}[insert] +
+\ACRfull[options]{label}[insert] +
+
+Print the long version followed by the abbreviation in brackets +with a hyperlink (if necessary) to the +relevant entry in the glossary. + +

+Note that if you change the definition of \newacronym, you +may additionally need to change the above commands as well as +the changing way the text is displayed using \defglsdisplay +and \defglsdisplayfirst. + +

+ +

+Top + +

+ +

+Unsetting and resetting entry flags +

+ +

+When using commands such as \gls it is possible that you may want +to use the value given by the first key, even though you have +already used the glossary entry. Conversely, you may want to use the +value given by the text key, even though you haven't used the +glossary entry. The former can be achieved by one of the following +commands: +
+
\glsreset{label} +
\glslocalreset{label} +
+
+while the latter can be achieved by one of the following commands: +
+
\glsunset{label} +
\glslocalunset{label} +
+
+You can determine whether an entry has been used using: +
+
+\ifglsused{label}{true part}{false part} +
+
+where label is the label of the required entry. If the +entry has been used, true part will be done, otherwise +false part will be done. + +

+Top + +

+ +

+ +
+Glossary Styles +

+The glossaries package comes with some pre-defined +glossary styles. These are as follows: +
+
list
+
The list style uses the description +environment. The entry name is placed in the optional argument +of the \item command (so it will appear in bold by +default). The description follows, and then the associated number +list for that entry. + +

+

+
listgroup
+
The listgroup style is like +list but the glossary groups have headings. + +

+

+
listhypergroup
+
The listhypergroup style is like +listgroup but has a set of links to the glossary +groups. + +

+

+
altlist
+
The altlist style is like list +but the description is placed on the following line. + +

+

+
altlistgroup
+
The altlistgroup style is like +altlist but the glossary groups have headings. + +

+

+
altlisthypergroup
+
The altlisthypergroup style is like +altlistgroup but has a set of links to the glossary +groups. + +

+

+
listdotted
+
This style uses the description +environment. Each entry starts with \item[], followed by the +name followed by a dotted line, followed by the description. Note that +this style ignores both the number list and the symbol. The +length \glslistdottedwidth +governs where the description should start.4 +

+

+
long
+
The long style uses the longtable +environment (defined by the longtable package). It has two +columns: the first column contains the entry's name and the second +column contains the description followed by the number list. + +

+

+
longborder
+
The longborder style is like +long but has horizontal and vertical lines around it. + +

+

+
longheader
+
The longheader style is like +long but has a header row. + +

+

+
longheaderborder
+
The longheaderborder style is +like longheader but has horizontal and vertical lines +around it. + +

+

+
long3col
+
The long3col style is like +long but has three columns. The first column contains +the entry's name, the second column contains the description +and the third column contains the number list. + +

+

+
long3colborder
+
The long3colborder style is like +the long3col style but has horizontal and vertical +lines around it. + +

+

+
long3colheader
+
The long3colheader style is like +long3col but has a header row. + +

+

+
long3colheaderborder
+
The long3colheaderborder style is +like long3colheader but has horizontal and vertical lines +around it. + +

+

+
long4col
+
The long4col style is like +long3col but has an additional column in which the +entry's associated symbol appears. + +

+

+
long4colborder
+
The long4colborder style is like +the long4col style but has horizontal and vertical +lines around it. + +

+

+
long4colheader
+
The long4colheader style is like +long4col but has a header row. + +

+

+
long4colheaderborder
+
The long4colheaderborder style is +like long4colheader but has horizontal and vertical lines +around it. + +

+

+
super
+
The super style uses the supertabular +environment (defined by the supertabular package). It has two +columns: the first column contains the entry's name and the second +column contains the description followed by the number list. + +

+

+
superborder
+
The superborder style is like +super but has horizontal and vertical lines around it. + +

+

+
superheader
+
The superheader style is like +super but has a header row. + +

+

+
superheaderborder
+
The superheaderborder style is +like superheader but has horizontal and vertical lines +around it. + +

+

+
super3col
+
The super3col style is like +super but has three columns. The first column contains +the entry's name, the second column contains the description +and the third column contains the . + +

+

+
super3colborder
+
The super3colborder style is like +the super3col style but has horizontal and vertical +lines around it. + +

+

+
super3colheader
+
The super3colheader style is like +super3col but has a header row. + +

+

+
super3colheaderborder
+
The super3colheaderborder style +is like super3colheader but has horizontal and vertical +lines around it. + +

+

+
super4col
+
The super4col style is like +super3col but has an additional column in which the +entry's associated symbol appears. + +

+

+
super4colborder
+
The super4colborder style is like +the super4col style but has horizontal and vertical +lines around it. + +

+

+
super4colheader
+
The super4colheader style is like +super4col but has a header row. + +

+

+
super4colheaderborder
+
The super4colheaderborder style +is like super4colheader but has horizontal and vertical +lines around it. + +

+

+
+ +

+The glossary style can be set using the style package option +or using the style key in the optional +argument to \printglossary or using the command: +
+
\glossarystyle{style-name} +
+
+

+All the styles except for the three- and four-column styles and the +listdotted style use the command +\glspostdescription after the +description. This simply displays a full stop by default. To eliminate +this full stop (or replace it with something else, say a comma), you +will need to redefine \glspostdescription before the glossary is +displayed. +

+Top + +

+ +

+Defining your own glossary style +

+ +

+If the predefined styles don't fit your requirements, you can +define your own style using: +
+
\newglossarystyle{name}{definitions} +
+
+where name is the name of the new glossary style (to be +used in \glossarystyle). The second argument definitions, +needs to redefine all of the following: + +

+

+
+
+theglossary +

+This environment defines how the main body of the glossary should +be typeset. Note that this does not include the section heading, +the glossary preamble (defined by \glossarypreamble) or the +glossary postamble (defined by \glossarypostamble.) For example, +the list style uses the description environment, +so the theglossary environment is simply redefined to begin +and end the description environment. + +

+

+
+
+\glossaryheader +

+This macro indicates what to do at the start of the main body +of the glossary. Note that this is not the same as +\glossarypreamble, which should not be affected by changes in +the glossary style. The list glossary style redefines +\glossaryheader to do nothing, whereas the longheader +glossary style redefines \glossaryheader to do a header row. + +

+

+
+
+\glsgroupheading{label} +

+This macro indicates what to do at the start of each logical block +within the main body of the glossary. The glossary is sub-divided into +twenty-eight logical blocks that are determined by the first character +of the sort key (or name key if the sort +key is omitted). The sub-divisions are in the following order: symbols, +numbers, A, ..., Z. Note that the argument to \glsgroupheading +is a label not the group title. The group title can be obtained +via \glsgetgrouptitle{label}, and a navigation hypertarget can +be created using \glsnavhypertarget{label}. Most of the +predefined glossary styles redefine \glsgroupheading to simply +ignore its argument. The listhypergroup style redefines +\glsgroupheading as follows: +

+\renewcommand*{\glsgroupheading}[1]{%
+\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}
+
+See also \glsgroupskip below. (Note that command definitions within +\newglossarystyle must use ##1 etc instead of #1 etc.) + +

+

+
+
+\glsgroupskip +

+This macro determines what to do after one logical group but before +the header for the next logical group. The list glossary +style simply redefines \glsgroupskip to be \indexspace. + +

+

+
+
+\glossaryentryfield{label}{formatted +name}{description}{symbol} +{number list} +

+This macro indicates what to do for a given glossary entry. +Note that formatted name will always be in the form +\glsnamefont{name}. This allows the user to set a given +font for the entry name, regardless of the glossary style used. +Note that label is the label used when the glossary entry +was defined via either \newglossaryentry or \newacronym. +Each time you use a glossary entry it creates a +link5 +using \@glslink{label}{text} with the label +glo:label. Your +new glossary style must therefore redefine \glossaryentryfield +so that it uses \@glstarget{glo:label}{text} +to ensure the hyperlinks function correctly.6 For example, the +list style defines \glossaryentryfield as follows: +

+\renewcommand*{\glossaryentryfield}[5]{%
+\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5}
+
+ +

+Note also that number list will always be of the form +
+
\glossaryentrynumbers{\relax +
\setentrycounter{counter name}\glsnumberformat{number(s)}} +
+
+where number(s) +may contain \delimN (to delimit individual numbers) and/or +\delimR (to indicate a range of numbers). There may be +multiple occurrences of +\setentrycounter{counter name}\glsnumberformat{number(s)}, but note +that the entire number list is enclosed within the argument +to \glossaryentrynumbers. The user can redefine this to change +the way the entire number list is formatted, regardless of +the glossary style. However the most common use of +\glossaryentrynumbers is to provide a means of suppressing the +number list altogether. (In fact, the nonumberlist option +redefines \glossaryentrynumbers to ignore its argument.) +Therefore, when you define a new glossary style, you don't need +to worry about whether the user has specified the +nonumberlist package option. +

+
+

+Top + +

+ +

+Example: creating a completely new style +

+ +

+If you want a completely new style, you will need to redefine all +of the commands and environment listed above. You also need to +take care when using internal commands (commands whose name +contain the @ symbol). These should either be used in a .sty +file or must be placed within \makeatletter and \makeatother. + +

+For example, suppose you want each entry to start with a bullet point. +This means that the glossary should be placed in the itemize +environment, so theglossary should start and end that +environment. Let's also suppose that you don't want anything between +the glossary groups (so \glsgroupheading and \glsgroupskip +should do nothing) and suppose you don't want anything to appear +immediately after \begin{theglossary} (so \glossaryheader +should do nothing). In addition, let's suppose the symbol should +appear in brackets after the name, followed by the description and +last of all the number list should appear within square brackets +at the end. Then you can create this new glossary style, called, say, +mylist, as follows: +

+ \newglossarystyle{mylist}{%
+ % put the glossary in the itemize environment:
+ \renewenvironment{theglossary}{\begin{itemize}}{\end{itemize}}%
+ % have nothing after \begin{theglossary}:
+ \renewcommand*{\glossaryheader}{}%
+ % have nothing between glossary groups:
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glsgroupskip}{}%
+ % set how each entry should appear:
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \item % bullet point
+ \@glstarget{glo:##1}{##2}% the entry name
+ \space (##4)% the symbol in brackets
+ \space ##3% the description
+ \space [##5]% the number list in square brackets
+ }%
+ }
+
+ +

+Top + +

+ +

+Example: creating a new glossary style based on an +existing style +

+ +

+If you want to define a new style that is a slightly modified +version of an existing style, you can use \glossarystyle +within the second argument of \newglossarystyle followed by +whatever alterations you require. For example, suppose you want +a style like the list style but you don't want the extra +vertical space created by \indexspace between groups, then you +can create a new glossary style called, say, mylist as +follows: +

+\newglossarystyle{mylist}{%
+\glossarystyle{list}% base this style on the list style
+\renewcommand{\glsgroupskip}{}% make nothing happen between groups
+}
+
+ +

+Top + +

+ +

+
+ +

+Index +

+
\acronymfont +
Acronyms + | Acronyms +
\acronymtype +
A Quick Guide For + | Package Options + | Defining Glossary Entries +
babel +
Introduction + | Package Options + | Package Options +
\defglsdisplay +
Acronyms + | Acronyms +
\defglsdisplayfirst +
Acronyms + | Acronyms +
\emph +
A Quick Guide For +
file types +
+
.alg +
Generating the associated glossary +
.glg +
Generating the associated glossary + | A Quick Guide For +
.glo +
Defining Glossary Entries +
.gls +
Defining Glossary Entries +
.ist +
Generating the associated glossary + | Defining Glossary Entries + | Defining Glossary Entries +
.nlg +
A Quick Guide For +
+
glossary +
Introduction +
glossary styles +
+
altlist +
Glossary Styles + | Glossary Styles +
altlistgroup +
Glossary Styles + | Glossary Styles +
altlisthypergroup +
Glossary Styles +
list +
Glossary Styles + | Glossary Styles + | Glossary Styles + | Defining your own glossary + | Defining your own glossary + | Defining your own glossary + | Defining your own glossary + | Example: creating a new +
listdotted +
Glossary Styles +
listgroup +
Glossary Styles + | Glossary Styles +
listhypergroup +
Glossary Styles + | Defining your own glossary +
long +
Glossary Styles + | Glossary Styles + | Glossary Styles + | Glossary Styles +
long3col +
Glossary Styles + | Glossary Styles + | Glossary Styles + | Glossary Styles +
long3colborder +
Glossary Styles +
long3colheader +
Glossary Styles + | Glossary Styles +
long3colheaderborder +
Glossary Styles +
long4col +
A Quick Guide For + | Glossary Styles + | Glossary Styles + | Glossary Styles +
long4colborder +
A Quick Guide For + | Glossary Styles +
long4colheader +
A Quick Guide For + | Glossary Styles + | Glossary Styles +
long4colheaderborder +
A Quick Guide For + | Glossary Styles +
longborder +
Glossary Styles +
longheader +
Glossary Styles + | Glossary Styles + | Defining your own glossary +
longheaderborder +
Glossary Styles +
super +
Glossary Styles + | Glossary Styles + | Glossary Styles + | Glossary Styles +
super3col +
Glossary Styles + | Glossary Styles + | Glossary Styles + | Glossary Styles +
super3colborder +
Glossary Styles +
super3colheader +
Glossary Styles + | Glossary Styles +
super3colheaderborder +
Glossary Styles +
super4col +
A Quick Guide For + | Glossary Styles + | Glossary Styles + | Glossary Styles +
super4colborder +
A Quick Guide For + | Glossary Styles +
super4colheader +
A Quick Guide For + | Glossary Styles + | Glossary Styles +
super4colheaderborder +
A Quick Guide For + | Glossary Styles +
superborder +
Glossary Styles +
superheader +
Glossary Styles + | Glossary Styles +
superheaderborder +
Glossary Styles +
+
glossary-list +
A Quick Guide For +
\glossaryentrynumbers +
Defining your own glossary +
\glossarystyle +
A Quick Guide For + | Displaying a glossary +
\gls +
A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of + | Enabling and disabling hyperlinks + | Unsetting and resetting entry +
\glsadd +
A Quick Guide For + | A Quick Guide For +
\glsaddall +
A Quick Guide For + | A Quick Guide For +
\glscompositor +
A Quick Guide For +
\glsdesc +
Acronyms +
\glsfirst +
Acronyms +
\glslink +
A Quick Guide For + | A Quick Guide For + | Links to Glossary Entries + | Enabling and disabling hyperlinks + | Adding an entry to +
\glslink keys +
+
counter +
Links to Glossary Entries +
format +
A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Links to Glossary Entries +
hyper +
Links to Glossary Entries + | Enabling and disabling hyperlinks + | Adding an entry to +
+
\glsnamefont +
A Quick Guide For + | A Quick Guide For +
\glspl +
A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Defining Glossary Entries + | Defining Glossary Entries + | Changing the format of +
\glssymbol +
Acronyms +
\glstext +
Acronyms + | Acronyms +
\glstextformat +
Changing the format of +
html +
A Quick Guide For + | Enabling and disabling hyperlinks +
\hyperemph +
A Quick Guide For +
\hyperlink +
Enabling and disabling hyperlinks +
hyperref +
A Quick Guide For + | Links to Glossary Entries + | Enabling and disabling hyperlinks + | Enabling and disabling hyperlinks +
\hypertarget +
Enabling and disabling hyperlinks +
\item +
A Quick Guide For +
link text +
Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of + | Changing the format of + | Changing the format of +
longtable +
Glossary Styles +
makeglossaries +
Generating the associated glossary + | Generating the associated glossary + | Generating the associated glossary + | Generating the associated glossary + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Defining Glossary Entries + | Displaying a glossary + | Displaying a glossary + | Defining New Glossaries +
makeindex +
Generating the associated glossary + | Generating the associated glossary + | Generating the associated glossary + | Generating the associated glossary + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Displaying a glossary + | Displaying a glossary + | Defining New Glossaries +
\newacronym +
A Quick Guide For + | Package Options + | Package Options + | Package Options + | Package Options + | Acronyms + | Acronyms +
\newglossary +
A Quick Guide For +
\newglossaryentry +
A Quick Guide For + | A Quick Guide For + | Links to Glossary Entries + | Links to Glossary Entries +
\newglossaryentry keys +
+
description +
A Quick Guide For + | Package Options + | Package Options + | Package Options + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of + | Acronyms + | Acronyms +
first +
Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of + | Acronyms + | Unsetting and resetting entry +
firstplural +
Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of +
format +
Links to Glossary Entries +
name +
A Quick Guide For + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Acronyms + | Acronyms + | Defining your own glossary +
plural +
A Quick Guide For + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of +
sort +
A Quick Guide For + | Package Options + | Defining Glossary Entries + | Defining your own glossary + | Defining your own glossary +
symbol +
Package Options + | Package Options + | Package Options + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of + | Changing the format of + | Changing the format of + | Acronyms +
text +
Package Options + | Package Options + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Defining Glossary Entries + | Links to Glossary Entries + | Links to Glossary Entries + | Changing the format of + | Acronyms + | Unsetting and resetting entry +
type +
A Quick Guide For + | A Quick Guide For + | Defining Glossary Entries + | Defining Glossary Entries +
+
number list +
Package Options + | Package Options + | Number lists + | Defining New Glossaries + | Glossary Styles + | Glossary Styles + | Glossary Styles + | Glossary Styles + | Glossary Styles + | Example: creating a completely +
package options +
+
acronym +
Generating the associated glossary + | Generating the associated glossary + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Defining Glossary Entries + | Defining Glossary Entries + | Defining New Glossaries + | Defining New Glossaries + | Defining New Glossaries + | Defining New Glossaries + | Defining New Glossaries + | Defining New Glossaries + | Acronyms + | Acronyms +
babel +
Package Options + | Package Options + | Package Options + | Package Options +
+
false +
Package Options +
true +
Package Options +
+
counter +
Package Options + | Package Options + | Number lists + | Number lists +
description +
Package Options + | Package Options + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms +
dua +
Package Options + | Package Options + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms +
footnote +
Package Options + | Package Options + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms +
nonumberlist +
A Quick Guide For + | A Quick Guide For + | Package Options + | Package Options + | Number lists + | Number lists + | Defining your own glossary + | Defining your own glossary + | Defining your own glossary + | Defining your own glossary +
numberedsection +
Package Options + | Package Options + | Package Options + | Package Options + | Package Options +
+
autolabel +
Package Options + | Package Options +
false +
Package Options +
nolabel +
Package Options +
+
numberline +
Package Options + | Package Options + | Package Options + | Package Options +
sanitize +
Package Options + | Package Options + | Package Options + | Package Options + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms +
+
description +
Acronyms + | Acronyms +
symbol +
Acronyms + | Acronyms + | Acronyms +
+
section +
A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Package Options + | Package Options +
smallcaps +
Package Options + | Package Options + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms + | Acronyms +
style +
A Quick Guide For + | A Quick Guide For + | Package Options + | Package Options + | Displaying a glossary + | Displaying a glossary + | Glossary Styles + | Glossary Styles +
toc +
A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | A Quick Guide For + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Package Options + | Displaying a glossary + | Displaying a glossary +
translate +
Introduction +
+
false +
Introduction +
+
+
\printglossaries +
A Quick Guide For + | Defining Glossary Entries +
\printglossary +
Defining Glossary Entries + | Glossary Styles +
\printglossary keys +
+
style +
Displaying a glossary + | Glossary Styles +
title +
Displaying a glossary +
toctitle +
Displaying a glossary +
type +
Displaying a glossary +
+
\setglossarysection +
Package Options +
supertabular +
Glossary Styles +
translator +
Introduction + +
+

+Top + +

+


Footnotes

+
+
... +range1
+
This is new to version 1.01 + +
+
...acronym2
+
if the +acronym option is used, otherwise the list of +acronyms is the main glossary + +
+
... name3
+
main for the main +(default) glossary, \acronymtype for the list of acronyms, or the +name supplied in the first mandatory argument to \newglossary for +additional glossaries. + +
+
... start.4
+
This style was +supplied by Axel Menzel. + +
+
... +link5
+
if the document doesn't have hyperlinks enabled +\@glslink ignores the label and simply typesets the text. + +
+
... correctly.6
+
again, if the +document doesn't support hyperlinks, \@glstarget will ignore +the label, and just typeset the text. + +
+
+

+ + + diff --git a/Master/texmf-dist/doc/latex/glossaries/glossaries-manual.tex b/Master/texmf-dist/doc/latex/glossaries/glossaries-manual.tex new file mode 100644 index 00000000000..9ede69d65e0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/glossaries-manual.tex @@ -0,0 +1,1947 @@ +\documentclass[a4paper]{ltxdoc} +\usepackage{ifthen} +\usepackage{alltt} +\usepackage[colorlinks, + bookmarks, + hyperindex=false, + pdfauthor={Nicola L.C. Talbot}, + pdftitle={glossaries.sty: LaTeX2e Package to Assist Generating Glossaries}, + pdfkeywords={LaTeX,package,glossary,acronyms}]{hyperref} + + %hyperindex conflicts with doc + %(end up with |usage|hyperpage in indexentry) + %This unfortunately means that the changes section doesn't + %have active links, but at least it will keep makeindex happy. + +\usepackage{creatdtx} +\ifmakedtx{ +\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{4357} +\CodelineNumbered +\newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}} +\newcommand*{\term}[1]{#1\iterm{#1}} +\newcommand*{\iterm}[1]{\index{#1|main}} +\newcommand{\dq}[1]{``#1''} +} +{ +\usepackage{html} +\usepackage{makeidx} +\renewcommand{\LaTeX}{LaTeX} +\renewcommand{\LaTeXe}{LaTeX2e} +\newcommand*{\termdef}[1]{\emph{#1}\index{#1}} +\newcommand*{\term}[1]{#1\index{#1}} +\newcommand*{\iterm}[1]{\index{#1}} +\newcommand{\dq}[1]{"#1"} +} + + +\ifmakedtx{ +\newcommand*{\istkey}[1]{\texttt{#1}\index{makeindex=\texttt{makeindex}>#1=\texttt{#1}|hyperpage}} +\newcommand*{\ics}[1]{\texttt{\char`\\#1}\SpecialMainIndex{#1}} +\newcommand*{\appname}[1]{\texttt{#1}\index{#1=\texttt{#1}|hyperpage}} +\newcommand*{\mkidxspch}{\index{makeindex=\texttt{makeindex}>special characters|hyperpage}} +\newcommand*{\igloskey}[2][newglossaryentry]{\index{#1 options=\cs{#1} options>#2=\textsf{#2}|hyperpage}} +\newcommand*{\gloskey}[2][newglossaryentry]{\textsf{#2}\igloskey[#1]{#2}} +\newcommand*{\ipkgopt}[2][]{% +\ifthenelse{\equal{#1}{}}{% +\index{package options>#2=\textsf{#2}|hyperpage}}{% +\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}} +\newcommand*{\pkgopt}[2][]{% +\ifthenelse{\equal{#1}{}}{% +\textsf{#2}\index{package options>#2=\textsf{#2}|hyperpage}}{% +\textsf{#2=#1}\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}} +\newcommand*{\pkgoptval}[2]{\textsf{#1}\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}} +\newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles>#1|hyperpage}} +\newcommand*{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}} +\newcommand*{\sty}[1]{\textsf{#1}} +\newcommand*{\isty}[1]{\sty{#1}\index{#1 package=\sty{#1} package|hyperpage}} +\newcommand*{\envname}[1]{\textsf{#1}} +} +{ +\newcommand{\istkey}[1]{\texttt{#1}\index{makeindex key!#1}} +\newcommand{\ics}[1]{\texttt{\char`\\#1}\index{#1@\cs{#1}}} +\html{\newcommand{\SpecialMainIndex}[1]{\index{#1@\cs{#1}}}} +\newcommand{\appname}[1]{\texttt{#1}\index{#1@\texttt{#1}}} +\newcommand*{\mkidxspch}{\index{makeindex@\texttt{makeindex}!special characters|hyperpage}} +\newcommand{\gloskey}[2][newglossaryentry]{\texttt{#2}\index{#1 keys@\cs{#1} keys!#2}} +\newcommand{\ipkgopt}[2][]{% +\ifthenelse{\equal{#1}{}}{% +\index{package options!#2}}{% +\index{package options!#2!#1}}} +\newcommand{\pkgopt}[2][]{% +\ifthenelse{\equal{#1}{}}{% +\texttt{#2}\index{package options!#2}}{% +\texttt{#2=#1}\index{package options!#2!#1}}} +\newcommand{\pkgoptval}[2]{\texttt{#1}\index{package options!#2!#1}} +\newcommand{\glostyle}[1]{\texttt{#1}\index{glossary styles!#1}} +\newcommand{\filetype}[1]{\texttt{#1}\index{file types!#1}} +\newcommand{\sty}[1]{\texttt{#1}} +\newcommand{\isty}[1]{\sty{#1}\index{#1@\sty{#1}}} +\newcommand{\envname}[1]{\texttt{#1}} +\newcommand{\toTop}{\mbox{}\par\htmlref{Top}{top}} +} + +\begin{document}\ifmakedtx{}{\label{top}} +\MakeShortVerb{"} +\DeleteShortVerb{\|} + + \title{glossaries.sty v 1.11: \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{2nd March 2008} + \maketitle +\tableofcontents + + \section{Introduction} + + \changes{1.0}{2007 May 16}{Initial version} +The \sty{glossaries} package is provided to assist generating +glossaries. It has a certain amount of flexibility, allowing the user +to customize the format of the glossary and define multiple glossaries. +It also supports acronyms and glossary styles that include +symbols (in addition to a name and description) for glossary +entries. There is provision for loading a database of glossary terms +where only those terms used in the text are added to the glossary. +This package replaces the \isty{glossary} package which is now +obsolete. + +As from version 1.08, the \sty{glossaries} package now has +limited multi-lingual support, thanks to all the people who have sent +me the relevant translations either via email or via comp.text.tex. +However you must load \isty{babel} \emph{before} +\sty{glossaries} to enable this. \ifmakedtx{(See \autoref{sec:predefinednames} for the +predefined names used by the \sty{glossaries} package.)}{} +As from version 1.1, the \sty{glossaries} package also supports +Till~Tantau's \isty{translator} package provided it is loaded +before the \sty{glossaries} package. This makes it easier to change +the default translations or add new dictionaries. +If you don't want to use the predefined translations, you can use the +package option \pkgopt[false]{translate} and supply your own translations. + +This documentation is structured as follows: \ifmakedtx{\autoref{sec:quick}}{\htmlref{{A Quick Guide For The Impatient}}{sec:quick}} is for +people who want a few quick pointers of how to get started, +without having to read through lengthy descriptions, +\ifmakedtx{\autoref{sec:overview}}{and \htmlref{Overview}{sec:overview}} gives an overview of available commands +and their syntax\ifmakedtx{, \autoref{sec:code} contains the documented +source code for those who want to know more about how the +package works, and how to do more complicated things, such as +changing the way glossary entries appear}{}.\ifmakedtx{}{\toTop} + +\subsection{Generating the associated glossary files} +\label{sec:makeglossaries} + +The \sty{glossaries} package comes with the Perl script +\appname{makeglossaries} which will run \appname{makeindex} on +all the glossary files using a customized \appname{makeindex} +\filetype{.ist} style file (which is created by \ics{makeglossaries}). +The relevant extensions are obtained from the +auxiliary file, so you should only pass the basename as the +argument. For example, if your document is called +\texttt{myfile.tex}, do: +\begin{verbatim} +latex myfile +makeglossaries myfile +latex myfile +\end{verbatim} +You may need to explicitly load \appname{makeglossaries} into +Perl: +\begin{verbatim} +perl makeglossaries myfile +\end{verbatim} +There is a batch file called \texttt{makeglossaries.bat} which +does this for Windows users. + +If you don't have Perl installed, you will have to run +\appname{makeindex} for each glossary type you have defined. +For example, if you have used the \pkgopt{acronym} package option +then you will have both a main glossary as well as a list of acronyms, so you +will need to do (assuming your document is called \texttt{myfile.tex}): +\begin{verbatim} +makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo +makeindex -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn +\end{verbatim} +This requires remembering all extensions for each of the glossaries +defined in your document, so where possible you should use +\appname{makeglossaries} instead to reduce the possibility of error. +Don't pass all the glossary files in a single call to +\appname{makeindex} or it will merge all your glossaries into a +single glossary. + +If any problems occur, remember to check the transcript files +(e.g.\ \filetype{.glg} or \filetype{.alg}) for messages.\ifmakedtx{}{\toTop} + +\subsection{Troubleshooting} + +The glossaries package comes with a minimal file called +\texttt{minimalgls.tex} which can be used for testing. This +should be located in \texttt{texmf/doc/latex/glossaries/samples/}. Further +information on debugging \LaTeX\ code is available at +\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/}. + +There is a list of frequently asked questions for the +\sty{glossaries} package available at +\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html}.\ifmakedtx{}{\toTop} + +\section{A Quick Guide For The Impatient} +\label{sec:quick} + +This section is for people who want a few quick pointers +of how to get started, without having to read through +lengthy descriptions. + +\begin{enumerate} +\item Load \sty{glossaries} \emph{after} \isty{hyperref}: +\begin{verbatim} +\usepackage{hyperref} +\usepackage{glossaries} +\end{verbatim} +Similarly for the \isty{html} package: +\begin{verbatim} +\usepackage{html} +\usepackage{glossaries} +\end{verbatim} + +\item Always use \ics{makeglossaries} if you want the glossary +entries to be written to the glossary file: +\begin{verbatim} +\documentclass{article} +\usepackage{glossaries} +\makeglossaries +\end{verbatim} +If you don't use \ics{makeglossaries}, your glossaries will +not appear in the document! + +\item Use \ics{printglossaries} to make your glossaries appear +in the document at that point. For example: +\begin{verbatim} +\maketitle +\printglossaries +\section{Introduction} +\end{verbatim} +Note that only the glossary entries that have been used in the +document text will appear in the glossary. + +\item When you have created your document, run \LaTeX\ on it, +then the Perl script \appname{makeglossaries}, then run \LaTeX\ +on it again: +\begin{verbatim} +latex myfile +makeglossaries myfile +latex myfile +\end{verbatim} +(You may need to run \LaTeX\ again if you have used the \pkgopt{toc} +package option.) +If you use Windows, there is a batch file called +\texttt{makeglossaries.bat} which you can use, but you will +still need Perl installed. + +\item New glossaries can be defined using:\par +\ics{newglossary}\oarg{log-ext}% +\marg{label}\marg{in-ext}\marg{out-ext}% +\marg{title}\par where \meta{label} is an identifying label, +\meta{in-ext} is the extension of the file to be created +by \appname{makeindex} (called by \appname{makeglossaries}), +\meta{out-ext} is the extension of the file to be read by +\appname{makeindex} and \meta{title} is the title for this +new glossary. The first optional argument \meta{log-ext} specifies +the extension of the \appname{makeindex} transcript file. Example: +\begin{verbatim} +\newglossary[nlg]{notation}{not}{ntn}{Notation} +\end{verbatim} +This glossary's label is \texttt{notation} and its title +will be Notation. If you use \appname{makeglossaries}, the +\appname{makeindex} transcript will be written to a file with the +extension \filetype{.nlg}. If \meta{log-ext} is omitted, the extension +\filetype{.glg} will be used. + +\item Any new glossaries must be defined before +\cs{makeglossaries} +\begin{verbatim} +\documentclass{article} +\usepackage{glossaries} +\newglossary{notation}{not}{ntn}{Notation} +\makeglossaries +\end{verbatim} + +\item If you use the \pkgopt{acronym} package option, the +\sty{glossaries} package +will automatically create a new glossary type labelled +\texttt{acronym}: +\begin{verbatim} +\usepackage[acronym]{glossaries} +\end{verbatim} + +\item If your pages have a hyphen compositor (i.e.\ your page +numbers appear in the form 2-1), redefine \ics{glscompositor} +\emph{before} \ics{makeglossaries}: +\begin{verbatim} +\documentclass{article} +\usepackage{glossaries} +\renewcommand{\glscompositor}{-} +\makeglossaries +\end{verbatim} + +\item To add the glossaries to the table of contents use the +\pkgopt{toc} package option: +\begin{verbatim} +\usepackage[toc]{glossaries} +\end{verbatim} + +\item Define a new entry with:\par +\ics{newglossaryentry}\marg{label}\marg{key-val list}\par +The \meta{key-val list} must at least contain a \gloskey{name} +key and a \gloskey{description} key. +For example: +\begin{verbatim} +\newglossaryentry{perl}{name=Perl, +description=A scripting language} +\end{verbatim} +In this example, I have given the entry the label \texttt{perl}. +Whenever I want to use this entry, that is the label I need +to use to identify it. + +\item If the entry name starts with an accented letter, you will +need to group the first letter (otherwise it will cause a +problem for \ics{Gls} and \ics{Glspl}): +\begin{verbatim} +\newglossaryentry{elite}{name={{\'e}lite}, +description={select group or class}} +\end{verbatim} + +\item If you have multiple glossaries, use the \gloskey{type} +key to specify in which glossary the entry belongs. For example: +\begin{verbatim} +\newglossary{languages}{lan}{lng}{Index of Languages} + +\makeglossaries + +\newglossaryentry{perl}{name=Perl, +description=A scripting language, +type=languages} +\end{verbatim} +If \gloskey{type} is omitted, the default glossary is used. + +\item Remember to group values that have a comma or equal sign. +For example: +\begin{verbatim} +\newglossaryentry{pagelist}{name=page list, +description={A list of individual pages or page ranges +(e.g.\ 1,2,4,7--9)}} +\end{verbatim} + +\item Plural forms are assumed to be the singular form with an +\dq{s} appended, unless otherwise specified. To specify an +irregular plural, use the \gloskey{plural} key. For example: +\begin{verbatim} +\newglossaryentry{matrix}{name=matrix, +description=rectangular array of quantities, +plural=matrices} +\end{verbatim} + +\item The way the term appears in the main text can be different +from the way the term appears in the glossary: +\begin{verbatim} +\newglossaryentry{matrix}{name=Matrix, +description=rectangular array of quantities, +text=matrix, +plural=matrices} +\end{verbatim} +In this example, the entry name appears as \dq{Matrix} in the +glossary, and either \dq{matrix} or \dq{matrices} in the text. + +\item The way the term appears on first use can be different +to the way it appears subsequently: +\begin{verbatim} +\newglossaryentry{singmtx}{name=Singular Matrix, +description=A matrix with a zero determinant, +first=singular matrix (SM), +text=SM, +firstplural=singular matrices (SMs)} +\end{verbatim} +In this example, the entry name appears as \dq{Singular Matrix} in +the glossary, and in the text it appears as \dq{singular matrix (SM)} +or \dq{singular matrices (SMs)} the first time the entry is used, +and subsequently appears as \dq{SM} or \dq{SMs}. + +\item The quick and easy way to define an acronym is to use:\par +\ics{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}% +\marg{long}\par +For example: +\begin{verbatim} +\newacronym{svm}{SVM}{support vector machine} +\end{verbatim} +This is equivalent to: +\begin{verbatim} +\newglossaryentry{svm}{type=\acronymtype, +name={SVM}, +description={support vector machine}, +text={SVM}, +first={support vector machine (SVM)}, +plural={SVMs}, +firstplural={support vector machines (SVMs)}} +\end{verbatim} +(The value of \ics{acronymtype} varies depending on whether +the \pkgopt{acronym} package option is used or not. +The optional argument \meta{key-val list} can be used to +override any of the \ics{newglossaryentry} keys; for +example, if the acronym has an irregular plural.) + +\item The font used to display the entry name in the glossary +is governed by \ics{glsnamefont}. This can be redefined +as required. For example, to make the entry names appear +in a medium sans-serif font do: +\begin{verbatim} +\renewcommand{\glsnamefont}[1]{\textsf{\mdseries #1}} +\end{verbatim} +Note that the list-like glossary styles defined in the +\isty{glossary-list} package place the entry name in +the optional argument to \ics{item}, so they will +appear in bold, unless you redefine \ics{glsnamefont} to counteract the +bold font. + +\item In the document use \ics{gls}\marg{label} +to use a predefined term (this will also enter the term into +the associated glossary output file). For example: +\begin{verbatim} +A \gls{singmtx} is a matrix with a zero determinant. +\end{verbatim} + +\item Other variations: +\begin{itemize} +\item \ics{Gls}\marg{label} : like \cs{gls}, +but with first letter in upper case +\item \ics{GLS}\marg{label} : like \cs{gls}, +but all upper case. +\item \ics{glspl}\marg{label} : use plural +\item \ics{Glspl}\marg{label} : use plural with +first letter in upper case +\item \ics{GLSpl}\marg{label} : use plural but +all upper case +\item \ics{glslink}\marg{label}\marg{link text} : +use \meta{link text} to link to the given entry in the glossary. +\end{itemize} +For example, the following will produce the plural form with +the first letter in uppercase: +\begin{verbatim} +\Glspl{singmtx} are matrices with a zero determinant. +\end{verbatim} + +\item Additional text can be appended to the link using the +end optional argument. For example, to form the possessive: +\begin{verbatim} +The \gls{singmtx}['s] dimensions \ldots +\end{verbatim} + +\item The format of the associated entry number can be +changed using the \gloskey[glslink]{format} key in the optional argument. +Note that the value of the \gloskey[glslink]{format} key should be the +name of a command \emph{without} the initial backslash. For +example: +\begin{verbatim} +The primary definition of \glspl[format=textbf]{singmtx}. +\end{verbatim} +In this example the relevant glossary entry will have the +page number in bold (since it uses \cs{textbf}) but +it will no longer have a hyperlink (if hyperlinks are enabled.) + +\item The \sty{glossaries} package provides commands to +change the font whilst ensuring that the number remains a +hyperlink. These are of the form \cs{hyper}\meta{xx} and +are equivalent to the standard font changing commands of the +form \cs{text}\meta{xx}, as well as \ics{hyperemph} +(which uses \ics{emph}.) For example: +\begin{verbatim} +The primary definition of \glspl[format=hyperbf]{singmtx}. +\end{verbatim} + +\item Don't use declarations in \gloskey[glslink]{format} as this can +cause unpredictable results, as there is no guarantee that the effect +will be localised to the required text. + +\item Entries can be added to the glossary without producing +any text using \ics{glsadd}\marg{label} or +\ics{glsaddall}. These commands also taken an optional +argument where you can specify the format. For example +\begin{verbatim} +\glsadd[format=hyperbf]{singmtx} +\end{verbatim} +will add a line to the +glossary file for the specified term, but will not produce +any text where the command occurs. + +\item A number range can be entered using \verb|format=(| and +\verb"format=)" to mark the beginning and ending of the +range\footnote{This is new to version 1.01}. For example: +\begin{verbatim} + \glsadd[format=(]{singmtx} + This is a very long section all about \glspl{singmtx}. + + % lots of text omitted + + \glsadd[format=)]{singmtx} +\end{verbatim} +This is equivalent to \appname{makeindex}'s \verb"|(" and \verb"|)" +formats. + +\item You can combine the range markers with a formatting command +(again without the preceding backslash). For example: +\begin{verbatim} + This is the start of a very long section all + about \glspl[format=(hyperbf]{singmtx}. + + % lots of text omitted + + This is the end a very long section all about + \glspl[format=)hyperbf]{singmtx}. +\end{verbatim} + +\item Only those terms that have actually been used in the +document will be placed in the glossary. If you have defined +a term that doesn't appear in the document, then it means +you haven't used it in the text (either via \ics{glslink} +or \ics{gls} and related commands, or via \ics{glsadd} +or \ics{glsaddall}.) + +\item To change the sorting order, use the \gloskey{sort} key. +For example: +\begin{verbatim} +\newglossaryentry{universal}{name={\ensuremath{\mathcal{U}}}, +description=The universal set, +sort=U} +\end{verbatim} + +\item You don't need to escape \appname{makeindex}'s special characters: +\begin{verbatim} +\newglossaryentry{quote}{name={"}, +description={Double quote character}} + +\newglossaryentry{exclam}{name={!}, +description={Exclamation mark}} + +\newacronym{rna}{RNA}{ribonukleins\"aure} +\end{verbatim} + +\item Associated symbols can also be specified, but whether the +symbol appears in the glossary depends on the glossary style. +For example: +\begin{verbatim} +\newglossaryentry{metre}{name={metre}, +description={A metric measurement of length}, +symbol={m}} +\end{verbatim} +The predefined glossary styles that display the entry symbol +are: \glostyle{long4col}, \glostyle{long4colheader}, +\glostyle{long4colborder}, \glostyle{long4colheaderborder}, +\glostyle{super4col}, \glostyle{super4colheader}, +\glostyle{super4colborder} and \glostyle{super4colheaderborder}. +All the other styles supplied by this package ignore the associated +symbol. + +\item Glossary styles can be set using the \pkgopt{style} +package option. For example: +\begin{verbatim} +\usepackage[style=long3col]{glossaries} +\end{verbatim} +or using \ics{glossarystyle}\marg{style}. For example: +\begin{verbatim} +\glossarystyle{altlist} +\end{verbatim} +The predefined glossary styles provided by the \sty{glossaries} +bundle are listed in \ifmakedtx{\autoref{sec:styles}}{\htmlref{{Glossary Styles}}{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}\ifmakedtx{}{\toTop} + +\section{Overview}\label{sec:overview} + \changes{1.02}{2007 May 25}{added overview section} + +\subsection{Package Options} + +The \sty{glossaries} package options are as follows: +\begin{description} +\item[\pkgopt{toc}] Add the glossaries to the table of contents. + +\item[\pkgopt{numberline}] When used with \pkgopt{toc}, this will +add \cs{numberline}\verb|{}| in the final argument of +\cs{addcontentsline}. This will align the table of contents entry +with the numbered section titles. Note that this option has no +effect if the \pkgopt{toc} option is omitted. If \pkgopt{toc} is +used without \pkgopt{numberline}, the title will be aligned with +the section numbers rather than the section titles. + +\item[\pkgopt{acronym}] Make a separate glossary for acronyms. + +\item[\pkgopt{section}] This is a \meta{key}=\meta{value} option. Its +value should be the name of a sectional unit (e.g.\ chapter). +This will make the glossaries appear in the named sectional unit, +otherwise each glossary will appear in a chapter, if chapters +exists, otherwise in a section. Unnumbered sectional units will be used +by default. Example: +\begin{verbatim} +\usepackage[section=subsection]{glossaries} +\end{verbatim} +You can omit the value if you want to use sections, i.e.\ +\begin{verbatim} +\usepackage[section]{glossaries} +\end{verbatim} +is equivalent to +\begin{verbatim} +\usepackage[section=section]{glossaries} +\end{verbatim} +You can change this value later in the document using +\ics{setglossarysection}\marg{type}. + +\item[\pkgopt{numberedsection}] +The glossaries are placed in unnumbered sectional units by default, +but this can be changed using \pkgopt{numberedsection}. This option can take +three possible values: \pkgoptval{false}{numberedsection} (no +number, i.e.\ use starred form), \pkgoptval{nolabel}{numberedsection} +(numbered, i.e.\ unstarred form, but not labelled) and +\pkgoptval{autolabel}{numberedsection} (numbered with automatic +labelling). If \pkgopt[autolabel]{numberedsection} is used, each +glossary is given a label that matches the glossary type, so the +main (default) glossary is labelled \texttt{main}, the list of +acronyms is labelled \texttt{acronym}\footnote{if the +\pkgopt{acronym} option is used, otherwise the list of +acronyms is the main glossary} and additional glossaries are labelled +using the value specified in the first mandatory argument to +\cs{newglossary}. For example, if you load \sty{glossaries} +using: +\begin{verbatim} +\usepackage[section,numberedsection=autolabel]{glossaries} +\end{verbatim} +then each glossary will appear in a numbered section, and can +be referenced using something like: +\begin{verbatim} +The main glossary is in section~\ref{main} and the list of +acronyms is in section~\ref{acronym}. +\end{verbatim} +If you can't decide whether to have the acronyms in the main +glossary or a separate list of acronyms, you can use +\ics{acronymtype} which is set to \texttt{main} if the +\pkgopt{acronym} option is not used and is set to \texttt{acronym} +if the \pkgopt{acronym} option is used. For example: +\begin{verbatim} +The list of acronyms is in section~\ref{\acronymtype}. +\end{verbatim} + +\item[\pkgopt{style}] This is a \meta{key}=\meta{value} option. Its +value should be the name of the glossary style to use. Predefined +glossary styles are listed \ifmakedtx{in \autoref{sec:styles}}{\htmlref{later}{sec:styles}}. + +\item[\pkgopt{nonumberlist}] This option will suppress the +associated number lists\iterm{number list} in the glossaries (see also +\ifmakedtx{\autoref{sec:numberlists}}{\htmlref{Number Lists}{sec:numberlists}}.) + +\item[\pkgopt{counter}] This is a \meta{key}=\meta{value} option. The +value should be the name of the default counter to use in the number +lists\iterm{number list}. + +\ifmakedtx{\hypertarget{sanitize}{}\relax}{\label{sanitize}} +\item[\pkgopt{sanitize}] This is a \meta{key}=\meta{value} option whose +value is also a \meta{key}=\meta{value} list. By default, the +\sty{glossaries} package sanitizes the values of the +\gloskey{name}, \gloskey{description} and \gloskey{symbol} keys used +when defining a new glossary entry. This may lead to unexpected results +if you try to display these values within the document text. This +sanitization can be switched off using the \pkgopt{sanitize} package +option. \ifmakedtx{(See \autoref{sec:pkgopt} and \autoref{sec:newentry} for +further details.)}{} For example, to switch off the sanitization for the +\gloskey{description} and \gloskey{name} keys, but not for the +\gloskey{symbol} key, do: +\begin{verbatim} +\usepackage[sanitize={name=false,description=false,% +symbol=true}]{glossaries} +\end{verbatim} + +\textbf{Note}: this sanitization only applies to the \gloskey{name}, +\gloskey{description} and \gloskey{symbol} keys. It doesn't apply +to any of the other keys (except the \gloskey{sort} key which is +always sanitized) so fragile commands contained in the value of +the other keys must always be protected using \cs{protect}. +Since the value of the \gloskey{text} key is obtained from the +\gloskey{name} key, you will still need to protect fragile commands +in the \gloskey{name} key if you don't use the \gloskey{text} key. + +\item[\pkgopt{babel}] This is a boolean key and is for use when +the \sty{glossaries} package is used in conjunction with the +\isty{babel} package. The default is \pkgopt[true]{babel}, which +adds the glossary translations to \isty{babel}'s captions. If +you don't like the translations provided by the \sty{glossaries} +package, you can set \pkgopt[false]{babel} and provide your own +translations. + +\item[\pkgopt{description}] This option changes the definition of +\ics{newacronym} to allow a description. See \ifmakedtx{\autoref{sec:acronyms}}{\htmlref{later}{sec:acronyms}} +for further details. + +\item[\pkgopt{footnote}] This option changes the definition of +\ics{newacronym} and the way that acronyms are displayed. See \ifmakedtx{\autoref{sec:acronyms}}{\htmlref{later}{sec:acronyms}} +for further details. + +\item[\pkgopt{smallcaps}] This option changes the definition of +\ics{newacronym} and the way that acronyms are displayed. See \ifmakedtx{\autoref{sec:acronyms}}{\htmlref{later}{sec:acronyms}} +for further details. + +\item[\pkgopt{dua}] This option changes the definition of +\ics{newacronym} so that acronyms are always expanded. +See \ifmakedtx{\autoref{sec:acronyms}}{\htmlref{later}{sec:acronyms}} +for further details. + +\end{description}\ifmakedtx{}{\toTop} + +\subsection{Defining Glossary Entries} +\label{sec:newglosentry} + +All glossary entries that are used in a document must be defined in +the preamble. Only those entries that occur in the document +(using any of the commands described in \ifmakedtx{\autoref{sec:glslink}}{\htmlref{Links to Glossary Entries}{sec:glslink}} and +\ifmakedtx{\autoref{sec:glsadd}}{\htmlref{Adding an entry to the glossary without generating text}{sec:glsadd}}) will appear in the glossary. Each time an entry +is used in this way, a line is added to an associated glossary +(\filetype{.glo}) file, which then needs to be converted into a +corresponding \filetype{.gls} file which contains the typeset glossary +which is input by \ics{printglossary} or +\ics{printglossaries}. The Perl script \appname{makeglossaries} +can be used to call \appname{makeindex}, using a customised +\filetype{.ist} style file, for each of the glossaries that are defined +in the document. Note that there should be no need for you to +explicitly edit or input any of these external files. + +\DescribeMacro{\makeglossaries} +The command \cs{makeglossaries} must be placed in the preamble in +order to create the customised \appname{makeindex} \filetype{.ist} +style file and to ensure that glossary entries are written to the +appropriate output file. If you omit \cs{makeglossaries} none of the +glossaries will be created. Note that if your page numbers use a +hyphen compositor, you must set this by redefining +\DescribeMacro{\glscompositor}\cs{glscompositor} \emph{before} +using \cs{makeglossaries}: +\begin{verbatim} +\renewcommand*{\glscompositor}{-} +\end{verbatim} +(The default value of \cs{glscompositor} is a full stop.) + +\DescribeMacro{\newglossaryentry} +New glossary entries are defined using the command:\\[10pt] +\cs{newglossaryentry}\marg{label}\marg{key-val list}\\[10pt] The first +argument, \meta{label}, must be a unique label with which to identify +this entry. The second argument, \meta{key-val list}, is a +\meta{key}=\meta{value} list that supplies the relevant information +about this entry. There are two required fields: \gloskey{name} and +\gloskey{description}. Available fields are listed below: + +\begin{description} +\item[{\gloskey{name}}] The name of the entry (as it will appear in the +glossary). + +\item[{\gloskey{description}}] A brief description of this term (to +appear in the glossary). + +\item[{\gloskey{text}}] How this entry will appear in the document text +when using \ics{gls} (or one of its uppercase variants). If this +field is omitted, the value of the \gloskey{name} key is used. + +\item[{\gloskey{first}}] How the entry will appear in the document text +the first time it is used with \ics{gls} (or one of its uppercase +variants). If this field is omitted, the value of the \gloskey{text} +key is used. + +\item[{\gloskey{plural}}] How the entry will appear in the document text +when using \ics{glspl} (or one of its uppercase variants). +If this field is omitted, the value is obtained by appending an +\dq{s} to the value of the \gloskey{text} field. + +\item[{\gloskey{firstplural}}] How the entry will appear in the document +text the first time it is used with \ics{glspl} (or one of +its uppercase variants). If this field is omitted, the value is +obtained by appending an \dq{s} to the value of the \gloskey{first} +field. + +\item[{\gloskey{symbol}}] This field is provided to allow the user to +specify an associated symbol, but most glossary styles ignore +this value. If omitted, the value is set to \cs{relax}. + +\item[{\gloskey{sort}}] This value indicates how \appname{makeindex} +should sort this entry. If omitted, the value is given by the +\gloskey{name} field. This value is equivalent to +\appname{makeindex}'s \dq{actual} character (which is usually the +at-sign @ although the \sty{glossaries} package uses a different +symbol). + +\item[{\gloskey{type}}] This is the glossary type to which this entry +belongs. If omitted, the default glossary is assumed +(\texttt{type=main}). The list of acronyms type is given by +\ics{acronymtype} which will either be \texttt{main} or +\texttt{acronym}, depending on whether the \pkgopt{acronym} package +option was used. +\end{description} +Note that if the \gloskey{text} key (or the \gloskey{name} key, if the +\gloskey{text} key is omitted) starts with an accented letter, +you must group the accented letter, otherwise it will cause a +problem for \cs{Gls} and \cs{Glspl}. For example: +\begin{verbatim} +\newglossaryentry{elite}{name={{\'e}lite}, +description={select group or class}} +\end{verbatim} +(Likewise for the \gloskey{plural}, \gloskey{first} and +\gloskey{firstplural} keys.) + +\DescribeMacro{\loadglsentries} +You can store all your glossary entry definitions in another +file, and use:\\[10pt] +\cs{loadglsentries}\oarg{type}\marg{filename}\\[10pt] +where \meta{filename} is the name of the file containing all the +\cs{newglossaryentry} commands. The optional argument +\meta{type} is the name of the glossary to which those entries +should belong, for those entries where the \gloskey{type} key has +been omitted. Note that only those entries that have been used +in the text will appear in the relevant glossaries.\ifmakedtx{}{\toTop} + +\subsection{Number lists} +\label{sec:numberlists} + +Each entry in the glossary has an associated \termdef{number list}. +By default, +these numbers refer to the pages on which that entry has been used +(using any of the commands described in \ifmakedtx{\autoref{sec:glslink}}{\htmlref{Links to Glossary Entries}{sec:glslink}} +and \ifmakedtx{\autoref{sec:glsadd}}{\htmlref{Adding an entry to the glossary without generating text}{sec:glsadd}}). The number list can be suppressed using +the \pkgopt{nonumberlist} package option, or an alternative counter +can be set as the default using the \pkgopt{counter} package option.\ifmakedtx{}{\toTop} + +\subsection{Links to Glossary Entries} +\label{sec:glslink} + +Once you have defined a glossary entry using +\ics{newglossaryentry}, you can refer to that entry in the +document using one of the commands listed in this section. The +text which appears at that point in the document when using +one of these commands is referred to as the +\termdef{link text} (even if there are no hyperlinks). + +The way the \term{link text} is displayed +depends on \DescribeMacro{\glstextformat}\cs{glstextformat}\marg{text}. +For example, to make all \term{link text} appear in a sans-serif +font, do: +\begin{verbatim} +\renewcommand*{\glstextformat}[1]{\textsf{#1}} +\end{verbatim} + +\DescribeMacro{\glslink} +The command:\\[10pt] +\cs{glslink}\oarg{options}\marg{label}\marg{text}\\[10pt] +will place \meta{text} in the document at that point and add +a line into the associated glossary file for the glossary entry +given by \meta{label}. If hyperlinks are supported, \meta{text} +will be a hyperlink to the relevant line in the glossary. The +optional argument \meta{options} must be a \meta{key}=\meta{value} +list which can take any of the following keys: + +\begin{description} +\item[{\gloskey[glslink]{format}}] This specifies how to format the +associated number for this entry in the glossary. This value is +equivalent to the \appname{makeindex} encap value, and (as with +\cs{index}) the value needs to be the name of a command \emph{without} +the initial backslash. As with \cs{index}, the characters \verb"(" and +\verb")" can also be used to specify the beginning and ending of a +number range. Again as with \cs{index}, the command should be the name +of a command which takes an argument (which will be the associated +number). Be careful not to use a declaration (such as \cs{bfseries}) +instead of a text block command (such as \cs{textbf}) as the effect is +not guaranteed to be localised. If you want to apply more than one +style to a given entry (e.g.\ \textbf{bold} and \emph{italic}) you will +need to create a command that applies both formats, e.g.\ +\begin{verbatim} +\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}} +\end{verbatim} +and use that command. + +If you are using hyperlinks and you want to change the font of the +hyperlink, don't use \cs{hyperpage} (provided by the \isty{hyperref} +package) as the numbers may not refer to a page number. +Instead, the \sty{glossaries} package provides the following +number formats: +\begin{center} +\ifmakedtx{\begin{tabular}{@{\sffamily}lp{0.8\linewidth}} +hyperrm & The number is a serif hyperlink to the relevant part of the +document\\ +hypersf & The number is a sans-serif hyperlink to the relevant part +of the document\\ +hypertt & The number is a monospaced hyperlink to the relevant part +of the document\\ +hyperbf & The number is a bold hyperlink to the relevant part of the +document\\ +hypermd & The number is a medium weight hyperlink to the relevant +part of the document\\ +hyperit & The number is an italic hyperlink to the relevant +part of the document\\ +hypersl & The number is a slanted hyperlink to the relevant +part of the document\\ +hyperup & The number is an upright hyperlink to the relevant +part of the document\\ +hypersc & The number is a small caps hyperlink to the relevant +part of the document\\ +hyperemph & The number is an emphasized hyperlink to the relevant +part of the document +\end{tabular}}{\begin{tabular}{ll} +\texttt{hyperrm} & The number is a serif hyperlink to the relevant part of the +document\\ +\texttt{hypersf} & The number is a sans-serif hyperlink to the relevant part +of the document\\ +\texttt{hypertt} & The number is a monospaced hyperlink to the relevant part +of the document\\ +\texttt{hyperbf} & The number is a bold hyperlink to the relevant part of the +document\\ +\texttt{hypermd} & The number is a medium weight hyperlink to the relevant +part of the document\\ +\texttt{hyperit} & The number is an italic hyperlink to the relevant +part of the document\\ +\texttt{hypersl} & The number is a slanted hyperlink to the relevant +part of the document\\ +\texttt{hyperup} & The number is an upright hyperlink to the relevant +part of the document\\ +\texttt{hypersc} & The number is a small caps hyperlink to the relevant +part of the document\\ +\texttt{hyperemph} & The number is an emphasized hyperlink to the relevant +part of the document +\end{tabular}} +\end{center} +Note that if the \cs{hyperlink} command hasn't been defined, +the \texttt{hyper}\meta{xx} formats are equivalent to the +analogous \cs{text}\meta{xx} font commands. If you want to +make a new format, you will need to define a command which takes +one argument and use that; for example, if you want the associated +number in the glossary to be in a bold sans-serif font, you can define a +command called, say, \cs{hyperbsf}: +\begin{verbatim} +\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}} +\end{verbatim} +and then use \texttt{hyperbsf} as the value for the \gloskey{format} +key.\ifmakedtx{ (See also \autoref{sec:printglos}.)}{} + +\item[{\gloskey[glslink]{counter}}] This specifies which counter +to use for the associated number for this glossary entry. (See also +\ifmakedtx{\autoref{sec:numberlists}}{\htmlref{Number Lists}{sec:numberlists}}.) + +\item[{\gloskey[glslink]{hyper}}] This is a boolean key which can +be used to enable/disable the hyperlink to the relevant entry +in the glossary. (Note that setting \texttt{hyper=true} will have no +effect if \cs{hyperlink} has not been defined.) The default +value is \texttt{hyper=true}. + +\end{description} +\DescribeMacro{\glslink*} +There is also a starred version:\\[10pt] +\cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt] +which is equivalent to \cs{glslink}, except it sets +\texttt{hyper=false}. + +\DescribeMacro{\gls} +The command:\\[10pt] +\cs{gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is the same as \cs{glslink}, except that the \term{link text} +is determined from the values of the \gloskey{text} and +\gloskey{first} keys supplied when the entry was defined using +\ics{newglossaryentry}. There are two uppercase variants:\\[10pt] +\DescribeMacro{\Gls} +\cs{Gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +and\\[10pt] +\DescribeMacro{\GLS} +\cs{GLS}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +which make the first letter of the link or all the link text +uppercase, respectively. + +The final optional argument \meta{insert}, allows you to insert +some additional text into the link text. By default, this will +append \meta{insert} at the end of the link text. The first optional +argument \meta{options} is the same as the optional argument to +\ics{glslink}. As with \cs{glslink}, these commands also have +a starred version that disable the hyperlink. + +There are also analogous plural forms:\\[10pt] +\DescribeMacro{\glspl} +\cs{glspl}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +\DescribeMacro{\Glspl} +\cs{Glspl}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSpl} +\cs{GLSpl}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +These determine the link text from the \gloskey{plural} and +\gloskey{firstplural} keys supplied when the entry was first +defined. As before, these commands also have +a starred version that disable the hyperlink. + +\DescribeMacro{\glstext}The command:\\[10pt] +\cs{glstext}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{text} key and does not mark the entry as +having been used. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glstext} +\cs{Glstext}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLStext} +\cs{GLStext}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\DescribeMacro{\glsfirst}The command:\\[10pt] +\cs{glsfirst}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{first} key and does not mark the entry as +having been used. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glsfirst} +\cs{Glsfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSfirst} +\cs{GLSfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\DescribeMacro{\glsplural}The command:\\[10pt] +\cs{glsplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{plural} key and does not mark the entry as +having been used. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glsplural} +\cs{Glsplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSplural} +\cs{GLSplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\DescribeMacro{\glsfirstplural}The command:\\[10pt] +\cs{glsfirstplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{firstplural} key and does not mark the entry as +having been used. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glsfirstplural} +\cs{Glsfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSfirstplural} +\cs{GLSfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\DescribeMacro{\glsname}The command:\\[10pt] +\cs{glsname}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{name} key and does not mark the entry as +having been used. Note: if you want to use this command and the +\gloskey{name} key contains commands, you will have to disable the +\ifmakedtx{\hyperlink{sanitize}{sanitization}}{\htmlref{sanitization}{sanitize}} +of the \gloskey{name} key and protect fragile commands. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glsname} +\cs{Glsname}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSname} +\cs{GLSname}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\DescribeMacro{\glssymbol}The command:\\[10pt] +\cs{glssymbol}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{symbol} key and does not mark the entry as +having been used. Note: if you want to use this command and the +\gloskey{symbol} key contains commands, you will have to disable the +\ifmakedtx{\hyperlink{sanitize}{sanitization}}{\htmlref{sanitization}{sanitize}} +of the \gloskey{symbol} key and protect fragile commands. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glssymbol} +\cs{Glssymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSsymbol} +\cs{GLSsymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\DescribeMacro{\glsdesc}The command:\\[10pt] +\cs{glsdesc}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +is similar to \ics{gls} except that it always uses the value +of the \gloskey{description} key and does not mark the entry as +having been used. Note: if you want to use this command and the +\gloskey{description} key contains commands, you will have to disable the +\ifmakedtx{\hyperlink{sanitize}{sanitization}}{\htmlref{sanitization}{sanitize}} +of the \gloskey{description} key and protect fragile commands. + +There are also analogous commands:\\[10pt] +\DescribeMacro{\Glsdesc} +\cs{Glsdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +\DescribeMacro{\GLSdesc} +\cs{GLSdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +As before, these commands also have a starred version that disable +the hyperlink. + +\ifmakedtx{}{\toTop} + +\subsubsection{Changing the format of the link text} +\label{sec:glsdisplay} + +The format of the \term{link text} for \ics{gls}, \ics{glspl} +and their uppercase variants is governed by two commands: +\DescribeMacro{\glsdisplayfirst}\cs{glsdisplayfirst}, which is used the +first time a glossary entry is used in the text and +\DescribeMacro{\glsdisplay}\cs{glsdisplay}, which is used subsequently. +Both commands take four arguments: the first is either the singular or +plural form given by the \gloskey{text}, \gloskey{plural}, +\gloskey{first} or \gloskey{firstplural} keys (used when the term was +defined) depending on context; the second argument is the term's +description (as supplied by the \gloskey{description} key); the third +argument is the symbol associated with the term (as supplied by the +\gloskey{symbol} key) and the fourth argument is the additional text +supplied in the final optional argument to \cs{gls} or +\cs{glspl} (or their uppercase variants). The default definitions +of \cs{glsdisplay} and \cs{glsdisplayfirst} simply +print the first argument immediately followed by the fourth argument. +The remaining arguments are ignored. + +For example, suppose you want a glossary of measurements and +units, you can use the \gloskey{symbol} key to store the unit: +\begin{verbatim} +\newglossaryentry{distance}{name=distance, +description={The length between two points}, +symbol={km}} +\end{verbatim} +and now suppose you want \verb|\gls{distance}| to produce +\dq{distance (km)} on first use, then you can redefine +\cs{glsdisplayfirst} as follows: +\begin{verbatim} +\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)} +\end{verbatim} +Note that the additional text is placed after \verb|#1|, so +\verb|\gls{distance}['s]| will produce \dq{distance's (km)} +rather than \dq{distance (km)'s} which looks a bit odd (even though +it may be in the context of \dq{the distance (km) is measured between +the two points} --- but in this instance it may be better not to +use a contraction). + +Note also that all of the \term{link text} will be formatted according +to \ics{glstextformat} (described earlier). So if you do, say: +\begin{verbatim} +\renewcommand{\glstextformat}[1]{\textbf{#1}} +\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)} +\end{verbatim} +then \verb|\gls{distance}| will produce \dq{\textbf{distance (km)}}. + +If you have multiple glossaries, changing \cs{glsdisplayfirst} and +\cs{glsdisplay} will change the way entries for all of the +glossaries appear when using commands \cs{gls}, \cs{glspl} and their +uppercase variants. If you only +want the change to affect entries for a given glossary, then you need +to use \DescribeMacro{\defglsdisplay}\cs{defglsdisplay} and +\DescribeMacro{\defglsdisplayfirst}\cs{defglsdisplayfirst} instead +of redefining \cs{glsdisplay} and \cs{glsdisplayfirst}. + +Both \cs{defglsdisplay} and \cs{defglsdisplayfirst} take two arguments: +the first (which is optional) is the glossary name\footnote{\texttt{main} for the main +(default) glossary, \cs{acronymtype} for the list of acronyms, or the +name supplied in the first mandatory argument to \cs{newglossary} for +additional glossaries.} and the second is how the term should be +displayed when it is invoked using commands \cs{gls}, +\cs{glspl} and their uppercase variants. This is similar to the way \cs{glsdisplayfirst} was +redefined above. + +For example, suppose you have created a new glossary called +\texttt{notation} and you want to change the way the entry is +displayed on first use so that it includes the symbol, you can +do: +\begin{verbatim} +\defglsdisplayfirst[notation]{#1#4 (denoted #3)} +\end{verbatim} +Now suppose you have defined an entry as follows: +\begin{verbatim} +\newglossaryentry{set}{type=notation, +name=set, +description={A collection of objects}, +symbol={$S$}, +} +\end{verbatim} +The first time you reference this entry using \cs{gls} it +will be displayed as: \dq{set (denoted \ifmakedtx{$S$}{\textit{S}})} +(similarly for \cs{glspl} and the uppercase variants). + +Remember that if you use the \gloskey{symbol} key, you need to use a +glossary style that displays the symbol, as many of the styles ignore +it. In addition, if you want either the description or symbol to appear +in the \term{link text}, you will have to disable the +\ifmakedtx{\hyperlink{sanitize}{sanitization}}{\htmlref{sanitization}{sanitize}} +of these keys and protect fragile commands.\ifmakedtx{}{\toTop} + +\subsubsection{Enabling and disabling hyperlinks to glossary entries} + +If you load the \isty{hyperref} or \isty{html} packages prior to +loading the \sty{glossaries} package, commands such as \ics{glslink} +and \ics{gls}, described above, will automatically have hyperlinks +to the relevant glossary entry, unless the \gloskey[glslink]{hyper} +option has been set to \texttt{false}. You can disable or enable links using:\\[10pt] +\DescribeMacro{\glsdisablehyper}\cs{glsdisablehyper}\\[10pt] +and\\[10pt] +\DescribeMacro{\glsenablehyper}\cs{glsenablehyper}\\[10pt] +respectively. The effect can be localised by placing the commands +within a group. Note that you should only use \cs{glsenablehyper} +if the commands \ics{hyperlink} and \ics{hypertarget} have been +defined (for example, by the \isty{hyperref} package). + +\subsection{Adding an entry to the glossary without generating text} +\label{sec:glsadd} + +\DescribeMacro{\glsadd} +It is possible to add a line in the glossary file without +generating any text at that point in the document using:\\[10pt] +\cs{glsadd}\oarg{options}\marg{label}\\[10pt] +This is similar to \ics{glslink}, only it doesn't produce +any text (so therefore, there is no \gloskey[glslink]{hyper} key +available in \meta{options} but all the other options that can +be used with \cs{glslink} can be passed to \cs{glsadd}). + +\DescribeMacro{\glsaddall} +To add all entries that have been defined, use:\\[10pt] +\cs{glsaddall}\oarg{glossary list}\\[10pt] +If there are multiple glossaries, you can specify to add only +those entries which belong to the glossaries listed in +\meta{glossary list} (which must be a comma separated list of +glossary names). For example: +\begin{verbatim} +\glsaddall[notation] +\end{verbatim} +will add all the entries that have been defined for the glossary +labelled \dq{notation}.\ifmakedtx{}{\toTop} + +\subsection{Displaying a glossary} + +\DescribeMacro{\printglossaries} +The command \cs{printglossaries} will display all the +defined glossaries. Note that no glossaries will appear until +you have either used the Perl script \appname{makeglossaries} +or have directly used \appname{makeindex} (as described in +\ifmakedtx{\autoref{sec:makeglossaries}}{\htmlref{Generating the Associated Glossary Files}{sec:makeglossaries}}). If the glossary still +does not appear after you re-\LaTeX\ your document, check +the \appname{makeindex} log files to see if there is a problem. +Remember that you also need to use the command \ics{makeglossaries} in +the preamble to enable the glossaries. + +\DescribeMacro{\printglossary} +An individual glossary is displayed using:\\[10pt] +\cs{printglossary}\oarg{options}\\[10pt] +where \meta{options} is a \meta{key}=\meta{value} list of options. +The following keys are available: +\begin{description} +\item[{\gloskey[printglossary]{type}}] The value of this key +specifies which glossary to print. If omitted, the default +glossary is assumed. For example, to print the list of acronyms: +\begin{verbatim} +\printglossary[type=\acronymtype] +\end{verbatim} + +\item[{\gloskey[printglossary]{title}}] This is the glossary's +title (overriding the title specified when the glossary was +defined). + +\item[{\gloskey[printglossary]{toctitle}}] This is the title +to use for the table of contents (if the \pkgopt{toc} package +option has been used). If omitted, the glossary title is used. + +\item[{\gloskey[printglossary]{style}}] This specifies which +glossary style to use for this glossary, overriding the effect +of the \pkgopt{style} option or \ics{glossarystyle}. +\end{description} + +\DescribeMacro{\glossarypreamble} +Information can be added to the start of the glossary by redefining +\cs{glossarypreamble}. For example: +\begin{verbatim} +\renewcommand{\glossarypreamble}{Numbers in italic indicate +primary definitions.} +\end{verbatim} +This needs to be done before the glossary is displayed using +\cs{printglossaries} or \cs{printglossary}. Note that if you +want a different preamble for each glossary, you will need to +use a separate \cs{printglossary} for each glossary and change +the definition of \cs{glossarypreamble} between each glossary. +For example: +\begin{verbatim} +\renewcommand{\glossarypreamble}{Numbers in italic indicate +primary definitions.} +\printglossary +\renewcommand{\glossarypreamble}{} +\printglossary[type=acronym] +\end{verbatim} +Alternatively, you can do something like: +\begin{verbatim} +\renewcommand{\glossarypreamble}{Numbers in italic indicate +primary definitions.\gdef\glossarypreamble{}} +\printglossaries +\end{verbatim} +which will print the preamble text for the first glossary and +change the preamble to do nothing for subsequent glossaries. +(Note that \cs{gdef} is required as the glossary is placed within +a group.) + +\DescribeMacro{\glossarypostamble}There is an analogous command +called \cs{glossarypostamble} which is placed at the end of each +glossary.\ifmakedtx{}{\toTop} + +\subsubsection{Changing the way the entry name appears in the glossary} +\label{sec:glsnamefont} + +\DescribeMacro{\glsnamefont}Within each glossary, each entry name is +formatted according to \cs{glsnamefont} which takes one argument: the +entry name. This command is always used regardless of the glossary +style. By default, \cs{glsnamefont} simply displays its argument in +whatever the surrounding font happens to be. This means that in the +list styles the name will appear in bold, since the name is placed in +the optional argument of \cs{item}, whereas in the tabular styles the +name will appear in the normal font. + +For example, suppose you want all the entry names to appear in +medium weight small caps, then you can do: +\begin{verbatim} +\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}} +\end{verbatim} +\ifmakedtx{}{\toTop} + +\subsection{Defining New Glossaries} + +\DescribeMacro{\newglossary} +A new glossary can be defined using:\\[10pt] +\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}\marg{title}\oarg{counter}\\[10pt] +where \meta{name} is label to assign to this glossary. The arguments +\meta{in-ext} and \meta{out-ext} specify the extensions to give to the +input and output files for that glossary, \meta{title} is the default +title for this new glossary and the final optional argument +\meta{counter} specifies which counter to use for the associated number +lists\iterm{number list} (see also \ifmakedtx{\autoref{sec:numberlists}}{\htmlref{Number Lists}{sec:numberlists}}.) The +first optional argument specifies the extension for the +\appname{makeindex} transcript file (this information is only used by +\appname{makeglossaries} which picks up the information from the +auxiliary file.) + +Note that the main (default) glossary is automatically created as: +\begin{verbatim} +\newglossary{main}{gls}{glo}{\glossaryname} +\end{verbatim} +so it can be identified by the label \texttt{main}. Using the +\pkgopt{acronym} package option is equivalent to: +\begin{verbatim} +\newglossary[alg]{acronym}{acr}{acn}{\acronymname} +\end{verbatim} +so it can be identified by the label \texttt{acronym}. If you are +not sure whether the \pkgopt{acronym} option has been used, you +can identify the list of acronyms by the command +\DescribeMacro{\acronymtype}\cs{acronymtype} which is set to +\texttt{acronym}, if the \pkgopt{acronym} option has been used, +otherwise it is set to \texttt{main}.\ifmakedtx{}{\toTop} + +\subsection{Acronyms} +\label{sec:acronyms} + +\DescribeMacro{\newacronym} +As you may have noticed in \ifmakedtx{\autoref{sec:newglosentry}}{\htmlref{Defining Glossary Entries}{sec:newglosentry}}, when you +specify a new entry, you can specify alternate text to use when +the term is first used in the document. This provides a useful +means to define acronyms. The \sty{glossaries} package defines +the command:\\[10pt] +\cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long}\\[10pt] +This is equivalent to:\vskip5pt +\begin{ttfamily}\par\noindent +\cs{newglossaryentry}\textrm{\marg{label}}\{type=\cs{acronymtype},\\ +name=\textrm{\marg{abbrv}},\\ +description=\textrm{\marg{long}},\\ +text=\textrm{\marg{abbrv}},\\ +first=\{\textrm{\meta{long}} (\textrm{\meta{abbrv}})\},\\ +plural=\{\textrm{\meta{abbrv}}s\},\\ +firstplural=\{\textrm{\meta{long}}s (\textrm{\meta{abbrv}}s)\},\\ +\textrm{\meta{key-val list}}\}\par +\end{ttfamily} +\vskip5pt +As mentioned in the previous section, the command \cs{acronymtype} is +the name of the glossary in which the acronyms should appear. If the +\pkgopt{acronym} package option has been used, this will be +\texttt{acronym}, otherwise it will be \texttt{main}. The acronyms can +then be used in exactly the same way as any other glossary entry. +For example, the following defines the acronym IDN: +\begin{verbatim} +\newacronym{idn}{IDN}{identification number} +\end{verbatim} +This is equivalent to: +\begin{verbatim} +\newglossaryentry{idn}{type=\acronymtype, +name={IDN}, +description={identification number}, +text={IDN}, +first={identification number (IDN)}, +plural={IDNs}, +firstplural={identification numbers (IDNs)}} +\end{verbatim} +so \verb|\gls{idn}| will produce \dq{identification number (IDN)} on +first use and \dq{IDN} on subsequent uses. + +The \sty{glossaries} package has options that change the +definition of \ics{newacronym} for common acronym formats. These +options also change the way the link text is displayed for the +acronyms. + +Table~\ref{tab:acronymsettings} lists the package options and +how the keys are used to store \meta{long} (the long form) and +\meta{abbrv} (the short form). Note that the \pkgopt{smallcaps} +option redefines \ics{acronymfont} so that it sets its argument +in small captials otherwise \cs{acronymfont} simply displays its +argument in the surrounding font. Note also that if none of +the package options \pkgopt{smallcaps}, \pkgopt{description} +or \pkgopt{footnote} are used, \cs{acronymfont} is not used, so +changing the definition of \cs{acronymfont} will have no effect +under such circumstances. + +\begin{table}[htbp] +\caption{Package options governing acronyms and how the information +is stored in the glossary keys} +\label{tab:acronymsettings} +\begin{center} +\begin{tabular}{lllll} +\bfseries Package Option & +\gloskey{first} & +\gloskey{text} & +\gloskey{description} & +\gloskey{symbol}\\ +\pkgopt{description},\pkgopt{footnote} & +\meta{abbrv} & +\meta{abbrv} & +user supplied & +\meta{long}\\ +\pkgopt{description},\pkgopt{dua} & +\meta{long} & +\meta{long} & +user supplied & +\meta{abbrv}\\ +\pkgopt{description} & +\meta{long} & +\meta{abbrv} & +user supplied & +\meta{abbrv}\\ +\pkgopt{footnote} & +\meta{abbrv} & +\meta{abbrv} & +\meta{long} & + \\ +\pkgopt{smallcaps} & +\meta{long} & +\meta{abbrv} & +\meta{long} & +\meta{abbrv}\\ +\pkgopt{dua} & +\meta{long} & +\meta{long} & +\meta{long} & +\meta{abbrv}\\ +None of the above& +\meta{long} (\meta{abbrv}) & +\meta{abbrv} & +\meta{long} & +\end{tabular} +\end{center} +\end{table} + +Each of the package options \pkgopt{smallcaps}, \pkgopt{footnote} +and \pkgopt{description} use \ics{defglsdisplay} and +\ics{defglsdisplayfirst} (described \ifmakedtx{in +\autoref{sec:glsdisplay}}{\htmlref{earlier}{sec:glsdisplay}}) +to change the way the link text is displayed. + +\begin{description} +\item[\pkgopt{description},\pkgopt{footnote}]\ifmakedtx{\mbox{}\par}{} +When these two options are used together, the first use displays +the entry as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long} +\\[10pt] +while subsequent use displays the entry as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +where \meta{insert} indicates the text supplied in the final +optional argument to \cs{gls}, \cs{glspl} or their uppercase +variants. + +Note also that when these two package options are used (in the +given order), the \sty{glossaries} package additionally implements the +\pkgopt{sanitize} option using +\ipkgopt[description]{sanitize}\ipkgopt[symbol]{sanitize}\verb|sanitize={description=false,symbol=false}|, so +remember to protect fragile commands when defining acronyms. + +\item[dua]\ifmakedtx{\mbox{}\par}{} +The \pkgopt{dua} package option always displays the expanded +form and so may not be used with \pkgopt{footnote} or +\pkgopt{smallcaps}. Both first use and subsequent use displays the +entry in the form:\\[10pt] +\meta{long}\meta{insert}\\[10pt] +If the \pkgopt{description} option is also used, the \gloskey{name} +key is set to the long form, otherwise the \gloskey{name} key is +set to the short form and the \gloskey{description} key is set to +the long form. + +\item[\pkgopt{description}]\ifmakedtx{\mbox{}\par}{} +This option displays the entry on first use as:\\[10pt] +\meta{long}\meta{insert} (\cs{acronymfont}\marg{abbrv})\\[10pt] +while subsequent use displays the entry as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +Note also that if this package option is used, the \sty{glossaries} +package additionally implements the option +\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so +remember to protect fragile commands when defining acronyms. + +\item[\pkgopt{footnote}]\ifmakedtx{\mbox{}\par}{} +This option displays the entry on first use as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long}\\[10pt] +while subsequent use displays the entry as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert} + +Note also that if this package option is used, the \sty{glossaries} +package additionally implements the option +\ipkgopt[description]{sanitize}\verb|sanitize={description=false}|, so +remember to protect fragile commands when defining acronyms. + +\item[\pkgopt{smallcaps}]\ifmakedtx{\mbox{}\par}{} +If neither the \pkgopt{footnote} nor \pkgopt{description} options +have been set, this option displays the entry on first use as:\\[10pt] +\meta{long}\meta{insert} (\cs{acronymfont}\marg{abbrv})\\[10pt] +while subsequent use displays the entry as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +where \cs{acronymfont} is set to \cs{textsc}. + +Note also that if this package option is used, the \sty{glossaries} +package additionally implements the option +\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so +remember to protect fragile commands when defining acronyms. + +\item[None of the above]\ifmakedtx{\mbox{}\par}{} +If none of the package options \pkgopt{smallcaps}, \pkgopt{footnote} +or \pkgopt{description} are used, then on first use the entry is +displayed as:\\[10pt] +\meta{long} (\meta{abbrv})\meta{insert}\\[10pt] +while subsequent use displays the entry as:\\[10pt] +\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +\meta{abbrv}\meta{insert} +\end{description} + +Recall from \ifmakedtx{\autoref{sec:glslink}}{\htmlref{earlier}{sec:glslink}} +that you can access the values of individual keys using commands +like \ics{glstext}, so it is possible to use these commands to +print just the long form or just the abbreviation without affecting +the flag that determines whether the entry has been used. However +the keys that store the long and short form vary depending on +the acronym style, so the \sty{glossaries} package provides +commands that are set according to the package options. These are +as follows: +\vspace{10pt}\par\noindent +\DescribeMacro{\acrshort} +\cs{acrshort}\oarg{options}\marg{label}\oarg{insert}\\ +\DescribeMacro{\Acrshort} +\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\ +\DescribeMacro{\ACRshort} +\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +Print the abbreviated version with a hyperlink (if necessary) to the +relevant entry in the glossary. This is usually equivalent to +\ics{glstext} (or its uppercase variants) but may additionally +put the link text within the argument to \ics{acronymfont}. +\vspace{10pt}\par\noindent +\DescribeMacro{\acrlong} +\cs{acrlong}\oarg{options}\marg{label}\oarg{insert}\\ +\DescribeMacro{\Acrlong} +\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\ +\DescribeMacro{\ACRlong} +\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +Print the long version with a hyperlink (if necessary) to the +relevant entry in the glossary. This is may be equivalent to +\ics{glsdesc}, \ics{glssymbol} or \ics{glsfirst} (or their uppercase +variants), depending on package options. +\vspace{10pt}\par\noindent +\DescribeMacro{\acrfull} +\cs{acrfull}\oarg{options}\marg{label}\oarg{insert}\\ +\DescribeMacro{\Acrfull} +\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\ +\DescribeMacro{\ACRfull} +\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +Print the long version followed by the abbreviation in brackets +with a hyperlink (if necessary) to the +relevant entry in the glossary. + +Note that if you change the definition of \ics{newacronym}, you +may additionally need to change the above commands as well as +the changing way the text is displayed using \ics{defglsdisplay} +and \ics{defglsdisplayfirst}. + +\ifmakedtx{}{\toTop} + +\subsection{Unsetting and resetting entry flags} + +When using commands such as \ics{gls} it is possible that you may want +to use the value given by the \gloskey{first} key, even though you have +already used the glossary entry. Conversely, you may want to use the +value given by the \gloskey{text} key, even though you haven't used the +glossary entry. The former can be achieved by one of the following +commands:\\[10pt] +\DescribeMacro{\glsreset}\cs{glsreset}\marg{label}\\ +\DescribeMacro{\glslocalreset}\cs{glslocalreset}\marg{label}\\[10pt] +while the latter can be achieved by one of the following commands:\\[10pt] +\DescribeMacro{\glsunset}\cs{glsunset}\marg{label}\\ +\DescribeMacro{\glslocalunset}\cs{glslocalunset}\marg{label} +\\[10pt] +You can determine whether an entry has been used using:\\[10pt] +\DescribeMacro{\ifglsused} +\cs{ifglsused}\marg{label}\marg{true part}\marg{false part}\\[10pt] +where \meta{label} is the label of the required entry. If the +entry has been used, \meta{true part} will be done, otherwise +\meta{false part} will be done. +\ifmakedtx{}{\toTop} + +\subsection{Glossary Styles} +\label{sec:styles} +The \sty{glossaries} package comes with some pre-defined +glossary styles. These are as follows: +\begin{description} +\item[list] The \glostyle{list} style uses the \envname{description} +environment. The entry name is placed in the optional argument +of the \cs{item} command (so it will appear in bold by +default). The description follows, and then the associated number +list for that entry. + +\item[listgroup] The \glostyle{listgroup} style is like +\glostyle{list} but the glossary groups have headings. + +\item[listhypergroup] The \glostyle{listhypergroup} style is like +\glostyle{listgroup} but has a set of links to the glossary +groups. + +\item[altlist] The \glostyle{altlist} style is like \glostyle{list} +but the description is placed on the following line. + +\item[altlistgroup] The \glostyle{altlistgroup} style is like +\glostyle{altlist} but the glossary groups have headings. + +\item[altlisthypergroup] The \glostyle{altlisthypergroup} style is like +\glostyle{altlistgroup} but has a set of links to the glossary +groups. + +\item[listdotted] This style uses the \envname{description} +environment. Each entry starts with \verb|\item[]|, followed by the +name followed by a dotted line, followed by the description. Note that +this style ignores both the \term{number list} and the symbol. The +length \DescribeMacro{\glslistdottedwidth}\cs{glslistdottedwidth} +governs where the description should start.\footnote{This style was +supplied by Axel~Menzel.} + +\item[long] The \glostyle{long} style uses the \envname{longtable} +environment (defined by the \isty{longtable} package). It has two +columns: the first column contains the entry's name and the second +column contains the description followed by the \term{number list}. + +\item[longborder] The \glostyle{longborder} style is like +\glostyle{long} but has horizontal and vertical lines around it. + +\item[longheader] The \glostyle{longheader} style is like +\glostyle{long} but has a header row. + +\item[longheaderborder] The \glostyle{longheaderborder} style is +like \glostyle{longheader} but has horizontal and vertical lines +around it. + +\item[long3col] The \glostyle{long3col} style is like +\glostyle{long} but has three columns. The first column contains +the entry's name, the second column contains the description +and the third column contains the \term{number list}. + +\item[long3colborder] The \glostyle{long3colborder} style is like +the \glostyle{long3col} style but has horizontal and vertical +lines around it. + +\item[long3colheader] The \glostyle{long3colheader} style is like +\glostyle{long3col} but has a header row. + +\item[long3colheaderborder] The \glostyle{long3colheaderborder} style is +like \glostyle{long3colheader} but has horizontal and vertical lines +around it. + +\item[long4col] The \glostyle{long4col} style is like +\glostyle{long3col} but has an additional column in which the +entry's associated symbol appears. + +\item[long4colborder] The \glostyle{long4colborder} style is like +the \glostyle{long4col} style but has horizontal and vertical +lines around it. + +\item[long4colheader] The \glostyle{long4colheader} style is like +\glostyle{long4col} but has a header row. + +\item[long4colheaderborder] The \glostyle{long4colheaderborder} style is +like \glostyle{long4colheader} but has horizontal and vertical lines +around it. + +\item[super] The \glostyle{super} style uses the \envname{supertabular} +environment (defined by the \isty{supertabular} package). It has two +columns: the first column contains the entry's name and the second +column contains the description followed by the \term{number list}. + +\item[superborder] The \glostyle{superborder} style is like +\glostyle{super} but has horizontal and vertical lines around it. + +\item[superheader] The \glostyle{superheader} style is like +\glostyle{super} but has a header row. + +\item[superheaderborder] The \glostyle{superheaderborder} style is +like \glostyle{superheader} but has horizontal and vertical lines +around it. + +\item[super3col] The \glostyle{super3col} style is like +\glostyle{super} but has three columns. The first column contains +the entry's name, the second column contains the description +and the third column contains the \iterm{number list}. + +\item[super3colborder] The \glostyle{super3colborder} style is like +the \glostyle{super3col} style but has horizontal and vertical +lines around it. + +\item[super3colheader] The \glostyle{super3colheader} style is like +\glostyle{super3col} but has a header row. + +\item[super3colheaderborder] The \glostyle{super3colheaderborder} style +is like \glostyle{super3colheader} but has horizontal and vertical +lines around it. + +\item[super4col] The \glostyle{super4col} style is like +\glostyle{super3col} but has an additional column in which the +entry's associated symbol appears. + +\item[super4colborder] The \glostyle{super4colborder} style is like +the \glostyle{super4col} style but has horizontal and vertical +lines around it. + +\item[super4colheader] The \glostyle{super4colheader} style is like +\glostyle{super4col} but has a header row. + +\item[super4colheaderborder] The \glostyle{super4colheaderborder} style +is like \glostyle{super4colheader} but has horizontal and vertical +lines around it. + +\end{description} + +The glossary style can be set using the \pkgopt{style} package option +or using the \gloskey[printglossary]{style} key in the optional +argument to \ics{printglossary} or using the command:\\[10pt] +\DescribeMacro{\glossarystyle}\cs{glossarystyle}\marg{style-name}\\[10pt] + + \changes{1.03}{2007 July 4}{'glspostdescription added} +All the styles except for the three- and four-column styles and the +\glostyle{listdotted} style use the command +\DescribeMacro{\glspostdescription}\cs{glspostdescription} after the +description. This simply displays a full stop by default. To eliminate +this full stop (or replace it with something else, say a comma), you +will need to redefine \cs{glspostdescription} before the glossary is +displayed.\ifmakedtx{}{\toTop} + +\subsection{Defining your own glossary style} + +If the predefined styles don't fit your requirements, you can +define your own style using\DescribeMacro{\newglossarystyle}:\\[10pt] +\cs{newglossarystyle}\marg{name}\marg{definitions}\\[10pt] +where \meta{name} is the name of the new glossary style (to be +used in \cs{glossarystyle}). The second argument \meta{definitions}, +needs to redefine all of the following: + +\begin{description} +\item +\DescribeEnv{theglossary} +\envname{theglossary}\par\noindent +This environment defines how the main body of the glossary should +be typeset. Note that this does not include the section heading, +the glossary preamble (defined by \cs{glossarypreamble}) or the +glossary postamble (defined by \cs{glossarypostamble}.) For example, +the \glostyle{list} style uses the \envname{description} environment, +so the \envname{theglossary} environment is simply redefined to begin +and end the \envname{description} environment. + +\item +\DescribeMacro{\glossaryheader} +\cs{glossaryheader}\par\noindent +This macro indicates what to do at the start of the main body +of the glossary. Note that this is not the same as +\cs{glossarypreamble}, which should not be affected by changes in +the glossary style. The \glostyle{list} glossary style redefines +\cs{glossaryheader} to do nothing, whereas the \glostyle{longheader} +glossary style redefines \cs{glossaryheader} to do a header row. + +\item +\DescribeMacro{\glsgroupheading} +\cs{glsgroupheading}\marg{label}\par\noindent +This macro indicates what to do at the start of each logical block +within the main body of the glossary. The glossary is sub-divided into +twenty-eight logical blocks that are determined by the first character +of the \gloskey{sort} key (or \gloskey{name} key if the \gloskey{sort} +key is omitted). The sub-divisions are in the following order: symbols, +numbers, A, \ldots, Z. Note that the argument to \cs{glsgroupheading} +is a label \emph{not} the group title. The group title can be obtained +via \cs{glsgetgrouptitle}\marg{label}, and a navigation hypertarget can +be created using \cs{glsnavhypertarget}\marg{label}. Most of the +predefined glossary styles redefine \cs{glsgroupheading} to simply +ignore its argument. The \glostyle{listhypergroup} style redefines +\cs{glsgroupheading} as follows: +\begin{verbatim} +\renewcommand*{\glsgroupheading}[1]{% +\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]} +\end{verbatim} +See also \cs{glsgroupskip} below. (Note that command definitions within +\cs{newglossarystyle} must use \verb|##1| etc instead of \verb|#1| etc.) + +\item +\DescribeMacro{\glsgroupskip} +\cs{glsgroupskip}\par\noindent +This macro determines what to do after one logical group but before +the header for the next logical group. The \glostyle{list} glossary +style simply redefines \cs{glsgroupskip} to be \cs{indexspace}. + +\item +\DescribeMacro{\glossaryentryfield} +\cs{glossaryentryfield}\marg{label}\marg{formatted +name}\marg{description}\marg{symbol} +\marg{number list}\par\noindent +This macro indicates what to do for a given glossary entry. +Note that \meta{formatted name} will always be in the form +\cs{glsnamefont}\marg{name}. This allows the user to set a given +font for the entry name, regardless of the glossary style used. +Note that \meta{label} is the label used when the glossary entry +was defined via either \cs{newglossaryentry} or \cs{newacronym}. +Each time you use a glossary entry it creates a +link\footnote{if the document doesn't have hyperlinks enabled +\cs{@glslink} ignores the label and simply typesets the text.} +using \cs{@glslink}\marg{label}\marg{text} with the label +\texttt{glo:}\meta{label}. Your +new glossary style must therefore redefine \cs{glossaryentryfield} +so that it uses \cs{@glstarget}\verb|{|\texttt{glo:}\meta{label}\verb|}|\marg{text} +to ensure the hyperlinks function correctly.\footnote{again, if the +document doesn't support hyperlinks, \cs{@glstarget} will ignore +the label, and just typeset the text.} For example, the +\glostyle{list} style defines \cs{glossaryentryfield} as follows: +\begin{verbatim} +\renewcommand*{\glossaryentryfield}[5]{% +\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5} +\end{verbatim} + +Note also that \meta{number list} will always be of the form\\[10pt] +\cs{glossaryentrynumbers}\{\cs{relax}\\ +\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}\}\\[10pt] +where \meta{number(s)} +may contain \cs{delimN} (to delimit individual numbers) and/or +\cs{delimR} (to indicate a range of numbers). There may be +multiple occurrences of +\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}, but note +that the entire number list is enclosed within the argument +to \ics{glossaryentrynumbers}. The user can redefine this to change +the way the entire number list is formatted, regardless of +the glossary style. However the most common use of +\cs{glossaryentrynumbers} is to provide a means of suppressing the +number list altogether. (In fact, the \pkgopt{nonumberlist} option +redefines \cs{glossaryentrynumbers} to ignore its argument.) +Therefore, when you define a new glossary style, you don't need +to worry about whether the user has specified the +\pkgopt{nonumberlist} package option. +\end{description}\ifmakedtx{}{\toTop} + +\subsubsection{Example: creating a completely new style} + +If you want a completely new style, you will need to redefine all +of the commands and environment listed above. You also need to +take care when using internal commands (commands whose name +contain the @ symbol). These should either be used in a \texttt{.sty} +file or must be placed within \cs{makeatletter} and \cs{makeatother}. + +For example, suppose you want each entry to start with a bullet point. +This means that the glossary should be placed in the \envname{itemize} +environment, so \envname{theglossary} should start and end that +environment. Let's also suppose that you don't want anything between +the glossary groups (so \cs{glsgroupheading} and \cs{glsgroupskip} +should do nothing) and suppose you don't want anything to appear +immediately after \verb|\begin{theglossary}| (so \cs{glossaryheader} +should do nothing). In addition, let's suppose the symbol should +appear in brackets after the name, followed by the description and +last of all the \term{number list} should appear within square brackets +at the end. Then you can create this new glossary style, called, say, +\texttt{mylist}, as follows: +\begin{verbatim} + \newglossarystyle{mylist}{% + % put the glossary in the itemize environment: + \renewenvironment{theglossary}{\begin{itemize}}{\end{itemize}}% + % have nothing after \begin{theglossary}: + \renewcommand*{\glossaryheader}{}% + % have nothing between glossary groups: + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glsgroupskip}{}% + % set how each entry should appear: + \renewcommand*{\glossaryentryfield}[5]{% + \item % bullet point + \@glstarget{glo:##1}{##2}% the entry name + \space (##4)% the symbol in brackets + \space ##3% the description + \space [##5]% the number list in square brackets + }% + } +\end{verbatim} +\ifmakedtx{}{\toTop} + +\subsubsection{Example: creating a new glossary style based on an +existing style} + +\changes{1.11}{2008 March 1}{Fixed error in manual (glossary style +is set using 'glossarystyle not 'setglossarystyle)}% +If you want to define a new style that is a slightly modified +version of an existing style, you can use \cs{glossarystyle} +within the second argument of \cs{newglossarystyle} followed by +whatever alterations you require. For example, suppose you want +a style like the \glostyle{list} style but you don't want the extra +vertical space created by \cs{indexspace} between groups, then you +can create a new glossary style called, say, \texttt{mylist} as +follows: +\begin{verbatim} +\newglossarystyle{mylist}{% +\glossarystyle{list}% base this style on the list style +\renewcommand{\glsgroupskip}{}% make nothing happen between groups +} +\end{verbatim} +\ifmakedtx{}{\toTop} + + \StopEventually{\clearpage\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex} + +\ifmakedtx{}{\printindex\toTop} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/glossaries.pdf b/Master/texmf-dist/doc/latex/glossaries/glossaries.pdf new file mode 100644 index 00000000000..34cab2da055 Binary files /dev/null and b/Master/texmf-dist/doc/latex/glossaries/glossaries.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries/glossaries.perl b/Master/texmf-dist/doc/latex/glossaries/glossaries.perl deleted file mode 100644 index 22ad50f784c..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/glossaries.perl +++ /dev/null @@ -1,1713 +0,0 @@ -# File : glossaries.perl -# Author : Nicola L.C. Talbot -# Date : 14th June 2007 -# Last Modified : 21st Aug 2007 -# Version : 1.02 -# Description : LaTeX2HTML (limited!) implementation of glossaries -# package. Note that not all the glossaries.sty -# macros have been implemented. - -# This is a LaTeX2HTML style implementing the glossaries package, and -# is distributed as part of that package. -# Copyright 2007 Nicola L.C. Talbot -# This work may be distributed and/or modified under the -# conditions of the LaTeX Project Public License, either version 1.3 -# of this license of (at your option) any later version. -# The latest version of this license is in -# http://www.latex-project.org/lppl.txt -# and version 1.3 or later is part of all distributions of LaTeX -# version 2005/12/01 or later. -# -# This work has the LPPL maintenance status `maintained'. -# -# The Current Maintainer of this work is Nicola Talbot. - -# This work consists of the files glossaries.dtx and glossaries.ins -# and the derived files glossaries.sty, glossary-hypernav.sty, -# glossary-list.sty, glossary-long.sty, glossary-super.sty, -# glossaries.perl. Also makeglossaries and makeglossaries.bat - -package main; - -# These are the only package options implemented. - -sub do_glossaries_style_altlist{ -} - -sub do_glossaries_toc{ -} - -sub do_glossaries_toc_true{ -} - -$GLSCURRENTFORMAT="textrm"; - -sub do_cmd_glossaryname{ - "Glossary$_[0]" -} - -$gls_mark{'main'} = ""; -$gls_file_mark{'main'} = ""; -$gls_title{'main'} = "\\glossaryname"; -$delimN{'main'} = ", "; -$glsnumformat{'main'} = $GLSCURRENTFORMAT; -@{$gls_entries{'main'}} = (); -$gls_displayfirst{'main'} = "glsdisplayfirst"; -$gls_display{'main'} = "glsdisplay"; - - -$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) =('',''); - if ($INDEX_STYLES) { -if ($INDEX_STYLES =~/,/) { -local(@styles) = split(/\s*,\s*/,$INDEX_STYLES); - $sidx_style = join('','<', join('><',@styles) ,'>'); - $eidx_style = join('',''); -} else { - $sidx_style = join('','<', $INDEX_STYLES,'>'); - $eidx_style = join('',''); -} - } - &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 - . "\n" - : "
" - . $name - . "
" - . $glsentry{$entry}{'description'} - . $symbol . '. ' - . $glossary{$type}{$key} - . $linktext. "\n"); - $previous = $current; - } - $glossary = '
'.$glossary unless ($glossary =~ /^\s*/); - - $glossary =~ s/(]*>)()/$2$1/g; - - $str = &translate_commands("\\glossarypostamble"); - s/$gls_mark{$type}/$preglossary\n
\n$glossary<\/DL>$str\n/s; -} - -sub set_depth_levels { - # Sets $outermost_level - local($level); - # scan the document body, not the preamble, for use of sectioning commands - my ($contents) = $_; - if ($contents =~ /\\begin\s*((?:$O|$OP)\d+(?:$C|$CP))document\1|\\startdocument/s) { -$contents = $'; - } - foreach $level ("part", "chapter", "section", "subsection", - "subsubsection", "paragraph") { -last if (($outermost_level) = $contents =~ /\\($level)$delimiter_rx/); -last if (($outermost_level) = $contents =~ /\\endsegment\s*\[\s*($level)\s*\]/s); -if ($contents =~ /\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)\s*($level)\s*\2/s) -{ $outermost_level = $3; last }; - } - $level = ($outermost_level ? $section_commands{$outermost_level} : - do {$outermost_level = 'section'; 3;}); - - if ($REL_DEPTH && $MAX_SPLIT_DEPTH) { -$MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH; - } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 }; - - %unnumbered_section_commands = ( - 'tableofcontents', $level -, 'listoffigures', $level -, 'listoftables', $level -, 'bibliography', $level -, 'textohtmlindex', $level -, 'textohtmlglossary', $level -, 'textohtmlglossaries', $level - , %unnumbered_section_commands - ); - - %section_commands = ( - %unnumbered_section_commands - , %section_commands - ); -} - -sub add_bbl_and_idx_dummy_commands { - local($id) = $global{'max_id'}; - - s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg; - ## if ($bbl_cnt == 1) { -s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo; - #} - $global{'max_id'} = $id; - s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o; - s/[\\]printindex/\\textohtmlindex /o; - &add_gls_dummy_commands; - &lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands); -} - -sub add_gls_dummy_commands{ - s/[\\]printglossary/\\textohtmlglossary/sg; - s/[\\]printglossaries/\\textohtmlglossaries/sg; -} - -sub get_firstkeyval{ - local($key,$_) = @_; - local($value); - - s/\b$key\s*=$OP(\d+)$CP(.*)$OP\1$CP\s*(,|$)/$value=$2;','/es; - undef($value) if $`=~/\b$key\s*=/; - - unless (defined($value)) - { - s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s; - $value=$2; - } - - ($value,$_); -} - -# need to get the value of the last key of a given name -# in the event of multiple occurences. -sub get_keyval{ - local($key,$_) = @_; - local($value); - - while (/\b$key\s*=/) - { - ($value,$_) = &get_firstkeyval($key, $_); - last unless defined($value); - } - - ($value,$_); -} - -# This is modified from do_cmd_textohtmlindex - -sub do_cmd_textohtmlglossary{ - local($_) = @_; - - local($keyval,$pat) = &get_next_optional_argument; - - local($type,$title,$toctitle,$style); - - ($type,$keyval) = &get_keyval('type', $keyval); - ($title,$keyval) = &get_keyval('title', $keyval); - ($toctitle,$keyval) = &get_keyval('toctitle', $keyval); - ($style,$keyval) = &get_keyval('style', $keyval); - - &make_textohtmlglossary($type,$toctitle,$title,$style).$_; -} - -sub make_textohtmlglossary{ - local($type,$toctitle,$title,$style) = @_; - - unless (defined($type)) {$type = 'main';} - - unless (defined $gls_mark{$type}) - { - &write_warnings("glossary type '$type' not implemented"); - } - - unless (defined($title) and $title) {$title = $gls_title{$type};} - unless (defined($toctitle) and $toctitle) {$toctitle = $title;} - - $toc_sec_title = $toctitle; - $glsfile{$type} = $CURRENT_FILE; - - $TITLE=&translate_commands($toctitle); - - if (%glossary_labels) { &make_glossary_labels(); } - - if (($SHORT_INDEX) && (%glossary_segment)) - { - &make_preglossary(); - } - else - { - $preglossary = &translate_commands("\\glossarypreamble"); - } - - local $idx_head = $section_headings{'textohtmlindex'}; - local($heading) = join('' - , &make_section_heading($title, $idx_head) - , $gls_mark{$type} ); - local($pre,$post) = &minimize_open_tags($heading); - join('',"
\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 = "
\n

Legend:

\n
"; - @keys = keys %glossary_segment; - foreach $key (@keys) { - local($tmp) = "segment$key"; - $tmp = $ref_files{$tmp}; - $body .= "\n
$key
".&make_named_href('',$tmp,$glossary_segment{$key}); - } - $preglossary = join('', $head, $body, "\n
") 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; - "
$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} = ""; - $gls_file_mark{$type} = ""; - $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); - - "$text$_"; -} - -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); - - # v1.01 removed following lines (\glslink doesn't have - # a final optional argument! - #local ($space) = ''; - #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - #($optarg,$pat) = &get_next_optional_argument; - - $type = &gls_get_type($label); - - #&make_glslink($type, $label, $format, $text).$space . $_; - &make_glslink($type, $label, $format, $text) . $_; -} - -sub do_cmd_glsentrydesc{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_description($label).$_; -} - -sub do_cmd_Glsentrydesc{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_description($label)).$_; -} - -sub do_cmd_glsentrytext{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_text($label).$_; -} - -sub do_cmd_Glsentrytext{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_text($label)).$_; -} - -sub do_cmd_glsentryname{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_name($label).$_; -} - -sub do_cmd_Glsentryname{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_name($label)).$_; -} - -sub do_cmd_glsentryfirst{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_first($label).$_; -} - -sub do_cmd_Glsentryfirst{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_first($label)).$_; -} - -sub do_cmd_glsentryplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_plural($label).$_; -} - -sub do_cmd_Glsentryplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_plural($label)).$_; -} - -sub do_cmd_glsentryfirstplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local($text)=$glsentry{$label}{'firstplural'}; - - unless (defined($text)) - { - &write_warnings("glossary entry '$label' has not been defined"); - $text = ''; - } - - "$text$_"; - &gls_get_firstplural($label).$_; -} - -sub do_cmd_Glsentryfirstplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_firstplural($label)).$_; -} - -sub do_cmd_glsentrysymbol{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_symbol($label).$_; -} - -sub do_cmd_Glsentrysymbol{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_symbol($label)).$_; -} - -sub do_cmd_gls{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = &gls_get_type($label); - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_text($label); - $display = &gls_get_display($type); - } - else - { - # entry hasn't been used - - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, $link_text) .$space . $_; -} - -sub do_cmd_glspl{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, $link_text) . $space . $_; -} - -sub do_cmd_Gls{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_text($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; -} - -sub do_cmd_Glspl{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_; -} - -sub do_cmd_GLS{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_text($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, uc($link_text)).$space . $_; -} - -sub do_cmd_GLSpl{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, uc($link_text)).$space . $_; -} - -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/glossary2glossaries.html b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html new file mode 100644 index 00000000000..74207fb56c1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html @@ -0,0 +1,764 @@ + + + + + +Upgrading from the glossary package to the glossaries +package + + + + + + + + + + + + + +

Upgrading from the glossary package to the glossaries +package

+

Nicola L.C. Talbot

+
+ +

+Contents +

+ + + + +

+ +

Abstract:

+
+The purpose of this document is to provide advice if you want +to convert a LaTeX document from using the obsolete +glossary package to the replacement glossaries package. +
+

+ +

+ +

+1 Package Options +

+ +

+When converting a document that currently uses the obsolete +glossary package to the replacement glossaries package, +it should be fairly obvious that the first thing you need to do is +replace \usepackage{glossary} with +\usepackage{glossaries}, however some of the package options +are different, so you may need to change those as well. +Table 1 shows the mappings from the glossary +to the glossaries package options. + +

+

+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1: +Mappings from glossary to glossaries +package options
glossary option glossaries option
style=liststyle=list
style=altliststyle=altlist
style=long,header=none,border=none,cols=2style=long
style=long,header=plain,border=none,cols=2style=longheader
style=long,header=none,border=plain,cols=2style=longborder
style=long,header=plain,border=plain,cols=2style=longheaderborder
style=long,header=none,border=none,cols=3style=long3col
style=long,header=plain,border=none,cols=3style=long3colheader
style=long,header=none,border=plain,cols=3style=long3colborder
style=long,header=plain,border=plain,cols=3style=long3colheaderborder
style=super,header=none,border=none,cols=2style=super
style=super,header=plain,border=none,cols=2style=superheader
style=super,header=none,border=plain,cols=2style=superborder
style=super,header=plain,border=plain,cols=2style=superheaderborder
style=super,header=none,border=none,cols=3style=super3col
style=super,header=plain,border=none,cols=3style=super3colheader
style=super,header=none,border=plain,cols=3style=super3colborder
style=super,header=plain,border=plain,cols=3style=super3colheaderborder
number=nonenonumberlist
number=<counter name>counter=<counter name>
toctoc
hypertoctoc
hyperno corresponding option
section=truesection
section=falseno corresponding option
acronymacronym
globalno corresponding option
+
+
+
+ +

+ +

+2 Defining new glossary types +

+ +

+If you have created new glossary types, you will need to +replace all instances of + +

+\newglossarytype[<log-ext>]{<type>}{<out-ext>}{<in-ext>}[<style list>] +
+\newcommand{\<type>name}{<title>}
+

+with + +

+\newglossary[<log-ext>]{<type>}{<out-ext>}{<in-ext>}{<title>} +

+in the preamble, and + +

+\glossarystyle{<new style list>} +

+immediately before \printglossary[type=<type>], +if the new glossary requires a different style to the main (default) +glossary. + +

+The <style list> optional argument can be converted to +<new style list> using the same mapping given in +Table 1. + +

+For example, if your document contains the following: +

+\newglossarytype[nlg]{notation}{not}{ntn}[style=long,header]
+\newcommand{\notationname}{Index of Notation}
+
+You will need to replace the above two lines with: +
+\newglossary[nlg]{notation}{not}{ntn}{Index of Notation}
+
+in the preamble, and +
+\glossarystyle{style=longheader}
+
+immediately prior to displaying this glossary new type. + +

+Note that the glossary title is no longer specified using +\<glossary-type>name (except for \glossaryname +and \acronymname) but is instead specified in the <title> +argument of \newglossary. The short title which is specified +in the glossary package by the command +\short<glossary-name>name is now specified +using the toctitle key in the optional argument to +\printglossary. + +

+ +

+3 \make<glossary name> +

+ +

+All instances of \make<glossary name> (e.g. +\makeglossary and \makeacronym) should be replaced +by the single command \makeglossaries. For example, if +your document contained the following: +

+\makeglossary
+\makeacronym
+
+then you should replace both lines with the single line: +
+\makeglossaries
+
+ +

+ +

+4 Storing glossary information +

+ +

+With the old glossary package you could optionally store +glossary information for later use, or you could simply use +\glossary whenever you wanted to add information to the glossary. +With the new glossaries package, the latter option is no longer +available1. If +you have stored all the glossary information using +\storeglosentry, then you will need to convert these commands +into the equivalent \newglossaryentry. If you haven't used +\storeglosentry, then you'll have a bit more work to do! + +

+The former approach requires substituting all instances of + +

+\storeglosentry{<label>}{<gls-entry>} +

+with + +

+\newglossaryentry{<label>}{<gls-entry>} +

+This should be fairly easy to do using the search and replace +facility in your editor (but see notes below). + +

+If you have used the optional argument of \storeglosentry +(i.e. you have multiple glossaries) then you will need to +substitute + +

+\storeglosentry[<gls-type>]{<label>}{<gls-entry>} +

+with + +

+\newglossaryentry{<label>}{<gls-entry>,type=<gls-type>} +

+ +

+The glossary entry information <gls-entry> may also need +changing. If <gls-entry> contains any of makeindex's +special characters (i.e. @ ! " or +|) then they should no longer be escaped with " +since the glossaries package deals with these characters +internally. For example, if your document contains the following: +

+\storeglosentry{card}{name={$"|\mathcal{S}"|$},
+description={The cardinality of the set $\mathcal{S}$}}
+
+then you will need to replace it with: +
+\newglossaryentry{card}{name={$|\mathcal{S}|$},
+description={The cardinality of the set $\mathcal{S}$}}
+
+ +

+The format and number keys available in +\storeglosentry are not available with \newglossaryentry. +Note also that the glossary package allowed you to use +\storeglosentry in the document, but \newglossaryentry +may only be used in the preamble. + +

+ +

+5 Adding an entry to the glossary +

+ +

+The glossary package provided two basic means to add +information to the glossary: firstly, the term was defined +using \storeglosentry and the entries for that term were +added using \useglosentry, \useGlosentry and \gls. +Secondly, the term was added to the glossary using \glossary. +This second approach is unavailable with the glossaries +package. + +

+ +

+ +
+5.1 \useglosentry +

+ +

+The glossary package allows you to add information to the +glossary for a predefined term without producing any text +in the document using + +

+\useglosentry[<old options>]{<label>} +

+Any occurrences of this command will need to be replaced with + +

+\glsadd[<new options>]{<label>} +

+The format key in <old options> remains the same +in <new options>, the number=<counter name> +key in <old options> should be replaced with +
counter=<counter name> in <new options>. + +

+ +

+5.2 \useGlosentry +

+ +

+The glossary package allows you to add information to the +glossary for a predefined term with the given text using + +

+\useGlosentry[<old options>]{<label>}{<text>} +

+Any occurrences if this command will need to be replaced with + +

+\glslink[<new options>]{<label>}{<text>} +

+The mapping from <old options> to <new options> is +the same as that given in section 5.1 above. + +

+ +

+5.3 \gls +

+ +

+Both the glossary and the glossaries packages define +the command \gls. In this case, the only thing you need to +change is the number key in the optional argument +to counter. + +

+ +

+5.4 \glossary +

+ +

+When using the glossaries package, you should not use +\glossary directly.2 If, with the old +package, you have opted to explicitly use \glossary instead of +storing the glossary information with \storeglosentry, then +converting from glossary to glossaries will be more +time-consuming, although in the end, I hope you will see the +benefits!3 If +you have used \glossary with the old glossary package, you will +instead need to define the relevant glossary terms using +\newglossaryentry and reference the terms using \glslink, +\gls (or \glspl etc). + +

+If you don't like the idea of continually scrolling back to the +preamble to type all your \newglossaryentry commands, you may +prefer to create a new file, in which to store all these commands, +and then input that file in your document's preamble. Most text +editors and front-ends allow you to have multiple files open, and +you can tab back and forth between them. + +

+ +

+6 Acronyms +

+ +

+In the glossary package, acronyms were treated differently +to glossary entries. This resulted in inconsistencies and sprawling +unmaintainable code. The new glossaries package treats +acronyms in exactly the same way as normal glossary terms. In fact, +in the glossaries package: + +

+\newacronym[<options>]{<label>}{<abbrv>}{<long>} +

+is a shortcut for: + +

+\newglossaryentry{<label>}{type=\acronymtype, +name={<abbrv>}, +description={<long>}, +text={<abbrv>}, +first={<long> (<abbrv>)}, +plural={<abbrv>s}, +firstplural={<long>s (<abbrv>s)}, +<options>} +

+ +

+This is different to the glossary package which set the +name key to <long> (<abbrv>) and allowed you +to set a description using the description key. If you want +your document to remain like this, you can redefine \newacronym +as follows: +

+\renewcommand{\newacronym}[4][]{%
+\newglossaryentry{#2}{type=\acronymtype,
+name={#4 (#3)},
+text={#3},
+first={#4 (#3)},
+plural={#3s},
+firstplural={#4s (#3s)},#1}}
+
+The description key will then need to be entered using the +optional argument. + +

+For example, if your document originally had the following: +

+\newacronym{SVM}{Support Vector Machine}{description=Statistical
+pattern recognition technique}
+
+Then you would need to redefine \newacronym as shown above, +and change the above to: +
+\newacronym[description=Statistical pattern recognition 
+technique]{svm}{SVM}{Support Vector Machine}
+
+You will also need to replace all occurrences of \SVM with +\gls{svm}. Alternatively, you can define \SVM: +
+\newcommand{\SVM}{\gls{svm}}
+
+ +

+If you have used \useacronym instead of \<acr-name>, +then you will need to replace all occurrences of + +

+\useacronym[<insert>]{<acr-name>} +

+with + +

+\gls{<label>}[<insert>] +

+Note that the starred versions of \useacronym and +\<acr-name> (which make the first letter uppercase) should +be replaced with \Gls{<label>}. + +

+ +

+6.1 \acrln and \acrsh +

+ +

+In the glossary package, it is possible to produce the +long and short forms of an acronym without adding an entry to +the glossary using \acrln and \acrsh. With the +glossaries package, you can replace + +

+\acrsh{<acr-name>} +

+with + +

+\glsentrytext{<label>} +

+However the glossaries package provides no direct equivalent +of \acrln. Instead it provides \glsentryfirst which +produces the ``first use'' text without adding an entry to the +glossary, or affecting the first use flag. + +

+Alternatively, if you haven't changed the definition of +\newacronym, the long form by itself can be obtained using +\glsentrydesc, since by default the description key is +set to the long form (but read the notes in the glossaries +manual regarding the sanitize package option). + +

+If you want to be able to set a description, and be able to +independently access the description, the long form and the +short form, you can redefine \newacronym so that it uses +the symbol key and use \defglsdisplayfirst +so that it uses this value on first use, as follows: +

+\renewcommand{\newacronym}[4][]{\newglossaryentry{#2}{%
+name={#4 (#3)},
+text={#3},
+first={#4},
+symbol={#3},
+}}
+\defglsdisplayfirst{\acronymtype}{##1 (##3)##4}
+
+As before, you can access the short name via +\glsentrytext{<label>}, but you can now access just the long +form via \glsentryfirst{<label>} and the description via +\glsentrydesc{<label>}. + +

+See +the section ``Using +glossary entries in the text'' of the glossaries +manual for further details of how to use these commands. + +

+ +

+6.2 \ifacronymfirstuse +

+ +

+The glossary package command + +

+\ifacronymfirstuse{<acr-name>}{<text1>}{<text2>} +

+can be replaced by the glossaries command: + +

+\ifglsused{<label>}{<text2>}{<text1>} +

+Note that \ifglsused evaluates the opposite condition to +that of \ifacronymfirstuse which is why the last two arguments +have been reversed. + +

+ +

+6.3 \resetacronym and \unsetacronym +

+ +

+The glossary package allows you to reset and unset the +acronym flag which is used to determine whether the acronym has +been used in the document. The glossaries package also +provides a means to do this on either a local or global level. +To reset an acronym, you will need to replace: + +

+\resetacronym{<acr-name>} +

+with either + +

+\glsreset{<label>} +

+or + +

+\glslocalreset{<label>} +

+ +

+To unset an acronym, you will need to replace: + +

+\unsetacronym{<acr-name>} +

+with either + +

+\glsunset{<label>} +

+or + +

+\glslocalunset{<label>} +

+ +

+ +

+7 Displaying the glossary +

+ +

+The glossary package provides the command \printglossary +(or \print<type> for other glossary types) which +can be used to print individual glossaries. The glossaries +package provides the command \printglossaries which +will print all the glossaries which have been defined, or +\printglossary[<options>] to print individual glossaries. +So if you just have \printglossary, then you can leave it as +it is, but if you have, say: +

+\printglossary
+\printglossary[acronym]
+
+or +
+\printglossary
+\printacronym
+
+then you will need to either replace this with either +
+\printglossaries
+
+or +
+\printglossary
+\printglossary[type=\acronymtype]
+
+ +

+The glossary package allows you to specify a short title +(for the table of contents and page header) by defining a command +of the form \short<glossary-type>name. The +glossaries package doesn't do this, but instead provides +the toctitle key which can be used in the optional +argument to \printglossary. For example, if you have created +a new glossary type called notation, and you had +defined +

+\newcommand{\shortnotationname}{Notation}
+
+then you would need to use the toctitle key: +
+\printglossary[type=notation,toctitle=Notation]
+
+The glossaries package will ignore \shortnotationname, +so unless you have used it elsewhere in the document, you may +as well remove the definition. + +

+ +

+8 Using makeindex +

+ +

+If you convert your document from using the glossary package +to the glossaries package, you will need to delete any of +the additional files, such as the .glo file, that were +created by the glossary package, as the glossaries +package uses a different makeindex style file. +Remember also, that if you used the makeglos Perl script, +you will need to use the makeglossaries Perl script +instead. + +

+


Footnotes

+
+
... +available1
+
mainly because having a key value list in +\glossary caused problems, but it also helps consistency. + +
+
... directly.2
+
This is because \glossary requires +the argument to be in a specific format and doesn't use the +<key>=<value> format that the old glossary package used. The +new package's internal commands set this format, as well as escaping +any of makeindex's special characters, so although it is +still possible to use \glossary with the new package, it's not +recommended. If you persist in using \glossary with the new +package, don't complain if things go wrong! + +
+
... +benefits!3
+
From the user's point of view, using \glossary +throughout the document is time consuming, and if you use it more than +once for the same term, there's a chance extra spaces may creep in +which will cause makeindex to treat the two entries as +different terms, even though they look the same in the document. + +
+
+

+ + + diff --git a/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.pdf b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.pdf new file mode 100644 index 00000000000..7280a20d692 Binary files /dev/null and b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.pdf differ diff --git a/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.tex b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.tex new file mode 100644 index 00000000000..f811c671f11 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.tex @@ -0,0 +1,529 @@ +\documentclass[a4paper]{article} + +\usepackage[colorlinks,pdfauthor={Nicola L.C. Talbot}, + pdftitle={Upgrading from the glossary package to + the glossaries package}]{hyperref} +\usepackage{html} +\usepackage{xr} + +\externaldocument{glossaries} + +\title{Upgrading from the glossary package to the glossaries +package} +\author{Nicola L.C. Talbot} + +\newcommand*{\meta}[1]{\textnormal{\textless\emph{#1}\textgreater}} +\newcommand*{\marg}[1]{\texttt{\char`\{\meta{#1}\char`\}}} +\newcommand*{\oarg}[1]{\texttt{[\meta{#1}]}} +\newcommand*{\cs}[1]{\texttt{\char`\\#1}} + +%\begin{latexonly} +\newcommand*{\sty}[1]{\textsf{#1}} + +\newsavebox\waybox +\newenvironment{oldway}{\begin{lrbox}{\waybox} +\begin{minipage}{0.98\linewidth}\ttfamily +}{\end{minipage}\end{lrbox}\vskip\baselineskip\par\noindent +\begin{tabular}{r} +\fbox{\usebox\waybox}\\[4pt]\footnotesize\mbox{\sty{glossary}} +\end{tabular}% +\vskip\baselineskip\par\noindent\ignorespaces} + +\newenvironment{newway}{\begin{lrbox}{\waybox} +\begin{minipage}{0.98\linewidth}\ttfamily +}{\end{minipage}\end{lrbox}\vskip\baselineskip\par\noindent +\begin{tabular}{r} +\fbox{\usebox\waybox}\\[4pt]\footnotesize\mbox{\sty{glossaries}} +\end{tabular}% +\vskip\baselineskip\par\noindent\ignorespaces} +%\end{latexonly} +\begin{htmlonly} +\newenvironment{oldway}{\par\begin{ttfamily}}{\end{ttfamily}\par} +\newenvironment{newway}{\par\begin{ttfamily}}{\end{ttfamily}\par} +\newcommand{\sty}[1]{\texttt{#1}} +\renewcommand{\LaTeX}{LaTeX} +\end{htmlonly} + +\begin{document} +\maketitle +\tableofcontents + +\begin{abstract} +The purpose of this document is to provide advice if you want +to convert a \LaTeX\ document from using the obsolete +\sty{glossary} package to the replacement \sty{glossaries} package. +\end{abstract} + +\section{Package Options} + +When converting a document that currently uses the obsolete +\sty{glossary} package to the replacement \sty{glossaries} package, +it should be fairly obvious that the first thing you need to do is +replace \verb|\usepackage{glossary}| with +\verb|\usepackage{glossaries}|, however some of the package options +are different, so you may need to change those as well. +Table~\ref{tab:pkgopt} shows the mappings from the \sty{glossary} +to the \sty{glossaries} package options. + +\begin{table}[htbp] +\caption[Mappings]{Mappings from \sty{glossary} to \sty{glossaries} +package options} +\label{tab:pkgopt} +\begin{center} +\begin{tabular}{ll} +\bfseries \sty{glossary} option & \bfseries \sty{glossaries} option\\ +style=list & style=list\\ +style=altlist & style=altlist\\ +style=long,header=none,border=none,cols=2 & style=long\\ +style=long,header=plain,border=none,cols=2 & style=longheader\\ +style=long,header=none,border=plain,cols=2 & style=longborder\\ +style=long,header=plain,border=plain,cols=2 & style=longheaderborder\\ +style=long,header=none,border=none,cols=3 & style=long3col\\ +style=long,header=plain,border=none,cols=3 & style=long3colheader\\ +style=long,header=none,border=plain,cols=3 & style=long3colborder\\ +style=long,header=plain,border=plain,cols=3 & style=long3colheaderborder\\ +style=super,header=none,border=none,cols=2 & style=super\\ +style=super,header=plain,border=none,cols=2 & style=superheader\\ +style=super,header=none,border=plain,cols=2 & style=superborder\\ +style=super,header=plain,border=plain,cols=2 & style=superheaderborder\\ +style=super,header=none,border=none,cols=3 & style=super3col\\ +style=super,header=plain,border=none,cols=3 & style=super3colheader\\ +style=super,header=none,border=plain,cols=3 & style=super3colborder\\ +style=super,header=plain,border=plain,cols=3 & style=super3colheaderborder\\ +number=none & nonumberlist\\ +number=\meta{counter name} & counter=\meta{counter name}\\ +toc & toc\\ +hypertoc & toc\\ +hyper & \emph{no corresponding option}\\ +section=true & section\\ +section=false & \emph{no corresponding option}\\ +acronym & acronym\\ +global & \emph{no corresponding option} +\end{tabular} +\end{center} +\end{table} + +\section{Defining new glossary types} + +If you have created new glossary types, you will need to +replace all instances of +\begin{oldway} +\cs{newglossarytype}\oarg{log-ext}\marg{type}\marg{out-ext}\marg{in-ext}\oarg{style list}\newline +\cs{newcommand}\verb|{\|\meta{type}name\verb|}|\marg{title} +\end{oldway}% +with +\begin{newway} +\cs{newglossary}\oarg{log-ext}\marg{type}\marg{out-ext}\marg{in-ext}\marg{title} +\end{newway}% +in the preamble, and +\begin{newway} +\cs{glossarystyle}\marg{new style list} +\end{newway}% +immediately before \verb|\printglossary[type=|\meta{type}\verb|]|, +if the new glossary requires a different style to the main (default) +glossary. + +The \meta{style list} optional argument can be converted to +\meta{new style list} using the same mapping given in +Table~\ref{tab:pkgopt}. + +For example, if your document contains the following: +\begin{verbatim} +\newglossarytype[nlg]{notation}{not}{ntn}[style=long,header] +\newcommand{\notationname}{Index of Notation} +\end{verbatim} +You will need to replace the above two lines with: +\begin{verbatim} +\newglossary[nlg]{notation}{not}{ntn}{Index of Notation} +\end{verbatim} +in the preamble, and +\begin{verbatim} +\glossarystyle{style=longheader} +\end{verbatim} +immediately prior to displaying this glossary new type. + +Note that the glossary title is no longer specified using +\cs{}\meta{glossary-type}\texttt{name} (except for \cs{glossaryname} +and \cs{acronymname}) but is instead specified in the \meta{title} +argument of \cs{newglossary}. The short title which is specified +in the \sty{glossary} package by the command +\cs{short}\meta{glossary-name}\texttt{name} is now specified +using the \texttt{toctitle} key in the optional argument to +\cs{printglossary}. + +\section{\cs{make}\meta{glossary name}} + +All instances of \cs{make}\meta{glossary name} (e.g.\ +\cs{makeglossary} and \cs{makeacronym}) should be replaced +by the single command \cs{makeglossaries}. For example, if +your document contained the following: +\begin{verbatim} +\makeglossary +\makeacronym +\end{verbatim} +then you should replace both lines with the single line: +\begin{verbatim} +\makeglossaries +\end{verbatim} + +\section{Storing glossary information} + +With the old \sty{glossary} package you could optionally store +glossary information for later use, or you could simply use +\cs{glossary} whenever you wanted to add information to the glossary. +With the new \sty{glossaries} package, the latter option is no longer +available\footnote{mainly because having a key value list in +\cs{glossary} caused problems, but it also helps consistency.}. If +you have stored all the glossary information using +\cs{storeglosentry}, then you will need to convert these commands +into the equivalent \cs{newglossaryentry}. If you haven't used +\cs{storeglosentry}, then you'll have a bit more work to do! + +The former approach requires substituting all instances of +\begin{oldway} +\cs{storeglosentry}\marg{label}\marg{gls-entry} +\end{oldway}% +with +\begin{newway} +\cs{newglossaryentry}\marg{label}\marg{gls-entry} +\end{newway}% +This should be fairly easy to do using the search and replace +facility in your editor (but see notes below). + +If you have used the optional argument of \cs{storeglosentry} +(i.e.\ you have multiple glossaries) then you will need to +substitute +\begin{oldway} +\cs{storeglosentry}\oarg{gls-type}\marg{label}\marg{gls-entry} +\end{oldway}% +with +\begin{newway} +\cs{newglossaryentry}\marg{label}\verb|{|\meta{gls-entry},type=\meta{gls-type}\verb|}| +\end{newway} + +The glossary entry information \meta{gls-entry} may also need +changing. If \meta{gls-entry} contains any of \texttt{makeindex}'s +special characters (i.e.\ \texttt{@} \texttt{!} \verb|"| or +\verb"|") then they should no longer be escaped with \verb'"' +since the \sty{glossaries} package deals with these characters +internally. For example, if your document contains the following: +\begin{verbatim} +\storeglosentry{card}{name={$"|\mathcal{S}"|$}, +description={The cardinality of the set $\mathcal{S}$}} +\end{verbatim} +then you will need to replace it with: +\begin{verbatim} +\newglossaryentry{card}{name={$|\mathcal{S}|$}, +description={The cardinality of the set $\mathcal{S}$}} +\end{verbatim} + +The \texttt{format} and \texttt{number} keys available in +\cs{storeglosentry} are not available with \cs{newglossaryentry}. +Note also that the \sty{glossary} package allowed you to use +\cs{storeglosentry} in the document, but \cs{newglossaryentry} +may only be used in the preamble. + +\section{Adding an entry to the glossary} + +The \sty{glossary} package provided two basic means to add +information to the glossary: firstly, the term was defined +using \cs{storeglosentry} and the entries for that term were +added using \cs{useglosentry}, \cs{useGlosentry} and \cs{gls}. +Secondly, the term was added to the glossary using \cs{glossary}. +This second approach is unavailable with the \sty{glossaries} +package. + +\subsection{\cs{useglosentry}} +\label{sec:useglosentry} + +The \sty{glossary} package allows you to add information to the +glossary for a predefined term without producing any text +in the document using +\begin{oldway} +\cs{useglosentry}\oarg{old options}\marg{label} +\end{oldway}% +Any occurrences of this command will need to be replaced with +\begin{newway} +\cs{glsadd}\oarg{new options}\marg{label} +\end{newway}% +The \texttt{format} key in \meta{old options} remains the same +in \meta{new options}, the \texttt{number=}\meta{counter name} +key in \meta{old options} should be replaced with\linebreak +\texttt{counter=}\meta{counter name} in \meta{new options}. + +\subsection{\cs{useGlosentry}} + +The \sty{glossary} package allows you to add information to the +glossary for a predefined term with the given text using +\begin{oldway} +\cs{useGlosentry}\oarg{old options}\marg{label}\marg{text} +\end{oldway}% +Any occurrences if this command will need to be replaced with +\begin{newway} +\cs{glslink}\oarg{new options}\marg{label}\marg{text} +\end{newway}% +The mapping from \meta{old options} to \meta{new options} is +the same as that given in section~\ref{sec:useglosentry} above. + +\subsection{\cs{gls}} + +Both the \sty{glossary} and the \sty{glossaries} packages define +the command \cs{gls}. In this case, the only thing you need to +change is the \texttt{number} key in the optional argument +to \texttt{counter}. + +\subsection{\cs{glossary}} + +When using the \sty{glossaries} package, you should not use +\cs{glossary} directly.\footnote{This is because \cs{glossary} requires +the argument to be in a specific format and doesn't use the +\meta{key}=\meta{value} format that the old glossary package used. The +new package's internal commands set this format, as well as escaping +any of \texttt{makeindex}'s special characters, so although it is +still possible to use \cs{glossary} with the new package, it's not +recommended. If you persist in using \cs{glossary} with the new +package, don't complain if things go wrong!} If, with the old +package, you have opted to explicitly use \cs{glossary} instead of +storing the glossary information with \cs{storeglosentry}, then +converting from \sty{glossary} to \sty{glossaries} will be more +time-consuming, although in the end, I hope you will see the +benefits!\footnote{From the user's point of view, using \cs{glossary} +throughout the document is time consuming, and if you use it more than +once for the same term, there's a chance extra spaces may creep in +which will cause \texttt{makeindex} to treat the two entries as +different terms, even though they look the same in the document.} If +you have used \cs{glossary} with the old glossary package, you will +instead need to define the relevant glossary terms using +\cs{newglossaryentry} and reference the terms using \cs{glslink}, +\cs{gls} (or \cs{glspl} etc). + +If you don't like the idea of continually scrolling back to the +preamble to type all your \cs{newglossaryentry} commands, you may +prefer to create a new file, in which to store all these commands, +and then input that file in your document's preamble. Most text +editors and front-ends allow you to have multiple files open, and +you can tab back and forth between them. + +\section{Acronyms} + +In the \sty{glossary} package, acronyms were treated differently +to glossary entries. This resulted in inconsistencies and sprawling +unmaintainable code. The new \sty{glossaries} package treats +acronyms in exactly the same way as normal glossary terms. In fact, +in the \sty{glossaries} package: +\begin{newway} +\cs{newacronym}\oarg{options}\marg{label}\marg{abbrv}\marg{long} +\end{newway} +is a shortcut for: +\begin{newway} +\cs{newglossaryentry}\marg{label}\{type=\cs{acronymtype}, +name=\marg{abbrv}, +description=\marg{long}, +text=\marg{abbrv}, +first=\{\meta{long} (\meta{abbrv})\}, +plural=\{\meta{abbrv}s\}, +firstplural=\{\meta{long}s (\meta{abbrv}s)\}, +\meta{options}\} +\end{newway} + +This is different to the \sty{glossary} package which set the +\texttt{name} key to \meta{long} (\meta{abbrv}) and allowed you +to set a description using the \texttt{description} key. If you want +your document to remain like this, you can redefine \cs{newacronym} +as follows: +\begin{verbatim} +\renewcommand{\newacronym}[4][]{% +\newglossaryentry{#2}{type=\acronymtype, +name={#4 (#3)}, +text={#3}, +first={#4 (#3)}, +plural={#3s}, +firstplural={#4s (#3s)},#1}} +\end{verbatim} +The \texttt{description} key will then need to be entered using the +optional argument. + +For example, if your document originally had the following: +\begin{verbatim} +\newacronym{SVM}{Support Vector Machine}{description=Statistical +pattern recognition technique} +\end{verbatim} +Then you would need to redefine \cs{newacronym} as shown above, +and change the above to: +\begin{verbatim} +\newacronym[description=Statistical pattern recognition +technique]{svm}{SVM}{Support Vector Machine} +\end{verbatim} +You will also need to replace all occurrences of \cs{SVM} with +\verb|\gls{svm}|. Alternatively, you can define \cs{SVM}: +\begin{verbatim} +\newcommand{\SVM}{\gls{svm}} +\end{verbatim} + +If you have used \cs{useacronym} instead of \cs{}\meta{acr-name}, +then you will need to replace all occurrences of +\begin{oldway} +\cs{useacronym}\oarg{insert}\marg{acr-name} +\end{oldway}% +with +\begin{newway} +\cs{gls}\marg{label}\oarg{insert} +\end{newway}% +Note that the starred versions of \cs{useacronym} and +\cs{}\meta{acr-name} (which make the first letter uppercase) should +be replaced with \cs{Gls}\marg{label}. + +\subsection{\cs{acrln} and \cs{acrsh}} + +In the \sty{glossary} package, it is possible to produce the +long and short forms of an acronym without adding an entry to +the glossary using \cs{acrln} and \cs{acrsh}. With the +\sty{glossaries} package, you can replace +\begin{oldway} +\cs{acrsh}\marg{acr-name} +\end{oldway}% +with +\begin{newway} +\cs{glsentrytext}\marg{label} +\end{newway}% +However the \sty{glossaries} package provides no direct equivalent +of \cs{acrln}. Instead it provides \cs{glsentryfirst} which +produces the ``first use'' text without adding an entry to the +glossary, or affecting the first use flag. + +Alternatively, if you haven't changed the definition of +\cs{newacronym}, the long form by itself can be obtained using +\cs{glsentrydesc}, since by default the \texttt{description} key is +set to the long form (but read the notes in the \sty{glossaries} +manual regarding the \texttt{sanitize} package option). + +If you want to be able to set a description, and be able to +independently access the description, the long form and the +short form, you can redefine \cs{newacronym} so that it uses +the \texttt{symbol} key and use \cs{defglsdisplayfirst} +so that it uses this value on first use, as follows: +\begin{verbatim} +\renewcommand{\newacronym}[4][]{\newglossaryentry{#2}{% +name={#4 (#3)}, +text={#3}, +first={#4}, +symbol={#3}, +}} +\defglsdisplayfirst{\acronymtype}{##1 (##3)##4} +\end{verbatim} +As before, you can access the short name via +\cs{glsentrytext}\marg{label}, but you can now access just the long +form via \cs{glsentryfirst}\marg{label} and the description via +\cs{glsentrydesc}\marg{label}. + +See +\latexhtml{section~\ref*{sec:code:glslink} (}{the section }``Using +glossary entries in the text''\latex{)} of the \sty{glossaries} +manual for further details of how to use these commands. + +\subsection{\cs{ifacronymfirstuse}} + +The \sty{glossary} package command +\begin{oldway} +\cs{ifacronymfirstuse}\marg{acr-name}\marg{text1}\marg{text2} +\end{oldway}% +can be replaced by the \sty{glossaries} command: +\begin{newway} +\cs{ifglsused}\marg{label}\marg{text2}\marg{text1} +\end{newway}% +Note that \cs{ifglsused} evaluates the opposite condition to +that of \cs{ifacronymfirstuse} which is why the last two arguments +have been reversed. + +\subsection{\cs{resetacronym} and \cs{unsetacronym}} + +The \sty{glossary} package allows you to reset and unset the +acronym flag which is used to determine whether the acronym has +been used in the document. The \sty{glossaries} package also +provides a means to do this on either a local or global level. +To reset an acronym, you will need to replace: +\begin{oldway} +\cs{resetacronym}\marg{acr-name} +\end{oldway}% +with either +\begin{newway} +\cs{glsreset}\marg{label} +\end{newway}% +or +\begin{newway} +\cs{glslocalreset}\marg{label} +\end{newway} + +To unset an acronym, you will need to replace: +\begin{oldway} +\cs{unsetacronym}\marg{acr-name} +\end{oldway}% +with either +\begin{newway} +\cs{glsunset}\marg{label} +\end{newway}% +or +\begin{newway} +\cs{glslocalunset}\marg{label} +\end{newway} + +\section{Displaying the glossary} + +The \sty{glossary} package provides the command \cs{printglossary} +(or \cs{print}\meta{type} for other glossary types) which +can be used to print individual glossaries. The \sty{glossaries} +package provides the command \cs{printglossaries} which +will print all the glossaries which have been defined, or +\cs{printglossary}\oarg{options} to print individual glossaries. +So if you just have \cs{printglossary}, then you can leave it as +it is, but if you have, say: +\begin{verbatim} +\printglossary +\printglossary[acronym] +\end{verbatim} +or +\begin{verbatim} +\printglossary +\printacronym +\end{verbatim} +then you will need to either replace this with either +\begin{verbatim} +\printglossaries +\end{verbatim} +or +\begin{verbatim} +\printglossary +\printglossary[type=\acronymtype] +\end{verbatim} + +The \sty{glossary} package allows you to specify a short title +(for the table of contents and page header) by defining a command +of the form \cs{short}\meta{glossary-type}\texttt{name}. The +\sty{glossaries} package doesn't do this, but instead provides +the \texttt{toctitle} key which can be used in the optional +argument to \cs{printglossary}. For example, if you have created +a new glossary type called \texttt{notation}, and you had +defined +\begin{verbatim} +\newcommand{\shortnotationname}{Notation} +\end{verbatim} +then you would need to use the \texttt{toctitle} key: +\begin{verbatim} +\printglossary[type=notation,toctitle=Notation] +\end{verbatim} +The \sty{glossaries} package will ignore \cs{shortnotationname}, +so unless you have used it elsewhere in the document, you may +as well remove the definition. + +\section{Using makeindex} + +If you convert your document from using the \sty{glossary} package +to the \sty{glossaries} package, you will need to delete any of +the additional files, such as the \texttt{.glo} file, that were +created by the \sty{glossary} package, as the \sty{glossaries} +package uses a different \texttt{makeindex} style file. +Remember also, that if you used the \texttt{makeglos} Perl script, +you will need to use the \texttt{makeglossaries} Perl script +instead. + +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl b/Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl deleted file mode 100644 index 22ad50f784c..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/latex2html/glossaries.perl +++ /dev/null @@ -1,1713 +0,0 @@ -# File : glossaries.perl -# Author : Nicola L.C. Talbot -# Date : 14th June 2007 -# Last Modified : 21st Aug 2007 -# Version : 1.02 -# Description : LaTeX2HTML (limited!) implementation of glossaries -# package. Note that not all the glossaries.sty -# macros have been implemented. - -# This is a LaTeX2HTML style implementing the glossaries package, and -# is distributed as part of that package. -# Copyright 2007 Nicola L.C. Talbot -# This work may be distributed and/or modified under the -# conditions of the LaTeX Project Public License, either version 1.3 -# of this license of (at your option) any later version. -# The latest version of this license is in -# http://www.latex-project.org/lppl.txt -# and version 1.3 or later is part of all distributions of LaTeX -# version 2005/12/01 or later. -# -# This work has the LPPL maintenance status `maintained'. -# -# The Current Maintainer of this work is Nicola Talbot. - -# This work consists of the files glossaries.dtx and glossaries.ins -# and the derived files glossaries.sty, glossary-hypernav.sty, -# glossary-list.sty, glossary-long.sty, glossary-super.sty, -# glossaries.perl. Also makeglossaries and makeglossaries.bat - -package main; - -# These are the only package options implemented. - -sub do_glossaries_style_altlist{ -} - -sub do_glossaries_toc{ -} - -sub do_glossaries_toc_true{ -} - -$GLSCURRENTFORMAT="textrm"; - -sub do_cmd_glossaryname{ - "Glossary$_[0]" -} - -$gls_mark{'main'} = ""; -$gls_file_mark{'main'} = ""; -$gls_title{'main'} = "\\glossaryname"; -$delimN{'main'} = ", "; -$glsnumformat{'main'} = $GLSCURRENTFORMAT; -@{$gls_entries{'main'}} = (); -$gls_displayfirst{'main'} = "glsdisplayfirst"; -$gls_display{'main'} = "glsdisplay"; - - -$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) =('',''); - if ($INDEX_STYLES) { -if ($INDEX_STYLES =~/,/) { -local(@styles) = split(/\s*,\s*/,$INDEX_STYLES); - $sidx_style = join('','<', join('><',@styles) ,'>'); - $eidx_style = join('',''); -} else { - $sidx_style = join('','<', $INDEX_STYLES,'>'); - $eidx_style = join('',''); -} - } - &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 - . "\n" - : "
" - . $name - . "
" - . $glsentry{$entry}{'description'} - . $symbol . '. ' - . $glossary{$type}{$key} - . $linktext. "\n"); - $previous = $current; - } - $glossary = '
'.$glossary unless ($glossary =~ /^\s*/); - - $glossary =~ s/(]*>)()/$2$1/g; - - $str = &translate_commands("\\glossarypostamble"); - s/$gls_mark{$type}/$preglossary\n
\n$glossary<\/DL>$str\n/s; -} - -sub set_depth_levels { - # Sets $outermost_level - local($level); - # scan the document body, not the preamble, for use of sectioning commands - my ($contents) = $_; - if ($contents =~ /\\begin\s*((?:$O|$OP)\d+(?:$C|$CP))document\1|\\startdocument/s) { -$contents = $'; - } - foreach $level ("part", "chapter", "section", "subsection", - "subsubsection", "paragraph") { -last if (($outermost_level) = $contents =~ /\\($level)$delimiter_rx/); -last if (($outermost_level) = $contents =~ /\\endsegment\s*\[\s*($level)\s*\]/s); -if ($contents =~ /\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)\s*($level)\s*\2/s) -{ $outermost_level = $3; last }; - } - $level = ($outermost_level ? $section_commands{$outermost_level} : - do {$outermost_level = 'section'; 3;}); - - if ($REL_DEPTH && $MAX_SPLIT_DEPTH) { -$MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH; - } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 }; - - %unnumbered_section_commands = ( - 'tableofcontents', $level -, 'listoffigures', $level -, 'listoftables', $level -, 'bibliography', $level -, 'textohtmlindex', $level -, 'textohtmlglossary', $level -, 'textohtmlglossaries', $level - , %unnumbered_section_commands - ); - - %section_commands = ( - %unnumbered_section_commands - , %section_commands - ); -} - -sub add_bbl_and_idx_dummy_commands { - local($id) = $global{'max_id'}; - - s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg; - ## if ($bbl_cnt == 1) { -s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo; - #} - $global{'max_id'} = $id; - s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o; - s/[\\]printindex/\\textohtmlindex /o; - &add_gls_dummy_commands; - &lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands); -} - -sub add_gls_dummy_commands{ - s/[\\]printglossary/\\textohtmlglossary/sg; - s/[\\]printglossaries/\\textohtmlglossaries/sg; -} - -sub get_firstkeyval{ - local($key,$_) = @_; - local($value); - - s/\b$key\s*=$OP(\d+)$CP(.*)$OP\1$CP\s*(,|$)/$value=$2;','/es; - undef($value) if $`=~/\b$key\s*=/; - - unless (defined($value)) - { - s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s; - $value=$2; - } - - ($value,$_); -} - -# need to get the value of the last key of a given name -# in the event of multiple occurences. -sub get_keyval{ - local($key,$_) = @_; - local($value); - - while (/\b$key\s*=/) - { - ($value,$_) = &get_firstkeyval($key, $_); - last unless defined($value); - } - - ($value,$_); -} - -# This is modified from do_cmd_textohtmlindex - -sub do_cmd_textohtmlglossary{ - local($_) = @_; - - local($keyval,$pat) = &get_next_optional_argument; - - local($type,$title,$toctitle,$style); - - ($type,$keyval) = &get_keyval('type', $keyval); - ($title,$keyval) = &get_keyval('title', $keyval); - ($toctitle,$keyval) = &get_keyval('toctitle', $keyval); - ($style,$keyval) = &get_keyval('style', $keyval); - - &make_textohtmlglossary($type,$toctitle,$title,$style).$_; -} - -sub make_textohtmlglossary{ - local($type,$toctitle,$title,$style) = @_; - - unless (defined($type)) {$type = 'main';} - - unless (defined $gls_mark{$type}) - { - &write_warnings("glossary type '$type' not implemented"); - } - - unless (defined($title) and $title) {$title = $gls_title{$type};} - unless (defined($toctitle) and $toctitle) {$toctitle = $title;} - - $toc_sec_title = $toctitle; - $glsfile{$type} = $CURRENT_FILE; - - $TITLE=&translate_commands($toctitle); - - if (%glossary_labels) { &make_glossary_labels(); } - - if (($SHORT_INDEX) && (%glossary_segment)) - { - &make_preglossary(); - } - else - { - $preglossary = &translate_commands("\\glossarypreamble"); - } - - local $idx_head = $section_headings{'textohtmlindex'}; - local($heading) = join('' - , &make_section_heading($title, $idx_head) - , $gls_mark{$type} ); - local($pre,$post) = &minimize_open_tags($heading); - join('',"
\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 = "
\n

Legend:

\n
"; - @keys = keys %glossary_segment; - foreach $key (@keys) { - local($tmp) = "segment$key"; - $tmp = $ref_files{$tmp}; - $body .= "\n
$key
".&make_named_href('',$tmp,$glossary_segment{$key}); - } - $preglossary = join('', $head, $body, "\n
") 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; - "
$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} = ""; - $gls_file_mark{$type} = ""; - $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); - - "$text$_"; -} - -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); - - # v1.01 removed following lines (\glslink doesn't have - # a final optional argument! - #local ($space) = ''; - #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - #($optarg,$pat) = &get_next_optional_argument; - - $type = &gls_get_type($label); - - #&make_glslink($type, $label, $format, $text).$space . $_; - &make_glslink($type, $label, $format, $text) . $_; -} - -sub do_cmd_glsentrydesc{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_description($label).$_; -} - -sub do_cmd_Glsentrydesc{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_description($label)).$_; -} - -sub do_cmd_glsentrytext{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_text($label).$_; -} - -sub do_cmd_Glsentrytext{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_text($label)).$_; -} - -sub do_cmd_glsentryname{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_name($label).$_; -} - -sub do_cmd_Glsentryname{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_name($label)).$_; -} - -sub do_cmd_glsentryfirst{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_first($label).$_; -} - -sub do_cmd_Glsentryfirst{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_first($label)).$_; -} - -sub do_cmd_glsentryplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_plural($label).$_; -} - -sub do_cmd_Glsentryplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_plural($label)).$_; -} - -sub do_cmd_glsentryfirstplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local($text)=$glsentry{$label}{'firstplural'}; - - unless (defined($text)) - { - &write_warnings("glossary entry '$label' has not been defined"); - $text = ''; - } - - "$text$_"; - &gls_get_firstplural($label).$_; -} - -sub do_cmd_Glsentryfirstplural{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_firstplural($label)).$_; -} - -sub do_cmd_glsentrysymbol{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - &gls_get_symbol($label).$_; -} - -sub do_cmd_Glsentrysymbol{ - local($_) = @_; - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - ucfirst(&gls_get_symbol($label)).$_; -} - -sub do_cmd_gls{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = &gls_get_type($label); - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_text($label); - $display = &gls_get_display($type); - } - else - { - # entry hasn't been used - - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, $link_text) .$space . $_; -} - -sub do_cmd_glspl{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, $link_text) . $space . $_; -} - -sub do_cmd_Gls{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_text($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; -} - -sub do_cmd_Glspl{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_; -} - -sub do_cmd_GLS{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_text($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, uc($link_text)).$space . $_; -} - -sub do_cmd_GLSpl{ - local($_) = @_; - local($optarg,$pat,$label,$text, $format, $insert); - - ($optarg,$pat) = &get_next_optional_argument; - - ($format,$optarg) = &get_keyval('format', $optarg); - - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); - - local ($space) = ''; - if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - - $insert = ''; - ($insert,$pat) = &get_next_optional_argument; - - local($display) = ''; - - local($type) = $glsentry{$label}{'type'}; - - if (&gls_used($label)) - { - # entry has already been used - - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used - - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); - - &unset_entry($label); - } - - local($args) = ''; - - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; - - local($link_text) = &translate_commands("$display$args"); - - &make_glslink($type, $label, $format, uc($link_text)).$space . $_; -} - -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/samples/database1.tex b/Master/texmf-dist/doc/latex/glossaries/samples/database1.tex new file mode 100644 index 00000000000..ab557f81460 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/samples/database2.tex b/Master/texmf-dist/doc/latex/glossaries/samples/database2.tex new file mode 100644 index 00000000000..1fb3042e36b --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/samples/minimalgls.tex b/Master/texmf-dist/doc/latex/glossaries/samples/minimalgls.tex new file mode 100644 index 00000000000..b9d3cf6c7e6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/minimalgls.tex @@ -0,0 +1,39 @@ + % This is a minimal file for testing and debugging + % the glossaries package. Change the class file as + % desired, and add the relevant package options to + % both the class file and the glossaries package. + % Change the sample glossary entry and acronym if + % required. + % + % Only add extra packages or commands if they + % contribute to whatever problem you are trying to + % test. + % + % Remember that the document will not be complete + % until you have successfully completed all of the + % following steps: + % 1. latex minimalgls + % 2. makeglossaries minimalgls (note no extension) + % 3. latex minimalgls + % A further run through LaTeX will be required to ensure that + % the table of contents is up to date if the toc option + % is used. +\documentclass{article} +\listfiles + + %\usepackage{glossaries} % acronym will go in main glossary +\usepackage[acronym]{glossaries} % make a separate list of acronyms + +\makeglossaries + +\newglossaryentry{sample}{name={sample}, +description={a sample entry}} + +\newacronym{aca}{aca}{a contrived acronym} + +\begin{document} + +A \gls{sample} entry and \gls{aca}. + +\printglossaries +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex new file mode 100644 index 00000000000..f91ab534f8e --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex @@ -0,0 +1,75 @@ +\documentclass[a4paper]{report} + +\usepackage[plainpages=false,colorlinks]{hyperref} +\usepackage[style=altlist]{glossaries} + +\makeglossaries + +\newglossaryentry{glossary}{name=glossary, +description={1) list of technical words, 2) collection of +glosses}, +plural={glossaries}} + +\newglossaryentry{Perl}{name=\texttt{Perl}, +sort=Perl, % need a sort key because name contains a command +description=A scripting language} + +\newglossaryentry{pagelist}{name=page list, + % description value has to be enclosed in braces + % because it contains commas +description={a list of individual pages or page ranges +(e.g.\ 1,2,4,7-9)}} + +\newglossaryentry{mtrx}{name=matrix, +description={rectangular array of quantities}, + % plural is not simply obtained by appending an s, so specify +plural=matrices} + +\newcommand{\pardescription}{distinct section of piece of +writing.\par Beginning on new, usually indented, line} +\newglossaryentry{par}{name=paragraph, +description=\pardescription} + +\begin{document} + +\title{Sample Document Using glossary Package} +\author{Nicola Talbot} +\pagenumbering{alph}% prevent duplicate page link names if using PDF +\maketitle + +\pagenumbering{roman} +\tableofcontents + +\chapter{Introduction} +\pagenumbering{arabic} + +A \gls{glossary} is a very useful addition to any +technical document, although a \gls{glossary} can +also simply be a collection of glosses, which is +another thing entirely. Some documents have +multiple \glspl{glossary}. + +Once you have run your document through \LaTeX, you +will then need to run the \texttt{.glo} file through +\texttt{makeindex}. You will need to set the output +file so that it creates a \texttt{.gls} file instead +of an \texttt{.ind} file, and change the name of +the log file so that it doesn't overwrite the index +log file (if you have an index for your document). +Rather than having to remember all the command line +switches, you can call the \gls{Perl} script +\texttt{makeglossaries} which provides a convenient +wrapper. + +If a comma appears within the name or description, grouping +must be used, e.g.\ in the description of \gls{pagelist}. + +Plurals are assumed to have the letter s appended, but if +this is not the case, as in \glspl{mtrx}, then you need +to specify the plural when you define the entry. + +\Glspl{par} can cause a problem in commands. + +\printglossaries + +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sample4col.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sample4col.tex new file mode 100644 index 00000000000..67b78bc4575 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/samples/sampleAcr.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleAcr.tex new file mode 100644 index 00000000000..2b26e982be0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/sampleAcr.tex @@ -0,0 +1,49 @@ +\documentclass[a4paper]{report} + +\usepackage[colorlinks,plainpages=false]{hyperref} +\usepackage[style=long,toc]{glossaries} + +\makeglossaries + +\renewcommand*{\glstextformat}[1]{\textsf{#1}} + +\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/samples/sampleAcrDesc.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleAcrDesc.tex new file mode 100644 index 00000000000..8014d656b42 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/samples/sampleDB.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleDB.tex new file mode 100644 index 00000000000..7d58e32e2af --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/samples/sampleEq.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleEq.tex new file mode 100644 index 00000000000..39829705e77 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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 glossaries.sty} +\author{Nicola Talbot} +\maketitle + +\begin{abstract} +This is a sample document illustrating the use of the \textsf{glossaries} +package. The functions here have been taken from ``Tables of +Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik. +The glossary is a list of special functions, so +the equation number has been used rather than the page number. This +can be done using the \texttt{counter=equation} package +option. +\end{abstract} + +\printglossary[title={Index of Special Functions and Notations}] + +\chapter{Gamma Functions} + +\begin{equation} +\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt +\end{equation} + +\verb|\ensuremath| is only required here if using +hyperlinks. +\begin{equation} +\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x) +\end{equation} + +\begin{equation} +\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt +\end{equation} + +\begin{equation} +\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt +\end{equation} + +\newpage + +\begin{equation} +\gls{Gamma} = \Gamma(\alpha, x) + \gamma(\alpha, x) +\end{equation} + +\begin{equation} +\gls{psi} = \frac{d}{dx}\ln\Gamma(x) +\end{equation} + +\chapter{Error Functions} + +\begin{equation} +\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt +\end{equation} + +\begin{equation} +\gls{erfc} = 1 - \erf(x) +\end{equation} + +\chapter{Beta Function} + +\begin{equation} +\gls{B} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt +\end{equation} +Alternatively: +\begin{equation} +\gls{B} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi +\end{equation} + +\begin{equation} +\gls{B} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x) +\end{equation} + +\begin{equation} +\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt +\end{equation} + +\chapter{Polynomials} + +\section{Chebyshev's polynomials} + +\begin{equation} +\gls{Tn} = \cos(n\arccos x) +\end{equation} + +\begin{equation} +\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]} +\end{equation} + +\section{Hermite polynomials} + +\begin{equation} +\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2}) +\end{equation} + +\section{Laguerre polynomials} + +\begin{equation} +L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} +\frac{d^n}{dx^n}(e^{-x}x^{n+\alpha}) +\end{equation} + +\chapter{Bessel Functions} + +Bessel functions $Z_\nu$ are solutions of +\begin{equation} +\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} ++ \frac{1}{z}\,\frac{dZ_\nu}{dz} + +\left( 1-\frac{\nu^2}{z^2}Z_\nu = 0 \right) +\end{equation} + +\chapter{Confluent hypergeometric function} + +\begin{equation} +\gls{Phi} = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!} ++ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!} ++\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\, +\frac{z^3}{3!} + \cdots +\end{equation} + +\begin{equation} +\gls{knu} = \frac{2}{\pi}\int_0^{\pi/2} +\cos(x \tan\theta - \nu\theta)\,d\theta +\end{equation} + +\chapter{Parabolic cylinder functions} + +\begin{equation} +\gls{Dp} = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}} +\left\{ +\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)} +\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right) +-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)} +\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right) +\right\} +\end{equation} + +\chapter{Elliptical Integral of the First Kind} + +\begin{equation} +\gls{F} = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}} +\end{equation} + +\chapter{Constants} + +\begin{equation} +\gls{C} = 0.577\,215\,664\,901\ldots +\end{equation} + +\begin{equation} +\gls{G} = 0.915\,965\,594\ldots +\end{equation} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sampleEqPg.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleEqPg.tex new file mode 100644 index 00000000000..218b1a3fed4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/samples/sampleNtn.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleNtn.tex new file mode 100644 index 00000000000..b33269174f6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/sampleNtn.tex @@ -0,0 +1,85 @@ +\documentclass{report} + +\usepackage[plainpages=false,colorlinks]{hyperref} +\usepackage{html} +\usepackage[toc]{glossaries} + + % Define a new glossary type called notation +\newglossary[nlg]{notation}{not}{ntn}{Notation} + +\makeglossaries + + % Notation definitions + +\newglossaryentry{not:set}{type=notation, % glossary type +name={$\mathcal{S}$}, +description={A set}, +sort={S}} + +\newglossaryentry{not:U}{type=notation, +name={$\mathcal{U}$}, +description={The universal set}, +sort=U} + +\newglossaryentry{not:card}{type=notation, +name={$|\mathcal{S}|$}, +description={cardinality of $\mathcal{S}$}, +sort=cardinality} + +\newglossaryentry{not:fact}{type=notation, +name={$!$}, +description={factorial}, +sort=factorial} + + % Main glossary definitions + +\newglossaryentry{gls:set}{name=set, +description={A collection of distinct objects}} + +\newglossaryentry{gls:card}{name=cardinality, +description={The number of elements in the specified set}} + +\begin{document} +\title{Sample Document using the glossaries Package} +\author{Nicola Talbot} +\pagenumbering{alph} +\maketitle + +\begin{abstract} + %stop hyperref complaining about duplicate page identifiers: +\pagenumbering{Alph} +This is a sample document illustrating the use of the +\textsf{glossaries} package. In this example, a new glossary type +called \texttt{notation} is defined, so that the document can have a +separate glossary of terms and index of notation. The index of notation +doesn't have associated numbers. +\end{abstract} + + +\pagenumbering{roman} +\tableofcontents + +\printglossaries + %\printglossary + %\setglossarysection{section} + %\printglossary[type=notation] + +\chapter{Introduction} +\pagenumbering{arabic} + +\glslink{gls:set}{Sets} +are denoted by a caligraphic font +e.g.\ \gls{not:set}. + +Let \gls[format=hyperit]{not:U} denote the universal set. + +The \gls{gls:card} of a set $\mathcal{S}$ is denoted +\gls{not:card}. + +\chapter{Another Chapter} + +Another mention of the universal set \gls{not:U}. + +The factorial symbol: \gls{not:fact}. + +\end{document} diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sampleSec.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sampleSec.tex new file mode 100644 index 00000000000..ccefe8c19e1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/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/scripts/makeglossaries b/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries deleted file mode 100755 index aaa0c1b36d0..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries +++ /dev/null @@ -1,229 +0,0 @@ -#!/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) - -# This file is distributed as part of the glossaries LaTeX package. -# Copyright 2007 Nicola L.C. Talbot -# This work may be distributed and/or modified under the -# conditions of the LaTeX Project Public License, either version 1.3 -# of this license of (at your option) any later version. -# The latest version of this license is in -# http://www.latex-project.org/lppl.txt -# and version 1.3 or later is part of all distributions of LaTeX -# version 2005/12/01 or later. -# -# This work has the LPPL maintenance status `maintained'. -# -# The Current Maintainer of this work is Nicola Talbot. - -# This work consists of the files glossaries.dtx and glossaries.ins -# and the derived files glossaries.sty, glossary-hypernav.sty, -# glossary-list.sty, glossary-long.sty, glossary-super.sty, -# glossaries.perl. Also makeglossaries and makeglossaries. - -use Getopt::Std; - -if ($#ARGV < 0) -{ - die "Syntax : $0 [-ilqrcg] [-s sty] [-o gls] [-t log] [-p num] \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 () - { - 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 deleted file mode 100755 index 64a6a20750c..00000000000 --- a/Master/texmf-dist/doc/latex/glossaries/scripts/makeglossaries.bat +++ /dev/null @@ -1,3 +0,0 @@ -@rem = '-*- Perl -*- -@echo off -perl -S "%~dp0makeglossaries" %* diff --git a/Master/texmf-dist/scripts/glossaries/makeglossaries b/Master/texmf-dist/scripts/glossaries/makeglossaries new file mode 100755 index 00000000000..20a4b236fff --- /dev/null +++ b/Master/texmf-dist/scripts/glossaries/makeglossaries @@ -0,0 +1,284 @@ +#!/usr/bin/perl -w + +# File : makeglossaries +# Author : Nicola Talbot +# Version : 1.2 (2008/03/02) +# Description: simple Perl script that calls makeindex. +# Intended for use with "glossaries.sty" (saves having to remember +# all the various switches) + +# This file is distributed as part of the glossaries LaTeX package. +# Copyright 2007 Nicola L.C. Talbot +# This work may be distributed and/or modified under the +# conditions of the LaTeX Project Public License, either version 1.3 +# of this license of (at your option) any later version. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3 or later is part of all distributions of LaTeX +# version 2005/12/01 or later. +# +# This work has the LPPL maintenance status `maintained'. +# +# The Current Maintainer of this work is Nicola Talbot. + +# This work consists of the files glossaries.dtx and glossaries.ins +# and the derived files glossaries.sty, glossary-hypernav.sty, +# glossary-list.sty, glossary-long.sty, glossary-super.sty, +# glossaries.perl. Also makeglossaries and makeglossaries. +# +# History: +# v1.2 (2008-03-02) : +# * added support for --help and --version +# * improved error handling +# v1.1 (2008-02-13) : +# * added -w and strict +# * added check to ensure .tex file not passed to makeglossaries +# +# v1.0 (2007-05-10) : Initial release. + +use Getopt::Std; +use strict; + +$Getopt::Std::STANDARD_HELP_VERSION = 1; + +my $version="1.2 (2008-03-02)"; + +my($opt_q, $opt_t, $opt_o, $opt_s, $opt_p, $opt_g, $opt_c, $opt_r, + $opt_l, $opt_i)=("","","","","","","","","",""); + +getopts('s:o:t:p:ilqrcg'); + +unless ($#ARGV == 0) +{ + die "makeglossaries: Need exactly one file argument.\nUse `makeglossaries --help' for help.\n"; +} + +# define known extensions + +my %exttype = ( + main => {in=>'glo', out=>'gls', 'log'=>'glg'}, + ); + +my $ext = ''; +my $name = $ARGV[0]; + +# modified this to make sure users don't try passing the +# tex file: +if (length($ARGV[0]) > 3 and substr($ARGV[0],-4,1) eq ".") +{ + $name = substr($ARGV[0],0,length($ARGV[0])-4); + + $ext = substr($ARGV[0],-3,3); + + if (lc($ext) eq 'tex') + { + die("Don't pass the tex file to makeglossaries:\n" + ."either omit the extension to make all the glossaries, " + ."or specify one of the glossary files, e.g. $name.glo, to " + ."make just that glossary.\n") + } +} + +my $istfile = "$name.ist"; + +# check aux file for other glossary types +# and for ist file name + +if (open AUXFILE, "$name.aux") +{ + while () + { + 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 STDERR "Unable to open $name.aux: $!\n"; +} + +# save all the general makeindex switches + +my $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 '') +{ + my %thistype = %{$exttype{'main'}}; #default + + foreach my $type (keys %exttype) + { + if ($exttype{$type}{'in'} eq $ext) + { + %thistype = %{$exttype{$type}}; + + last; + } + } + + my $outfile; + + if ($opt_o eq "") + { + $outfile = "$name.$thistype{out}"; + } + else + { + $outfile = $opt_o; + } + + my $transcript; + + if ($opt_t eq "") + { + $transcript = "$name.$thistype{'log'}"; + } + else + { + $transcript = $opt_t; + } + + &makeindex("$name.$ext",$outfile,$transcript,$istfile, + $mkidxopts,$opt_q); +} +else +{ + foreach my $type (keys %exttype) + { + my %thistype = %{$exttype{$type}}; + + my $inputfile = "$name.$thistype{in}"; + + if (-r $inputfile) + { + my $outfile; + + if ($opt_o eq "") + { + $outfile = "$name.$thistype{out}"; + } + else + { + $outfile = $opt_o; + } + + my $transcript; + + if ($opt_t eq "") + { + $transcript = "$name.$thistype{'log'}"; + } + else + { + $transcript = $opt_t; + } + + &makeindex($inputfile,$outfile,$transcript, + $istfile,$mkidxopts,$opt_q); + } + else + { + print STDERR "No read access for '$inputfile': $!\n"; + } + } +} + +sub makeindex{ + my($in,$out,$trans,$ist,$rest,$quiet) = @_; + my($name,$cmdstr,$buffer,$n,$i,$j); + my(@stuff,@item); + + $cmdstr = "$rest -s $ist -t $trans -o $out $in"; + + unless ($quiet) + { + print "makeindex $cmdstr\n"; + } + + `makeindex $cmdstr`; +} + +sub HELP_MESSAGE{ + print "\nSyntax : makeglossaries [options] \n\n"; + print "For use with the glossaries package to pass relevant\n"; + print "files to makeindex\n\n"; + print "\tBase name of glossary file(s). This should\n"; + print "\t\tbe the name of your main LaTeX document without any\n"; + print "\t\textension.\n"; + print "\nOptions:\n"; + print "-c\t\tCompress intermediate blanks\n"; + print "-g\t\tEmploy German word ordering\n"; + print "-l\t\tLetter ordering\n"; + print "-o \tUse as the output file.\n"; + print "-p \tSet the starting page number to be \n"; + print "-q\t\tQuiet mode\n"; + print "-r\t\tDisable implicit page range formation\n"; + print "-s \tEmploy as the style file\n"; + print "-t \tEmploy as the transcript file\n"; + print "\nSee makeindex documentation for further details on these "; + print "options\n"; +} + +sub VERSION_MESSAGE{ + print "Makeglossaries Version $version\n"; + print "Copyright (C) 2007 Nicola L C Talbot\n"; + print "This material is subject to the LaTeX Project Public License.\n"; +} + +1; diff --git a/Master/texmf-dist/scripts/glossaries/makeglossaries.bat b/Master/texmf-dist/scripts/glossaries/makeglossaries.bat new file mode 100755 index 00000000000..64a6a20750c --- /dev/null +++ b/Master/texmf-dist/scripts/glossaries/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 index a47abec2adb..08536be6b18 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -2,17 +2,24 @@ % glossaries.dtx generated using makedtx version 0.94b (c) Nicola Talbot % Command line args: % -macrocode "glossaries\.perl" +% -macrocode ".*\.tex" % -src "glossaries.sty\Z=>glossaries.sty" % -src "(glossary-.+)\.(sty)\Z=>\1.\2" -% -src "glossaries\.perl\Z=>glossaries.perl" +% -src "(glossaries-babel)\.(sty)\Z=>\1.\2" +% -src "(glossaries-dictionary-.+)\.(dict)\Z=>\1.\2" +% -src "(minimalgls\.tex)\Z=>\1" +% -src "(sample.*\.tex)\Z=>\1" +% -src "(database.*\.tex)\Z=>\1" +% -src "(glossaries\.perl)\Z=>\1" % -author "Nicola Talbot" % -dir "source" % -setambles "glossaries\.perl=>\nopreamble\nopostamble" % -comment "glossaries\.perl" -% -doc "manual.tex" +% -comment ".*\.tex" +% -doc "glossaries-manual.tex" % -codetitle "Documented Code" % glossaries -% Created on 2007/10/13 15:35 +% Created on 2008/3/4 12:06 %\fi %\iffalse %<*package> @@ -35,7 +42,7 @@ %\fi % \iffalse % Doc-Source file to use with LaTeX2e -% Copyright (C) 2007 Nicola Talbot, all rights reserved. +% Copyright (C) 2008 Nicola Talbot, all rights reserved. % \fi % \iffalse %<*driver> @@ -45,7 +52,7 @@ \usepackage[colorlinks, bookmarks, hyperindex=false, - pdfauthor={N.L.C. Talbot}, + pdfauthor={Nicola L.C. Talbot}, pdftitle={glossaries.sty: LaTeX2e Package to Assist Generating Glossaries}, pdfkeywords={LaTeX,package,glossary,acronyms}]{hyperref} @@ -63,40 +70,45 @@ \makeatother \RecordChanges \PageIndex -\CheckSum{3027} +\CheckSum{4357} \CodelineNumbered \newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}} \newcommand*{\term}[1]{#1\iterm{#1}} \newcommand*{\iterm}[1]{\index{#1|main}} +\newcommand{\dq}[1]{``#1''} \newcommand*{\istkey}[1]{\texttt{#1}\index{makeindex=\texttt{makeindex}>#1=\texttt{#1}|hyperpage}} -\newcommand*{\icmdname}[1]{\texttt{\char`\\#1}\SpecialMainIndex{#1}} +\newcommand*{\ics}[1]{\texttt{\char`\\#1}\SpecialMainIndex{#1}} \newcommand*{\appname}[1]{\texttt{#1}\index{#1=\texttt{#1}|hyperpage}} \newcommand*{\mkidxspch}{\index{makeindex=\texttt{makeindex}>special characters|hyperpage}} \newcommand*{\igloskey}[2][newglossaryentry]{\index{#1 options=\cs{#1} options>#2=\textsf{#2}|hyperpage}} \newcommand*{\gloskey}[2][newglossaryentry]{\textsf{#2}\igloskey[#1]{#2}} +\newcommand*{\ipkgopt}[2][]{% +\ifthenelse{\equal{#1}{}}{% +\index{package options>#2=\textsf{#2}|hyperpage}}{% +\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}} \newcommand*{\pkgopt}[2][]{% \ifthenelse{\equal{#1}{}}{% \textsf{#2}\index{package options>#2=\textsf{#2}|hyperpage}}{% \textsf{#2=#1}\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}}} -\newcommand*{\pkgoptval}[2]{\textsf{#1}\index{package options>#2>#1|hyperpage}} +\newcommand*{\pkgoptval}[2]{\textsf{#1}\index{package options>#2=\textsf{#2}>#1=\textsf{#1}|hyperpage}} \newcommand*{\glostyle}[1]{\textsf{#1}\index{glossary styles>#1|hyperpage}} \newcommand*{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}} -\newcommand*{\styname}[1]{\textsf{#1}\index{#1 package=\textsf{#1} package|hyperpage}} +\newcommand*{\sty}[1]{\textsf{#1}} +\newcommand*{\isty}[1]{\sty{#1}\index{#1 package=\sty{#1} package|hyperpage}} \newcommand*{\envname}[1]{\textsf{#1}} -\begin{document} -\DocInput{glossaries.dtx} +\begin{document}\DocInput{glossaries.dtx} \end{document} % %\fi %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{glossaries.sty v 1.08: \LaTeXe\ Package to Assist Generating Glossaries} +% \title{glossaries.sty v 1.11: \LaTeXe\ Package to Assist Generating Glossaries} % \author{Nicola L.C. Talbot\\[10pt] %School of Computing Sciences\\ %University of East Anglia\\ @@ -104,31 +116,47 @@ %NR4 7TJ. United Kingdom.\\ %\url{http://theoval.cmp.uea.ac.uk/~nlct/}} % -% \date{13th October 2007} +% \date{2nd March 2008} % \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 +%The \sty{glossaries} package is provided to assist generating +%glossaries. It has a certain amount of flexibility, allowing the user +%to customize the format of the glossary and define multiple glossaries. +%It also supports acronyms and glossary styles that include +%symbols (in addition to a name and description) for glossary +%entries. There is provision for loading a database of glossary terms +%where only those terms used in the text are added to the glossary. +%This package replaces the \isty{glossary} package which is now %obsolete. % -%The \styname{glossaries} package comes with the Perl script +%As from version 1.08, the \sty{glossaries} package now has +%limited multi-lingual support, thanks to all the people who have sent +%me the relevant translations either via email or via comp.text.tex. +%However you must load \isty{babel} \emph{before} +%\sty{glossaries} to enable this. (See \autoref{sec:predefinednames} for thepredefined names used by the \sty{glossaries} package.) +%As from version 1.1, the \sty{glossaries} package also supports +%Till~Tantau's \isty{translator} package provided it is loaded +%before the \sty{glossaries} package. This makes it easier to change +%the default translations or add new dictionaries. +%If you don't want to use the predefined translations, you can use the +%package option \pkgopt[false]{translate} and supply your own translations. +% +%This documentation is structured as follows: \autoref{sec:quick} is for people who want a few quick pointers of how to get started, +%without having to read through lengthy descriptions, +%\autoref{sec:overview} gives an overview of available commands. +%\subsection{Generating the associated glossary files} +%\label{sec:makeglossaries} +% +%The \sty{glossaries} package comes with the Perl script %\appname{makeglossaries} which will run \appname{makeindex} on %all the glossary files using a customized \appname{makeindex} -%style file (which is created by \icmdname{makeglossaries}). +%\filetype{.ist} style file (which is created by \ics{makeglossaries}). %The relevant extensions are obtained from the -%auxiliary file, so you only need to pass the basename as the +%auxiliary file, so you should only pass the basename as the %argument. For example, if your document is called %\texttt{myfile.tex}, do: %\begin{verbatim} @@ -146,8 +174,8 @@ % %If you don't have Perl installed, you will have to run %\appname{makeindex} for each glossary type you have defined. -%For example, if you have used the \pkgopt{acronym} package option, -%so you have both a main glossary as well as a list of acronyms, you +%For example, if you have used the \pkgopt{acronym} package option +%then you will have both a main glossary as well as a list of acronyms, so you %will need to do (assuming your document is called \texttt{myfile.tex}): %\begin{verbatim} %makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo @@ -156,29 +184,23 @@ %This requires remembering all extensions for each of the glossaries %defined in your document, so where possible you should use %\appname{makeglossaries} instead to reduce the possibility of error. +%Don't pass all the glossary files in a single call to +%\appname{makeindex} or it will merge all your glossaries into a +%single glossary. % -%As from version 1.08, the \styname{glossaries} package now has -%limited multi-lingual support, thanks to all the people who have sent -%me the relevant translations either via email or via comp.text.tex. -%However, you must load \styname{babel} \emph{before} -%\styname{glossaries}. (See \autoref{sec:predefinednames} for the -%predefined names used by the \styname{glossaries} package.) -% -%This documentation is structured as follows: \autoref{sec:quick} -%is for people who want a few quick pointers of how to get started, -%without having to read through lengthy descriptions, -%\autoref{sec:overview} gives an overview of available commands -%and their syntax, \autoref{sec:code} contains the documented -%source code for those who want to know more about how the -%package works, and how to do more complicated things, such as -%changing the way glossary entries appear. -% +%If any problems occur, remember to check the transcript files +%(e.g.\ \filetype{.glg} or \filetype{.alg}) for messages. %\subsection{Troubleshooting} % -%There is a list of frequently asked questions for the -%\styname{glossaries} package available at: -%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/}. +%The glossaries package comes with a minimal file called +%\texttt{minimalgls.tex} which can be used for testing. This +%should be located in \texttt{texmf/doc/latex/glossaries/samples/}. Further +%information on debugging \LaTeX\ code is available at +%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/}. % +%There is a list of frequently asked questions for the +%\sty{glossaries} package available at +%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html}. %\section{A Quick Guide For The Impatient} %\label{sec:quick} % @@ -187,28 +209,28 @@ %lengthy descriptions. % %\begin{enumerate} -%\item Load \styname{glossaries} \emph{after} \styname{hyperref}: +%\item Load \sty{glossaries} \emph{after} \isty{hyperref}: %\begin{verbatim} %\usepackage{hyperref} %\usepackage{glossaries} %\end{verbatim} -%Similarly for the \styname{html} package: +%Similarly for the \isty{html} package: %\begin{verbatim} %\usepackage{html} %\usepackage{glossaries} %\end{verbatim} % -%\item Always use \icmdname{makeglossaries} if you want the glossary +%\item Always use \ics{makeglossaries} if you want the glossary %entries to be written to the glossary file: %\begin{verbatim} %\documentclass{article} %\usepackage{glossaries} %\makeglossaries %\end{verbatim} -%If you don't use \icmdname{makeglossaries}, your glossaries will +%If you don't use \ics{makeglossaries}, your glossaries will %not appear in the document! % -%\item Use \icmdname{printglossaries} to make your glossaries appear +%\item Use \ics{printglossaries} to make your glossaries appear %in the document at that point. For example: %\begin{verbatim} %\maketitle @@ -226,24 +248,30 @@ %makeglossaries myfile %latex myfile %\end{verbatim} +%(You may need to run \LaTeX\ again if you have used the \pkgopt{toc} +%package option.) %If you use Windows, there is a batch file called %\texttt{makeglossaries.bat} which you can use, but you will %still need Perl installed. % %\item New glossaries can be defined using:\par -%\icmdname{newglossary}% +%\ics{newglossary}\oarg{log-ext}% %\marg{label}\marg{in-ext}\marg{out-ext}% %\marg{title}\par where \meta{label} is an identifying label, %\meta{in-ext} is the extension of the file to be created %by \appname{makeindex} (called by \appname{makeglossaries}), %\meta{out-ext} is the extension of the file to be read by %\appname{makeindex} and \meta{title} is the title for this -%new glossary. Example: +%new glossary. The first optional argument \meta{log-ext} specifies +%the extension of the \appname{makeindex} transcript file. Example: %\begin{verbatim} -%\newglossary{notation}{not}{ntn}{Notation} +%\newglossary[nlg]{notation}{not}{ntn}{Notation} %\end{verbatim} %This glossary's label is \texttt{notation} and its title -%will be Notation. +%will be Notation. If you use \appname{makeglossaries}, the +%\appname{makeindex} transcript will be written to a file with the +%extension \filetype{.nlg}. If \meta{log-ext} is omitted, the extension +%\filetype{.glg} will be used. % %\item Any new glossaries must be defined before %\cs{makeglossaries} @@ -255,7 +283,7 @@ %\end{verbatim} % %\item If you use the \pkgopt{acronym} package option, the -%\styname{glossaries} package +%\sty{glossaries} package %will automatically create a new glossary type labelled %\texttt{acronym}: %\begin{verbatim} @@ -263,8 +291,8 @@ %\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}: +%numbers appear in the form 2-1), redefine \ics{glscompositor} +%\emph{before} \ics{makeglossaries}: %\begin{verbatim} %\documentclass{article} %\usepackage{glossaries} @@ -279,7 +307,7 @@ %\end{verbatim} % %\item Define a new entry with:\par -%\icmdname{newglossaryentry}\marg{label}\marg{key-val list}\par +%\ics{newglossaryentry}\marg{label}\marg{key-val list}\par %The \meta{key-val list} must at least contain a \gloskey{name} %key and a \gloskey{description} key. %For example: @@ -293,7 +321,7 @@ % %\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}): +%problem for \ics{Gls} and \ics{Glspl}): %\begin{verbatim} %\newglossaryentry{elite}{name={{\'e}lite}, %description={select group or class}} @@ -321,7 +349,7 @@ %\end{verbatim} % %\item Plural forms are assumed to be the singular form with an -%``s'' appended, unless otherwise specified. To specify an +%\dq{s} appended, unless otherwise specified. To specify an %irregular plural, use the \gloskey{plural} key. For example: %\begin{verbatim} %\newglossaryentry{matrix}{name=matrix, @@ -337,8 +365,8 @@ %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. +%In this example, the entry name appears as \dq{Matrix} in the +%glossary, and either \dq{matrix} or \dq{matrices} in the text. % %\item The way the term appears on first use can be different %to the way it appears subsequently: @@ -349,13 +377,13 @@ %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. +%In this example, the entry name appears as \dq{Singular Matrix} in +%the glossary, and in the text it appears as \dq{singular matrix (SM)} +%or \dq{singular matrices (SMs)} the first time the entry is used, +%and subsequently appears as \dq{SM} or \dq{SMs}. % %\item The quick and easy way to define an acronym is to use:\par -%\icmdname{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}% +%\ics{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}% %\marg{long}\par %For example: %\begin{verbatim} @@ -371,43 +399,44 @@ %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 value of \ics{acronymtype} varies depending on whether +%the \pkgopt{acronym} package option is used or not. %The optional argument \meta{key-val list} can be used to -%override any of the \icmdname{newglossaryentry} keys, for +%override any of the \ics{newglossaryentry} keys; for %example, if the acronym has an irregular plural.) % %\item The font used to display the entry name in the glossary -%is governed by \icmdname{glsnamefont}. This can be redefined +%is governed by \ics{glsnamefont}. This can be redefined %as required. For example, to make the entry names appear %in a medium sans-serif font do: %\begin{verbatim} %\renewcommand{\glsnamefont}[1]{\textsf{\mdseries #1}} %\end{verbatim} %Note that the list-like glossary styles defined in the -%\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}. +%\isty{glossary-list} package place the entry name in +%the optional argument to \ics{item}, so they will +%appear in bold, unless you redefine \ics{glsnamefont} to counteract the +%bold font. % -%\item In the document use \icmdname{gls}\marg{label} +%\item In the document use \ics{gls}\marg{label} %to use a predefined term (this will also enter the term into -%the associated glossary output file.) For example: +%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 \cs{gls}, +%\item \ics{Gls}\marg{label} : like \cs{gls}, %but with first letter in upper case -%\item \icmdname{GLS}\marg{label} : like \cs{gls}, +%\item \ics{GLS}\marg{label} : like \cs{gls}, %but all upper case. -%\item \icmdname{glspl}\marg{label} : use plural -%\item \icmdname{Glspl}\marg{label} : use plural with +%\item \ics{glspl}\marg{label} : use plural +%\item \ics{Glspl}\marg{label} : use plural with %first letter in upper case -%\item \icmdname{GLSpl}\marg{label} : use plural but +%\item \ics{GLSpl}\marg{label} : use plural but %all upper case -%\item \icmdname{glslink}\marg{label}\marg{link text} : +%\item \ics{glslink}\marg{label}\marg{link text} : %use \meta{link text} to link to the given entry in the glossary. %\end{itemize} %For example, the following will produce the plural form with @@ -419,7 +448,7 @@ %\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. +%The \gls{singmtx}['s] dimensions \ldots %\end{verbatim} % %\item The format of the associated entry number can be @@ -434,19 +463,23 @@ %page number in bold (since it uses \cs{textbf}) but %it will no longer have a hyperlink (if hyperlinks are enabled.) % -%\item The \styname{glossaries} package provides commands to +%\item The \sty{glossaries} package provides commands to %change the font whilst ensuring that the number remains a %hyperlink. These are of the form \cs{hyper}\meta{xx} and %are equivalent to the standard font changing commands of the -%form \cs{text}\meta{xx}, as well as \icmdname{hyperemph} -%(which uses \icmdname{emph}.) For example: +%form \cs{text}\meta{xx}, as well as \ics{hyperemph} +%(which uses \ics{emph}.) For example: %\begin{verbatim} %The primary definition of \glspl[format=hyperbf]{singmtx}. %\end{verbatim} % +%\item Don't use declarations in \gloskey[glslink]{format} as this can +%cause unpredictable results, as there is no guarantee that the effect +%will be localised to the required text. +% %\item Entries can be added to the glossary without producing -%any text using \icmdname{glsadd}\marg{label} or -%\icmdname{glsaddall}. These commands also taken an optional +%any text using \ics{glsadd}\marg{label} or +%\ics{glsaddall}. These commands also taken an optional %argument where you can specify the format. For example %\begin{verbatim} %\glsadd[format=hyperbf]{singmtx} @@ -455,9 +488,9 @@ %glossary file for the specified term, but will not produce %any text where the command occurs. % -%\item A number range can be entered using "format=(" and "format=)" -%to mark the beginning and ending of the range\footnote{This is new -%to version 1.01}. For example: +%\item A number range can be entered using \verb|format=(| and +%\verb"format=)" to mark the beginning and ending of the +%range\footnote{This is new to version 1.01}. For example: %\begin{verbatim} % \glsadd[format=(]{singmtx} % This is a very long section all about \glspl{singmtx}. @@ -466,10 +499,11 @@ % % \glsadd[format=)]{singmtx} %\end{verbatim} -%This is equivalent to \appname{makeindex}'s "|(" and "|)" formats. +%This is equivalent to \appname{makeindex}'s \verb"|(" and \verb"|)" +%formats. % %\item You can combine the range markers with a formatting command -%(again without the preceding backslash.) For example: +%(again without the preceding backslash). For example: %\begin{verbatim} % This is the start of a very long section all % about \glspl[format=(hyperbf]{singmtx}. @@ -483,9 +517,9 @@ %\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}.) +%you haven't used it in the text (either via \ics{glslink} +%or \ics{gls} and related commands, or via \ics{glsadd} +%or \ics{glsaddall}.) % %\item To change the sorting order, use the \gloskey{sort} key. %For example: @@ -525,15 +559,14 @@ %\item Glossary styles can be set using the \pkgopt{style} %package option. For example: %\begin{verbatim} -%\usepackage[style=long3col]{glossary} +%\usepackage[style=long3col]{glossaries} %\end{verbatim} -%or using \icmdname{glossarystyle}\marg{style}. For example: +%or using \ics{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}. -% +%The predefined glossary styles provided by the \sty{glossaries} +%bundle are listed in \autoref{sec:styles}. %\item The list of numbers associated with each glossary entry %can be suppressed using the package option \pkgopt{nonumberlist}: %\begin{verbatim} @@ -556,20 +589,31 @@ %\end{verbatim} % %\end{enumerate} -% %\section{Overview}\label{sec:overview} % \changes{1.02}{2007 May 25}{added overview section} % %\subsection{Package Options} % -%The \styname{glossaries} package options are as follows: +%The \sty{glossaries} package options are as follows: %\begin{description} -%\item[\pkgopt{toc}] Add the glossaries to the table of contents -%\item[\pkgopt{section}] This is a key=value option. Its value should -%be the name of a sectional unit (e.g.\ "chapter"). This will make -%the glossaries appear in the named sectional unit, otherwise the -%each glossary will appear in an unnumber chapter, if chapters -%exists, otherwise in an unnumbered section. Example: +%\item[\pkgopt{toc}] Add the glossaries to the table of contents. +% +%\item[\pkgopt{numberline}] When used with \pkgopt{toc}, this will +%add \cs{numberline}\verb|{}| in the final argument of +%\cs{addcontentsline}. This will align the table of contents entry +%with the numbered section titles. Note that this option has no +%effect if the \pkgopt{toc} option is omitted. If \pkgopt{toc} is +%used without \pkgopt{numberline}, the title will be aligned with +%the section numbers rather than the section titles. +% +%\item[\pkgopt{acronym}] Make a separate glossary for acronyms. +% +%\item[\pkgopt{section}] This is a \meta{key}=\meta{value} option. Its +%value should be the name of a sectional unit (e.g.\ chapter). +%This will make the glossaries appear in the named sectional unit, +%otherwise each glossary will appear in a chapter, if chapters +%exists, otherwise in a section. Unnumbered sectional units will be used +%by default. Example: %\begin{verbatim} %\usepackage[section=subsection]{glossaries} %\end{verbatim} @@ -581,41 +625,63 @@ %\begin{verbatim} %\usepackage[section=section]{glossaries} %\end{verbatim} -%Note that the starred form of the sectioning command is always used -%since glossaries tend to be placed in unnumbered sections or chapters. -%If you want the glossaries to appeared in a numbered section, you -%will need to set \DescribeMacro{\glossarysection}\cs{glossarysection} -%to the relevant sectioning command. For example, to make the -%glossaries appear in numbered chapters, do: +%You can change this value later in the document using +%\ics{setglossarysection}\marg{type}. +% +%\item[\pkgopt{numberedsection}] +%The glossaries are placed in unnumbered sectional units by default, +%but this can be changed using \pkgopt{numberedsection}. This option can take +%three possible values: \pkgoptval{false}{numberedsection} (no +%number, i.e.\ use starred form), \pkgoptval{nolabel}{numberedsection} +%(numbered, i.e.\ unstarred form, but not labelled) and +%\pkgoptval{autolabel}{numberedsection} (numbered with automatic +%labelling). If \pkgopt[autolabel]{numberedsection} is used, each +%glossary is given a label that matches the glossary type, so the +%main (default) glossary is labelled \texttt{main}, the list of +%acronyms is labelled \texttt{acronym}\footnote{if the +%\pkgopt{acronym} option is used, otherwise the list of +%acronyms is the main glossary} and additional glossaries are labelled +%using the value specified in the first mandatory argument to +%\cs{newglossary}. For example, if you load \sty{glossaries} +%using: %\begin{verbatim} -%\let\glossarysection\chapter +%\usepackage[section,numberedsection=autolabel]{glossaries} +%\end{verbatim} +%then each glossary will appear in a numbered section, and can +%be referenced using something like: +%\begin{verbatim} +%The main glossary is in section~\ref{main} and the list of +%acronyms is in section~\ref{acronym}. +%\end{verbatim} +%If you can't decide whether to have the acronyms in the main +%glossary or a separate list of acronyms, you can use +%\ics{acronymtype} which is set to \texttt{main} if the +%\pkgopt{acronym} option is not used and is set to \texttt{acronym} +%if the \pkgopt{acronym} option is used. For example: +%\begin{verbatim} +%The list of acronyms is in section~\ref{\acronymtype}. %\end{verbatim} % -%\item[\pkgopt{style}] This is a key=value option. Its value should -%be the name of the glossary style to use. -% +%\item[\pkgopt{style}] This is a \meta{key}=\meta{value} option. Its +%value should be the name of the glossary style to use. Predefined +%glossary styles are listed in \autoref{sec:styles}. %\item[\pkgopt{nonumberlist}] This option will suppress the %associated number lists\iterm{number list} in the glossaries (see also %\autoref{sec:numberlists}.) -% -%\item[\pkgopt{acronym}] Make a separate glossary for acronyms. -% -%\item[\pkgopt{counter}] This is a key=value option. The value should -%be the name of the default counter to use in the -%number lists\iterm{number list}. -% -%\hypertarget{sanitize}{}\relax -%\item[\pkgopt{sanitize}] This is a key=value option whose value is a -%key=value list. By default, the \styname{glossaries} package -%sanitizes the values of the \gloskey{name}, \gloskey{description} and -%\gloskey{symbol} keys used when defining a new glossary entry. This -%may lead to unexpected results if you try to -%display these values within the document text. This sanitization can -%be switched off using the \pkgopt{sanitize} package option. (See -%\autoref{sec:pkgopt} and \autoref{sec:newentry} for further details.) -%For example, to switch off the sanitization for the -%\gloskey{description} and \gloskey{name} keys, but not for -%the \gloskey{symbol} key, do: +%\item[\pkgopt{counter}] This is a \meta{key}=\meta{value} option. The +%value should be the name of the default counter to use in the number +%lists\iterm{number list}. +% +%\hypertarget{sanitize}{}\relax\item[\pkgopt{sanitize}] This is a \meta{key}=\meta{value} option whose +%value is also a \meta{key}=\meta{value} list. By default, the +%\sty{glossaries} package sanitizes the values of the +%\gloskey{name}, \gloskey{description} and \gloskey{symbol} keys used +%when defining a new glossary entry. This may lead to unexpected results +%if you try to display these values within the document text. This +%sanitization can be switched off using the \pkgopt{sanitize} package +%option. (See \autoref{sec:pkgopt} and \autoref{sec:newentry} for further details.) For example, to switch off the sanitization for the +%\gloskey{description} and \gloskey{name} keys, but not for the +%\gloskey{symbol} key, do: %\begin{verbatim} %\usepackage[sanitize={name=false,description=false,% %symbol=true}]{glossaries} @@ -630,70 +696,121 @@ %\gloskey{name} key, you will still need to protect fragile commands %in the \gloskey{name} key if you don't use the \gloskey{text} key. % -%\end{description} +%\item[\pkgopt{babel}] This is a boolean key and is for use when +%the \sty{glossaries} package is used in conjunction with the +%\isty{babel} package. The default is \pkgopt[true]{babel}, which +%adds the glossary translations to \isty{babel}'s captions. If +%you don't like the translations provided by the \sty{glossaries} +%package, you can set \pkgopt[false]{babel} and provide your own +%translations. +% +%\item[\pkgopt{description}] This option changes the definition of +%\ics{newacronym} to allow a description. See \autoref{sec:acronyms} for further details. +% +%\item[\pkgopt{footnote}] This option changes the definition of +%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details. % +%\item[\pkgopt{smallcaps}] This option changes the definition of +%\ics{newacronym} and the way that acronyms are displayed. See \autoref{sec:acronyms} for further details. +% +%\item[\pkgopt{dua}] This option changes the definition of +%\ics{newacronym} so that acronyms are always expanded. +%See \autoref{sec:acronyms} for further details. +% +%\end{description} %\subsection{Defining Glossary Entries} %\label{sec:newglosentry} % %All glossary entries that are used in a document must be defined in %the preamble. Only those entries that occur in the document -%(using any of the commands described in \autoref{sec:glslink} and -%\autoref{sec:glsadd}) will appear in the glossary. Each time an entry -%is used in this way, a line is added to an associated glossary (.glo) -%file, which then needs to be converted into a corresponding .gls file -%which contains the typeset glossary. The Perl script -%\appname{makeglossaries} can be used to call \appname{makeindex} -%using a customised style file for each of the glossaries that are -%defined in the document. +%(using any of the commands described in \autoref{sec:glslink} and \autoref{sec:glsadd}) will appear in the glossary. Each time an entry is used in this way, a line is added to an associated glossary +%(\filetype{.glo}) file, which then needs to be converted into a +%corresponding \filetype{.gls} file which contains the typeset glossary +%which is input by \ics{printglossary} or +%\ics{printglossaries}. The Perl script \appname{makeglossaries} +%can be used to call \appname{makeindex}, using a customised +%\filetype{.ist} style file, for each of the glossaries that are defined +%in the document. Note that there should be no need for you to +%explicitly edit or input any of these external files. % %\DescribeMacro{\makeglossaries} -%The command \cs{makeglossaries} must be placed in the preamble, -%in order to create the customised \appname{makeindex} style file, -%and to ensure that glossary entries are written to the appropriate -%output file. +%The command \cs{makeglossaries} must be placed in the preamble in +%order to create the customised \appname{makeindex} \filetype{.ist} +%style file and to ensure that glossary entries are written to the +%appropriate output file. If you omit \cs{makeglossaries} none of the +%glossaries will be created. Note that if your page numbers use a +%hyphen compositor, you must set this by redefining +%\DescribeMacro{\glscompositor}\cs{glscompositor} \emph{before} +%using \cs{makeglossaries}: +%\begin{verbatim} +%\renewcommand*{\glscompositor}{-} +%\end{verbatim} +%(The default value of \cs{glscompositor} is a full stop.) % %\DescribeMacro{\newglossaryentry} %New glossary entries are defined using the command:\\[10pt] -%\cs{newglossaryentry}\marg{label}\marg{key-val list}\\[10pt] -%The first argument, \meta{label}, must be a unique label with which to -%identify this entry. The second argument, \meta{key-val list}, -%is a key=value list that supplies the relevant information about this -%entry. There are two required fields: \gloskey{name} and +%\cs{newglossaryentry}\marg{label}\marg{key-val list}\\[10pt] The first +%argument, \meta{label}, must be a unique label with which to identify +%this entry. The second argument, \meta{key-val list}, is a +%\meta{key}=\meta{value} list that supplies the relevant information +%about this entry. There are two required fields: \gloskey{name} and %\gloskey{description}. Available fields are listed below: % %\begin{description} %\item[{\gloskey{name}}] The name of the entry (as it will appear in the -%glossary.) +%glossary). +% %\item[{\gloskey{description}}] A brief description of this term (to -%appear in the glossary.) +%appear in the glossary). +% %\item[{\gloskey{text}}] How this entry will appear in the document text -%when using \icmdname{gls} (or one of its -%uppercase variants.) If this field is omitted, the value of the -%\gloskey{name} key is used. +%when using \ics{gls} (or one of its uppercase variants). If this +%field is omitted, the value of the \gloskey{name} key is used. +% %\item[{\gloskey{first}}] How the entry will appear in the document text -%the first time it is used with \icmdname{gls} -%(or one of its uppercase variants.) If this field is omitted, -%the value of the \gloskey{text} key is used. +%the first time it is used with \ics{gls} (or one of its uppercase +%variants). If this field is omitted, the value of the \gloskey{text} +%key is used. +% %\item[{\gloskey{plural}}] How the entry will appear in the document text -%when using \icmdname{glspl} (or one of its uppercase variants.) +%when using \ics{glspl} (or one of its uppercase variants). %If this field is omitted, the value is obtained by appending an -%``s'' to the value of the \gloskey{text} field. +%\dq{s} to the value of the \gloskey{text} field. +% %\item[{\gloskey{firstplural}}] How the entry will appear in the document -%text the first time it is used with \icmdname{glspl} (or one of -%its uppercase variants.) If this field is omitted, the value is -%obtained by appending an ``s'' to the value of the \gloskey{first} +%text the first time it is used with \ics{glspl} (or one of +%its uppercase variants). If this field is omitted, the value is +%obtained by appending an \dq{s} to the value of the \gloskey{first} %field. +% %\item[{\gloskey{symbol}}] This field is provided to allow the user to %specify an associated symbol, but most glossary styles ignore %this value. If omitted, the value is set to \cs{relax}. -%\item[{\gloskey{sort}}] This value indicates how \appname{makeindex} -%should sort this entry. If omitted, the value is given by -%the \gloskey{name} field. -%This value is equivalent to \appname{makeindex}'s ``actual'' -%character (which is usually the at-sign @.) +% +%\item[{\gloskey{sort}}] This value indicates how \appname{makeindex} +%should sort this entry. If omitted, the value is given by the +%\gloskey{name} field. This value is equivalent to +%\appname{makeindex}'s \dq{actual} character (which is usually the +%at-sign @ although the \sty{glossaries} package uses a different +%symbol). +% %\item[{\gloskey{type}}] This is the glossary type to which this entry -%belongs. If omitted, the default glossary is assumed. +%belongs. If omitted, the default glossary is assumed +%(\texttt{type=main}). The list of acronyms type is given by +%\ics{acronymtype} which will either be \texttt{main} or +%\texttt{acronym}, depending on whether the \pkgopt{acronym} package +%option was used. %\end{description} +%Note that if the \gloskey{text} key (or the \gloskey{name} key, if the +%\gloskey{text} key is omitted) starts with an accented letter, +%you must group the accented letter, otherwise it will cause a +%problem for \cs{Gls} and \cs{Glspl}. For example: +%\begin{verbatim} +%\newglossaryentry{elite}{name={{\'e}lite}, +%description={select group or class}} +%\end{verbatim} +%(Likewise for the \gloskey{plural}, \gloskey{first} and +%\gloskey{firstplural} keys.) % %\DescribeMacro{\loadglsentries} %You can store all your glossary entry definitions in another @@ -705,27 +822,23 @@ %should belong, for those entries where the \gloskey{type} key has %been omitted. Note that only those entries that have been used %in the text will appear in the relevant glossaries. -% %\subsection{Number lists} %\label{sec:numberlists} % %Each entry in the glossary has an associated \termdef{number list}. %By default, %these numbers refer to the pages on which that entry has been used -%(using any of the commands described in \autoref{sec:glslink} -%and \autoref{sec:glsadd}.) The number list can be suppressed using -%the \pkgopt{nonumberlist} package option, or an alternative counter +%(using any of the commands described in \autoref{sec:glslink} and \autoref{sec:glsadd}). The number list can be suppressed using the \pkgopt{nonumberlist} package option, or an alternative counter %can be set as the default using the \pkgopt{counter} package option. -% %\subsection{Links to Glossary Entries} %\label{sec:glslink} % %Once you have defined a glossary entry using -%\icmdname{newglossaryentry}, you can refer to that entry in the +%\ics{newglossaryentry}, you can refer to that entry in the %document using one of the commands listed in this section. The %text which appears at that point in the document when using %one of these commands is referred to as the -%\termdef{link text} (even if there are no hyperlinks.) +%\termdef{link text} (even if there are no hyperlinks). % %The way the \term{link text} is displayed %depends on \DescribeMacro{\glstextformat}\cs{glstextformat}\marg{text}. @@ -738,41 +851,39 @@ %\DescribeMacro{\glslink} %The command:\\[10pt] %\cs{glslink}\oarg{options}\marg{label}\marg{text}\\[10pt] -%will place \meta{text} in the document at that point, and add +%will place \meta{text} in the document at that point and add %a line into the associated glossary file for the glossary entry %given by \meta{label}. If hyperlinks are supported, \meta{text} %will be a hyperlink to the relevant line in the glossary. The -%optional argument \meta{options} must be a key=value list which -%can take any of the following keys: +%optional argument \meta{options} must be a \meta{key}=\meta{value} +%list which can take any of the following keys: % %\begin{description} -%\item[{\gloskey[glslink]{format}}] This specifies how to format -%the associated number for this entry in the glossary. This value -%is equivalent to the \appname{makeindex} encap value, and (as with -%\cs{index}) the value needs to be the name of a -%command \emph{without} the initial backslash. As with -%\cs{index}, the characters "(" and ")" can also be used to -%specify the beginning and ending of a number range. -%Again, as with \cs{index} the command should be the name of a -%command which takes an argument (which will be the associated number.) -%Be careful not to use a declaration (such as \cs{bfseries}) instead of -%a text block command (such as \cs{textbf}) as the effect will not be -%localised. If you want to apply more than one -%style to a given entry (e.g.\ \textbf{bold} and \emph{italic}) you -%will need to create a command that applies both formats, e.g.\ +%\item[{\gloskey[glslink]{format}}] This specifies how to format the +%associated number for this entry in the glossary. This value is +%equivalent to the \appname{makeindex} encap value, and (as with +%\cs{index}) the value needs to be the name of a command \emph{without} +%the initial backslash. As with \cs{index}, the characters \verb"(" and +%\verb")" can also be used to specify the beginning and ending of a +%number range. Again as with \cs{index}, the command should be the name +%of a command which takes an argument (which will be the associated +%number). Be careful not to use a declaration (such as \cs{bfseries}) +%instead of a text block command (such as \cs{textbf}) as the effect is +%not guaranteed to be localised. If you want to apply more than one +%style to a given entry (e.g.\ \textbf{bold} and \emph{italic}) you will +%need to create a command that applies both formats, e.g.\ %\begin{verbatim} %\newcommand*{\textbfem}[1]{\textbf{\emph{#1}}} %\end{verbatim} -%and use that command. (Just as you would have to do with \cs{index}.) +%and use that command. % -%If you are using hyperlinks, and you want to change the font of the -%hyperlink, don't use \cs{hyperpage} (provided by the \styname{hyperref} +%If you are using hyperlinks and you want to change the font of the +%hyperlink, don't use \cs{hyperpage} (provided by the \isty{hyperref} %package) as the numbers may not refer to a page number. -%Instead, the \styname{glossaries} package provides the following +%Instead, the \sty{glossaries} package provides the following %number formats: %\begin{center} -%\begin{tabular}{@{\sffamily}lp{0.8\linewidth}} -%hyperrm & The number is a serif hyperlink to the relevant part of the +%\begin{tabular}{@{\sffamily}lp{0.8\linewidth}}hyperrm & The number is a serif hyperlink to the relevant part of the %document\\ %hypersf & The number is a sans-serif hyperlink to the relevant part %of the document\\ @@ -791,38 +902,36 @@ %hypersc & The number is a small caps hyperlink to the relevant %part of the document\\ %hyperemph & The number is an emphasized hyperlink to the relevant -%part of the document\\ +%part of the document %\end{tabular} %\end{center} %Note that if the \cs{hyperlink} command hasn't been defined, -%the "hyper"\meta{xx} formats are equivalent to the +%the \texttt{hyper}\meta{xx} formats are equivalent to the %analogous \cs{text}\meta{xx} font commands. If you want to %make a new format, you will need to define a command which takes -%one argument, for example, if you want the associated number in -%the glossary to be in a bold sans-serif font, you can define a +%one argument and use that; for example, if you want the associated +%number in the glossary to be in a bold sans-serif font, you can define a %command called, say, \cs{hyperbsf}: %\begin{verbatim} %\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}} %\end{verbatim} -%and then use "hyperbsf" as the value for the \gloskey{format} key. -%(See also \autoref{sec:printglos}.) -% +%and then use \texttt{hyperbsf} as the value for the \gloskey{format} +%key. (See also \autoref{sec:printglos}.) %\item[{\gloskey[glslink]{counter}}] This specifies which counter %to use for the associated number for this glossary entry. (See also %\autoref{sec:numberlists}.) -% %\item[{\gloskey[glslink]{hyper}}] This is a boolean key which can %be used to enable/disable the hyperlink to the relevant entry -%in the glossary. (Note that setting "hyper=true" will have no +%in the glossary. (Note that setting \texttt{hyper=true} will have no %effect if \cs{hyperlink} has not been defined.) The default -%value is "hyper=true". +%value is \texttt{hyper=true}. % %\end{description} %\DescribeMacro{\glslink*} %There is also a starred version:\\[10pt] %\cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt] %which is equivalent to \cs{glslink}, except it sets -%"hyper=false". +%\texttt{hyper=false}. % %\DescribeMacro{\gls} %The command:\\[10pt] @@ -830,20 +939,21 @@ %is the same as \cs{glslink}, except that the \term{link text} %is determined from the values of the \gloskey{text} and %\gloskey{first} keys supplied when the entry was defined using -%\icmdname{newglossaryentry}. There are two uppercase variants:\\[10pt] +%\ics{newglossaryentry}. There are two uppercase variants:\\[10pt] %\DescribeMacro{\Gls} %\cs{Gls}\oarg{options}\marg{label}\oarg{insert}\\[10pt] -%and +%and\\[10pt] %\DescribeMacro{\GLS} %\cs{GLS}\oarg{options}\marg{label}\oarg{insert}\\[10pt] -%which make the first letter of the link, or all the link text, +%which make the first letter of the link or all the link text %uppercase, respectively. % %The final optional argument \meta{insert}, allows you to insert %some additional text into the link text. By default, this will %append \meta{insert} at the end of the link text. The first optional -%argument, \meta{options}, is the same as the optional argument to -%\icmdname{glslink}. +%argument \meta{options} is the same as the optional argument to +%\ics{glslink}. As with \cs{glslink}, these commands also have +%a starred version that disable the hyperlink. % %There are also analogous plural forms:\\[10pt] %\DescribeMacro{\glspl} @@ -854,131 +964,614 @@ %\cs{GLSpl}\oarg{options}\marg{label}\oarg{insert}\\[10pt] %These determine the link text from the \gloskey{plural} and %\gloskey{firstplural} keys supplied when the entry was first -%defined. -% -%To make the description or symbol also appear in the \term{link text}, -%you will need to redefine \cs{glsdisplayfirst} and \cs{glsdisplay} -%or use the commands \cs{defglsdisplayfirst} and \cs{defglsdisplay}. -%See \autoref{sec:code:glslink} for further details. (Note that if you -%want either the description or symbol to appear in the -%\term{link text}, you will have to disable the -%\hyperlink{sanitize}{sanitization} of these -%keys, and protect fragile commands.) +%defined. As before, these commands also have +%a starred version that disable the hyperlink. +% +%\DescribeMacro{\glstext}The command:\\[10pt] +%\cs{glstext}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{text} key and does not mark the entry as +%having been used. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glstext} +%\cs{Glstext}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLStext} +%\cs{GLStext}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +%\DescribeMacro{\glsfirst}The command:\\[10pt] +%\cs{glsfirst}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{first} key and does not mark the entry as +%having been used. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glsfirst} +%\cs{Glsfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLSfirst} +%\cs{GLSfirst}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +%\DescribeMacro{\glsplural}The command:\\[10pt] +%\cs{glsplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{plural} key and does not mark the entry as +%having been used. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glsplural} +%\cs{Glsplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLSplural} +%\cs{GLSplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +%\DescribeMacro{\glsfirstplural}The command:\\[10pt] +%\cs{glsfirstplural}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{firstplural} key and does not mark the entry as +%having been used. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glsfirstplural} +%\cs{Glsfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLSfirstplural} +%\cs{GLSfirstplural}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +%\DescribeMacro{\glsname}The command:\\[10pt] +%\cs{glsname}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{name} key and does not mark the entry as +%having been used. Note: if you want to use this command and the +%\gloskey{name} key contains commands, you will have to disable the +%\hyperlink{sanitize}{sanitization} of the \gloskey{name} key and protect fragile commands. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glsname} +%\cs{Glsname}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLSname} +%\cs{GLSname}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +%\DescribeMacro{\glssymbol}The command:\\[10pt] +%\cs{glssymbol}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{symbol} key and does not mark the entry as +%having been used. Note: if you want to use this command and the +%\gloskey{symbol} key contains commands, you will have to disable the +%\hyperlink{sanitize}{sanitization} of the \gloskey{symbol} key and protect fragile commands. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glssymbol} +%\cs{Glssymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLSsymbol} +%\cs{GLSsymbol}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +%\DescribeMacro{\glsdesc}The command:\\[10pt] +%\cs{glsdesc}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%is similar to \ics{gls} except that it always uses the value +%of the \gloskey{description} key and does not mark the entry as +%having been used. Note: if you want to use this command and the +%\gloskey{description} key contains commands, you will have to disable the +%\hyperlink{sanitize}{sanitization} of the \gloskey{description} key and protect fragile commands. +% +%There are also analogous commands:\\[10pt] +%\DescribeMacro{\Glsdesc} +%\cs{Glsdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%\DescribeMacro{\GLSdesc} +%\cs{GLSdesc}\oarg{options}\marg{text}\oarg{insert}\\[10pt] +%As before, these commands also have a starred version that disable +%the hyperlink. +% +% +%\subsubsection{Changing the format of the link text} +%\label{sec:glsdisplay} +% +%The format of the \term{link text} for \ics{gls}, \ics{glspl} +%and their uppercase variants is governed by two commands: +%\DescribeMacro{\glsdisplayfirst}\cs{glsdisplayfirst}, which is used the +%first time a glossary entry is used in the text and +%\DescribeMacro{\glsdisplay}\cs{glsdisplay}, which is used subsequently. +%Both commands take four arguments: the first is either the singular or +%plural form given by the \gloskey{text}, \gloskey{plural}, +%\gloskey{first} or \gloskey{firstplural} keys (used when the term was +%defined) depending on context; the second argument is the term's +%description (as supplied by the \gloskey{description} key); the third +%argument is the symbol associated with the term (as supplied by the +%\gloskey{symbol} key) and the fourth argument is the additional text +%supplied in the final optional argument to \cs{gls} or +%\cs{glspl} (or their uppercase variants). The default definitions +%of \cs{glsdisplay} and \cs{glsdisplayfirst} simply +%print the first argument immediately followed by the fourth argument. +%The remaining arguments are ignored. +% +%For example, suppose you want a glossary of measurements and +%units, you can use the \gloskey{symbol} key to store the unit: +%\begin{verbatim} +%\newglossaryentry{distance}{name=distance, +%description={The length between two points}, +%symbol={km}} +%\end{verbatim} +%and now suppose you want \verb|\gls{distance}| to produce +%\dq{distance (km)} on first use, then you can redefine +%\cs{glsdisplayfirst} as follows: +%\begin{verbatim} +%\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)} +%\end{verbatim} +%Note that the additional text is placed after \verb|#1|, so +%\verb|\gls{distance}['s]| will produce \dq{distance's (km)} +%rather than \dq{distance (km)'s} which looks a bit odd (even though +%it may be in the context of \dq{the distance (km) is measured between +%the two points} --- but in this instance it may be better not to +%use a contraction). +% +%Note also that all of the \term{link text} will be formatted according +%to \ics{glstextformat} (described earlier). So if you do, say: +%\begin{verbatim} +%\renewcommand{\glstextformat}[1]{\textbf{#1}} +%\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)} +%\end{verbatim} +%then \verb|\gls{distance}| will produce \dq{\textbf{distance (km)}}. +% +%If you have multiple glossaries, changing \cs{glsdisplayfirst} and +%\cs{glsdisplay} will change the way entries for all of the +%glossaries appear when using commands \cs{gls}, \cs{glspl} and their +%uppercase variants. If you only +%want the change to affect entries for a given glossary, then you need +%to use \DescribeMacro{\defglsdisplay}\cs{defglsdisplay} and +%\DescribeMacro{\defglsdisplayfirst}\cs{defglsdisplayfirst} instead +%of redefining \cs{glsdisplay} and \cs{glsdisplayfirst}. +% +%Both \cs{defglsdisplay} and \cs{defglsdisplayfirst} take two arguments: +%the first (which is optional) is the glossary name\footnote{\texttt{main} for the main +%(default) glossary, \cs{acronymtype} for the list of acronyms, or the +%name supplied in the first mandatory argument to \cs{newglossary} for +%additional glossaries.} and the second is how the term should be +%displayed when it is invoked using commands \cs{gls}, +%\cs{glspl} and their uppercase variants. This is similar to the way \cs{glsdisplayfirst} was +%redefined above. +% +%For example, suppose you have created a new glossary called +%\texttt{notation} and you want to change the way the entry is +%displayed on first use so that it includes the symbol, you can +%do: +%\begin{verbatim} +%\defglsdisplayfirst[notation]{#1#4 (denoted #3)} +%\end{verbatim} +%Now suppose you have defined an entry as follows: +%\begin{verbatim} +%\newglossaryentry{set}{type=notation, +%name=set, +%description={A collection of objects}, +%symbol={$S$}, +%} +%\end{verbatim} +%The first time you reference this entry using \cs{gls} it +%will be displayed as: \dq{set (denoted $S$)} (similarly for \cs{glspl} and the uppercase variants). +% +%Remember that if you use the \gloskey{symbol} key, you need to use a +%glossary style that displays the symbol, as many of the styles ignore +%it. In addition, if you want either the description or symbol to appear +%in the \term{link text}, you will have to disable the +%\hyperlink{sanitize}{sanitization} of these keys and protect fragile commands. +%\subsubsection{Enabling and disabling hyperlinks to glossary entries} +% +%If you load the \isty{hyperref} or \isty{html} packages prior to +%loading the \sty{glossaries} package, commands such as \ics{glslink} +%and \ics{gls}, described above, will automatically have hyperlinks +%to the relevant glossary entry, unless the \gloskey[glslink]{hyper} +%option has been set to \texttt{false}. You can disable or enable links using:\\[10pt] +%\DescribeMacro{\glsdisablehyper}\cs{glsdisablehyper}\\[10pt] +%and\\[10pt] +%\DescribeMacro{\glsenablehyper}\cs{glsenablehyper}\\[10pt] +%respectively. The effect can be localised by placing the commands +%within a group. Note that you should only use \cs{glsenablehyper} +%if the commands \ics{hyperlink} and \ics{hypertarget} have been +%defined (for example, by the \isty{hyperref} package). % %\subsection{Adding an entry to the glossary without generating text} %\label{sec:glsadd} % %\DescribeMacro{\glsadd} -%It is also possible to add a line in the glossary file without -%generating any text at that point in the document.\\[10pt] +%It is possible to add a line in the glossary file without +%generating any text at that point in the document using:\\[10pt] %\cs{glsadd}\oarg{options}\marg{label}\\[10pt] -%This is similar to \icmdname{glslink}, only it doesn't produce +%This is similar to \ics{glslink}, only it doesn't produce %any text (so therefore, there is no \gloskey[glslink]{hyper} key -%available in \meta{options}.) +%available in \meta{options} but all the other options that can +%be used with \cs{glslink} can be passed to \cs{glsadd}). % %\DescribeMacro{\glsaddall} -%To add a line for all entries that have been defined, use:\\[10pt] +%To add all entries that have been defined, use:\\[10pt] %\cs{glsaddall}\oarg{glossary list}\\[10pt] %If there are multiple glossaries, you can specify to add only %those entries which belong to the glossaries listed in %\meta{glossary list} (which must be a comma separated list of -%glossary names.) -% +%glossary names). For example: +%\begin{verbatim} +%\glsaddall[notation] +%\end{verbatim} +%will add all the entries that have been defined for the glossary +%labelled \dq{notation}. %\subsection{Displaying a glossary} % %\DescribeMacro{\printglossaries} %The command \cs{printglossaries} will display all the %defined glossaries. Note that no glossaries will appear until %you have either used the Perl script \appname{makeglossaries} -%or have directly used \appname{makeindex}. If the glossary still -%does not appear, after you re-\LaTeX\ your document, then check +%or have directly used \appname{makeindex} (as described in +%\autoref{sec:makeglossaries}). If the glossary still does not appear after you re-\LaTeX\ your document, check %the \appname{makeindex} log files to see if there is a problem. +%Remember that you also need to use the command \ics{makeglossaries} in +%the preamble to enable the glossaries. % %\DescribeMacro{\printglossary} %An individual glossary is displayed using:\\[10pt] %\cs{printglossary}\oarg{options}\\[10pt] -%where \meta{options} is a key-val list of options. The following -%keys are available: +%where \meta{options} is a \meta{key}=\meta{value} list of options. +%The following keys are available: %\begin{description} %\item[{\gloskey[printglossary]{type}}] The value of this key %specifies which glossary to print. If omitted, the default -%glossary is assumed. +%glossary is assumed. For example, to print the list of acronyms: +%\begin{verbatim} +%\printglossary[type=\acronymtype] +%\end{verbatim} % %\item[{\gloskey[printglossary]{title}}] This is the glossary's %title (overriding the title specified when the glossary was -%defined.) +%defined). % %\item[{\gloskey[printglossary]{toctitle}}] This is the title %to use for the table of contents (if the \pkgopt{toc} package -%option has been used.) +%option has been used). If omitted, the glossary title is used. % %\item[{\gloskey[printglossary]{style}}] This specifies which -%glossary style to use for this glossary. +%glossary style to use for this glossary, overriding the effect +%of the \pkgopt{style} option or \ics{glossarystyle}. %\end{description} % +%\DescribeMacro{\glossarypreamble} +%Information can be added to the start of the glossary by redefining +%\cs{glossarypreamble}. For example: +%\begin{verbatim} +%\renewcommand{\glossarypreamble}{Numbers in italic indicate +%primary definitions.} +%\end{verbatim} +%This needs to be done before the glossary is displayed using +%\cs{printglossaries} or \cs{printglossary}. Note that if you +%want a different preamble for each glossary, you will need to +%use a separate \cs{printglossary} for each glossary and change +%the definition of \cs{glossarypreamble} between each glossary. +%For example: +%\begin{verbatim} +%\renewcommand{\glossarypreamble}{Numbers in italic indicate +%primary definitions.} +%\printglossary +%\renewcommand{\glossarypreamble}{} +%\printglossary[type=acronym] +%\end{verbatim} +%Alternatively, you can do something like: +%\begin{verbatim} +%\renewcommand{\glossarypreamble}{Numbers in italic indicate +%primary definitions.\gdef\glossarypreamble{}} +%\printglossaries +%\end{verbatim} +%which will print the preamble text for the first glossary and +%change the preamble to do nothing for subsequent glossaries. +%(Note that \cs{gdef} is required as the glossary is placed within +%a group.) +% +%\DescribeMacro{\glossarypostamble}There is an analogous command +%called \cs{glossarypostamble} which is placed at the end of each +%glossary. +%\subsubsection{Changing the way the entry name appears in the glossary} +%\label{sec:glsnamefont} +% +%\DescribeMacro{\glsnamefont}Within each glossary, each entry name is +%formatted according to \cs{glsnamefont} which takes one argument: the +%entry name. This command is always used regardless of the glossary +%style. By default, \cs{glsnamefont} simply displays its argument in +%whatever the surrounding font happens to be. This means that in the +%list styles the name will appear in bold, since the name is placed in +%the optional argument of \cs{item}, whereas in the tabular styles the +%name will appear in the normal font. +% +%For example, suppose you want all the entry names to appear in +%medium weight small caps, then you can do: +%\begin{verbatim} +%\renewcommand{\glsnamefont}[1]{\textsc{\mdseries #1}} +%\end{verbatim} +% %\subsection{Defining New Glossaries} % %\DescribeMacro{\newglossary} %A new glossary can be defined using:\\[10pt] %\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}\marg{title}\oarg{counter}\\[10pt] -%where \meta{name} is label to assign to this glossary. (Note that -%the default glossary is labelled "main" and if you use the -%\pkgopt{acronym} package option, there will also be a glossary -%called "acronym".) The arguments \meta{in-ext} and \meta{out-ext} -%specify the extensions to give to the input and output files -%for that glossary, \meta{title} is the default title for this -%new glossary and the final optional argument \meta{counter} specifies -%which counter to use for the associated -%number lists\iterm{number list} (see also -%\autoref{sec:numberlists}.) The first optional argument specifies -%the extension for the \appname{makeindex} transcript file (this -%information is only used by \appname{makeglossaries} which picks -%up the information from the auxiliary file.) -% +%where \meta{name} is label to assign to this glossary. The arguments +%\meta{in-ext} and \meta{out-ext} specify the extensions to give to the +%input and output files for that glossary, \meta{title} is the default +%title for this new glossary and the final optional argument +%\meta{counter} specifies which counter to use for the associated number +%lists\iterm{number list} (see also \autoref{sec:numberlists}.) The first optional argument specifies the extension for the +%\appname{makeindex} transcript file (this information is only used by +%\appname{makeglossaries} which picks up the information from the +%auxiliary file.) +% +%Note that the main (default) glossary is automatically created as: +%\begin{verbatim} +%\newglossary{main}{gls}{glo}{\glossaryname} +%\end{verbatim} +%so it can be identified by the label \texttt{main}. Using the +%\pkgopt{acronym} package option is equivalent to: +%\begin{verbatim} +%\newglossary[alg]{acronym}{acr}{acn}{\acronymname} +%\end{verbatim} +%so it can be identified by the label \texttt{acronym}. If you are +%not sure whether the \pkgopt{acronym} option has been used, you +%can identify the list of acronyms by the command +%\DescribeMacro{\acronymtype}\cs{acronymtype} which is set to +%\texttt{acronym}, if the \pkgopt{acronym} option has been used, +%otherwise it is set to \texttt{main}. %\subsection{Acronyms} +%\label{sec:acronyms} % %\DescribeMacro{\newacronym} -%As you may have noticed in \autoref{sec:newglosentry}, when you -%specify a new entry, you can specify alternate text to use when -%the term is first used in the document, this provides a useful -%means to define acronyms. The \styname{glossaries} package defines +%As you may have noticed in \autoref{sec:newglosentry}, when you specify a new entry, you can specify alternate text to use when +%the term is first used in the document. This provides a useful +%means to define acronyms. The \sty{glossaries} package defines %the command:\\[10pt] %\cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrv}\marg{long}\\[10pt] %This is equivalent to:\vskip5pt -%\begin{ttfamily}\obeylines -%\cs{newglossaryentry}\textrm{\marg{label}}\{type=\cs{acronymtype}, -%name=\textrm{\marg{abbrv}}, -%description=\textrm{\marg{long}}, -%text=\textrm{\marg{abbrv}}, -%first=\{\textrm{\meta{long}} (\textrm{\meta{abbrv}})\}, -%plural=\{\textrm{\meta{abbrv}}s\}, -%firstplural=\{\textrm{\meta{long}}s (\textrm{\meta{abbrv}}s)\}, -%\textrm{\meta{key-val list}}\} +%\begin{ttfamily}\par\noindent +%\cs{newglossaryentry}\textrm{\marg{label}}\{type=\cs{acronymtype},\\ +%name=\textrm{\marg{abbrv}},\\ +%description=\textrm{\marg{long}},\\ +%text=\textrm{\marg{abbrv}},\\ +%first=\{\textrm{\meta{long}} (\textrm{\meta{abbrv}})\},\\ +%plural=\{\textrm{\meta{abbrv}}s\},\\ +%firstplural=\{\textrm{\meta{long}}s (\textrm{\meta{abbrv}}s)\},\\ +%\textrm{\meta{key-val list}}\}\par %\end{ttfamily} %\vskip5pt -%The command \cs{acronymtype} is the name of the glossary -%in which the acronyms should appear. If the \pkgopt{acronym} -%package option has been used, this will be "acronym", otherwise -%it will be "main". The acronyms can then be used in exactly -%the same way as any other glossary entry. -% -%As you can see from the above, \cs{newacronym} sets the -%description to the long form of the acronym. You may prefer to -%have a description, and set the name to both the long and abbreviated -%forms. For example, the following defines the acronym IDN: +%As mentioned in the previous section, the command \cs{acronymtype} is +%the name of the glossary in which the acronyms should appear. If the +%\pkgopt{acronym} package option has been used, this will be +%\texttt{acronym}, otherwise it will be \texttt{main}. The acronyms can +%then be used in exactly the same way as any other glossary entry. +%For example, the following defines the acronym IDN: %\begin{verbatim} -%\newacronym[name={identification number (IDN)}, -%description={A number uniquely identifying a particular -%object}]{idn}{IDN}{identification number} +%\newacronym{idn}{IDN}{identification number} %\end{verbatim} -%Alternatively: +%This is equivalent to: %\begin{verbatim} -%\newacronym[description={identification number --- a number uniquely -%identifying a particular object}]{idn}{IDN}{identification number} +%\newglossaryentry{idn}{type=\acronymtype, +%name={IDN}, +%description={identification number}, +%text={IDN}, +%first={identification number (IDN)}, +%plural={IDNs}, +%firstplural={identification numbers (IDNs)}} %\end{verbatim} +%so \verb|\gls{idn}| will produce \dq{identification number (IDN)} on +%first use and \dq{IDN} on subsequent uses. +% +%The \sty{glossaries} package has options that change the +%definition of \ics{newacronym} for common acronym formats. These +%options also change the way the link text is displayed for the +%acronyms. +% +%Table~\ref{tab:acronymsettings} lists the package options and +%how the keys are used to store \meta{long} (the long form) and +%\meta{abbrv} (the short form). Note that the \pkgopt{smallcaps} +%option redefines \ics{acronymfont} so that it sets its argument +%in small captials otherwise \cs{acronymfont} simply displays its +%argument in the surrounding font. Note also that if none of +%the package options \pkgopt{smallcaps}, \pkgopt{description} +%or \pkgopt{footnote} are used, \cs{acronymfont} is not used, so +%changing the definition of \cs{acronymfont} will have no effect +%under such circumstances. +% +%\begin{table}[htbp] +%\caption{Package options governing acronyms and how the information +%is stored in the glossary keys} +%\label{tab:acronymsettings} +%\begin{center} +%\begin{tabular}{lllll} +%\bfseries Package Option & +%\gloskey{first} & +%\gloskey{text} & +%\gloskey{description} & +%\gloskey{symbol}\\ +%\pkgopt{description},\pkgopt{footnote} & +%\meta{abbrv} & +%\meta{abbrv} & +%user supplied & +%\meta{long}\\ +%\pkgopt{description},\pkgopt{dua} & +%\meta{long} & +%\meta{long} & +%user supplied & +%\meta{abbrv}\\ +%\pkgopt{description} & +%\meta{long} & +%\meta{abbrv} & +%user supplied & +%\meta{abbrv}\\ +%\pkgopt{footnote} & +%\meta{abbrv} & +%\meta{abbrv} & +%\meta{long} & +% \\ +%\pkgopt{smallcaps} & +%\meta{long} & +%\meta{abbrv} & +%\meta{long} & +%\meta{abbrv}\\ +%\pkgopt{dua} & +%\meta{long} & +%\meta{long} & +%\meta{long} & +%\meta{abbrv}\\ +%None of the above& +%\meta{long} (\meta{abbrv}) & +%\meta{abbrv} & +%\meta{long} & +%\end{tabular} +%\end{center} +%\end{table} +% +%Each of the package options \pkgopt{smallcaps}, \pkgopt{footnote} +%and \pkgopt{description} use \ics{defglsdisplay} and +%\ics{defglsdisplayfirst} (described in \autoref{sec:glsdisplay}) +%to change the way the link text is displayed. +% +%\begin{description} +%\item[\pkgopt{description},\pkgopt{footnote}]\mbox{}\par When these two options are used together, the first use displays +%the entry as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long} +%\\[10pt] +%while subsequent use displays the entry as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +%where \meta{insert} indicates the text supplied in the final +%optional argument to \cs{gls}, \cs{glspl} or their uppercase +%variants. +% +%Note also that when these two package options are used (in the +%given order), the \sty{glossaries} package additionally implements the +%\pkgopt{sanitize} option using +%\ipkgopt[description]{sanitize}\ipkgopt[symbol]{sanitize}\verb|sanitize={description=false,symbol=false}|, so +%remember to protect fragile commands when defining acronyms. +% +%\item[dua]\mbox{}\par The \pkgopt{dua} package option always displays the expanded +%form and so may not be used with \pkgopt{footnote} or +%\pkgopt{smallcaps}. Both first use and subsequent use displays the +%entry in the form:\\[10pt] +%\meta{long}\meta{insert}\\[10pt] +%If the \pkgopt{description} option is also used, the \gloskey{name} +%key is set to the long form, otherwise the \gloskey{name} key is +%set to the short form and the \gloskey{description} key is set to +%the long form. +% +%\item[\pkgopt{description}]\mbox{}\par This option displays the entry on first use as:\\[10pt] +%\meta{long}\meta{insert} (\cs{acronymfont}\marg{abbrv})\\[10pt] +%while subsequent use displays the entry as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +%Note also that if this package option is used, the \sty{glossaries} +%package additionally implements the option +%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so +%remember to protect fragile commands when defining acronyms. +% +%\item[\pkgopt{footnote}]\mbox{}\par This option displays the entry on first use as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert}\cs{footnote}\marg{long}\\[10pt] +%while subsequent use displays the entry as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert} +% +%Note also that if this package option is used, the \sty{glossaries} +%package additionally implements the option +%\ipkgopt[description]{sanitize}\verb|sanitize={description=false}|, so +%remember to protect fragile commands when defining acronyms. +% +%\item[\pkgopt{smallcaps}]\mbox{}\par If neither the \pkgopt{footnote} nor \pkgopt{description} options +%have been set, this option displays the entry on first use as:\\[10pt] +%\meta{long}\meta{insert} (\cs{acronymfont}\marg{abbrv})\\[10pt] +%while subsequent use displays the entry as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +%where \cs{acronymfont} is set to \cs{textsc}. +% +%Note also that if this package option is used, the \sty{glossaries} +%package additionally implements the option +%\ipkgopt[symbol]{sanitize}\verb|sanitize={symbol=false}|, so +%remember to protect fragile commands when defining acronyms. +% +%\item[None of the above]\mbox{}\par If none of the package options \pkgopt{smallcaps}, \pkgopt{footnote} +%or \pkgopt{description} are used, then on first use the entry is +%displayed as:\\[10pt] +%\meta{long} (\meta{abbrv})\meta{insert}\\[10pt] +%while subsequent use displays the entry as:\\[10pt] +%\cs{acronymfont}\marg{abbrv}\meta{insert}\\[10pt] +%\meta{abbrv}\meta{insert} +%\end{description} +% +%Recall from \autoref{sec:glslink} that you can access the values of individual keys using commands +%like \ics{glstext}, so it is possible to use these commands to +%print just the long form or just the abbreviation without affecting +%the flag that determines whether the entry has been used. However +%the keys that store the long and short form vary depending on +%the acronym style, so the \sty{glossaries} package provides +%commands that are set according to the package options. These are +%as follows: +%\vspace{10pt}\par\noindent +%\DescribeMacro{\acrshort} +%\cs{acrshort}\oarg{options}\marg{label}\oarg{insert}\\ +%\DescribeMacro{\Acrshort} +%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\ +%\DescribeMacro{\ACRshort} +%\cs{ACRshort}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%Print the abbreviated version with a hyperlink (if necessary) to the +%relevant entry in the glossary. This is usually equivalent to +%\ics{glstext} (or its uppercase variants) but may additionally +%put the link text within the argument to \ics{acronymfont}. +%\vspace{10pt}\par\noindent +%\DescribeMacro{\acrlong} +%\cs{acrlong}\oarg{options}\marg{label}\oarg{insert}\\ +%\DescribeMacro{\Acrlong} +%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\ +%\DescribeMacro{\ACRlong} +%\cs{ACRlong}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%Print the long version with a hyperlink (if necessary) to the +%relevant entry in the glossary. This is may be equivalent to +%\ics{glsdesc}, \ics{glssymbol} or \ics{glsfirst} (or their uppercase +%variants), depending on package options. +%\vspace{10pt}\par\noindent +%\DescribeMacro{\acrfull} +%\cs{acrfull}\oarg{options}\marg{label}\oarg{insert}\\ +%\DescribeMacro{\Acrfull} +%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\ +%\DescribeMacro{\ACRfull} +%\cs{ACRfull}\oarg{options}\marg{label}\oarg{insert}\\[10pt] +%Print the long version followed by the abbreviation in brackets +%with a hyperlink (if necessary) to the +%relevant entry in the glossary. +% +%Note that if you change the definition of \ics{newacronym}, you +%may additionally need to change the above commands as well as +%the changing way the text is displayed using \ics{defglsdisplay} +%and \ics{defglsdisplayfirst}. +% +% +%\subsection{Unsetting and resetting entry flags} +% +%When using commands such as \ics{gls} it is possible that you may want +%to use the value given by the \gloskey{first} key, even though you have +%already used the glossary entry. Conversely, you may want to use the +%value given by the \gloskey{text} key, even though you haven't used the +%glossary entry. The former can be achieved by one of the following +%commands:\\[10pt] +%\DescribeMacro{\glsreset}\cs{glsreset}\marg{label}\\ +%\DescribeMacro{\glslocalreset}\cs{glslocalreset}\marg{label}\\[10pt] +%while the latter can be achieved by one of the following commands:\\[10pt] +%\DescribeMacro{\glsunset}\cs{glsunset}\marg{label}\\ +%\DescribeMacro{\glslocalunset}\cs{glslocalunset}\marg{label} +%\\[10pt] +%You can determine whether an entry has been used using:\\[10pt] +%\DescribeMacro{\ifglsused} +%\cs{ifglsused}\marg{label}\marg{true part}\marg{false part}\\[10pt] +%where \meta{label} is the label of the required entry. If the +%entry has been used, \meta{true part} will be done, otherwise +%\meta{false part} will be done. % %\subsection{Glossary Styles} -%The \styname{glossaries} package comes with some pre-defined +%\label{sec:styles} +%The \sty{glossaries} package comes with some pre-defined %glossary styles. These are as follows: %\begin{description} %\item[list] The \glostyle{list} style uses the \envname{description} @@ -988,35 +1581,43 @@ %list for that entry. % %\item[listgroup] The \glostyle{listgroup} style is like -%\glostyle{list}, but the glossary groups have headings. +%\glostyle{list} but the glossary groups have headings. % %\item[listhypergroup] The \glostyle{listhypergroup} style is like -%\glostyle{listgroup}, but has a set of links to the glossary +%\glostyle{listgroup} but has a set of links to the glossary %groups. % %\item[altlist] The \glostyle{altlist} style is like \glostyle{list} %but the description is placed on the following line. % %\item[altlistgroup] The \glostyle{altlistgroup} style is like -%\glostyle{altlist}, but the glossary groups have headings. +%\glostyle{altlist} but the glossary groups have headings. % %\item[altlisthypergroup] The \glostyle{altlisthypergroup} style is like -%\glostyle{altlistgroup}, but has a set of links to the glossary +%\glostyle{altlistgroup} but has a set of links to the glossary %groups. % +%\item[listdotted] This style uses the \envname{description} +%environment. Each entry starts with \verb|\item[]|, followed by the +%name followed by a dotted line, followed by the description. Note that +%this style ignores both the \term{number list} and the symbol. The +%length \DescribeMacro{\glslistdottedwidth}\cs{glslistdottedwidth} +%governs where the description should start.\footnote{This style was +%supplied by Axel~Menzel.} +% %\item[long] The \glostyle{long} style uses the \envname{longtable} -%environment. It has two columns, the first column contains the -%entry's name, the second column contains the description followed -%by the \term{number list}. +%environment (defined by the \isty{longtable} package). It has two +%columns: the first column contains the entry's name and the second +%column contains the description followed by the \term{number list}. % %\item[longborder] The \glostyle{longborder} style is like -%\glostyle{long}, but has horizontal and vertical lines around it. +%\glostyle{long} but has horizontal and vertical lines around it. % %\item[longheader] The \glostyle{longheader} style is like -%\glostyle{long}, but has a header row. +%\glostyle{long} but has a header row. % %\item[longheaderborder] The \glostyle{longheaderborder} style is -%like \glostyle{longheader}, but has horizontal and vertical lines +%like \glostyle{longheader} but has horizontal and vertical lines %around it. % %\item[long3col] The \glostyle{long3col} style is like @@ -1029,10 +1630,10 @@ %lines around it. % %\item[long3colheader] The \glostyle{long3colheader} style is like -%\glostyle{long3col}, but has a header row. +%\glostyle{long3col} but has a header row. % %\item[long3colheaderborder] The \glostyle{long3colheaderborder} style is -%like \glostyle{long3colheader}, but has horizontal and vertical lines +%like \glostyle{long3colheader} but has horizontal and vertical lines %around it. % %\item[long4col] The \glostyle{long4col} style is like @@ -1044,25 +1645,25 @@ %lines around it. % %\item[long4colheader] The \glostyle{long4colheader} style is like -%\glostyle{long4col}, but has a header row. +%\glostyle{long4col} but has a header row. % %\item[long4colheaderborder] The \glostyle{long4colheaderborder} style is -%like \glostyle{long4colheader}, but has horizontal and vertical lines +%like \glostyle{long4colheader} but has horizontal and vertical lines %around it. % %\item[super] The \glostyle{super} style uses the \envname{supertabular} -%environment. It has two columns, the first column contains the -%entry's name, the second column contains the description followed -%by the \term{number list}. +%environment (defined by the \isty{supertabular} package). It has two +%columns: the first column contains the entry's name and the second +%column contains the description followed by the \term{number list}. % %\item[superborder] The \glostyle{superborder} style is like -%\glostyle{super}, but has horizontal and vertical lines around it. +%\glostyle{super} but has horizontal and vertical lines around it. % %\item[superheader] The \glostyle{superheader} style is like -%\glostyle{super}, but has a header row. +%\glostyle{super} but has a header row. % %\item[superheaderborder] The \glostyle{superheaderborder} style is -%like \glostyle{superheader}, but has horizontal and vertical lines +%like \glostyle{superheader} but has horizontal and vertical lines %around it. % %\item[super3col] The \glostyle{super3col} style is like @@ -1075,11 +1676,11 @@ %lines around it. % %\item[super3colheader] The \glostyle{super3colheader} style is like -%\glostyle{super3col}, but has a header row. +%\glostyle{super3col} but has a header row. % -%\item[super3colheaderborder] The \glostyle{super3colheaderborder} style is -%like \glostyle{super3colheader}, but has horizontal and vertical lines -%around it. +%\item[super3colheaderborder] The \glostyle{super3colheaderborder} style +%is like \glostyle{super3colheader} but has horizontal and vertical +%lines around it. % %\item[super4col] The \glostyle{super4col} style is like %\glostyle{super3col} but has an additional column in which the @@ -1090,38 +1691,40 @@ %lines around it. % %\item[super4colheader] The \glostyle{super4colheader} style is like -%\glostyle{super4col}, but has a header row. +%\glostyle{super4col} but has a header row. % -%\item[super4colheaderborder] The \glostyle{super4colheaderborder} style is -%like \glostyle{super4colheader}, but has horizontal and vertical lines -%around it. +%\item[super4colheaderborder] The \glostyle{super4colheaderborder} style +%is like \glostyle{super4colheader} but has horizontal and vertical +%lines around it. % %\end{description} % -%The glossary style can be set using the \pkgopt{style} package option, +%The glossary style can be set using the \pkgopt{style} package option %or using the \gloskey[printglossary]{style} key in the optional -%argument to \icmdname{printglossary}, or using the command:\\[10pt] -%\cs{glossarystyle}\marg{style-name}\\[10pt] +%argument to \ics{printglossary} or using the command:\\[10pt] +%\DescribeMacro{\glossarystyle}\cs{glossarystyle}\marg{style-name}\\[10pt] % % \changes{1.03}{2007 July 4}{'glspostdescription added} -%All the styles except for the three and four column styles use the -%command \DescribeMacro{\glspostdescription}\cs{glspostdescription} -%after the description. This simply displays a full stop by default. -%To eliminate this full stop (or replace it with something else, -%say a comma), you will need to redefine \cs{glspostdescription} -%before the glossary is displayed. -% +%All the styles except for the three- and four-column styles and the +%\glostyle{listdotted} style use the command +%\DescribeMacro{\glspostdescription}\cs{glspostdescription} after the +%description. This simply displays a full stop by default. To eliminate +%this full stop (or replace it with something else, say a comma), you +%will need to redefine \cs{glspostdescription} before the glossary is +%displayed. %\subsection{Defining your own glossary style} % %If the predefined styles don't fit your requirements, you can %define your own style using\DescribeMacro{\newglossarystyle}:\\[10pt] %\cs{newglossarystyle}\marg{name}\marg{definitions}\\[10pt] %where \meta{name} is the name of the new glossary style (to be -%used in \cs{glossarystyle}. The second argument \meta{definitions}, -%needs to redefine the following: +%used in \cs{glossarystyle}). The second argument \meta{definitions}, +%needs to redefine all of the following: % +%\begin{description} +%\item %\DescribeEnv{theglossary} -%\noindent\envname{theglossary}\par\noindent +%\envname{theglossary}\par\noindent %This environment defines how the main body of the glossary should %be typeset. Note that this does not include the section heading, %the glossary preamble (defined by \cs{glossarypreamble}) or the @@ -1130,8 +1733,9 @@ %so the \envname{theglossary} environment is simply redefined to begin %and end the \envname{description} environment. % +%\item %\DescribeMacro{\glossaryheader} -%\noindent\cs{glossaryheader}\par\noindent +%\cs{glossaryheader}\par\noindent %This macro indicates what to do at the start of the main body %of the glossary. Note that this is not the same as %\cs{glossarypreamble}, which should not be affected by changes in @@ -1139,27 +1743,36 @@ %\cs{glossaryheader} to do nothing, whereas the \glostyle{longheader} %glossary style redefines \cs{glossaryheader} to do a header row. % +%\item %\DescribeMacro{\glsgroupheading} -%\noindent\cs{glsgroupheading}\marg{label}\par\noindent +%\cs{glsgroupheading}\marg{label}\par\noindent %This macro indicates what to do at the start of each logical block -%within the main body of the glossary. The glossary is sub-divided -%into 28 logical blocks that are determined by the first character of -%the \gloskey{sort} key (or \gloskey{name} key if the \gloskey{sort} -%key is omitted.) The sub-divisions are in the following order: -%symbols, numbers, A, \ldots, Z. Note that the argument to -%\cs{glsgroupheading} is a label, \emph{not} the group title. The -%group title can be obtained via \cs{glsgetgrouptitle}\marg{label}, -%and a navigation hypertarget can be created using -%\cs{glsnavhypertarget}\marg{label}. Most of the predefined glossary -%styles redefine \cs{glsgroupheading} to simply ignore its argument. -%The \glostyle{listhypergroup} style redefines \cs{glsgroupheading} -%as follows: +%within the main body of the glossary. The glossary is sub-divided into +%twenty-eight logical blocks that are determined by the first character +%of the \gloskey{sort} key (or \gloskey{name} key if the \gloskey{sort} +%key is omitted). The sub-divisions are in the following order: symbols, +%numbers, A, \ldots, Z. Note that the argument to \cs{glsgroupheading} +%is a label \emph{not} the group title. The group title can be obtained +%via \cs{glsgetgrouptitle}\marg{label}, and a navigation hypertarget can +%be created using \cs{glsnavhypertarget}\marg{label}. Most of the +%predefined glossary styles redefine \cs{glsgroupheading} to simply +%ignore its argument. The \glostyle{listhypergroup} style redefines +%\cs{glsgroupheading} as follows: %\begin{verbatim} %\renewcommand*{\glsgroupheading}[1]{% %\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]} %\end{verbatim} -%See also \cs{glsgroupskip} below. +%See also \cs{glsgroupskip} below. (Note that command definitions within +%\cs{newglossarystyle} must use \verb|##1| etc instead of \verb|#1| etc.) +% +%\item +%\DescribeMacro{\glsgroupskip} +%\cs{glsgroupskip}\par\noindent +%This macro determines what to do after one logical group but before +%the header for the next logical group. The \glostyle{list} glossary +%style simply redefines \cs{glsgroupskip} to be \cs{indexspace}. % +%\item %\DescribeMacro{\glossaryentryfield} %\cs{glossaryentryfield}\marg{label}\marg{formatted %name}\marg{description}\marg{symbol} @@ -1171,52 +1784,101 @@ %Note that \meta{label} is the label used when the glossary entry %was defined via either \cs{newglossaryentry} or \cs{newacronym}. %Each time you use a glossary entry it creates a -%link\footnote{if the document doesn't have hyperlinks enabled, -%\cs{@glslink} ignores the label, and simply typesets the text.} +%link\footnote{if the document doesn't have hyperlinks enabled +%\cs{@glslink} ignores the label and simply typesets the text.} %using \cs{@glslink}\marg{label}\marg{text} with the label %\texttt{glo:}\meta{label}. Your %new glossary style must therefore redefine \cs{glossaryentryfield} -%so that it uses \cs{@glstarget}\{\texttt{glo:}\meta{label}\}\marg{text} -%to ensure the hyperlinks function correctly\footnote{again, if the +%so that it uses \cs{@glstarget}\verb|{|\texttt{glo:}\meta{label}\verb|}|\marg{text} +%to ensure the hyperlinks function correctly.\footnote{again, if the %document doesn't support hyperlinks, \cs{@glstarget} will ignore -%the label, and just typeset the text.}. +%the label, and just typeset the text.} For example, the +%\glostyle{list} style defines \cs{glossaryentryfield} as follows: +%\begin{verbatim} +%\renewcommand*{\glossaryentryfield}[5]{% +%\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5} +%\end{verbatim} % %Note also that \meta{number list} will always be of the form\\[10pt] %\cs{glossaryentrynumbers}\{\cs{relax}\\ %\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}\}\\[10pt] %where \meta{number(s)} %may contain \cs{delimN} (to delimit individual numbers) and/or -%\cs{delimR} (to indicate a range of numbers.) There may be +%\cs{delimR} (to indicate a range of numbers). There may be %multiple occurrences of %\cs{setentrycounter}\marg{counter name}\cs{glsnumberformat}\marg{number(s)}, but note %that the entire number list is enclosed within the argument -%to \cs{glossaryentrynumbers}. The user can redefine this to change +%to \ics{glossaryentrynumbers}. The user can redefine this to change %the way the entire number list is formatted, regardless of -%the glossary style (although, obviously, the \gloskey{format} -%key may over-ride this.) However the most common use of +%the glossary style. However the most common use of %\cs{glossaryentrynumbers} is to provide a means of suppressing the %number list altogether. (In fact, the \pkgopt{nonumberlist} option %redefines \cs{glossaryentrynumbers} to ignore its argument.) %Therefore, when you define a new glossary style, you don't need %to worry about whether the user has specified the %\pkgopt{nonumberlist} package option. +%\end{description} +%\subsubsection{Example: creating a completely new style} +% +%If you want a completely new style, you will need to redefine all +%of the commands and environment listed above. You also need to +%take care when using internal commands (commands whose name +%contain the @ symbol). These should either be used in a \texttt{.sty} +%file or must be placed within \cs{makeatletter} and \cs{makeatother}. +% +%For example, suppose you want each entry to start with a bullet point. +%This means that the glossary should be placed in the \envname{itemize} +%environment, so \envname{theglossary} should start and end that +%environment. Let's also suppose that you don't want anything between +%the glossary groups (so \cs{glsgroupheading} and \cs{glsgroupskip} +%should do nothing) and suppose you don't want anything to appear +%immediately after \verb|\begin{theglossary}| (so \cs{glossaryheader} +%should do nothing). In addition, let's suppose the symbol should +%appear in brackets after the name, followed by the description and +%last of all the \term{number list} should appear within square brackets +%at the end. Then you can create this new glossary style, called, say, +%\texttt{mylist}, as follows: +%\begin{verbatim} +% \newglossarystyle{mylist}{% +% % put the glossary in the itemize environment: +% \renewenvironment{theglossary}{\begin{itemize}}{\end{itemize}}% +% % have nothing after \begin{theglossary}: +% \renewcommand*{\glossaryheader}{}% +% % have nothing between glossary groups: +% \renewcommand*{\glsgroupheading}[1]{}% +% \renewcommand*{\glsgroupskip}{}% +% % set how each entry should appear: +% \renewcommand*{\glossaryentryfield}[5]{% +% \item % bullet point +% \@glstarget{glo:##1}{##2}% the entry name +% \space (##4)% the symbol in brackets +% \space ##3% the description +% \space [##5]% the number list in square brackets +% }% +% } +%\end{verbatim} % -%One more thing to remember is that when you are redefining a command -%within the argument to another command, you must use \verb|##1|, -%\verb|##2|, etc instead of \verb|#1|, \verb|#2|, etc. For examples, -%look at the way the predefined styles are defined in -%\autoref{sec:styles}. -% -%\DescribeMacro{\glsgroupskip} -%\noindent\cs{glsgroupskip}\par\noindent -%This macro determines what to do after one logical group but before -%the header for the next logical group. The \glostyle{list} glossary -%style simply redefines \cs{glsgroupskip} to be \cs{indexspace}. -% -%For further details on creating or modifying glossary styles see -%\autoref{sec:printglos} and \autoref{sec:styles}. +%\subsubsection{Example: creating a new glossary style based on an +%existing style} +% +%\changes{1.11}{2008 March 1}{Fixed error in manual (glossary style +%is set using 'glossarystyle not 'setglossarystyle)}% +%If you want to define a new style that is a slightly modified +%version of an existing style, you can use \cs{glossarystyle} +%within the second argument of \cs{newglossarystyle} followed by +%whatever alterations you require. For example, suppose you want +%a style like the \glostyle{list} style but you don't want the extra +%vertical space created by \cs{indexspace} between groups, then you +%can create a new glossary style called, say, \texttt{mylist} as +%follows: +%\begin{verbatim} +%\newglossarystyle{mylist}{% +%\glossarystyle{list}% base this style on the list style +%\renewcommand{\glsgroupskip}{}% make nothing happen between groups +%} +%\end{verbatim} % -% \StopEventually{\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex} +% \StopEventually{\clearpage\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex} % % % @@ -1232,13 +1894,20 @@ % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2007/10/13 v1.08 (NLCT)] +\ProvidesPackage{glossaries}[2008/02/22 v1.11 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] -\RequirePackage{xspace} +% \end{macrocode} +%\changes{1.1}{2008 Feb 22}{amsgen now loaded (\cs{new@ifnextchar} needed)} +% Need to use \cs{new@ifnextchar} instead of \cs{@ifnextchar} in +% commands that have a final optional argument (such as \ics{gls}) +% so require \isty{amsgen}. +% Thanks to Morten~H{\o}gholm for suggesting this. +% \begin{macrocode} +\RequirePackage{amsgen} % \end{macrocode} % % \subsection{Package Options}\label{sec:pkgopt} @@ -1248,6 +1917,13 @@ % \begin{macrocode} \define@boolkey{glossaries.sty}[gls]{toc}[true]{} % \end{macrocode} +%\changes{1.1}{2008 Feb 22}{numberline option added} +% The \pkgopt{numberline} package option adds \cs{numberline} to +% \cs{addcontentsline}. Note that this option only has an effect +% if used in with \pkgopt[true]{toc}. +% \begin{macrocode} +\define@boolkey{glossaries.sty}[gls]{numberline}[true]{} +% \end{macrocode} % % The sectional unit used to start the glossary is stored in % \cs{@@glossarysec}. If chapters are defined, this @@ -1264,18 +1940,44 @@ % 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}. +% \ics{glossarysection}. % \begin{macrocode} \define@choicekey{glossaries.sty}{section}{part,chapter,section,% subsection,subsubsection,paragraph,subparagraph}[section]{% \renewcommand*{\@@glossarysec}{#1}} % \end{macrocode} +%\changes{1.1}{2008 Feb 22}{numberedsection option added} +% Determine whether or not to use numbered sections. +%\begin{macro}{\@@glossarysecstar} +% \begin{macrocode} +\newcommand*{\@@glossarysecstar}{*} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@@glossaryseclabel} +% \begin{macrocode} +\newcommand*{\@@glossaryseclabel}{} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\define@choicekey{glossaries.sty}{numberedsection}[\val\nr]{% +false,nolabel,autolabel}[nolabel]{% +\ifcase\nr\relax + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{}% +\or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{}% +\or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{\label{\@glo@type}}% +\fi} +% \end{macrocode} % % The default glossary style is stored in % \cs{@glossary@default@style}. This is initialised to % \texttt{list}. (The \glostyle{list} style is -% defined in the accompanying \styname{glossary-list} package -% described in \autoref{sec:styles}.) +% defined in the accompanying \isty{glossary-list} package +% described in \autoref{sec:code:styles}.) %\begin{macro}{\@glossary@default@style} % \begin{macrocode} \newcommand*{\@glossary@default@style}{list} @@ -1287,7 +1989,7 @@ subsection,subsubsection,paragraph,subparagraph}[section]{% % 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}. +% \autoref{sec:code:styles}. % \begin{macrocode} \define@key{glossaries.sty}{style}{% \renewcommand*{\@glossary@default@style}{#1}} @@ -1321,7 +2023,7 @@ subsection,subsubsection,paragraph,subparagraph}[section]{% % 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 +% \ics{loadglsentries} can temporarily change % \cs{glsdefaulttype} while it loads a file containing % new glossary entries (see \autoref{sec:load}). %\begin{macro}{\glsdefaulttype} @@ -1348,7 +2050,7 @@ subsection,subsubsection,paragraph,subparagraph}[section]{% % is stored in \cs{glscounter}. This is initialised to the % page counter. This is used as the default counter when a % new glossary is defined, unless a different counter is specified -% in the optional argument to \icmdname{newglossary} (see +% in the optional argument to \ics{newglossary} (see % \autoref{sec:newglos}). %\begin{macro}{\glscounter} % \begin{macrocode} @@ -1366,15 +2068,15 @@ subsection,subsubsection,paragraph,subparagraph}[section]{% % \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 +% \ics{newglossaryentry}. However, strange results will occur % if you then use those fields in the document. As these fields % are not normally used in the document, but are by default only % used in the glossary, the default is to sanitize them. If however % you want to use these values in the document (either by redefining -% commands like \icmdname{glsdisplay} or by using commands like -% \icmdname{glsentrydesc}) you will have to switch off the +% commands like \ics{glsdisplay} or by using commands like +% \ics{glsentrydesc}) you will have to switch off the % sanitization using the \pkgopt{sanitize} package option, but -% you will then have to use \icmdname{protect} to protect fragile +% you will then have to use \ics{protect} to protect fragile % commands when defining new glossary entries. % The \pkgopt{sanitize} option % takes a key-value list as its value, which can be used to @@ -1458,6 +2160,48 @@ name=true]{% }{\setkeys[gls]{sanitize}{#1}}% } % \end{macrocode} +%\changes{1.1}{2008 Feb 22}{translate option added} +% Define \pkgopt{translate} option. If false don't set up +% multi-lingual support. +% \begin{macrocode} +\define@boolkey{glossaries.sty}[gls]{translate}[true]{} +% \end{macrocode} +% Set the default value: +% \begin{macrocode} +\glstranslatefalse +\@ifpackageloaded{translator}{\glstranslatetrue}{% +\@ifpackageloaded{babel}{\glstranslatetrue}{}} +% \end{macrocode} +% Set the long form of the acronym in footnote on first use. +% \begin{macrocode} +\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% +\ifthenelse{\boolean{glsacrdescription}}{}% +{\renewcommand*{\@gls@sanitizedesc}{}}% +} +% \end{macrocode} +% Allow acronyms to have a description (needs to be set using +% the \gloskey{description} key in the optional argument of +% \ics{newacronym}). +% \begin{macrocode} +\define@boolkey{glossaries.sty}[glsacr]{description}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% +} +% \end{macrocode} +% Define \ics{newacronym} to set the short form in small capitals. +% \begin{macrocode} +\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% +} +% \end{macrocode} +% Define \ics{newacronym} to always use the long forms +% (i.e.\ don't use acronyms) +% \begin{macrocode} +\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% +} +% \end{macrocode} +% +% % Process package options: % \begin{macrocode} \ProcessOptionsX @@ -1487,7 +2231,7 @@ name=true]{% %\subsection{Default values}\label{sec:predefinednames} % This section sets up default values that are used by this % package. Some of the names may already be defined (e.g.\ by -% \styname{babel}) so \cs{providecommand} is used. +% \isty{babel}) so \cs{providecommand} is used. % % Main glossary title: %\begin{macro}{\glossaryname} @@ -1544,199 +2288,82 @@ name=true]{% % babel support}. Thanks to everyone who contributed to the % translations from both comp.text.tex and via email. % \begin{macrocode} -\@ifpackageloaded{babel}{% +\ifglstranslate +% \end{macrocode} +% If \isty{translator} is not install, used standard +% \isty{babel} captions, otherwise load \isty{translator} +% dictionary. +%\changes{1.1}{2008 Feb 22}{Added support for translator package} +% \begin{macrocode} +\@ifpackageloaded{translator}{\usedictionary{glossaries-dictionary}% +\renewcommand*{\glossaryname}{\translate{Glossary}}% +\renewcommand*{\acronymname}{\translate{Acronyms}}% +\renewcommand*{\entryname}{\translate{Notation (glossaries)}}% +\renewcommand*{\descriptionname}{\translate{Description (glossaries)}}% +\renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}% +\renewcommand*{\pagelistname}{\translate{Page List (glossaries)}}% +\renewcommand*{\glssymbolsgroupname}{\translate{Symbols (glossaries)}}% +\renewcommand*{\glsnumbersgroupname}{\translate{Numbers (glossaries)}}% +}{% +\@ifpackageloaded{babel}{\RequirePackage{glossaries-babel}}{}} +\fi % \end{macrocode} -% English: +% The description terminator is given by \cs{glspostdescription} +% (except for the 3 and 4 column styles). This is a full stop +% by default: +%\begin{macro}{\glspostdescription} % \begin{macrocode} -\addto\captionsenglish{% -\renewcommand*{\glossaryname}{Glossary}% -\renewcommand*{\acronymname}{Acronyms}% -\renewcommand*{\entryname}{Notation}% -\renewcommand*{\descriptionname}{Description}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Page List}% -\renewcommand*{\glssymbolsgroupname}{Symbols}% -\renewcommand*{\glsnumbersgroupname}{Numbers}% -}% +\newcommand*{\glspostdescription}{.} % \end{macrocode} -% German (quite a few variations were suggested for German, -% I settled on the following): +%\end{macro} +% +% The name of the \appname{makeindex} style file is given by +% \cs{istfilename}. This file is +% created by \ics{writeist} (which is used by +% \ics{makeglossaries}) so +% redefining this command will only have an effect if it is +% done \emph{before} the \filetype{.ist} file is created. +%\begin{macro}{\istfilename} % \begin{macrocode} -\addto\captionsgerman{% -\renewcommand*{\glossaryname}{Glossar}% -\renewcommand*{\acronymname}{Akronyme}% -\renewcommand*{\entryname}{Bezeichnung}% -\renewcommand*{\descriptionname}{Beschreibung}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Seiten}% -\renewcommand*{\glssymbolsgroupname}{Symbole}% -\renewcommand*{\glsnumbersgroupname}{Zahlen}} +\providecommand*{\istfilename}{\jobname.ist} % \end{macrocode} -% ngerman is identical to German: +%\end{macro} +% The \appname{makeglossaries} Perl script picks up this name +% from the auxiliary file and passes it to \appname{makeindex} +% using the \texttt{-s} option. Since its not required by +% \LaTeX, \cs{@istfilename} ignores its argument. +%\begin{macro}{\@istfilename} % \begin{macrocode} -\addto\captionsngerman{% -\renewcommand*{\glossaryname}{Glossar}% -\renewcommand*{\acronymname}{Akronyme}% -\renewcommand*{\entryname}{Bezeichnung}% -\renewcommand*{\descriptionname}{Beschreibung}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Seiten}% -\renewcommand*{\glssymbolsgroupname}{Symbole}% -\renewcommand*{\glsnumbersgroupname}{Zahlen}} +\newcommand*{\@istfilename}[1]{} % \end{macrocode} -% Italian: +%\end{macro} +% +% This command is the value of the \istkey{page\_compositor} +% \appname{makeindex} key. Again, any redefinition of this command +% must take place \emph{before} \cs{writeist} otherwise it +% will have no effect. +%\begin{macro}{\glscompositor} % \begin{macrocode} -\addto\captionsitalian{% -\renewcommand*{\glossaryname}{Glossario}% -\renewcommand*{\acronymname}{Acronimi}% -\renewcommand*{\entryname}{Nomenclatura}% -\renewcommand*{\descriptionname}{Descrizione}% -\renewcommand*{\symbolname}{Simbolo}% -\renewcommand*{\pagelistname}{Elenco delle pagine}% -\renewcommand*{\glssymbolsgroupname}{Simboli}% -\renewcommand*{\glsnumbersgroupname}{Numeri}} +\newcommand{\glscompositor}{.} % \end{macrocode} -% Dutch: +%\end{macro} +% (The page compositor is usually defined as a dash when using +% \appname{makeindex}, but most of the standard counters used +% by \LaTeX\ use a full stop as the compositor, which is why I +% have used it as the default.) +% +% The command \cs{glsnumberformat} indicates the default +% format for the page numbers in the glossary. (Note that this +% is not the same as \ics{glossaryentrynumbers}, but applies +% to individual numbers or groups of numbers within an entry's +% associated number list.) If hyperlinks are defined, it will use +% \ics{glshypernumber}, otherwise it will simply display its +% argument ``as is''. +%\begin{macro}{\glsnumberformat} % \begin{macrocode} -\addto\captionsdutch{% -\renewcommand*{\glossaryname}{Woordenlijst}% -\renewcommand*{\acronymname}{Acroniemen}% -\renewcommand*{\entryname}{Benaming}% -\renewcommand*{\descriptionname}{Beschrijving}% -\renewcommand*{\symbolname}{Symbool}% -\renewcommand*{\pagelistname}{Pagina's}% -\renewcommand*{\glssymbolsgroupname}{Symbolen}% -\renewcommand*{\glsnumbersgroupname}{Cijfers}} -% \end{macrocode} -% Spanish: -% \begin{macrocode} -\addto\captionsspanish{% -\renewcommand*{\glossaryname}{Glosario}% -\renewcommand*{\acronymname}{Siglas}% -\renewcommand*{\entryname}{Entrada}% -\renewcommand*{\descriptionname}{Descripci\'on}% -\renewcommand*{\symbolname}{S\'{\i}mbolo}% -\renewcommand*{\pagelistname}{Lista de p\'aginas}% -\renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}% -\renewcommand*{\glsnumbersgroupname}{N\'umeros}} -% \end{macrocode} -% French: -% \begin{macrocode} -\addto\captionsfrench{% -\renewcommand*{\glossaryname}{Glossaire}% -\renewcommand*{\acronymname}{Acronymes}% -\renewcommand*{\entryname}{Terme}% -\renewcommand*{\descriptionname}{Description}% -\renewcommand*{\symbolname}{Symbole}% -\renewcommand*{\pagelistname}{Pages}% -\renewcommand*{\glssymbolsgroupname}{Symboles}% -\renewcommand*{\glsnumbersgroupname}{Nombres}} -% \end{macrocode} -% Danish: -% \begin{macrocode} -\addto\captionsdanish{% -\renewcommand*{\glossaryname}{Ordliste}% -\renewcommand*{\acronymname}{Akronymer}% -\renewcommand*{\entryname}{Symbolforklaring}% -\renewcommand*{\descriptionname}{Beskrivelse}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Side}% -\renewcommand*{\glssymbolsgroupname}{Symboler}% -\renewcommand*{\glsnumbersgroupname}{Tal}} -% \end{macrocode} -% Irish: -% \begin{macrocode} -\addto\captionsirish{% -\renewcommand*{\glossaryname}{Gluais}% -\renewcommand*{\acronymname}{Acrainmneacha}% 'Acronyms' -% \end{macrocode} -% wasn't sure whether to go for N\'ota (Note), Ciall (`Meaning', -% `sense') ot Br\'{\i} (`Meaning'). In the end I chose Ciall. -% \begin{macrocode} -\renewcommand*{\entryname}{Ciall}% -\renewcommand*{\descriptionname}{Tuairisc}% -% \end{macrocode} -% Again, not sure whether to use Comhartha/Comhartha\'{\i} or -% Siombail/Siombaile, so have chosen the former. -% \begin{macrocode} -\renewcommand*{\symbolname}{Comhartha}% -\renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}%OR -\renewcommand*{\pagelistname}{Leathanaigh}% -\renewcommand*{\glsnumbersgroupname}{Uimhreacha}} -% \end{macrocode} -% Hungarian: -% \begin{macrocode} -\addto\captionsmagyar{% -\renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}% -\renewcommand*{\acronymname}{Bet\H uszavak}% -\renewcommand*{\entryname}{Kifejez\'es}% -\renewcommand*{\descriptionname}{Magyar\'azat}% -\renewcommand*{\symbolname}{Jel\"ol\'es}% -\renewcommand*{\pagelistname}{Oldalsz\'am}% -\renewcommand*{\glssymbolsgroupname}{Jelek}% -\renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}% -} -% \end{macrocode} -% babel not loaded: -% \begin{macrocode} -}{} -% \end{macrocode} -% The description terminator is given by \cs{glspostdescription} -% (except for the 3 and 4 column styles). This is a full stop -% by default: -%\begin{macro}{\glspostdescription} -% \begin{macrocode} -\newcommand*{\glspostdescription}{.} -% \end{macrocode} -%\end{macro} -% -% The name of the \appname{makeindex} style file is given by -% \cs{istfilename}. This file is -% created by \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{macro}{\istfilename} -% \begin{macrocode} -\providecommand*{\istfilename}{\jobname.ist} -% \end{macrocode} -%\end{macro} -% The \appname{makeglossaries} Perl script picks up this name -% from the auxiliary file and passes it to \appname{makeindex} -% using the \texttt{-s} option. Since its not required by -% \LaTeX, \cs{@istfilename} ignores its argument. -%\begin{macro}{\@istfilename} -% \begin{macrocode} -\newcommand*{\@istfilename}[1]{} -% \end{macrocode} -%\end{macro} -% -% This command is the value of the \istkey{page\_compositor} -% \appname{makeindex} key. Again, any redefinition of this command -% must take place \emph{before} \cs{writeist} otherwise it -% will have no effect. -%\begin{macro}{\glscompositor} -% \begin{macrocode} -\newcommand{\glscompositor}{.} -% \end{macrocode} -%\end{macro} -% (The page compositor is usually defined as a dash when using -% \appname{makeindex}, but most of the standard counters used -% by \LaTeX\ use a full stop as the compositor, which is why I -% have used it as the default.) -% -% The command \cs{glsnumberformat} indicates the default -% format for the page numbers in the glossary. (Note that this -% is not the same as \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{macro}{\glsnumberformat} -% \begin{macrocode} -\@ifundefined{hyperlink}{% -\newcommand*{\glsnumberformat}[1]{#1}}{% -\newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}} +\@ifundefined{hyperlink}{% +\newcommand*{\glsnumberformat}[1]{#1}}{% +\newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} % Individual numbers in an entry's associated number list are @@ -1768,9 +2395,9 @@ name=true]{% % change \cs{glossarypreamble}.) The preamble is empty by % default. If you have multiple glossaries, and you want a % different preamble for each glossary, you will need to use -% \icmdname{printglossary} for each glossary type, instead of -% \icmdname{printglossaries}, and redefine \cs{glossarypreamble} -% before each \icmdname{printglossary}. +% \ics{printglossary} for each glossary type, instead of +% \ics{printglossaries}, and redefine \cs{glossarypreamble} +% before each \ics{printglossary}. %\begin{macro}{\glossarypreamble} % \begin{macrocode} \newcommand*{\glossarypreamble}{} @@ -1782,7 +2409,7 @@ name=true]{% % 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 +% text after \ics{printglossary}, but if you only want the % postamble to appear after the first glossary, but not after % subsequent glossaries, you can do something like: %\begin{verbatim} @@ -1798,7 +2425,7 @@ name=true]{% % The sectioning command that starts a glossary is given by % \cs{glossarysection}. (This does not form part of the % glossary style, and so should not be changed by a glossary -% style.) If \icmdname{phantomsection} +% style.) If \ics{phantomsection} % is defined, it uses \cs{\@p@glossarysection}, otherwise it % uses \cs{@glossarysection}. %\changes{1.05}{2007 Aug 10}{added '@mkboth to 'glossarysection} @@ -1815,31 +2442,52 @@ name=true]{% % % The required sectional unit is given by \cs{@@glossarysec} % which was defined by the \pkgopt{section} package option. The -% starred form of the command is chosen. If you want a numbered -% section for the glossary or if you don't want any sectional +% starred form of the command is chosen. If you don't want any sectional % command, you will need to redefine \cs{glossarysection}. +% The sectional unit can be changed, if different sectional units +% are required. +%\begin{macro}{\setglossarysection} +%\changes{1.1}{2008 Feb 22}{new} +% \begin{macrocode} +\newcommand*{\setglossarysection}[1]{% +\setkeys{glossaries.sty}{section=#1}} +% \end{macrocode} +%\end{macro} % %The command \cs{@glossarysection} indicates how to start -% the glossary section if \icmdname{phantomsection} is not defined. +% the glossary section if \ics{phantomsection} is not defined. %\begin{macro}{\@glossarysection} +%\changes{1.1}{2008 Feb 22}{numbered sections and auto label added} % \begin{macrocode} \newcommand*{\@glossarysection}[2]{% -\csname\@@glossarysec\endcsname*{#2}% -\@gls@toc{#1}{\@@glossarysec}} +\ifx\@@glossarysecstar\@empty + \csname\@@glossarysec\endcsname{#2}% +\else + \csname\@@glossarysec\endcsname*{#2}% + \@gls@toc{#1}{\@@glossarysec}% +\fi +\@@glossaryseclabel} % \end{macrocode} %\end{macro} % % As \cs{@glossarysection}, but put in -% \icmdname{phantomsection}, and swap where \cs{@gls@toc} goes. +% \ics{phantomsection}, and swap where \cs{@gls@toc} goes. % If using chapters do a \cs{clearpage}. This ensures that % the hyper link from the table of contents leads to the line above % the heading, rather than the line below it. %\begin{macro}{\@p@glossarysection} +%\changes{1.1}{2008 Feb 22}{numbered sections and auto label added} % \begin{macrocode} \newcommand*{\@p@glossarysection}[2]{% \gls@doclearpage -\phantomsection\@gls@toc{#1}{\@@glossarysec}% -\csname\@@glossarysec\endcsname*{#2}} +\phantomsection +\ifx\@@glossarysecstar\@empty + \csname\@@glossarysec\endcsname{#2}% +\else + \@gls@toc{#1}{\@@glossarysec}% + \csname\@@glossarysec\endcsname*{#2}% +\fi +\@@glossaryseclabel} % \end{macrocode} %\end{macro} % @@ -1858,13 +2506,20 @@ name=true]{% % % The glossary is added to the table of contents if glstoc flag set. % If it is set, \cs{@gls@toc} will add a line to the -% \filetype{toc} file, otherwise it will do nothing. +% \filetype{.toc} file, otherwise it will do nothing. % (The first argument to \cs{@gls@toc} is the title for the % table of contents, the second argument is the sectioning type.) %\begin{macro}{\@gls@toc} +%\changes{1.1}{2008 Feb 22}{numberline added} % \begin{macrocode} \newcommand*{\@gls@toc}[2]{% -\ifglstoc \addcontentsline{toc}{#2}{#1}\fi} +\ifglstoc + \ifglsnumberline + \addcontentsline{toc}{#2}{\numberline{}#1}% + \else + \addcontentsline{toc}{#2}{#1}% + \fi +\fi} % \end{macrocode} %\end{macro} % @@ -1971,7 +2626,7 @@ been defined.}{}}{#2}} % in \cs{@glo@types}. When a new glossary type % is created, its identifying name is added to this list. % This is used by commands that iterate through all glossaries -% (such as \icmdname{makeglossaries} and \icmdname{printglossaries}.) +% (such as \ics{makeglossaries} and \ics{printglossaries}.) %\begin{macro}{\@glo@types} % \begin{macrocode} \newcommand*{\@glo@types}{,} @@ -1983,12 +2638,12 @@ been defined.}{}}{#2}} %\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 +% input file (read in by \ics{printglossary} and created by % \appname{makeindex}), \meta{out-ext} is the extension of the % glossary output file which is read in by \appname{makeindex} -% (lines are written to this file by the \icmdname{glossary} command), +% (lines are written to this file by the \ics{glossary} command), % \meta{title} is the title of the glossary that is used in -% \icmdname{glossarysection} and +% \ics{glossarysection} and % \meta{counter} is the default counter to be used by entries % belonging to this glossary. The \appname{makeglossaries} Perl % script reads in the relevant extensions from the auxiliary file, @@ -2024,7 +2679,7 @@ exists}% % How to display this entry in the document text (uses % \cs{glsdisplay} and \cs{glsdisplayfirst} by % default). These can be redefined by the user later if required -% (see \icmdname{defglsdisplay} and \icmdname{defglsdisplayfirst}) +% (see \ics{defglsdisplay} and \ics{defglsdisplayfirst}) % \begin{macrocode} \expandafter\gdef\csname gls@#2@display\endcsname{% \glsdisplay}% @@ -2033,7 +2688,7 @@ exists}% % \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.) +% \ics{glscounter} if no optional argument is present.) % \begin{macrocode} \@ifnextchar[{\@gls@setcounter{#2}}{\@gls@setcounter{#2}[\glscounter]}}} % \end{macrocode} @@ -2044,7 +2699,7 @@ exists}% % \end{macrocode} %\cs{@newglossary} is used to specify the file extensions % for the \appname{makeindex} input, output and transcript files. -% It is written to the auxiliary file by \icmdname{newglossary}. +% It is written to the auxiliary file by \ics{newglossary}. % Since it is not used by \LaTeX, \cs{@newglossary} simply % ignores its arguments. %\begin{macro}{\@newglossary} @@ -2072,7 +2727,7 @@ exists}% %\end{macro} % % Define the main glossary. This will be the first glossary to -% be displayed when using \icmdname{printglossaries}. +% be displayed when using \ics{printglossaries}. % \begin{macrocode} \newglossary{main}{gls}{glo}{\glossaryname} % \end{macrocode} @@ -2100,8 +2755,8 @@ exists}% % % 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, +% \ics{glsdisplay} and \ics{glsdisplayfirst} (or +% using \ics{defglsdisplay} and \ics{defglsdisplayfirst}), however, % you will have to disable the sanitize option (using the % \pkgopt{sanitize} package option, % "sanitize={description=false}", and protect fragile @@ -2174,12 +2829,12 @@ exists}% % 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. +% \ics{glossaryentryfield} so that it uses its fourth parameter. % If you want this value to appear in the text when the term is used -% by commands like \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.) +% by commands like \ics{gls}, you will need to change +% \ics{glsdisplay} and \ics{glsdisplayfirst} (either +% explicitly for all glossaries or via \ics{defglsdisplay} +% and \ics{defglsdisplayfirst} for individual glossaries.) % \begin{macrocode} \define@key{glossentry}{symbol}{% \def\@glo@symbol{#1}% @@ -2289,7 +2944,7 @@ in it}}{% % Each glossary entry is assigned a conditional of the form %\cs{ifglo@}\meta{label}\texttt{@flag} which determines % whether or not the entry has been used (see also -% \icmdname{ifglsused} defined below.) These flags can +% \ics{ifglsused} defined below.) These flags can % be set and unset using the following macros: % % The command \cs{glsreset}\marg{label} can be used @@ -2368,8 +3023,8 @@ in it}}{% % \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 +% These external files can contain \ics{newglossaryentry} +% and \ics{newacronym} commands.\footnote{and any other valid %\LaTeX\ code that can be used in the preamble.}\\[10pt] % \cs{loadglsentries}\oarg{type}\marg{filename}\\[10pt] % This command will input the file using \cs{input}. @@ -2377,8 +3032,8 @@ in it}}{% % 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} +% \ics{glslink}, \ics{gls}, \ics{glspl} and uppercase +% variants or \ics{glsadd} and \ics{glsaddall} % will appear in the glossary.) The mandatory argument is % the filename (with or without .tex extension.) %\begin{macro}{\loadglsentries} @@ -2397,15 +3052,15 @@ in it}}{% %\subsection{Using glossary entries in the text} %\label{sec:code:glslink} % -% Any term that has been defined using \icmdname{newglossaryentry} -% (or \icmdname{newacronym}) can be displayed in the text +% Any term that has been defined using \ics{newglossaryentry} +% (or \ics{newacronym}) can be displayed in the text % (i.e.\ outside of the glossary) using % one of the commands defined in this section. Unless you use -% \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 +% \ics{glslink}, the way the term appears in the text is +% determined by \ics{glsdisplayfirst} (if it is the first +% time the term has been used) or \ics{glsdisplay} (for % subsequent use.) Any formatting commands (such as \cs{textbf} -% is governed by \icmdname{glstextformat}. By default this just +% is governed by \ics{glstextformat}. By default this just % displays the \term{link text} ``as is''. %\changes{1.04}{2007 Aug 3}{Added 'glstextformat}% %\begin{macro}{\glstextformat} @@ -2421,7 +3076,7 @@ in it}}{% % \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}. +% argument to commands like \ics{gls} and \ics{glspl}. % The default is to display the first parameter followed by the % additional text. %\begin{macro}{\glsdisplayfirst} @@ -2437,7 +3092,7 @@ in it}}{% % \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}. +% argument to commands like \ics{gls} and \ics{glspl}. %\begin{macro}{\glsdisplay} % \begin{macrocode} \newcommand*{\glsdisplay}[4]{#1#4} @@ -2448,14 +3103,14 @@ in it}}{% % and \cs{glsdisplay} as the default way of displaying its % entry in the text. This can be changed for the entries belonging % to an individual glossary using -% \icmdname{defglsdisplay} and \icmdname{defglsdisplayfirst}. +% \ics{defglsdisplay} and \ics{defglsdisplayfirst}. %\\[10pt] % \cs{defglsdisplay}\oarg{type}\marg{definition}\\[10pt]% % The glossary type is given by \meta{type} (the default glossary % if omitted) and % \meta{definition} should have at most \verb|#1|, \verb|#2|, % \verb|#3| and \verb|#4|. These represent the same arguments -% as those described for \icmdname{glsdisplay}. +% as those described for \ics{glsdisplay}. %\begin{macro}{\defglsdisplay} % \begin{macrocode} \newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% @@ -2468,7 +3123,7 @@ in it}}{% % 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}. +% as those described for \ics{glsdisplayfirst}. %\begin{macro}{\defglsdisplayfirst} % \begin{macrocode} \newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% @@ -2483,7 +3138,7 @@ in it}}{% % the commands like \cs{gls} have a final optional % argument that can be used to insert additional text in the % link (this will usually be appended, but can be redefined using -% \icmdname{defglsdisplay} and \icmdname{defglsdisplayfirst}). +% \ics{defglsdisplay} and \ics{defglsdisplayfirst}). % It goes against the \LaTeX\ norm to have an optional % argument after the mandatory arguments, but it makes more % sense to write, say, \verb|\gls{label}['s]| rather than, say, @@ -2491,7 +3146,8 @@ in it}}{% % 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. +% to ignore following spaces, so \cs{new@ifnextchar} from the +% \isty{amsgen} package is required. % % The following keys can be used in the first optional % argument. The \gloskey[glslink]{counter} key checks that the @@ -2597,7 +3253,6 @@ counter as its value}}{% % if there is nothing else), % otherwise set \cs{@glo@prefix} to nothing and % \cs{@glo@suffix} to all of it. -%\begin{macro}{\@glo@check@mkidxrangechar} % \begin{macrocode} \def\@glo@check@mkidxrangechar#1#2\@nil{% \if#1(\relax @@ -2620,7 +3275,6 @@ counter as its value}}{% \fi \fi} % \end{macrocode} -%\end{macro} % Catch \appname{makeindex} special characters\mkidxspch: %\begin{macro}{\@gls@checkmkidxchars} % \begin{macrocode} @@ -2655,10 +3309,17 @@ counter as its value}}{% \def\@gls@updatechecked#1\@nil#2{\def#2{#1}} % \end{macrocode} %\end{macro} +%\begin{macro}{\@gls@tmpb} +%\changes{1.1}{2008 Feb 22}{changed \cs{toksdef} to \cs{newtoks}} +% Define temporary token +% \begin{macrocode} +\newtoks\@gls@tmpb +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkquote} % Replace \verb|"| with \verb|""| since \verb|"| is a makeindex % special character\mkidxspch. % \begin{macrocode} -\toksdef\@gls@tmpb=2 \def\@gls@checkquote#1"#2"#3\null{% \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% \toks@={#1}% @@ -2682,6 +3343,8 @@ counter as its value}}{% \fi \@@gls@checkquote} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkescquote} % Do the same for \verb|\"|: % \begin{macrocode} \def\@gls@checkescquote#1\"#2\"#3\null{% @@ -2708,6 +3371,8 @@ counter as its value}}{% \fi \@@gls@checkescquote} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkescactual} % Similarly for \verb|\?| (which is replaces @ as % \appname{makeindex}'s special character): % \begin{macrocode} @@ -2735,6 +3400,8 @@ counter as its value}}{% \fi \@@gls@checkescactual} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkescbar} % Similarly for \verb"\|": % \begin{macrocode} \def\@gls@checkescbar#1\|#2\|#3\null{% @@ -2761,6 +3428,8 @@ counter as its value}}{% \fi \@@gls@checkescbar} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkesclevel} % Similarly for \verb"\!": % \begin{macrocode} \def\@gls@checkesclevel#1\!#2\!#3\null{% @@ -2787,6 +3456,8 @@ counter as its value}}{% \fi \@@gls@checkesclevel} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkbar} % and for \verb"|": % \begin{macrocode} \def\@gls@checkbar#1|#2|#3\null{% @@ -2812,6 +3483,8 @@ counter as its value}}{% \fi \@@gls@checkbar} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checklevel} % and for \verb"!": % \begin{macrocode} \def\@gls@checklevel#1!#2!#3\null{% @@ -2837,6 +3510,8 @@ counter as its value}}{% \fi \@@gls@checklevel} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@checkactual} % and for \verb"?": % \begin{macrocode} \def\@gls@checkactual#1?#2?#3\null{% @@ -2862,12 +3537,13 @@ counter as its value}}{% \fi \@@gls@checkactual} % \end{macrocode} +%\end{macro} % -% If \icmdname{hyperlink} +% If \ics{hyperlink} % is not defined, \cs{@glslink} and \cs{@glstarget} % ignore their first argument, and just do the second argument, -% otherwise they are equivalent to \icmdname{hyperlink} and -%\icmdname{hypertarget}. +% otherwise they are equivalent to \ics{hyperlink} and +%\ics{hypertarget}. % \begin{macrocode} \@ifundefined{hyperlink}{% \gdef\@glslink#1#2{#2}\gdef\@glstarget#1#2{#2}% @@ -2901,12 +3577,12 @@ counter as its value}}{% % 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}, +% \ics{glslink}\igloskey[glslink]{hyper}\igloskey[glslink]{format}\igloskey[glslink]{counter}, % the mandatory argument is the entry label. % After the mandatory argument, there is another optional argument % to insert extra text in the link text (the location of the inserted -% text is governed by \icmdname{glsdisplay} and -% \icmdname{glsdisplayfirst}). As with \cs{glslink} +% text is governed by \ics{glsdisplay} and +% \ics{glsdisplayfirst}). As with \cs{glslink} % there is a starred version which is the same as the unstarred % version but with the \gloskey[glslink]{hyper} key set to \texttt{false}. % (Additional options can also be specified @@ -2929,7 +3605,7 @@ counter as its value}}{% %\begin{macro}{\@gls} % \begin{macrocode} \newcommand*{\@gls}[2][]{% -\@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}} +\new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}} % \end{macrocode} %\end{macro} % Read in the final optional argument: @@ -2937,6 +3613,11 @@ counter as its value}}{% \def\@gls@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#2}% +% \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) % \begin{macrocode} @@ -2947,15 +3628,24 @@ counter as its value}}{% \csname gls@\@glo@type @displayfirst\endcsname {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% % \end{macrocode} -% Call \cs{@gls@link} +% Call \cs{@gls@link}. +% If \pkgopt{footnote} package option has been used, suppress +% hyperlink for first use. % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + \else + \@gls@link[#1]{#2}{\@glo@text}% + \fi +}% % \end{macrocode} -% Indicate that this entry has now been used, and add a space if -% appropriate +% Indicate that this entry has now been used % \begin{macrocode} \glsunset{#2}}% -\xspace} +} % \end{macrocode} % % \cs{Gls} behaves like \cs{gls}, but the first letter @@ -2976,13 +3666,18 @@ counter as its value}}{% % a final optional argument % \begin{macrocode} \newcommand*{\@Gls}[2][]{% -\@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}} +\new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} \def\@Gls@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#2}% +% \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) % \begin{macrocode} @@ -2994,17 +3689,26 @@ counter as its value}}{% {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} +% If \pkgopt{footnote} package option has been used, suppress +% hyperlink for first use. % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\expandafter\MakeUppercase\@glo@text}% + \else + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \fi +}% % \end{macrocode} -% Indicate that this entry has now been used, and add a space if -% appropriate +% Indicate that this entry has now been used % \begin{macrocode} \glsunset{#2}}% -\xspace} +} % \end{macrocode} % -% \cs{GLS} behaves like \icmdname{gls}, but the link +% \cs{GLS} behaves like \ics{gls}, but the link % text is converted to uppercase: %\begin{macro}{\GLS} % \begin{macrocode} @@ -3019,13 +3723,18 @@ counter as its value}}{% % a final optional argument % \begin{macrocode} \newcommand*{\@GLS}[2][]{% -\@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}} +\new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} \def\@GLS@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#2}% +% \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) % \begin{macrocode} @@ -3037,17 +3746,26 @@ counter as its value}}{% {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} +% If \pkgopt{footnote} package option has been used, suppress +% hyperlink for first use. % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% + \else + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% + \fi +}% % \end{macrocode} -% Indicate that this entry has now been used, and add a space if -% appropriate +% Indicate that this entry has now been used % \begin{macrocode} \glsunset{#2}}% -\xspace} +} % \end{macrocode} % -% \cs{glspl} behaves in the same way as \icmdname{gls} except +% \cs{glspl} behaves in the same way as \ics{gls} except % it uses the plural form. %\begin{macro}{\glspl} % \begin{macrocode} @@ -3062,13 +3780,18 @@ counter as its value}}{% % a final optional argument % \begin{macrocode} \newcommand*{\@glspl}[2][]{% -\@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}} +\new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} \def\@glspl@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#2}% +% \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) % \begin{macrocode} @@ -3080,19 +3803,28 @@ counter as its value}}{% {\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} +% If \pkgopt{footnote} package option has been used, suppress +% hyperlink for first use. % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + \else + \@gls@link[#1]{#2}{\@glo@text}% + \fi +}% % \end{macrocode} -% Indicate that this entry has now been used, and add a space if -% appropriate +% Indicate that this entry has now been used % \begin{macrocode} \glsunset{#2}}% -\xspace} +} % \end{macrocode} % -% \cs{Glspl} behaves in the same way as \icmdname{glspl}, except +% \cs{Glspl} behaves in the same way as \ics{glspl}, except % that the first letter of the link text is converted to uppercase -% (as with \icmdname{Gls}, if the first letter has an accent, it +% (as with \ics{Gls}, if the first letter has an accent, it % will need to be grouped.) %\begin{macro}{\Glspl} % \begin{macrocode} @@ -3107,13 +3839,18 @@ counter as its value}}{% % a final optional argument % \begin{macrocode} \newcommand*{\@Glspl}[2][]{% -\@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}} +\new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} \def\@Glspl@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#2}% +% \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) % \begin{macrocode} @@ -3125,17 +3862,26 @@ counter as its value}}{% {\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} +% If \pkgopt{footnote} package option has been used, suppress +% hyperlink for first use. % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\expandafter\MakeUppercase\@glo@text}% + \else + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \fi +}% % \end{macrocode} -% Indicate that this entry has now been used, and add a space if -% appropriate +% Indicate that this entry has now been used % \begin{macrocode} \glsunset{#2}}% -\xspace} +} % \end{macrocode} % -% \cs{GLSpl} behaves like \icmdname{glspl} except that all the +% \cs{GLSpl} behaves like \ics{glspl} except that all the % link text is converted to uppercase. %\begin{macro}{\GLSpl} % \begin{macrocode} @@ -3150,13 +3896,18 @@ counter as its value}}{% % a final optional argument % \begin{macrocode} \newcommand*{\@GLSpl}[2][]{% -\@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}} +\new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} \def\@GLSpl@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#2}% +% \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) % \begin{macrocode} @@ -3168,2544 +3919,5746 @@ counter as its value}}{% {\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} +% If \pkgopt{footnote} package option has been used, suppress +% hyperlink for first use. % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% + \else + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% + \fi +}% % \end{macrocode} -% Indicate that this entry has now been used, and add a space if -% appropriate +% Indicate that this entry has now been used % \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. -% -% 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{macro}{\glsentryname} +% \cs{glstext} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{text} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glstext} % \begin{macrocode} -\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} +\newcommand*{\glstext}{\@ifstar\@sglstext\@glstext} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentryname} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentryname}[1]{\expandafter -\MakeUppercase\csname glo@#1@name\endcsname} +\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% Get the entry description (as specified by the -% \gloskey{description} when the entry was defined.) The argument -% is the label associated with the entry. Note that unless you -% used \texttt{description=false} in the \pkgopt{sanitize} package -% option you may get unexpected results if the \gloskey{description} -% key contained any commands. -%\begin{macro}{\glsentrydesc} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname} +\newcommand*{\@glstext}[2][]{% +\new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrydesc} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentrydesc}[1]{\expandafter -\MakeUppercase\csname glo@#1@desc\endcsname} +\def\@glstext@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -% Get the entry text, as specified by the \gloskey{text} key when -% the entry was defined. The argument -% is the label associated with the entry: -%\begin{macro}{\glsentrytext} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrytext} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentrytext}[1]{\expandafter -\MakeUppercase\csname glo@#1@text\endcsname} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} % -% Get the plural form: -%\begin{macro}{\glsentryplural} +% \cs{GLStext} behaves like \cs{glstext} except the text is converted +% to uppercase. +%\begin{macro}{\GLStext} % \begin{macrocode} -\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname} +\newcommand*{\GLStext}{\@ifstar\@sGLStext\@GLStext} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentryplural} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentryplural}[1]{\expandafter -\MakeUppercase\csname glo@#1@plural\endcsname} +\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% Get the symbol associated with this entry. The argument -% is the label associated with the entry. Note that unless you -% used \texttt{symbol=false} in the \pkgopt{sanitize} package -% option you may get unexpected results if the \gloskey{symbol} -% key contained any commands. -%\begin{macro}{\glsentrysymbol} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname} +\newcommand*{\@GLStext}[2][]{% +\new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrysymbol} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentrysymbol}[1]{\expandafter -\MakeUppercase\csname glo@#1@symbol\endcsname} +\def\@GLStext@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -% Get the entry text to be used when the entry is first used in -% the document (as specified by the \gloskey{first} key when -% the entry was defined.) -%\begin{macro}{\glsentryfirst} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryfirst} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentryfirst}[1]{\expandafter -\MakeUppercase\csname glo@#1@first\endcsname} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} % \end{macrocode} -%\end{macro} % -% Get the plural form (as specified by the \gloskey{firstplural} -% key when the entry was defined.) -%\begin{macro}{\glsentryfirstplural} +% \cs{Glstext} behaves like \cs{glstext} except that the first letter +% of the text is converted to uppercase. +%\begin{macro}{\Glstext} % \begin{macrocode} -\newcommand*{\glsentryfirstplural}[1]{% -\csname glo@#1@firstpl\endcsname} +\newcommand*{\Glstext}{\@ifstar\@sGlstext\@Glstext} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentryfirstplural} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentryfirstplural}[1]{% -\expandafter\MakeUppercase\csname glo@#1@firstpl\endcsname} +\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% Display the glossary type with which this entry is associated -% (as specified by the \gloskey{type} key used when the entry was -% defined) -%\begin{macro}{\glsentrytype} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname} +\newcommand*{\@Glstext}[2][]{% +\new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@Glstext@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} % -% Display the sort text used for this entry. Note that the -% \gloskey{sort} key is sanitize, so unexpected results may -% occur if the \gloskey{sort} key contained commands. -%\begin{macro}{\glsentrysort} +% \cs{glsfirst} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{first} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsfirst} % \begin{macrocode} -\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname} +\newcommand*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst} % \end{macrocode} %\end{macro} -% -%\subsection{Adding an entry to the glossary without generating -% text} -% The following keys are provided for \cs{glsadd} and -% \cs{glsaddall}: +% Define the starred form: % \begin{macrocode} -\define@key{glossadd}{counter}{\def\@glo@counter{#1}} -\define@key{glossadd}{format}{\def\@glo@format{#1}} +\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]} % \end{macrocode} -% This key is only used by \cs{glsaddall}: +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\define@key{glossadd}{types}{\def\@glo@type{#1}} +\newcommand*{\@glsfirst}[2][]{% +\new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} % \end{macrocode} -%\vskip5pt -%\cs{glsadd}\oarg{options}\marg{label}\\[10pt] -% Add a term to the glossary without generating any link text. -% The optional argument indicates which counter to use, -% and how to format it (using a key-value list) -% the second argument is the entry label. Note that \meta{options} -% only has two keys: \gloskey[glsadd]{counter} and \gloskey[glsadd]{format} (the \gloskey[glsaddall]{types} key will be ignored). -%\begin{macro}{\glsadd} -%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glsadd}[2][]{% -\glsdoifexists{#2}{% -\def\@glo@format{glsnumberformat}% -\edef\@glo@counter{\csname glo@#2@counter\endcsname}% -\setkeys{glossadd}{#1}% -\edef\theglsentrycounter{\expandafter\noexpand\csname the\@glo@counter\endcsname}% -\protected@edef\@glo@sort{\csname glo@#2@sort\endcsname}% -\@gls@checkmkidxchars\@glo@sort -\protected@edef\@@glo@name{\csname glo@#2@name\endcsname}% -\@gls@checkmkidxchars\@@glo@name -\protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}% -\protected@edef\@glo@desc{\csname glo@#2@desc\endcsname}% -\@gls@checkmkidxchars\@glo@desc -\protected@edef\@glo@symbol{\csname glo@#2@symbol\endcsname}% -\@gls@checkmkidxchars\@glo@symbol -\@set@glo@numformat\@glo@numfmt\@glo@counter\@glo@format -\glossary[\csname glo@#2@type\endcsname]{% -\@glo@sort\@gls@actualchar\string\glossaryentryfield -{#2}{\@glo@name}{\@glo@desc}{\@glo@symbol}\@gls@encapchar -\@glo@numfmt}% -}} +\def\@glsfirst@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -%\vskip5pt -%\cs{glsaddall}\oarg{glossary list}\\[10pt] -% Add all terms defined for the listed glossaries (without displaying -% any text.) If \gloskey[glsaddall]{types} key is omitted, apply to all -% glossary types. -%\begin{macro}{\glsaddall} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand*{\glsaddall}[1][]{% -\def\@glo@type{\@glo@types}% -\setkeys{glossadd}{#1}% -\forallglsentries[\@glo@type]{\@glo@entry}{% -\glsadd[#1]{\@glo@entry}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\@glo@text}% +}% } % \end{macrocode} -%\end{macro} -% -%\subsection{Creating associated files} -% The \cs{writeist} command creates the associated -% customized \filetype{ist} \appname{makeindex} style file. -% While defining this command, some characters have their -% catcodes temporarily changed to ensure they get written to -% the \filetype{ist} file correctly. The \appname{makeindex} -% actual character (usually "@") is redefined to be a "?", to allow -% internal commands to be written to the glossary file output file. % -% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar}, -% \cs{@gls@encapchar}, \cs{@glsl@levelchar} and -% \cs{@gls@quotechar} to make them easier to use later, -% but don't change these values, because the characters are -% encoded in the command definitions that are used to escape -% the special characters (which means that the user no longer -% needs to worry about \appname{makeindex} special characters.) -% -% The symbols and numbers label for group headings are hardwired into -% the \filetype{ist} file as \texttt{glssymbols} and -% \texttt{glsnumbers}, the group titles can be translated -% (so that \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}. -%\changes{1.01}{2007 May 17}{Added spaces after 'delimN and 'delimR in ist file}% -%\begin{macro}{\writeist} +% \cs{Glsfirst} behaves like \ics{glsfirst} except it displays the +% first letter in uppercase. +%\begin{macro}{\Glsfirst} % \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 +\newcommand*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst} % \end{macrocode} %\end{macro} -% -%The command \cs{noist} will suppress the creation of -% the \filetype{ist} file (it simply redefines -% \cs{writeist} to do nothing.) Obviously you need to use this -% command before \cs{writeist} to have any effect. Since -% the \filetype{ist} file should only be created once, \cs{noist} -% is called at the end of \cs{writeist}. -%\begin{macro}{\noist} +% Define the starred form: % \begin{macrocode} -\newcommand{\noist}{\let\writeist\relax} +\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% \cs{@makeglossary} is an internal command that takes an -% argument indicating the glossary type. This command will -% create the glossary file required by \appname{makeindex} for the -% given glossary type, using the extension supplied by the -% \meta{out-ext} parameter used in \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 \cs{@makeglossary} for only some of the -% defined glossaries. You either need to have a \cs{makeglossary} -% for all glossaries or none (otherwise you will end up with a -% situation where \TeX\ is trying to write to a non-existant -% file.) The relevant glossary must be -% defined prior to using \cs{@makeglossary}. -%\begin{macro}{\@makeglossary} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \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}}} +\newcommand*{\@Glsfirst}[2][]{% +\new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -% -% \cs{makeglossaries} will use \cs{@makeglossary} -% for each glossary type that has been defined. New glossaries -% need to be defined before using \cs{makeglossary}, so -% have \cs{makeglossaries} redefine \cs{newglossary} -% to prevent it being used afterwards. -%\begin{macro}{\makeglossaries} +% Read in the final optional argument: % \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} +\def\@Glsfirst@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -% The \cs{makeglossary} command is redefined to be -% identical to \cs{makeglossaries}. (This is done to -% reinforce the message that you must either use -% \cs{@makeglossary} for all the glossaries or for none -% of them.) -%\begin{macro}{\makeglossary} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\let\makeglossary\makeglossaries +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -% -%\subsection{Writing information to associated files} -% The \cs{glossary} command is redefined so that it takes an -% optional argument \meta{type} to specify the glossary type (use -% \cs{glsdefaulttype} glossary by default). -% This shouldn't be used at user level -% as \cs{glslink} sets the correct format. The associated -% number should be stored in \cs{theglsentrycounter} -% before using \cs{glossary}. -%\begin{macro}{\glossary} +% Call \cs{@gls@link} % \begin{macrocode} -\renewcommand*{\glossary}[1][\glsdefaulttype]{% -\@glossary[#1]} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} % -% Define internal \cs{@glossary} to ignore its argument. -% This gets redefined in \cs{@makeglossary}. -%\begin{macro}{\@glossary} +% \cs{GLSfirst} behaves like \ics{Glsfirst} except it displays the +% text in uppercase. +%\begin{macro}{\GLSfirst} % \begin{macrocode} -\def\@glossary[#1]{\@bsphack\begingroup\@sanitize\@index} +\newcommand*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst} % \end{macrocode} %\end{macro} -% This is a convenience command to set \cs{@glossary}. -% It is used by \cs{@makeglossary} and then redefined to -% do nothing, as it only needs to be done once. -%\begin{macro}{@gls@renewglossary} +% Define the starred form: % \begin{macrocode} -\newcommand{\@gls@renewglossary}{% -\gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}% -\let\@gls@renewglossary\@empty -} +\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% The \cs{@wrglossary} command is redefined to have -% two arguments. The first argument is the glossary type, -% the second argument is the glossary entry -% (the format of which is set in \cs{glslink}.) -%\begin{macro}{\@wrglossary} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\renewcommand*{\@wrglossary}[2]{% -\expandafter\protected@write\csname glo@#1@file\endcsname{}{% -\string\glossaryentry{#2}{\theglsentrycounter}}\endgroup\@esphack} +\newcommand*{\@GLSfirst}[2][]{% +\new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -% -% \subsection{Displaying the glossary}\label{sec:printglos} -% An individual glossary is displayed in the text using -% \cs{printglossary}\oarg{key-val list}. If the -% \gloskey[printglossary]{type} key is omitted, the default glossary is displayed. -% The optional argument can be used to specify an alternative -% glossary, and can also be used to set the style, title and -% entry in the table of contents. Available keys are defined below. -%\begin{macro}{\printglossary} +% Read in the final optional argument: % \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 +\def\@GLSfirst@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% } % \end{macrocode} -%\end{macro} % -% The \cs{printglossaries} command will do \cs{printglossary} -% for each glossary type that has been defined. It is better -% to use \cs{printglossaries} rather than individual -% \cs{printglossary} commands to ensure that you don't forget -% any new glossaries you may have created. It also makes it easier to -% chop and change the value of the \pkgopt{acronym} package option. -% However, if you want to list the glossaries in a different order, -% or if you want to set the title or table of contents entry, or -% if you want to use different glossary styles for each glossary, you -% will need to use \cs{printglossary} explicitly for each -% glossary type. -%\begin{macro}{\printglossaries} +% \cs{glsplural} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{plural} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsplural} % \begin{macrocode} -\newcommand*{\printglossaries}{% -\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}} +\newcommand*{\glsplural}{\@ifstar\@sglsplural\@glsplural} % \end{macrocode} %\end{macro} -% 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. +% Define the starred form: % \begin{macrocode} -\define@key{printgloss}{type}{\def\@glo@type{#1}} +\newcommand*{\@sglsplural}[1][]{\@glsplural[hyper=false,#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}. +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\define@key{printgloss}{title}{\def\glossarytitle{#1}} +\newcommand*{\@glsplural}[2][]{% +\new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}} % \end{macrocode} -% The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry -% in the table of contents. +% Read in the final optional argument: % \begin{macrocode} -\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}} +\def\@glsplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% The \gloskey[printglossary]{style} key sets the glossary style (but only for -% the given glossary.) +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\define@key{printgloss}{style}{% -\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary -style `#1' undefined}{}}{% -\def\@glossarystyle{\csname @glsstyle@#1\endcsname}}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \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. +% Call \cs{@gls@link} % \begin{macrocode} -\@ifundefined{theglossary}{% -\newenvironment{theglossary}{}{}}{% -\PackageWarning{glossaries}{overriding `theglossary' environment}% -\renewenvironment{theglossary}{}{}} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} % \end{macrocode} % -% The glossary header is given by \cs{glossaryheader}. -% This forms part of the glossary style, and -% must indicate what should appear immediately after the start of the -% \envname{theglossary} environment. (For example, if the glossary -% uses a tabular-like environment, it may be used to set the -% header row.) Note that if you don't want a header row, the glossary -% style must redefine \cs{glossaryheader} to do nothing. -%\begin{macro}{\glossaryheader} +% \cs{Glsplural} behaves like \ics{glsplural} except that the first +% letter is converted to uppercase. +%\begin{macro}{\Glsplural} % \begin{macrocode} -\newcommand*{\glossaryheader}{} +\newcommand*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural} % \end{macrocode} %\end{macro} -%\vskip5pt -% \cs{glossaryentryfield}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt] -% This command governs how each entry row should be formatted -% in the glossary. Glossary styles need to redefine this command. -% Most of the predefined styles ignore \meta{symbol}. -%\begin{macro}{\glossaryentryfield} +% Define the starred form: % \begin{macrocode} -\newcommand*{\glossaryentryfield}[5]{% -\@glstarget{glo:#1}{#2} #4 #3. #5\par} +\newcommand*{\@sGlsplural}[1][]{\@Glsplural[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% Within each glossary, the entries form 28 distinct groups -% which are determined by the first character of the \gloskey{sort} -% key. There will be a maximum of 28 groups: symbols, numbers, -% and the 26 alphabetical groups A, \ldots, Z\@. -% The command \cs{glsgroupskip} -% specifies what to do between glossary groups. Glossary styles -% must redefine this command. (Note that \cs{glsgroupskip} -% only occurs between groups, not at the start or end of the -% glossary.) -%\begin{macro}{\glsgroupskip} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsgroupskip}{} +\newcommand*{\@Glsplural}[2][]{% +\new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -% -% Each of the 28 glossary groups described above is preceded by a -% group heading. -% This is formatted by the command \cs{glsgroupheading} -% which takes one argument which is the \emph{label} assigned to that -% group (not the title). The corresponding labels are: \texttt{glssymbols}, -% \texttt{glsnumbers}, \texttt{A}, \ldots, \texttt{Z}. -% Glossary styles must redefined this command. (In between groups, -% \cs{glsgroupheading} comes immediately after \cs{glsgroupskip}.) -%\begin{macro}{\glsgroupheading} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glsgroupheading}[1]{} +\def\@Glsplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% It is possible to ``trick'' \appname{makeindex} into -% treating entries as though they belong to the same group, -% even if the terms don't start with the same letter, by -% modifying the \gloskey{sort} key. For example, all entries -% belonging to one -% group could be defined so that the \gloskey{sort} key starts with an -% "a", while entries belonging to another group could be defined -% so that the \gloskey{sort} key starts with a "b", and so on. If -% you want each group to have a heading, you would then need to -% modify the translation control sequences \cs{glsgetgrouptitle} -% and \cs{glsgetgrouplabel} so that the label is translated -% into the required title (and vice-versa.) -%\\[10pt] -%\cs{glsgetgrouptitle}\marg{label}\\[10pt] -% This command produces the title for the glossary group -% whose label is given by \meta{label}. By default, the group -% labelled \texttt{glssymbols} produces -% \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{macro}{\glsgetgrouptitle} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand*{\glsgetgrouptitle}[1]{% -\@ifundefined{#1groupname}{#1}{\csname #1groupname\endcsname}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -%\vskip5pt -%\cs{glsgetgrouplabel}\marg{title}\\[10pt] -%This command does the reverse to the previous command. The -% argument is the group title, and it produces the group label. -% Note that if you redefine \cs{glsgetgrouptitle}, you -% will also need to redefine \cs{glsgetgrouplabel}. -%\begin{macro}{\glsgetgrouplabel} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\glsgetgrouplabel}[1]{% -\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{% -\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} % -% The command \cs{setentrycounter} sets the entry's -% associated counter (required by -% \cs{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{macro}{\setentrycounter} +% \cs{GLSplural} behaves like \ics{glsplural} except that the +% text is converted to uppercase. +%\begin{macro}{\GLSplural} % \begin{macrocode} -\newcommand*{\setentrycounter}[1]{\def\glsentrycounter{#1}} +\newcommand*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural} % \end{macrocode} %\end{macro} -% -% The current glossary style can be set using -% \cs{glossarystyle}\marg{style}. -%\begin{macro}{\glossarystyle} +% Define the starred form: % \begin{macrocode} -\newcommand*{\glossarystyle}[1]{% -\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary -style `#1' undefined}{}}{% -\csname @glsstyle@#1\endcsname}} +\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% New glossary styles can be defined using:\\[10pt] -% \cs{newglossarystyle}\marg{name}\marg{definition}\\[10pt] -% The \meta{definition} argument should redefine -% \envname{theglossary}, \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{macro}{\newglossarystyle} -% \begin{macrocode} -\newcommand*{\newglossarystyle}[2]{% -\@ifundefined{@glsstyle@#1}{% -\expandafter\def\csname @glsstyle@#1\endcsname{#2}}{% -\PackageError{glossaries}{Glossary style `#1' is already defined}{}}} -% \end{macrocode} -%\end{macro} -% -% Glossary entries are encoded so that the second argument -% to \icmdname{glossaryentryfield} is always specified as -% \cs{glsnamefont}\marg{name}. This allows the -% user to change the font used to display the name term -% without having to redefine \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{macro}{\glsnamefont} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsnamefont}[1]{#1} +\newcommand*{\@GLSplural}[2][]{% +\new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -% -% Each glossary entry has an associated number list (usually page -% numbers) that indicate where in the document the entry has been -% used. The format for these number lists can be changed using the -% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \icmdname{glslink}. -% The default format is given by \cs{glshypernumber}. This takes -% a single argument which may be a single number, a number range -% or a number list. The number ranges are delimited with -% \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{macro}{\glshypernumber} +% Read in the final optional argument: % \begin{macrocode} -\@ifundefined{hyperlink}{% -\def\glshypernumber#1{#1}}{% -\def\glshypernumber#1{% -\@delimR#1\delimR\delimR\\}} +\def\@GLSplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% \cs{@delimR} displays a range of numbers for the counter -% whose name is given by -% \cs{@gls@counter} (which must be set prior to using -% \cs{glshypernumber}.) -%\begin{macro}{\@delimR} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\def\@delimR#1\delimR #2\delimR #3\\{% -\ifx\\#2\\% - \@delimN{#1}% -\else - \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% -\fi} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -% \cs{@delimN} displays a list of individual numbers, -% instead of a range: -%\begin{macro}{\@delimN} +% Call \cs{@gls@link} % \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 +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% } % \end{macrocode} +% +% \cs{glsfirstplural} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{firstplural} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsfirstplural} +% \begin{macrocode} +\newcommand*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural} +% \end{macrocode} %\end{macro} -% The following code is modified from hyperref's -% \cs{HyInd@pagelink} where -% the name of the counter being used is given by -% \cs{@gls@counter}. +% Define the starred form: % \begin{macrocode} -\def\@gls@numberlink#1{% -\begingroup - \toks@={}% - \@gls@removespaces#1 \@nil -\endgroup} +\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]} % \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\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*{\@glsfirstplural}[2][]{% +\new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} % \end{macrocode} -% -% The following commands will switch to the -% appropriate font, and create a hyperlink, if hyperlinks are -% supported. If hyperlinks are not supported, they will just -% display their argument in the appropriate font. -%\begin{macro}{\hyperrm} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} +\def\@glsfirstplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\hypersf} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\hypertt} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\hyperbf} +% +% \cs{Glsfirstplural} behaves like \ics{glsfirstplural} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsfirstplural} % \begin{macrocode} -\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} +\newcommand*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural} % \end{macrocode} %\end{macro} -%\begin{macro}{\hypermd} +% Define the starred form: % \begin{macrocode} -\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} +\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]} % \end{macrocode} -%\end{macro} -%\begin{macro}{\hyperit} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} +\newcommand*{\@Glsfirstplural}[2][]{% +\new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -%\begin{macro}{\hypersl} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} +\def\@Glsfirstplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\hyperup} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\hypersc} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\hyperemph} +% +% \cs{GLSfirstplural} behaves like \ics{glsfirstplural} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSfirstplural} % \begin{macrocode} -\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} +\newcommand*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural} % \end{macrocode} %\end{macro} -% -%\subsection{Acronyms}\label{sec:acronym} -%If the \pkgopt{acronym} package option is used, a -% new glossary called "acronym" is created +% Define the starred form: % \begin{macrocode} -\ifglsacronym -\newglossary[alg]{acronym}{acr}{acn}{\acronymname} +\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[hyper=false,#1]} % \end{macrocode} -%and \icmdname{acronymtype} is set to the name of this new glossary. +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\renewcommand{\acronymtype}{acronym} +\newcommand*{\@GLSfirstplural}[2][]{% +\new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}} % \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. +% Read in the final optional argument: % \begin{macrocode} -\defglsdisplay[acronym]{#1#4}\defglsdisplayfirst[acronym]{#1#4} -\fi +\def\@GLSfirstplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\vskip5pt -% \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long}\\[10pt] -% This is a quick way of defining acronyms, all it does -% is call \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 \cs{newacronym} merely calls \icmdname{newglossaryentry}, -% the acronym is treated like any other glossary entry. -% -% If you prefer a different format, you -% can redefine \cs{newacronym} as required. The optional -% argument can be used to override any of the settings. -%\begin{macro}{\newacronym} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newcommand{\newacronym}[4][]{% -\newglossaryentry{#2}{type=\acronymtype,% -name={#3},description={#4},text={#3},% -first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\end{macro} -% New acronyms can only be defined in the preamble: +% Call \cs{@gls@link} % \begin{macrocode} -\@onlypreamble{\newacronym} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} % \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: +% \cs{glsname} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{name} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsname} % \begin{macrocode} -\RequirePackage{glossary-hypernav} -\RequirePackage{glossary-list} -\RequirePackage{glossary-long} -\RequirePackage{glossary-super} +\newcommand*{\glsname}{\@ifstar\@sglsname\@glsname} % \end{macrocode} -% The default glossary style is set according to the \pkgopt{style} package -% option, but can be overridden by \icmdname{glossarystyle}. +%\end{macro} +% Define the starred form: % \begin{macrocode} -\glossarystyle{\@glossary@default@style} +\newcommand*{\@sglsname}[1][]{\@glsname[hyper=false,#1]} % \end{macrocode} -%\iffalse +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -% +\newcommand*{\@glsname}[2][]{% +\new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}} % \end{macrocode} -%\fi -%\iffalse +% Read in the final optional argument: % \begin{macrocode} -%<*glossary-hypernav.sty> +\def\@glsname@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\fi -% \subsubsection{Glossary hyper-navigation definitions (glossary-hypernav package)} -% Package Definition: +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\ProvidesPackage{glossary-hypernav}[2007/07/04 v1.01 (NLCT)] +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} % \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 \cs{@glo@type} to the label of the current -% glossary. This is used to create a unique hypertarget in -% the event of multiple glossaries. -%\\[10pt] -% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text}\\[10pt] -% This command makes \meta{text} a hyperlink to the glossary group -% whose label is given by \meta{label} for the glossary given -% by \meta{type}. -%\begin{macro}{\glsnavhyperlink} +% \cs{Glsname} behaves like \ics{glsname} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsname} % \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}}} +\newcommand*{\Glsname}{\@ifstar\@sGlsname\@Glsname} % \end{macrocode} %\end{macro} -%\vskip5pt -% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text}\\[10pt] -% This command makes \meta{text} a hypertarget for the glossary group -% whose label is given by \meta{label} in the glossary given -% by \meta{type}. -%\begin{macro}{\glsnavhypertarget} +% Define the starred form: % \begin{macrocode} -\@ifundefined{hypertarget}{% -\newcommand*{\glsnavhypertarget}[3][]{#3}}{% -\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% -\hypertarget{glsn:#1@#2}{#3}}} +\newcommand*{\@sGlsname}[1][]{\@Glsname[hyper=false,#1]} % \end{macrocode} -%\end{macro} -% -% The \cs{glsnavigation} command displays a simple glossary -% group navigation. -% The symbol and number elements are defined separately, -% so that they can be suppressed if need be. Note that this -% command will produce a link to all 28 groups, but some groups -% may not be defined if there are groups that do not contain any -% terms, in which case you will get an undefined hyperlink warning. -% Now for the whole navigation bit: -%\begin{macro}{\glsnavigation} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \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}}} +\newcommand*{\@Glsname}[2][]{% +\new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -% The \cs{glssymbolnav} produces a simple navigation set of -% links for just the symbol and number groups. This is used at -% the start of \cs{glsnavigation}. If your glossary doesn't -% contain any symbol or navigation groups, you can redefine this -% command to do nothing. -%\begin{macro}{\glssymbolnav} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glssymbolnav}{% -\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}} \textbar\ -\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}} \textbar\ -} +\def\@Glsname@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -%\iffalse +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -%\fi -%\iffalse +% Call \cs{@gls@link} % \begin{macrocode} -%<*glossary-list.sty> +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} % \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. +% +% \cs{GLSname} behaves like \ics{glsname} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSname} % \begin{macrocode} -\ProvidesPackage{glossary-list}[2007/10/04 v1.02 (NLCT)] +\newcommand*{\GLSname}{\@ifstar\@sGLSname\@GLSname} % \end{macrocode} -% The \glostyle{list} glossary style -% uses the \envname{description} environment. The group separator -% \icmdname{glsgroupskip} is redefined as \cs{indexspace} -% which produces a gap between groups. The glossary heading -% and the group headings do nothing. This is used as the default -% style for the \styname{glossaries} package. +%\end{macro} +% Define the starred form: % \begin{macrocode} -\newglossarystyle{list}{% -\renewenvironment{theglossary}{\begin{description}}{\end{description}}% -\renewcommand*{\glossaryheader}{}% -\renewcommand*{\glsgroupheading}[1]{}% -\renewcommand*{\glossaryentryfield}[5]{% -\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5}% -\renewcommand*{\glsgroupskip}{\indexspace}} +\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]} % \end{macrocode} -% The \glostyle{listgroup} style is like the \glostyle{list} -% style, but the glossary groups have headings. -%\changes{1.08}{2007 Oct 13}{changed listgroup style to use \cs{glsgetgrouptitle}} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newglossarystyle{listgroup}{% -\glossarystyle{list}% -\renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} +\newcommand*{\@GLSname}[2][]{% +\new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} % \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. +% Read in the final optional argument: % \begin{macrocode} -\newglossarystyle{listhypergroup}{% -\glossarystyle{list}% -\renewcommand*{\glossaryheader}{% -\item[]\glsnavigation}% -\renewcommand*{\glsgroupheading}[1]{% -\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +\def\@GLSname@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% The \glostyle{altlist} glossary style is like the \glostyle{list} -% style, but places the description on a new line. +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newglossarystyle{altlist}{% -\glossarystyle{list}% -\renewcommand*{\glossaryentryfield}[5]{% -\item[\@glstarget{glo:##1}{##2}]\mbox{}\newline ##3\glspostdescription\space ##5}% -} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% The \glostyle{altlistgroup} glossary style is like the -% \glostyle{altlist} style, but the glossary groups have headings. -%\changes{1.08}{2007 Oct 13}{changed altlistgroup style to use \cs{glsgetgrouptitle}} +% Call \cs{@gls@link} % \begin{macrocode} -\newglossarystyle{altlistgroup}{% -\glossarystyle{altlist}% -\renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} % \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. +% +% \cs{glsdesc} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{description} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsdesc} % \begin{macrocode} -\newglossarystyle{altlisthypergroup}{% -\glossarystyle{altlist}% -\renewcommand*{\glossaryheader}{% -\item[]\glsnavigation}% -\renewcommand*{\glsgroupheading}[1]{% -\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +\newcommand*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc} % \end{macrocode} -%\iffalse +%\end{macro} +% Define the starred form: % \begin{macrocode} -% +\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]} % \end{macrocode} -%\fi -%\iffalse +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -%<*glossary-long.sty> +\newcommand*{\@glsdesc}[2][]{% +\new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} % \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. +% Read in the final optional argument: % \begin{macrocode} -\ProvidesPackage{glossary-long}[2007/07/04 v1.01 (NLCT)] +\def\@glsdesc@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Requires the \styname{longtable} package: +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\RequirePackage{longtable} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% This is a length that governs the width of the description column. -%\begin{macro}{\glsdescwidth} +% Call \cs{@gls@link} % \begin{macrocode} -\newlength\glsdescwidth +\@gls@link[#1]{#2}{\@glo@text}% +}% +} % \end{macrocode} -%\end{macro} -% This is a length that governs the width of the page list column. -%\begin{macro}{\glspagelistwidth} +% +% \cs{Glsdesc} behaves like \ics{glsdesc} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsdesc} % \begin{macrocode} -\newlength\glspagelistwidth +\newcommand*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc} % \end{macrocode} %\end{macro} -% Default values: +% Define the starred form: % \begin{macrocode} -\setlength{\glsdescwidth}{0.6\linewidth} -\setlength{\glspagelistwidth}{0.1\linewidth} +\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]} % \end{macrocode} -% -% The \glostyle{long} glossary style command which -% uses the \envname{longtable} environment: +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newglossarystyle{long}{% -\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}}}{% -\end{longtable}}% -\renewcommand*{\glossaryheader}{}% -\renewcommand*{\glsgroupheading}[1]{}% -\renewcommand*{\glossaryentryfield}[5]{% -\@glstarget{glo:##1}{##2} & ##3\glspostdescription\space ##5\\}% -\renewcommand*{\glsgroupskip}{ & \\}} +\newcommand*{\@Glsdesc}[2][]{% +\new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} % \end{macrocode} -% The \glostyle{longborder} style is like the above, but with horizontal and -% vertical lines: +% Read in the final optional argument: % \begin{macrocode} -\newglossarystyle{longborder}{% -\glossarystyle{long}% -\renewenvironment{theglossary}{% -\begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% -\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% -} +\def\@Glsdesc@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% The \glostyle{longheader} style is like the -% \glostyle{long} style but with a header: +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newglossarystyle{longheader}{% -\glossarystyle{long}% -\renewcommand*{\glossaryheader}{% -\bfseries \entryname & \bfseries \descriptionname\\ -\endhead}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% The \glostyle{longheaderborder} style is -% like the \glostyle{long} style but with a header and border: +% Call \cs{@gls@link} % \begin{macrocode} -\newglossarystyle{longheaderborder}{% -\glossarystyle{longborder}% -\renewcommand*{\glossaryheader}{% -\hline\bfseries \entryname & \bfseries \descriptionname\\\hline -\endhead -\hline\endfoot}} +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} % \end{macrocode} -% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns +% +% \cs{GLSdesc} behaves like \ics{glsdesc} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSdesc} % \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}{ & &\\}} +\newcommand*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc} % \end{macrocode} -% The \glostyle{long3colborder} style is like the -% \glostyle{long3col} style but with a border: +%\end{macro} +% Define the starred form: % \begin{macrocode} -\newglossarystyle{long3colborder}{% -\glossarystyle{long3col}% -\renewenvironment{theglossary}{% -\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% -\end{longtable}}% -\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% -} +\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]} % \end{macrocode} -% The \glostyle{long3colheader} style is like \glostyle{long3col} but with a header row: +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newglossarystyle{long3colheader}{% -\glossarystyle{long3col}% -\renewcommand*{\glossaryheader}{% -\bfseries\entryname&\bfseries\descriptionname& -\bfseries\pagelistname\\\endhead}% -} +\newcommand*{\@GLSdesc}[2][]{% +\new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} % \end{macrocode} -% The \glostyle{long3colheaderborder} style is like the above but with a border +% Read in the final optional argument: % \begin{macrocode} -\newglossarystyle{long3colheaderborder}{% -\glossarystyle{long3colborder}% -\renewcommand*{\glossaryheader}{% -\hline -\bfseries\entryname&\bfseries\descriptionname& -\bfseries\pagelistname\\\hline\endhead -\hline\endfoot}% -} +\def\@GLSdesc@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% The \glostyle{long4col} style has four columns where the third column contains the value of the associated \gloskey{symbol} key. +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \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}{ & & &\\}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% The \glostyle{long4colheader} style is like \glostyle{long4col} but with a header row. +% Call \cs{@gls@link} % \begin{macrocode} -\newglossarystyle{long4colheader}{% -\glossarystyle{long4col}% -\renewcommand*{\glossaryheader}{% -\bfseries\entryname&\bfseries\descriptionname& -\bfseries \symbolname& -\bfseries\pagelistname\\\endhead}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% } % \end{macrocode} -% The \glostyle{long4colborder} style is like \glostyle{long4col} but with a border. +% +% \cs{glssymbol} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{symbol} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glssymbol} % \begin{macrocode} -\newglossarystyle{long4colborder}{% -\glossarystyle{long4col}% -\renewenvironment{theglossary}{% -\begin{longtable}{|l|l|l|l|}}{% -\end{longtable}}% -\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% -} +\newcommand*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol} % \end{macrocode} -% The \glostyle{long4colheaderborder} style is like the above but with a border. +%\end{macro} +% Define the starred form: % \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}% -} +\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]} % \end{macrocode} -%\iffalse +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -% +\newcommand*{\@glssymbol}[2][]{% +\new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} % \end{macrocode} -%\fi -%\iffalse +% Read in the final optional argument: % \begin{macrocode} -%<*glossary-super.sty> +\def\@glssymbol@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \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. +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\ProvidesPackage{glossary-super}[2007/07/04 v1.01 (NLCT)] +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% Requires the \styname{supertabular} package: +% Call \cs{@gls@link} % \begin{macrocode} -\RequirePackage{supertabular} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} % \end{macrocode} -% The \glostyle{super} glossary style uses the -% \envname{supertabular} environment -% (it uses lengths defined in the \styname{glossary-long} package.) +% +% \cs{Glssymbol} behaves like \ics{glssymbol} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glssymbol} % \begin{macrocode} -\newglossarystyle{super}{% -\renewenvironment{theglossary}{% -\tablehead{}\tabletail{}% -\begin{supertabular}{lp{\glsdescwidth}}}{% -\end{supertabular}}% -\renewcommand*{\glossaryheader}{}% -\renewcommand*{\glsgroupheading}[1]{}% -\renewcommand*{\glossaryentryfield}[5]{% -\@glstarget{glo:##1}{##2} & ##3\glspostdescription\space ##5\\}% -\renewcommand*{\glsgroupskip}{ & \\}} +\newcommand*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol} % \end{macrocode} -% The \glostyle{superborder} style is like the above, but with horizontal and -% vertical lines: +%\end{macro} +% Define the starred form: % \begin{macrocode} -\newglossarystyle{superborder}{% -\glossarystyle{super}% -\renewenvironment{theglossary}{% -\tablehead{\hline}\tabletail{\hline}% -\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}% -} +\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]} % \end{macrocode} -% The \glostyle{superheader} style is like the -% \glostyle{super} style, but with a header: +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newglossarystyle{superheader}{% -\glossarystyle{super}% -\renewenvironment{theglossary}{% -\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}% -\tabletail{}% -\begin{supertabular}{lp{\glsdescwidth}}}{\end{supertabular}}% -} +\newcommand*{\@Glssymbol}[2][]{% +\new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} % \end{macrocode} -% The \glostyle{superheaderborder} style is like -% the \glostyle{super} style but with a header and border: +% Read in the final optional argument: % \begin{macrocode} -\newglossarystyle{superheaderborder}{% -\glossarystyle{super}% -\renewenvironment{theglossary}{% -\tablehead{\hline\bfseries \entryname & \bfseries \descriptionname\\\hline}% -\tabletail{\hline} -\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}% -} +\def\@Glssymbol@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% The \glostyle{super3col} style is like the \glostyle{super} style, but with 3 columns: +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \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}{ & &\\}} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% The \glostyle{super3colborder} style is like the -% \glostyle{super3col} style, but with a border: +% Call \cs{@gls@link} % \begin{macrocode} -\newglossarystyle{super3colborder}{% -\glossarystyle{super3col}% -\renewenvironment{theglossary}{% -\tablehead{\hline}\tabletail{\hline}% -\begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% -\end{supertabular}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% } % \end{macrocode} -% The \glostyle{super3colheader} style is like -% the \glostyle{super3col} style but with a header row: +% +% \cs{GLSsymbol} behaves like \ics{glssymbol} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSsymbol} % \begin{macrocode} -\newglossarystyle{super3colheader}{% -\glossarystyle{super3col}% -\renewenvironment{theglossary}{% -\tablehead{\bfseries\entryname&\bfseries\descriptionname& -\bfseries\pagelistname\\}\tabletail{}% -\begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}{% -\end{supertabular}}% -} +\newcommand*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol} % \end{macrocode} -% The \glostyle{super3colheaderborder} style is like -% the \glostyle{super3col} style but with a header and border: +%\end{macro} +% Define the starred form: % \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}}% -} +\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]} % \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. +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \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}{ & & &\\}} +\newcommand*{\@GLSsymbol}[2][]{% +\new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} % \end{macrocode} -% The \glostyle{super4colheader} style is like -% the \glostyle{super4col} but with a header row. +% Read in the final optional argument: % \begin{macrocode} -\newglossarystyle{super4colheader}{% -\glossarystyle{super4col}% -\renewenvironment{theglossary}{% -\tablehead{\bfseries\entryname&\bfseries\descriptionname& -\bfseries\symbolname & -\bfseries\pagelistname\\}\tabletail{}% -\begin{supertabular}{llll}}{% -\end{supertabular}}% -} +\def\@GLSsymbol@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% The \glostyle{super4colborder} style is like -% the \glostyle{super4col} but with a border. +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) % \begin{macrocode} -\newglossarystyle{super4colborder}{% -\glossarystyle{super4col}% -\renewenvironment{theglossary}{% -\tablehead{\hline}\tabletail{\hline}% -\begin{supertabular}{|l|l|l|l|}}{% -\end{supertabular}}% -} +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% % \end{macrocode} -% The \glostyle{super4colheaderborder} style is like -% the \glostyle{super4col} but with a header and border. +% Call \cs{@gls@link} % \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}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% } % \end{macrocode} -%\iffalse +% +% \subsubsection{Displaying entry details without adding +% information to the glossary} +% +% These commands merely display entry information without adding +% entries in the associated file or having hyperlinks. +% +% Get the entry name (as specified by the \gloskey{name} key +% when the entry was defined.) The argument +% is the label associated with the entry. Note that unless you +% used \texttt{name=false} in the \pkgopt{sanitize} package option +% you may get unexpected results if the \gloskey{name} key contained +% any commands. +%\begin{macro}{\glsentryname} % \begin{macrocode} -% +\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} % \end{macrocode} -%\fi -%\iffalse +%\end{macro} +%\begin{macro}{\Glsentryname} % \begin{macrocode} -%<*glossaries.perl> +\newcommand*{\Glsentryname}[1]{\expandafter +\MakeUppercase\csname glo@#1@name\endcsname} % \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -# File : glossaries.perl +%\end{macro} +% +% Get the entry description (as specified by the +% \gloskey{description} when the entry was defined.) The argument +% is the label associated with the entry. Note that unless you +% used \texttt{description=false} in the \pkgopt{sanitize} package +% option you may get unexpected results if the \gloskey{description} +% key contained any commands. +%\begin{macro}{\glsentrydesc} +% \begin{macrocode} +\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentrydesc} +% \begin{macrocode} +\newcommand*{\Glsentrydesc}[1]{\expandafter +\MakeUppercase\csname glo@#1@desc\endcsname} +% \end{macrocode} +%\end{macro} +% +% Get the entry text, as specified by the \gloskey{text} key when +% the entry was defined. The argument +% is the label associated with the entry: +%\begin{macro}{\glsentrytext} +% \begin{macrocode} +\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentrytext} +% \begin{macrocode} +\newcommand*{\Glsentrytext}[1]{\expandafter +\MakeUppercase\csname glo@#1@text\endcsname} +% \end{macrocode} +%\end{macro} +% +% Get the plural form: +%\begin{macro}{\glsentryplural} +% \begin{macrocode} +\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentryplural} +% \begin{macrocode} +\newcommand*{\Glsentryplural}[1]{\expandafter +\MakeUppercase\csname glo@#1@plural\endcsname} +% \end{macrocode} +%\end{macro} +% +% Get the symbol associated with this entry. The argument +% is the label associated with the entry. Note that unless you +% used \texttt{symbol=false} in the \pkgopt{sanitize} package +% option you may get unexpected results if the \gloskey{symbol} +% key contained any commands. +%\begin{macro}{\glsentrysymbol} +% \begin{macrocode} +\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentrysymbol} +% \begin{macrocode} +\newcommand*{\Glsentrysymbol}[1]{\expandafter +\MakeUppercase\csname glo@#1@symbol\endcsname} +% \end{macrocode} +%\end{macro} +% +% Get the entry text to be used when the entry is first used in +% the document (as specified by the \gloskey{first} key when +% the entry was defined.) +%\begin{macro}{\glsentryfirst} +% \begin{macrocode} +\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentryfirst} +% \begin{macrocode} +\newcommand*{\Glsentryfirst}[1]{\expandafter +\MakeUppercase\csname glo@#1@first\endcsname} +% \end{macrocode} +%\end{macro} +% +% Get the plural form (as specified by the \gloskey{firstplural} +% key when the entry was defined.) +%\begin{macro}{\glsentryfirstplural} +% \begin{macrocode} +\newcommand*{\glsentryfirstplural}[1]{% +\csname glo@#1@firstpl\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentryfirstplural} +% \begin{macrocode} +\newcommand*{\Glsentryfirstplural}[1]{% +\expandafter\MakeUppercase\csname glo@#1@firstpl\endcsname} +% \end{macrocode} +%\end{macro} +% +% Display the glossary type with which this entry is associated +% (as specified by the \gloskey{type} key used when the entry was +% defined) +%\begin{macro}{\glsentrytype} +% \begin{macrocode} +\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname} +% \end{macrocode} +%\end{macro} +% +% Display the sort text used for this entry. Note that the +% \gloskey{sort} key is sanitize, so unexpected results may +% occur if the \gloskey{sort} key contained commands. +%\begin{macro}{\glsentrysort} +% \begin{macrocode} +\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname} +% \end{macrocode} +%\end{macro} +% +%\subsection{Adding an entry to the glossary without generating +% text} +% The following keys are provided for \cs{glsadd} and +% \cs{glsaddall}: +% \begin{macrocode} +\define@key{glossadd}{counter}{\def\@glo@counter{#1}} +\define@key{glossadd}{format}{\def\@glo@format{#1}} +% \end{macrocode} +% This key is only used by \cs{glsaddall}: +% \begin{macrocode} +\define@key{glossadd}{types}{\def\@glo@type{#1}} +% \end{macrocode} +%\vskip5pt +%\cs{glsadd}\oarg{options}\marg{label}\\[10pt] +% Add a term to the glossary without generating any link text. +% The optional argument indicates which counter to use, +% and how to format it (using a key-value list) +% the second argument is the entry label. Note that \meta{options} +% only has two keys: \gloskey[glsadd]{counter} and \gloskey[glsadd]{format} (the \gloskey[glsaddall]{types} key will be ignored). +%\begin{macro}{\glsadd} +%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} +% \begin{macrocode} +\newcommand*{\glsadd}[2][]{% +\glsdoifexists{#2}{% +\def\@glo@format{glsnumberformat}% +\edef\@glo@counter{\csname glo@#2@counter\endcsname}% +\setkeys{glossadd}{#1}% +\edef\theglsentrycounter{\expandafter\noexpand\csname the\@glo@counter\endcsname}% +\protected@edef\@glo@sort{\csname glo@#2@sort\endcsname}% +\@gls@checkmkidxchars\@glo@sort +\protected@edef\@@glo@name{\csname glo@#2@name\endcsname}% +\@gls@checkmkidxchars\@@glo@name +\protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}% +\protected@edef\@glo@desc{\csname glo@#2@desc\endcsname}% +\@gls@checkmkidxchars\@glo@desc +\protected@edef\@glo@symbol{\csname glo@#2@symbol\endcsname}% +\@gls@checkmkidxchars\@glo@symbol +\@set@glo@numformat\@glo@numfmt\@glo@counter\@glo@format +\glossary[\csname glo@#2@type\endcsname]{% +\@glo@sort\@gls@actualchar\string\glossaryentryfield +{#2}{\@glo@name}{\@glo@desc}{\@glo@symbol}\@gls@encapchar +\@glo@numfmt}% +}} +% \end{macrocode} +%\end{macro} +%\vskip5pt +%\cs{glsaddall}\oarg{glossary list}\\[10pt] +% Add all terms defined for the listed glossaries (without displaying +% any text.) If \gloskey[glsaddall]{types} key is omitted, apply to all +% glossary types. +%\begin{macro}{\glsaddall} +% \begin{macrocode} +\newcommand*{\glsaddall}[1][]{% +\def\@glo@type{\@glo@types}% +\setkeys{glossadd}{#1}% +\forallglsentries[\@glo@type]{\@glo@entry}{% +\glsadd[#1]{\@glo@entry}}% +} +% \end{macrocode} +%\end{macro} +% +%\subsection{Creating associated files} +% The \cs{writeist} command creates the associated +% customized \filetype{.ist} \appname{makeindex} style file. +% While defining this command, some characters have their +% catcodes temporarily changed to ensure they get written to +% the \filetype{.ist} file correctly. The \appname{makeindex} +% actual character (usually "@") is redefined to be a "?", to allow +% internal commands to be written to the glossary file output file. +% +% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar}, +% \cs{@gls@encapchar}, \cs{@glsl@levelchar} and +% \cs{@gls@quotechar} to make them easier to use later, +% but don't change these values, because the characters are +% encoded in the command definitions that are used to escape +% the special characters (which means that the user no longer +% needs to worry about \appname{makeindex} special characters.) +% +% The symbols and numbers label for group headings are hardwired into +% the \filetype{.ist} file as \texttt{glssymbols} and +% \texttt{glsnumbers}, the group titles can be translated +% (so that \ics{glssymbolsgroupname} replaces \texttt{glssymbols} +% and \ics{glsnumbersgroupname} replaces \texttt{glsnumbers}) +% using the command \ics{glsgetgrouptitle} which is +% defined in \isty{glossary-hypernav}. This is done to prevent +% any problem characters in \ics{glssymbolsgroupname} +% and \ics{glsnumbersgroupname} from breaking hyperlinks. +% +% Some of these lines are too long to fit on the page, but as I +% have temporarily disabled the comment character, I can't split +% the lines. If you want to see the code in full, have a look at +% \texttt{glossaries.sty}. +%\changes{1.01}{2007 May 17}{Added spaces after 'delimN and 'delimR in ist file}% +%\begin{macro}{\writeist} +% \begin{macrocode} +\newwrite\istfile +\bgroup +\catcode`\%12\relax +\catcode`\"12\relax +\catcode`\|12\relax +\catcode`\!12\relax +\catcode`\?12\relax +\gdef\@gls@actualchar{?} +\gdef\@gls@encapchar{|} +\gdef\@gls@levelchar{!} +\gdef\@gls@quotechar{"} +\gdef\writeist{\relax +\protected@write\@auxout{}{\string\@istfilename{\istfilename}} +\openout\istfile=\istfilename +\write\istfile{% makeindex style file created by the glossaries package} +\write\istfile{% for document '\jobname' on \the\year-\the\month-\the\day} +\write\istfile{actual '\@gls@actualchar'} +\write\istfile{encap '\@gls@encapchar'} +\write\istfile{level '\@gls@levelchar'} +\write\istfile{quote '\@gls@quotechar'} +\write\istfile{keyword "\string\\glossaryentry"} +\write\istfile{preamble "\string\\glossarysection[\string\\glossarytoctitle]{\string\\glossarytitle}\string\\glossarypreamble\string\n\string\\begin{theglossary}\string\\glossaryheader\string\n"} +\write\istfile{postamble "\string\n\string\\end{theglossary}\string\n\string\\glossarypostamble\string\n"} +\write\istfile{group_skip "\string\\glsgroupskip\string\n"} +\write\istfile{item_0 "\string\n"} +\write\istfile{delim_0 "\{\string\\glossaryentrynumbers\{\string\\relax "} +\write\istfile{delim_t "\}\}"} +\write\istfile{delim_n "\string\\delimN "} +\write\istfile{delim_r "\string\\delimR "} +\write\istfile{headings_flag 1} +\write\istfile{heading_prefix "\string\\glsgroupheading\{"} +\write\istfile{heading_suffix "\}"} +\write\istfile{symhead_positive "glssymbols"} +\write\istfile{numhead_positive "glsnumbers"} +\write\istfile{page_compositor "\glscompositor"} +\noist} +\egroup +% \end{macrocode} +%\end{macro} +% +%The command \cs{noist} will suppress the creation of +% the \filetype{.ist} file (it simply redefines +% \cs{writeist} to do nothing.) Obviously you need to use this +% command before \cs{writeist} to have any effect. Since +% the \filetype{.ist} file should only be created once, \cs{noist} +% is called at the end of \cs{writeist}. +%\begin{macro}{\noist} +% \begin{macrocode} +\newcommand{\noist}{\let\writeist\relax} +% \end{macrocode} +%\end{macro} +% +% \cs{@makeglossary} is an internal command that takes an +% argument indicating the glossary type. This command will +% create the glossary file required by \appname{makeindex} for the +% given glossary type, using the extension supplied by the +% \meta{out-ext} parameter used in \ics{newglossary} +% (and it will also activate the \ics{glossary} command, +% and create the customized \filetype{.ist} \appname{makeindex} +% style file.) +% +% Note that you can't use \cs{@makeglossary} for only some of the +% defined glossaries. You either need to have a \cs{makeglossary} +% for all glossaries or none (otherwise you will end up with a +% situation where \TeX\ is trying to write to a non-existant +% file.) The relevant glossary must be +% defined prior to using \cs{@makeglossary}. +%\begin{macro}{\@makeglossary} +% \begin{macrocode} +\newcommand*{\@makeglossary}[1]{% +\ifglossaryexists{#1}{% +\edef\glo@out{\csname @glotype@#1@out\endcsname}% +\expandafter\newwrite\csname glo@#1@file\endcsname +\edef\@glo@file{\csname glo@#1@file\endcsname}% +\immediate\openout\@glo@file=\jobname.\glo@out +\@gls@renewglossary +\PackageInfo{glossaries}{Writing glossary file \jobname.\glo@out} +\writeist +}{\PackageError{glossaries}{% +Glossary type `#1' not defined}{New glossaries must be defined before +using \string\makeglossary}}} +% \end{macrocode} +%\end{macro} +% +% \cs{makeglossaries} will use \cs{@makeglossary} +% for each glossary type that has been defined. New glossaries +% need to be defined before using \cs{makeglossary}, so +% have \cs{makeglossaries} redefine \cs{newglossary} +% to prevent it being used afterwards. +%\begin{macro}{\makeglossaries} +% \begin{macrocode} +\newcommand*{\makeglossaries}{% +\@for\@glo@type:=\@glo@types\do{% +\ifthenelse{\equal{\@glo@type}{}}{}{% +\@makeglossary{\@glo@type}}}% +\renewcommand*\newglossary[4][]{% +\PackageError{glossaries}{New glossaries +must be created before \string\makeglossaries}{You need +to move \string\makeglossaries\space after all your +\string\newglossary\space commands}}% +\let\@makeglossary\empty +\let\makeglossary\empty} +% \end{macrocode} +%\end{macro} +% +% The \cs{makeglossary} command is redefined to be +% identical to \cs{makeglossaries}. (This is done to +% reinforce the message that you must either use +% \cs{@makeglossary} for all the glossaries or for none +% of them.) +%\begin{macro}{\makeglossary} +% \begin{macrocode} +\let\makeglossary\makeglossaries +% \end{macrocode} +%\end{macro} +% +%\subsection{Writing information to associated files} +% The \cs{glossary} command is redefined so that it takes an +% optional argument \meta{type} to specify the glossary type (use +% \cs{glsdefaulttype} glossary by default). +% This shouldn't be used at user level +% as \cs{glslink} sets the correct format. The associated +% number should be stored in \cs{theglsentrycounter} +% before using \cs{glossary}. +%\begin{macro}{\glossary} +% \begin{macrocode} +\renewcommand*{\glossary}[1][\glsdefaulttype]{% +\@glossary[#1]} +% \end{macrocode} +%\end{macro} +% +% Define internal \cs{@glossary} to ignore its argument. +% This gets redefined in \cs{@makeglossary}. +%\begin{macro}{\@glossary} +% \begin{macrocode} +\def\@glossary[#1]{\@bsphack\begingroup\@sanitize\@index} +% \end{macrocode} +%\end{macro} +% This is a convenience command to set \cs{@glossary}. +% It is used by \cs{@makeglossary} and then redefined to +% do nothing, as it only needs to be done once. +%\begin{macro}{@gls@renewglossary} +% \begin{macrocode} +\newcommand{\@gls@renewglossary}{% +\gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}% +\let\@gls@renewglossary\@empty +} +% \end{macrocode} +%\end{macro} +% The \cs{@wrglossary} command is redefined to have +% two arguments. The first argument is the glossary type, +% the second argument is the glossary entry +% (the format of which is set in \cs{glslink}.) +%\begin{macro}{\@wrglossary} +% \begin{macrocode} +\renewcommand*{\@wrglossary}[2]{% +\expandafter\protected@write\csname glo@#1@file\endcsname{}{% +\string\glossaryentry{#2}{\theglsentrycounter}}\endgroup\@esphack} +% \end{macrocode} +%\end{macro} +% +% \subsection{Displaying the glossary}\label{sec:printglos} +% An individual glossary is displayed in the text using +% \cs{printglossary}\oarg{key-val list}. If the +% \gloskey[printglossary]{type} key is omitted, the default glossary is displayed. +% The optional argument can be used to specify an alternative +% glossary, and can also be used to set the style, title and +% entry in the table of contents. Available keys are defined below. +%\begin{macro}{\printglossary} +% \begin{macrocode} +\newcommand*{\printglossary}[1][type=\glsdefaulttype]{% +\def\@glo@type{\glsdefaulttype}% +\def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% +\def\glossarytoctitle{\glossarytitle}% +\def\@glossarystyle{}% +\setkeys{printgloss}{#1}% +\bgroup +\@glossarystyle +\makeatletter +\@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% +\egroup +} +% \end{macrocode} +%\end{macro} +% +% The \cs{printglossaries} command will do \cs{printglossary} +% for each glossary type that has been defined. It is better +% to use \cs{printglossaries} rather than individual +% \cs{printglossary} commands to ensure that you don't forget +% any new glossaries you may have created. It also makes it easier to +% chop and change the value of the \pkgopt{acronym} package option. +% However, if you want to list the glossaries in a different order, +% or if you want to set the title or table of contents entry, or +% if you want to use different glossary styles for each glossary, you +% will need to use \cs{printglossary} explicitly for each +% glossary type. +%\begin{macro}{\printglossaries} +% \begin{macrocode} +\newcommand*{\printglossaries}{% +\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}} +% \end{macrocode} +%\end{macro} +% The keys that can be used in the optional argument to +% \ics{printglossary} are as follows: +% The \gloskey[printglossary]{type} key sets the glossary type. +% \begin{macrocode} +\define@key{printgloss}{type}{\def\@glo@type{#1}} +% \end{macrocode} +% The \gloskey[printglossary]{title} key sets the title used in the glossary section +% header. This overrides the title used in \ics{newglossary}. +% \begin{macrocode} +\define@key{printgloss}{title}{\def\glossarytitle{#1}} +% \end{macrocode} +% The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry +% in the table of contents. +% \begin{macrocode} +\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}} +% \end{macrocode} +% The \gloskey[printglossary]{style} key sets the glossary style (but only for +% the given glossary.) +% \begin{macrocode} +\define@key{printgloss}{style}{% +\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary +style `#1' undefined}{}}{% +\def\@glossarystyle{\csname @glsstyle@#1\endcsname}}} +% \end{macrocode} +% +%\DescribeEnv{theglossary} +% If the \envname{theglossary} environment has +% already been defined, a warning will be issued. +% This environment should be redefined by glossary styles. +% \begin{macrocode} +\@ifundefined{theglossary}{% +\newenvironment{theglossary}{}{}}{% +\PackageWarning{glossaries}{overriding `theglossary' environment}% +\renewenvironment{theglossary}{}{}} +% \end{macrocode} +% +% The glossary header is given by \cs{glossaryheader}. +% This forms part of the glossary style, and +% must indicate what should appear immediately after the start of the +% \envname{theglossary} environment. (For example, if the glossary +% uses a tabular-like environment, it may be used to set the +% header row.) Note that if you don't want a header row, the glossary +% style must redefine \cs{glossaryheader} to do nothing. +%\begin{macro}{\glossaryheader} +% \begin{macrocode} +\newcommand*{\glossaryheader}{} +% \end{macrocode} +%\end{macro} +%\vskip5pt +% \cs{glossaryentryfield}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt] +% This command governs how each entry row should be formatted +% in the glossary. Glossary styles need to redefine this command. +% Most of the predefined styles ignore \meta{symbol}. +%\begin{macro}{\glossaryentryfield} +% \begin{macrocode} +\newcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:#1}{#2} #4 #3. #5\par} +% \end{macrocode} +%\end{macro} +% +% Within each glossary, the entries form 28 distinct groups +% which are determined by the first character of the \gloskey{sort} +% key. There will be a maximum of 28 groups: symbols, numbers, +% and the 26 alphabetical groups A, \ldots, Z\@. +% The command \cs{glsgroupskip} +% specifies what to do between glossary groups. Glossary styles +% must redefine this command. (Note that \cs{glsgroupskip} +% only occurs between groups, not at the start or end of the +% glossary.) +%\begin{macro}{\glsgroupskip} +% \begin{macrocode} +\newcommand*{\glsgroupskip}{} +% \end{macrocode} +%\end{macro} +% +% Each of the 28 glossary groups described above is preceded by a +% group heading. +% This is formatted by the command \cs{glsgroupheading} +% which takes one argument which is the \emph{label} assigned to that +% group (not the title). The corresponding labels are: \texttt{glssymbols}, +% \texttt{glsnumbers}, \texttt{A}, \ldots, \texttt{Z}. +% Glossary styles must redefined this command. (In between groups, +% \cs{glsgroupheading} comes immediately after \cs{glsgroupskip}.) +%\begin{macro}{\glsgroupheading} +% \begin{macrocode} +\newcommand*{\glsgroupheading}[1]{} +% \end{macrocode} +%\end{macro} +% It is possible to ``trick'' \appname{makeindex} into +% treating entries as though they belong to the same group, +% even if the terms don't start with the same letter, by +% modifying the \gloskey{sort} key. For example, all entries +% belonging to one +% group could be defined so that the \gloskey{sort} key starts with an +% "a", while entries belonging to another group could be defined +% so that the \gloskey{sort} key starts with a "b", and so on. If +% you want each group to have a heading, you would then need to +% modify the translation control sequences \cs{glsgetgrouptitle} +% and \cs{glsgetgrouplabel} so that the label is translated +% into the required title (and vice-versa.) +%\\[10pt] +%\cs{glsgetgrouptitle}\marg{label}\\[10pt] +% This command produces the title for the glossary group +% whose label is given by \meta{label}. By default, the group +% labelled \texttt{glssymbols} produces +% \ics{glssymbolsgroupname}, the group labelled +% \texttt{glsnumbers} produces \ics{glsnumbersgroupname} +% and all the other groups simply produce their label. +% As mentioned above, the group labels are: \texttt{glssymbols}, \texttt{glsnumbers}, +% \texttt{A}, \ldots, \texttt{Z}\@. If you want to redefine +% the group titles, you will need to redefine this command. +%\begin{macro}{\glsgetgrouptitle} +% \begin{macrocode} +\newcommand*{\glsgetgrouptitle}[1]{% +\@ifundefined{#1groupname}{#1}{\csname #1groupname\endcsname}} +% \end{macrocode} +%\end{macro} +%\vskip5pt +%\cs{glsgetgrouplabel}\marg{title}\\[10pt] +%This command does the reverse to the previous command. The +% argument is the group title, and it produces the group label. +% Note that if you redefine \cs{glsgetgrouptitle}, you +% will also need to redefine \cs{glsgetgrouplabel}. +%\begin{macro}{\glsgetgrouplabel} +% \begin{macrocode} +\newcommand*{\glsgetgrouplabel}[1]{% +\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{% +\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} +% \end{macrocode} +%\end{macro} +% +% The command \cs{setentrycounter} sets the entry's +% associated counter (required by +% \cs{glshypernumber} etc.) \ics{glslink} and +% \ics{glsadd} encode the +% \ics{glossary} argument so that the relevant counter is +% set prior to the formatting command. +%\begin{macro}{\setentrycounter} +% \begin{macrocode} +\newcommand*{\setentrycounter}[1]{\def\glsentrycounter{#1}} +% \end{macrocode} +%\end{macro} +% +% The current glossary style can be set using +% \cs{glossarystyle}\marg{style}. +%\begin{macro}{\glossarystyle} +% \begin{macrocode} +\newcommand*{\glossarystyle}[1]{% +\@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary +style `#1' undefined}{}}{% +\csname @glsstyle@#1\endcsname}} +% \end{macrocode} +%\end{macro} +% +% New glossary styles can be defined using:\\[10pt] +% \cs{newglossarystyle}\marg{name}\marg{definition}\\[10pt] +% The \meta{definition} argument should redefine +% \envname{theglossary}, \ics{glossaryheader}, +% \ics{glsgroupheading}, \ics{glossaryentryfield} and +% \ics{glsgroupskip} (see \autoref{sec:code:styles} for the +% definitions of predefined styles.) Glossary styles should not +% redefine \ics{glossarypreamble} and +% \ics{glossarypostamble}, as +% the user should be able to switch between styles without affecting +% the pre- and postambles. +%\begin{macro}{\newglossarystyle} +% \begin{macrocode} +\newcommand*{\newglossarystyle}[2]{% +\@ifundefined{@glsstyle@#1}{% +\expandafter\def\csname @glsstyle@#1\endcsname{#2}}{% +\PackageError{glossaries}{Glossary style `#1' is already defined}{}}} +% \end{macrocode} +%\end{macro} +% +% Glossary entries are encoded so that the second argument +% to \ics{glossaryentryfield} is always specified as +% \cs{glsnamefont}\marg{name}. This allows the +% user to change the font used to display the name term +% without having to redefine \ics{glossaryentryfield}. +% The default uses the surrounding font, so in the list type +% styles (which place the name in the optional argument to +% \ics{item}) the name will appear in bold. +%\begin{macro}{\glsnamefont} +% \begin{macrocode} +\newcommand*{\glsnamefont}[1]{#1} +% \end{macrocode} +%\end{macro} +% +% Each glossary entry has an associated number list (usually page +% numbers) that indicate where in the document the entry has been +% used. The format for these number lists can be changed using the +% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \ics{glslink}. +% The default format is given by \cs{glshypernumber}. This takes +% a single argument which may be a single number, a number range +% or a number list. The number ranges are delimited with +% \ics{delimR}, the number lists are delimited with +% \ics{delimN}. +% +% If the document doesn't have hyperlinks, the numbers can be +% displayed just as they are, but if the document supports +% hyperlinks, the numbers should link to the relevant location. +% This means extracting the individual numbers from the list or +% ranges. The \isty{hyperref} package does this with the +% \ics{hyperpage} command, but this is encoded for comma and +% dash delimiters and only for the page counter, but this code needs +% to be more general. So I have adapted the code used in the +% \isty{hyperref} package. +%\begin{macro}{\glshypernumber} +% \begin{macrocode} +\@ifundefined{hyperlink}{% +\def\glshypernumber#1{#1}}{% +\def\glshypernumber#1{% +\@delimR#1\delimR\delimR\\}} +% \end{macrocode} +%\end{macro} +% \cs{@delimR} displays a range of numbers for the counter +% whose name is given by +% \cs{@gls@counter} (which must be set prior to using +% \cs{glshypernumber}.) +%\begin{macro}{\@delimR} +% \begin{macrocode} +\def\@delimR#1\delimR #2\delimR #3\\{% +\ifx\\#2\\% + \@delimN{#1}% +\else + \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% +\fi} +% \end{macrocode} +%\end{macro} +% \cs{@delimN} displays a list of individual numbers, +% instead of a range: +%\begin{macro}{\@delimN} +% \begin{macrocode} +\def\@delimN#1{\@@delimN#1\delimN \delimN\\} +\def\@@delimN#1\delimN #2\delimN#3\\{% +\ifx\\#3\\% + \@gls@numberlink{#1}% +\else + \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}% +\fi +} +% \end{macrocode} +%\end{macro} +% The following code is modified from hyperref's +% \cs{HyInd@pagelink} where +% the name of the counter being used is given by +% \cs{@gls@counter}. +% \begin{macrocode} +\def\@gls@numberlink#1{% +\begingroup + \toks@={}% + \@gls@removespaces#1 \@nil +\endgroup} +% \end{macrocode} +% \begin{macrocode} +\def\@gls@removespaces#1 #2\@nil{% + \toks@=\expandafter{\the\toks@#1}% + \ifx\\#2\\% + \edef\x{\the\toks@}% + \ifx\x\empty + \else + \hyperlink{\glsentrycounter.\the\toks@}{\the\toks@}% + \fi + \else + \@gls@ReturnAfterFi{% + \@gls@removespaces#2\@nil + }% + \fi +} +\long\def\@gls@ReturnAfterFi#1\fi{\fi#1} +% \end{macrocode} +% +% The following commands will switch to the +% appropriate font, and create a hyperlink, if hyperlinks are +% supported. If hyperlinks are not supported, they will just +% display their argument in the appropriate font. +%\begin{macro}{\hyperrm} +% \begin{macrocode} +\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hypersf} +% \begin{macrocode} +\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hypertt} +% \begin{macrocode} +\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hyperbf} +% \begin{macrocode} +\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hypermd} +% \begin{macrocode} +\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hyperit} +% \begin{macrocode} +\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hypersl} +% \begin{macrocode} +\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hyperup} +% \begin{macrocode} +\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hypersc} +% \begin{macrocode} +\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hyperemph} +% \begin{macrocode} +\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} +% \end{macrocode} +%\end{macro} +% +%\subsection{Acronyms}\label{sec:acronym} +%If the \pkgopt{acronym} package option is used, a +% new glossary called "acronym" is created +% \begin{macrocode} +\ifglsacronym + \newglossary[alg]{acronym}{acr}{acn}{\acronymname} +% \end{macrocode} +%and \ics{acronymtype} is set to the name of this new glossary. +% \begin{macrocode} + \renewcommand{\acronymtype}{acronym} +% \end{macrocode} +% In the event that the user redefines \ics{glsdisplay} +% and \ics{glsdisplayfirst}, the relevant commands for +% the new acronym glossary are set to match the format +% given by \ics{newacronym}. If you redefine +% \ics{newacronym} you may need to set these to something +% else. +% \begin{macrocode} + \defglsdisplay[acronym]{#1#4} + \defglsdisplayfirst[acronym]{#1#4} +\fi +% \end{macrocode} +%\vskip5pt +% \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long}\\[10pt] +% This is a quick way of defining acronyms, all it does +% is call \ics{newglossaryentry} with the appropriate +% values. It sets the +% glossary type to \ics{acronymtype} which will be +% "acronym" if the package option \pkgopt{acronym} has +% been used, otherwise it will be the default glossary. +% Since \cs{newacronym} merely calls \ics{newglossaryentry}, +% the acronym is treated like any other glossary entry. +% +% If you prefer a different format, you +% can redefine \cs{newacronym} as required. The optional +% argument can be used to override any of the settings. +%\begin{macro}{\newacronym} +% \begin{macrocode} +\newcommand{\newacronym}[4][]{% +\newglossaryentry{#2}{type=\acronymtype,% +name={#3},description={#4},text={#3},% +first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} +% \end{macrocode} +%\end{macro} +% New acronyms can only be defined in the preamble: +% \begin{macrocode} +\@onlypreamble{\newacronym} +% \end{macrocode} +% Set up some convenient short cuts. These need to be changed if +% \cs{newacronym} is changed (or if the \gloskey{description} key +% is changed). +% +% Using the default definitions, \ics{acrshort} is the same as +% \ics{glstext}, which means that it will print the abbreviation. +%\begin{macro}{\acrshort} +% \begin{macrocode} +\newcommand*{\acrshort}[2][]{% +\new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}} +\def\@acrshort#1#2[#3]{\@glstext@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Acrshort} +% \begin{macrocode} +\newcommand*{\Acrshort}[2][]{% +\new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}} +\def\@Acrshort#1#2[#3]{\@glstext@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ACRshort} +% \begin{macrocode} +\newcommand*{\ACRshort}[2][]{% +\new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}} +\def\@ACRshort#1#2[#3]{\@glstext@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +% \ics{acrlong} is set to \ics{glsdesc}, so it will print the long +% form, unless the description key has been set to something else. +%\begin{macro}{\acrlong} +% \begin{macrocode} +\newcommand*{\acrlong}[2][]{% +\new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}} +\def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Acrlong} +% \begin{macrocode} +\newcommand*{\Acrlong}[2][]{% +\new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}} +\def\@Acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ACRlong} +% \begin{macrocode} +\newcommand*{\ACRlong}[2][]{% +\new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}} +\def\@ACRlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +% +% \ics{acrfull} is set to \ics{glsfirst}, so it should display the +% full form. +%\begin{macro}{\acrfull} +% \begin{macrocode} +\newcommand*{\acrfull}[2][]{% +\new@ifnextchar[{\@acrfull{#1}{#2}}{\@acrfull{#1}{#2}[]}} +\def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Acrfull} +% \begin{macrocode} +\newcommand*{\Acrfull}[2][]{% +\new@ifnextchar[{\@Acrfull{#1}{#2}}{\@Acrfull{#1}{#2}[]}} +\def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ACRfull} +% \begin{macrocode} +\newcommand*{\ACRfull}[2][]{% +\new@ifnextchar[{\@ACRfull{#1}{#2}}{\@ACRfull{#1}{#2}[]}} +\def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} +% \end{macrocode} +%\end{macro} +% +%\subsection{Additional predefined acronym styles} +%\begin{macro}{\acronymfont} +%This is only used with the additional acronym styles: +% \begin{macrocode} +\newcommand{\acronymfont}[1]{#1} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\ifglsacrdescription +% \end{macrocode} +% +% If a description and footnote are both required, store the long form +% in the \gloskey{symbol} key. Store the short form in \gloskey{text} +% key. +% \begin{macrocode} + \ifglsacrfootnote + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + symbol={#4},% + #1}} +% \end{macrocode} +% Set up short cuts. Short form: +% \begin{macrocode} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} +% \end{macrocode} +% Long form: +% \begin{macrocode} + \def\@acrlong#1#2[#3]{\@glssymbol@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]} +% \end{macrocode} +% Full form: +% \begin{macrocode} + \def\@acrfull#1#2[#3]{\@glssymbol@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glssymbol@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3] + (\acronymfont{\@GLStext@{#1}{#2}[#3]})} +% \end{macrocode} +% +% If \pkgopt{footnote} package option is specified, set the first +% use to append the long form (stored in \gloskey{symbol}) as a +% footnote. +% \begin{macrocode} + \defglsdisplayfirst[\acronymtype]{% + \acronymfont{#1}#4\noexpand\footnote{% + \noexpand\glslink[\@gls@link@opts]{\@gls@link@label}{#3}}}% + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{#1}} + \fi +% \end{macrocode} +% Check for package option clash +% \begin{macrocode} + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi + \else +% \end{macrocode} +% Footnote not required. Should the acronym always be expanded? +% \begin{macrocode} + \ifglsacrdua + \ifglsacrsmallcaps + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \fi + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#4},% + first={#4},% + symbol={#3},% + #1}} +% \end{macrocode} +% Set up short cuts. Short form: +% \begin{macrocode} + \def\@acrshort#1#2[#3]{\acronymfont{\@glssymbol@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glssymbol@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLSsymbol@{#1}{#2}[#3]}} +% \end{macrocode} +% Long form: +% \begin{macrocode} + \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} +% \end{macrocode} +% Full form: +% \begin{macrocode} + \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] + (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})} +% \end{macrocode} +% Set display. +% \begin{macrocode} + \defglsdisplayfirst[\acronymtype]{#1#4} + \defglsdisplay[\acronymtype]{#1#4} + \else +% \end{macrocode} +% Store long form in \gloskey{first} key +% and short form in \gloskey{text} and \gloskey{symbol} key. +% \begin{macrocode} + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + first={#4},% + symbol={#3},% + #1}} +% \end{macrocode} +% Set up short cuts. Short form: +% \begin{macrocode} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} +% \end{macrocode} +% Long form: +% \begin{macrocode} + \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} +% \end{macrocode} +% Full form: +% \begin{macrocode} + \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] + (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})} +% \end{macrocode} +% Set display. +% \begin{macrocode} + \defglsdisplayfirst[\acronymtype]{#1#4 (\acronymfont{#3})} + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4} +% \end{macrocode} +% Set small caps and check for option clash +% \begin{macrocode} + \ifglsacrsmallcaps + \renewcommand{\acronymfont}[1]{\textsc{#1}} + \fi + \fi + \fi +\else +% \end{macrocode} +% If here, acronyms do not require additional description. +% \begin{macrocode} + \ifglsacrfootnote +% \end{macrocode} +% +% If \pkgopt{footnote} package option is specified, set the first +% use to append the long form (stored in \gloskey{description}) as a +% footnote. +% Use the \gloskey{description} key to store the long form. +% \begin{macrocode} + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + description={#4},% + #1}} +% \end{macrocode} +% Set display +% \begin{macrocode} + \defglsdisplayfirst[\acronymtype]{% + \acronymfont{#1}#4\noexpand\footnote{% + \noexpand\glslink[\@gls@link@opts]{\@gls@link@label}{#2}}}% + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}% +% \end{macrocode} +% Set up short cuts. Short form: +% \begin{macrocode} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} +% \end{macrocode} +% Long form: +% \begin{macrocode} + \def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsdesc@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSdesc@{#1}{#2}[#3]} +% \end{macrocode} +% Full form: +% \begin{macrocode} + \def\@acrfull#1#2[#3]{\@glsdesc@{#1}{#2}[#3] + (\@glstext@{#1}{#2}[#3])} + \def\@Acrfull#1#2[#3]{\@Glsdesc@{#1}{#2}[#3] + (\@glstext@{#1}{#2}[#3])} + \def\@ACRfull#1#2[#3]{\@GLSdesc@{#1}{#2}[#3] + (\@GLStext@{#1}{#2}[#3])} +% \end{macrocode} +% Redefine \ics{acronymfont} is small caps required +% \begin{macrocode} + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{#1}}% + \fi +% \end{macrocode} +% Check for option clash +% \begin{macrocode} + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi + \else +% \end{macrocode} +% No footnotes required. +% \begin{macrocode} + \ifglsacrsmallcaps +% \end{macrocode} +% +% Neither footnote nor description required. +% Use the \gloskey{symbol} key to store the short form and +% \gloskey{first} to store the description. +% Note that this way makes the first use plural form +% appear as \dq{\meta{long}s (\meta{short})} instead of +% \dq{\meta{long}s (\meta{short}s)}. +% \begin{macrocode} + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + first={#4},% + description={#4},% + symbol={#3},% + #1}} +% \end{macrocode} +% Change the display since \gloskey{first} only contains long form. +% \begin{macrocode} + \defglsdisplayfirst[\acronymtype]{#1#4 (\acronymfont{#3})} + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4} +% \end{macrocode} +% Change \ics{acronymfont} to small caps: +% \begin{macrocode} + \renewcommand*{\acronymfont}[1]{\textsc{#1}} +% \end{macrocode} +% Set up short cuts. Short form: +% \begin{macrocode} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} +% \end{macrocode} +% Long form: +% \begin{macrocode} + \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} +% \end{macrocode} +% Full form: +% \begin{macrocode} + \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] + (\acronymfont{\@GLStext@{#1}{#2}[#3]})} +% \end{macrocode} +% check for option clash +% \begin{macrocode} + \ifglsacrdua + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \fi + \else +% \end{macrocode} +% Should acronyms always be expanded? +% \begin{macrocode} + \ifglsacrdua + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + description={#4},% + text={#4},% + symbol={#3},% + #1}} +% \end{macrocode} +% Set the display +% \begin{macrocode} + \defglsdisplayfirst[\acronymtype]{#1#4} + \defglsdisplay[\acronymtype]{#1#4} +% \end{macrocode} +% Set up short cuts. Short form: +% \begin{macrocode} + \def\@acrshort#1#2[#3]{\@glssymbol@{#1}{#2}[#3]} + \def\@Acrshort#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]} + \def\@ACRshort#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]} +% \end{macrocode} +% Long form: +% \begin{macrocode} + \def\@acrlong#1#2[#3]{\@glstext@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glstext@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLStext@{#1}{#2}[#3]} +% \end{macrocode} +% Full form: +% \begin{macrocode} + \def\@acrfull#1#2[#3]{\@glstext@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glstext@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLStext@{#1}{#2}[#3] + (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})} + \fi + \fi + \fi +\fi +% \end{macrocode} +% +% \subsection{Predefined Glossary Styles}\label{sec:code:styles} +% The \sty{glossaries} bundle comes with some predefined glossary styles which +% are defined in the following packages: +% \begin{macrocode} +\RequirePackage{glossary-hypernav} +\RequirePackage{glossary-list} +\RequirePackage{glossary-long} +\RequirePackage{glossary-super} +% \end{macrocode} +% The default glossary style is set according to the \pkgopt{style} package +% option, but can be overridden by \ics{glossarystyle}. +% \begin{macrocode} +\glossarystyle{\@glossary@default@style} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \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/07/04 v1.01 (NLCT)] +% \end{macrocode} +% +% The commands defined in this package are provided to +% help navigate around the groups within a glossary +% (see \autoref{sec:printglos}.) +% \ics{printglossary} (and \ics{printglossaries}) +% set \cs{@glo@type} to the label of the current +% glossary. This is used to create a unique hypertarget in +% the event of multiple glossaries. +%\\[10pt] +% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text}\\[10pt] +% This command makes \meta{text} a hyperlink to the glossary group +% whose label is given by \meta{label} for the glossary given +% by \meta{type}. +%\begin{macro}{\glsnavhyperlink} +% \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} +%\end{macro} +%\vskip5pt +% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text}\\[10pt] +% This command makes \meta{text} a hypertarget for the glossary group +% whose label is given by \meta{label} in the glossary given +% by \meta{type}. +%\begin{macro}{\glsnavhypertarget} +% \begin{macrocode} +\@ifundefined{hypertarget}{% +\newcommand*{\glsnavhypertarget}[3][]{#3}}{% +\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% +\hypertarget{glsn:#1@#2}{#3}}} +% \end{macrocode} +%\end{macro} +% +% The \cs{glsnavigation} command displays a simple glossary +% group navigation. +% The symbol and number elements are defined separately, +% so that they can be suppressed if need be. Note that this +% command will produce a link to all 28 groups, but some groups +% may not be defined if there are groups that do not contain any +% terms, in which case you will get an undefined hyperlink warning. +% Now for the whole navigation bit: +%\begin{macro}{\glsnavigation} +% \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} +%\end{macro} +% The \cs{glssymbolnav} produces a simple navigation set of +% links for just the symbol and number groups. This is used at +% the start of \cs{glsnavigation}. If your glossary doesn't +% contain any symbol or navigation groups, you can redefine this +% command to do nothing. +%\begin{macro}{\glssymbolnav} +% \begin{macrocode} +\newcommand*{\glssymbolnav}{% +\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}} \textbar\ +\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}} \textbar\ +} +% \end{macrocode} +%\end{macro} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-list.sty> +% \end{macrocode} +%\fi +% \subsubsection{List Style (glossary-list package)} +% The \isty{glossary-list} package defines glossary styles +% that use the \envname{description} environment. Note that since +% the entry name is placed in the optional argument to the +% \ics{item} command, it will appear in a bold font by +% default. +% \begin{macrocode} +\ProvidesPackage{glossary-list}[2008/02/16 v1.03 (NLCT)] +% \end{macrocode} +% The \glostyle{list} glossary style +% uses the \envname{description} environment. The group separator +% \ics{glsgroupskip} is redefined as \cs{indexspace} +% which produces a gap between groups. The glossary heading +% and the group headings do nothing. This is used as the default +% style for the \sty{glossaries} package. +% \begin{macrocode} +\newglossarystyle{list}{% +\renewenvironment{theglossary}{\begin{description}}{\end{description}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\item[\@glstarget{glo:##1}{##2}] ##3\glspostdescription\space ##5}% +\renewcommand*{\glsgroupskip}{\indexspace}} +% \end{macrocode} +% The \glostyle{listgroup} style is like the \glostyle{list} +% style, but the glossary groups have headings. +%\changes{1.08}{2007 Oct 13}{changed listgroup style to use \cs{glsgetgrouptitle}} +% \begin{macrocode} +\newglossarystyle{listgroup}{% +\glossarystyle{list}% +\renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} +% \end{macrocode} +% The \glostyle{listhypergroup} style is like the \glostyle{listgroup} +% style, but has a set of links to the groups at the +% start of the glossary. +% \begin{macrocode} +\newglossarystyle{listhypergroup}{% +\glossarystyle{list}% +\renewcommand*{\glossaryheader}{% +\item[]\glsnavigation}% +\renewcommand*{\glsgroupheading}[1]{% +\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +% \end{macrocode} +% The \glostyle{altlist} glossary style is like the \glostyle{list} +% style, but places the description on a new line. +% \begin{macrocode} +\newglossarystyle{altlist}{% +\glossarystyle{list}% +\renewcommand*{\glossaryentryfield}[5]{% +\item[\@glstarget{glo:##1}{##2}]\mbox{}\newline ##3\glspostdescription\space ##5}% +} +% \end{macrocode} +% The \glostyle{altlistgroup} glossary style is like the +% \glostyle{altlist} style, but the glossary groups have headings. +%\changes{1.08}{2007 Oct 13}{changed altlistgroup style to use \cs{glsgetgrouptitle}} +% \begin{macrocode} +\newglossarystyle{altlistgroup}{% +\glossarystyle{altlist}% +\renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} +% \end{macrocode} +% The \glostyle{altlisthypergroup} glossary style is like the +% \glostyle{altlisthypergroup} style, but has a +% set of links to the groups at the start of the glossary. +% \begin{macrocode} +\newglossarystyle{altlisthypergroup}{% +\glossarystyle{altlist}% +\renewcommand*{\glossaryheader}{% +\item[]\glsnavigation}% +\renewcommand*{\glsgroupheading}[1]{% +\item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +% \end{macrocode} +% The \glostyle{listdotted} glossary style was supplied by +% Axel~Menzel. I've modified it slightly so that the distance from +% the start of the name to the end of the dotted line is specified by +% \cs{glslistdottedwidth}. +%\begin{macro}{\glslistdottedwidth} +% \begin{macrocode} +\newlength\glslistdottedwidth +\setlength{\glslistdottedwidth}{.5\linewidth} +% \end{macrocode} +%\end{macro} +% Note that this style ignores the page numbers as well as the +% symbol. +% \begin{macrocode} +\newglossarystyle{listdotted}{% +\glossarystyle{list}% +\renewcommand*{\glossaryentryfield}[5]{% +\item[]\makebox[\glslistdottedwidth][l]{\@glstarget{glo:##1}{##2}% +\unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \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 \isty{glossary-long} package +% used the \envname{longtable} environment in the glossary. +% \begin{macrocode} +\ProvidesPackage{glossary-long}[2007/07/04 v1.01 (NLCT)] +% \end{macrocode} +% Requires the \isty{longtable} package: +% \begin{macrocode} +\RequirePackage{longtable} +% \end{macrocode} +% This is a length that governs the width of the description column. +%\begin{macro}{\glsdescwidth} +% \begin{macrocode} +\newlength\glsdescwidth +% \end{macrocode} +%\end{macro} +% This is a length that governs the width of the page list column. +%\begin{macro}{\glspagelistwidth} +% \begin{macrocode} +\newlength\glspagelistwidth +% \end{macrocode} +%\end{macro} +% Default values: +% \begin{macrocode} +\setlength{\glsdescwidth}{0.6\linewidth} +\setlength{\glspagelistwidth}{0.1\linewidth} +% \end{macrocode} +% +% The \glostyle{long} glossary style command which +% uses the \envname{longtable} environment: +% \begin{macrocode} +\newglossarystyle{long}{% +\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3\glspostdescription\space ##5\\}% +\renewcommand*{\glsgroupskip}{ & \\}} +% \end{macrocode} +% The \glostyle{longborder} style is like the above, but with horizontal and +% vertical lines: +% \begin{macrocode} +\newglossarystyle{longborder}{% +\glossarystyle{long}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% +\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +% \end{macrocode} +% The \glostyle{longheader} style is like the +% \glostyle{long} style but with a header: +% \begin{macrocode} +\newglossarystyle{longheader}{% +\glossarystyle{long}% +\renewcommand*{\glossaryheader}{% +\bfseries \entryname & \bfseries \descriptionname\\ +\endhead}} +% \end{macrocode} +% The \glostyle{longheaderborder} style is +% like the \glostyle{long} style but with a header and border: +% \begin{macrocode} +\newglossarystyle{longheaderborder}{% +\glossarystyle{longborder}% +\renewcommand*{\glossaryheader}{% +\hline\bfseries \entryname & \bfseries \descriptionname\\\hline +\endhead +\hline\endfoot}} +% \end{macrocode} +% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns +% \begin{macrocode} +\newglossarystyle{long3col}{% +\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3 & ##5\\}% +\renewcommand*{\glsgroupskip}{ & &\\}} +% \end{macrocode} +% The \glostyle{long3colborder} style is like the +% \glostyle{long3col} style but with a border: +% \begin{macrocode} +\newglossarystyle{long3colborder}{% +\glossarystyle{long3col}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +% \end{macrocode} +% The \glostyle{long3colheader} style is like \glostyle{long3col} but with a header row: +% \begin{macrocode} +\newglossarystyle{long3colheader}{% +\glossarystyle{long3col}% +\renewcommand*{\glossaryheader}{% +\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\\endhead}% +} +% \end{macrocode} +% The \glostyle{long3colheaderborder} style is like the above but with a border +% \begin{macrocode} +\newglossarystyle{long3colheaderborder}{% +\glossarystyle{long3colborder}% +\renewcommand*{\glossaryheader}{% +\hline +\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\\hline\endhead +\hline\endfoot}% +} +% \end{macrocode} +% The \glostyle{long4col} style has four columns where the third column contains the value of the associated \gloskey{symbol} key. +% \begin{macrocode} +\newglossarystyle{long4col}{% +\renewenvironment{theglossary}{% +\begin{longtable}{llll}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3 & ##4 & ##5\\}% +\renewcommand*{\glsgroupskip}{ & & &\\}} +% \end{macrocode} +% The \glostyle{long4colheader} style is like \glostyle{long4col} but with a header row. +% \begin{macrocode} +\newglossarystyle{long4colheader}{% +\glossarystyle{long4col}% +\renewcommand*{\glossaryheader}{% +\bfseries\entryname&\bfseries\descriptionname& +\bfseries \symbolname& +\bfseries\pagelistname\\\endhead}% +} +% \end{macrocode} +% The \glostyle{long4colborder} style is like \glostyle{long4col} but with a border. +% \begin{macrocode} +\newglossarystyle{long4colborder}{% +\glossarystyle{long4col}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|l|l|l|}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +% \end{macrocode} +% The \glostyle{long4colheaderborder} style is like the above but with a border. +% \begin{macrocode} +\newglossarystyle{long4colheaderborder}{% +\glossarystyle{long4col}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|l|l|l|}}{% +\end{longtable}}% +\renewcommand*{\glossaryheader}{% +\hline\bfseries\entryname&\bfseries\descriptionname& +\bfseries \symbolname& +\bfseries\pagelistname\\\hline\endhead\hline\\\endfoot}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \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 \isty{glossary-super} package +% use the \envname{supertabular} environment. +% \begin{macrocode} +\ProvidesPackage{glossary-super}[2007/07/04 v1.01 (NLCT)] +% \end{macrocode} +% Requires the \isty{supertabular} package: +% \begin{macrocode} +\RequirePackage{supertabular} +% \end{macrocode} +% The \glostyle{super} glossary style uses the +% \envname{supertabular} environment +% (it uses lengths defined in the \isty{glossary-long} package.) +% \begin{macrocode} +\newglossarystyle{super}{% +\renewenvironment{theglossary}{% +\tablehead{}\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}}}{% +\end{supertabular}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3\glspostdescription\space ##5\\}% +\renewcommand*{\glsgroupskip}{ & \\}} +% \end{macrocode} +% The \glostyle{superborder} style is like the above, but with horizontal and +% vertical lines: +% \begin{macrocode} +\newglossarystyle{superborder}{% +\glossarystyle{super}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{superheader} style is like the +% \glostyle{super} style, but with a header: +% \begin{macrocode} +\newglossarystyle{superheader}{% +\glossarystyle{super}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}% +\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}}}{\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{superheaderborder} style is like +% the \glostyle{super} style but with a header and border: +% \begin{macrocode} +\newglossarystyle{superheaderborder}{% +\glossarystyle{super}% +\renewenvironment{theglossary}{% +\tablehead{\hline\bfseries \entryname & \bfseries \descriptionname\\\hline}% +\tabletail{\hline} +\begin{supertabular}{|l|p{\glsdescwidth}|}}{\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{super3col} style is like the \glostyle{super} style, but with 3 columns: +% \begin{macrocode} +\newglossarystyle{super3col}{% +\renewenvironment{theglossary}{% +\tablehead{}\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}{% +\end{supertabular}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3 & ##5\\}% +\renewcommand*{\glsgroupskip}{ & &\\}} +% \end{macrocode} +% The \glostyle{super3colborder} style is like the +% \glostyle{super3col} style, but with a border: +% \begin{macrocode} +\newglossarystyle{super3colborder}{% +\glossarystyle{super3col}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{super3colheader} style is like +% the \glostyle{super3col} style but with a header row: +% \begin{macrocode} +\newglossarystyle{super3colheader}{% +\glossarystyle{super3col}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\}\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{super3colheaderborder} style is like +% the \glostyle{super3col} style but with a header and border: +% \begin{macrocode} +\newglossarystyle{super3colheaderborder}{% +\glossarystyle{super3colborder}% +\renewenvironment{theglossary}{% +\tablehead{\hline +\bfseries\entryname&\bfseries\descriptionname& +\bfseries\pagelistname\\\hline}% +\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{super4col} glossary style has four columns, +% where the third column contains the value of the +% corresponding \gloskey{symbol} key used when that entry +% was defined. +% \begin{macrocode} +\newglossarystyle{super4col}{% +\renewenvironment{theglossary}{% +\tablehead{}\tabletail{}% +\begin{supertabular}{llll}}{% +\end{supertabular}}% +\renewcommand*{\glossaryheader}{}% +\renewcommand*{\glsgroupheading}[1]{}% +\renewcommand*{\glossaryentryfield}[5]{% +\@glstarget{glo:##1}{##2} & ##3 & ##4 & ##5\\}% +\renewcommand*{\glsgroupskip}{ & & &\\}} +% \end{macrocode} +% The \glostyle{super4colheader} style is like +% the \glostyle{super4col} but with a header row. +% \begin{macrocode} +\newglossarystyle{super4colheader}{% +\glossarystyle{super4col}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries\entryname&\bfseries\descriptionname& +\bfseries\symbolname & +\bfseries\pagelistname\\}\tabletail{}% +\begin{supertabular}{llll}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{super4colborder} style is like +% the \glostyle{super4col} but with a border. +% \begin{macrocode} +\newglossarystyle{super4colborder}{% +\glossarystyle{super4col}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|l|l|l|}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{super4colheaderborder} style is like +% the \glostyle{super4col} but with a header and border. +% \begin{macrocode} +\newglossarystyle{super4colheaderborder}{% +\glossarystyle{super4col}% +\renewenvironment{theglossary}{% +\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname& +\bfseries\symbolname & +\bfseries\pagelistname\\}\tabletail{\hline}% +\begin{supertabular}{|l|l|l|l|}}{% +\end{supertabular}}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-babel.sty> +% \end{macrocode} +%\fi +%\subsection{Multi-Lingual Support} +%\subsubsection{Babel Captions} +% Define \isty{babel} captions if multi-lingual +% support is required, but the \isty{translator} package is not loaded. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-babel}[2008/02/22 v1.0 (NLCT)] +% \end{macrocode} +% English: +% \begin{macrocode} +\addto\captionsenglish{% +\renewcommand*{\glossaryname}{Glossary}% +\renewcommand*{\acronymname}{Acronyms}% +\renewcommand*{\entryname}{Notation}% +\renewcommand*{\descriptionname}{Description}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Page List}% +\renewcommand*{\glssymbolsgroupname}{Symbols}% +\renewcommand*{\glsnumbersgroupname}{Numbers}% +}% +% \end{macrocode} +% German (quite a few variations were suggested for German; +% I settled on the following): +% \begin{macrocode} +\addto\captionsgerman{% +\renewcommand*{\glossaryname}{Glossar}% +\renewcommand*{\acronymname}{Akronyme}% +\renewcommand*{\entryname}{Bezeichnung}% +\renewcommand*{\descriptionname}{Beschreibung}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Seiten}% +\renewcommand*{\glssymbolsgroupname}{Symbole}% +\renewcommand*{\glsnumbersgroupname}{Zahlen}} +% \end{macrocode} +% ngerman is identical to German: +% \begin{macrocode} +\addto\captionsngerman{% +\renewcommand*{\glossaryname}{Glossar}% +\renewcommand*{\acronymname}{Akronyme}% +\renewcommand*{\entryname}{Bezeichnung}% +\renewcommand*{\descriptionname}{Beschreibung}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Seiten}% +\renewcommand*{\glssymbolsgroupname}{Symbole}% +\renewcommand*{\glsnumbersgroupname}{Zahlen}} +% \end{macrocode} +% Italian: +% \begin{macrocode} +\addto\captionsitalian{% +\renewcommand*{\glossaryname}{Glossario}% +\renewcommand*{\acronymname}{Acronimi}% +\renewcommand*{\entryname}{Nomenclatura}% +\renewcommand*{\descriptionname}{Descrizione}% +\renewcommand*{\symbolname}{Simbolo}% +\renewcommand*{\pagelistname}{Elenco delle pagine}% +\renewcommand*{\glssymbolsgroupname}{Simboli}% +\renewcommand*{\glsnumbersgroupname}{Numeri}} +% \end{macrocode} +% Dutch: +% \begin{macrocode} +\addto\captionsdutch{% +\renewcommand*{\glossaryname}{Woordenlijst}% +\renewcommand*{\acronymname}{Acroniemen}% +\renewcommand*{\entryname}{Benaming}% +\renewcommand*{\descriptionname}{Beschrijving}% +\renewcommand*{\symbolname}{Symbool}% +\renewcommand*{\pagelistname}{Pagina's}% +\renewcommand*{\glssymbolsgroupname}{Symbolen}% +\renewcommand*{\glsnumbersgroupname}{Cijfers}} +% \end{macrocode} +% Spanish: +% \begin{macrocode} +\addto\captionsspanish{% +\renewcommand*{\glossaryname}{Glosario}% +\renewcommand*{\acronymname}{Siglas}% +\renewcommand*{\entryname}{Entrada}% +\renewcommand*{\descriptionname}{Descripci\'on}% +\renewcommand*{\symbolname}{S\'{\i}mbolo}% +\renewcommand*{\pagelistname}{Lista de p\'aginas}% +\renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}% +\renewcommand*{\glsnumbersgroupname}{N\'umeros}} +% \end{macrocode} +% French: +% \begin{macrocode} +\addto\captionsfrench{% +\renewcommand*{\glossaryname}{Glossaire}% +\renewcommand*{\acronymname}{Acronymes}% +\renewcommand*{\entryname}{Terme}% +\renewcommand*{\descriptionname}{Description}% +\renewcommand*{\symbolname}{Symbole}% +\renewcommand*{\pagelistname}{Pages}% +\renewcommand*{\glssymbolsgroupname}{Symboles}% +\renewcommand*{\glsnumbersgroupname}{Nombres}} +% \end{macrocode} +% Danish: +% \begin{macrocode} +\addto\captionsdanish{% +\renewcommand*{\glossaryname}{Ordliste}% +\renewcommand*{\acronymname}{Akronymer}% +\renewcommand*{\entryname}{Symbolforklaring}% +\renewcommand*{\descriptionname}{Beskrivelse}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Side}% +\renewcommand*{\glssymbolsgroupname}{Symboler}% +\renewcommand*{\glsnumbersgroupname}{Tal}} +% \end{macrocode} +% Irish: +% \begin{macrocode} +\addto\captionsirish{% +\renewcommand*{\glossaryname}{Gluais}% +\renewcommand*{\acronymname}{Acrainmneacha}% +% \end{macrocode} +% wasn't sure whether to go for N\'ota (Note), Ciall (`Meaning', +% `sense') or Br\'{\i} (`Meaning'). In the end I chose Ciall. +% \begin{macrocode} +\renewcommand*{\entryname}{Ciall}% +\renewcommand*{\descriptionname}{Tuairisc}% +% \end{macrocode} +% Again, not sure whether to use Comhartha/Comhartha\'{\i} or +% Siombail/Siombaile, so have chosen the former. +% \begin{macrocode} +\renewcommand*{\symbolname}{Comhartha}% +\renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}% +\renewcommand*{\pagelistname}{Leathanaigh}% +\renewcommand*{\glsnumbersgroupname}{Uimhreacha}} +% \end{macrocode} +% Hungarian: +% \begin{macrocode} +\addto\captionsmagyar{% +\renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}% +\renewcommand*{\acronymname}{Bet\H uszavak}% +\renewcommand*{\entryname}{Kifejez\'es}% +\renewcommand*{\descriptionname}{Magyar\'azat}% +\renewcommand*{\symbolname}{Jel\"ol\'es}% +\renewcommand*{\pagelistname}{Oldalsz\'am}% +\renewcommand*{\glssymbolsgroupname}{Jelek}% +\renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}% +} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-Danish.dict> +% \end{macrocode} +%\fi +%\subsubsection{Danish Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{Danish} +% \end{macrocode} +% Provide Danish translations: +% \begin{macrocode} +\providetranslation{Glossary}{Ordliste} +\providetranslation{Acronyms}{Akronymer} +\providetranslation{Notation (glossaries)}{Symbolforklaring} +\providetranslation{Description (glossaries)}{Beskrivelse} +\providetranslation{Symbol (glossaries)}{Symbol} +\providetranslation{Page List (glossaries)}{Side} +\providetranslation{Symbols (glossaries)}{Symboler} +\providetranslation{Numbers (glossaries)}{Tal} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-Dutch.dict> +% \end{macrocode} +%\fi +%\subsubsection{Dutch Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{Dutch} +% \end{macrocode} +% Provide Dutch translations: +% \begin{macrocode} +\providetranslation{Glossary}{Woordenlijst} +\providetranslation{Acronyms}{Acroniemen} +\providetranslation{Notation (glossaries)}{Benaming} +\providetranslation{Description (glossaries)}{Beschrijving} +\providetranslation{Symbol (glossaries)}{Symbool} +\providetranslation{Page List (glossaries)}{Pagina's} +\providetranslation{Symbols (glossaries)}{Symbolen} +\providetranslation{Numbers (glossaries)}{Cijfers} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-English.dict> +% \end{macrocode} +%\fi +%\subsubsection{English Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{English} +% \end{macrocode} +% Provide English translations: +% \begin{macrocode} +\providetranslation{Glossary}{Glossary} +\providetranslation{Acronyms}{Acronyms} +\providetranslation{Notation (glossaries)}{Notation} +\providetranslation{Description (glossaries)}{Description} +\providetranslation{Symbol (glossaries)}{Symbol} +\providetranslation{Page List (glossaries)}{Page List} +\providetranslation{Symbols (glossaries)}{Symbols} +\providetranslation{Numbers (glossaries)}{Numbers} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-French.dict> +% \end{macrocode} +%\fi +%\subsubsection{French Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{French} +% \end{macrocode} +% Provide French translations: +% \begin{macrocode} +\providetranslation{Glossary}{Glossaire} +\providetranslation{Acronyms}{Acronymes} +\providetranslation{Notation (glossaries)}{Terme} +\providetranslation{Description (glossaries)}{Description} +\providetranslation{Symbol (glossaries)}{Symbole} +\providetranslation{Page List (glossaries)}{Pages} +\providetranslation{Symbols (glossaries)}{Symboles} +\providetranslation{Numbers (glossaries)}{Nombres} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-German.dict> +% \end{macrocode} +%\fi +%\subsubsection{German Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{German} +% \end{macrocode} +% Provide German translations (quite a few variations were suggested +% for German; I settled on the following): +% \begin{macrocode} +\providetranslation{Glossary}{Glossar} +\providetranslation{Acronyms}{Akronyme} +\providetranslation{Notation (glossaries)}{Bezeichnung} +\providetranslation{Description (glossaries)}{Beschreibung} +\providetranslation{Symbol (glossaries)}{Symbol} +\providetranslation{Page List (glossaries)}{Seiten} +\providetranslation{Symbols (glossaries)}{Symbole} +\providetranslation{Numbers (glossaries)}{Zahlen} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-Irish.dict> +% \end{macrocode} +%\fi +%\subsubsection{Irish Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{Irish} +% \end{macrocode} +% Provide Irish translations: +% \begin{macrocode} +\providetranslation{Glossary}{Gluais} +\providetranslation{Acronyms}{Acrainmneacha} +\providetranslation{Notation (glossaries)}{Ciall} +\providetranslation{Description (glossaries)}{Tuairisc} +\providetranslation{Symbol (glossaries)}{Comhartha} +\providetranslation{Page List (glossaries)}{Leathanaigh} +\providetranslation{Symbols (glossaries)}{Comhartha\'{\i}} +\providetranslation{Numbers (glossaries)}{Uimhreacha} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-Italian.dict> +% \end{macrocode} +%\fi +%\subsubsection{Italian Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{Italian} +% \end{macrocode} +% Provide Italian translations: +% \begin{macrocode} +\providetranslation{Glossary}{Glossario} +\providetranslation{Acronyms}{Acronimi} +\providetranslation{Notation (glossaries)}{Nomenclatura} +\providetranslation{Description (glossaries)}{Descrizione} +\providetranslation{Symbol (glossaries)}{Simbolo} +\providetranslation{Page List (glossaries)}{Elenco delle pagine} +\providetranslation{Symbols (glossaries)}{Simboli} +\providetranslation{Numbers (glossaries)}{Numeri} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-Magyar.dict> +% \end{macrocode} +%\fi +%\subsubsection{Magyar Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{Magyar} +% \end{macrocode} +% Provide translations: +% \begin{macrocode} +\providetranslation{Glossary}{Sz\'ojegyz\'ek} +\providetranslation{Acronyms}{Bet\H uszavak} +\providetranslation{Notation (glossaries)}{Kifejez\'es} +\providetranslation{Description (glossaries)}{Magyar\'azat} +\providetranslation{Symbol (glossaries)}{Jel\"ol\'es} +\providetranslation{Page List (glossaries)}{Oldalsz\'am} +\providetranslation{Symbols (glossaries)}{Jelek} +\providetranslation{Numbers (glossaries)}{Sz\'amjegyek} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-dictionary-Spanish.dict> +% \end{macrocode} +%\fi +%\subsubsection{Spanish Dictionary} +% This is a dictonary file provided for use with the \isty{translator} +% package. +% \begin{macrocode} +\ProvidesDictionary{glossaries-dictionary}{Spanish} +% \end{macrocode} +% Provide Spanish translations: +% \begin{macrocode} +\providetranslation{Glossary}{Glosario} +\providetranslation{Acronyms}{Siglas} +\providetranslation{Notation (glossaries)}{Entrada} +\providetranslation{Description (glossaries)}{Descripci\'on} +\providetranslation{Symbol (glossaries)}{S\'{\i}mbolo} +\providetranslation{Page List (glossaries)}{Lista de p\'aginas} +\providetranslation{Symbols (glossaries)}{S\'{\i}mbolos} +\providetranslation{Numbers (glossaries)}{N\'umeros} +% \end{macrocode} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*minimalgls.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This is a minimal file for testing and debugging + % the glossaries package. Change the class file as + % desired, and add the relevant package options to + % both the class file and the glossaries package. + % Change the sample glossary entry and acronym if + % required. + % + % Only add extra packages or commands if they + % contribute to whatever problem you are trying to + % test. + % + % Remember that the document will not be complete + % until you have successfully completed all of the + % following steps: + % 1. latex minimalgls + % 2. makeglossaries minimalgls (note no extension) + % 3. latex minimalgls + % A further run through LaTeX will be required to ensure that + % the table of contents is up to date if the toc option + % is used. +\documentclass{article} +\listfiles + + %\usepackage{glossaries} % acronym will go in main glossary +\usepackage[acronym]{glossaries} % make a separate list of acronyms + +\makeglossaries + +\newglossaryentry{sample}{name={sample}, +description={a sample entry}} + +\newacronym{aca}{aca}{a contrived acronym} + +\begin{document} + +A \gls{sample} entry and \gls{aca}. + +\printglossaries +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass[a4paper]{report} + +\usepackage[plainpages=false,colorlinks]{hyperref} +\usepackage[style=altlist]{glossaries} + +\makeglossaries + +\newglossaryentry{glossary}{name=glossary, +description={1) list of technical words, 2) collection of +glosses}, +plural={glossaries}} + +\newglossaryentry{Perl}{name=\texttt{Perl}, +sort=Perl, % need a sort key because name contains a command +description=A scripting language} + +\newglossaryentry{pagelist}{name=page list, + % description value has to be enclosed in braces + % because it contains commas +description={a list of individual pages or page ranges +(e.g.\ 1,2,4,7-9)}} + +\newglossaryentry{mtrx}{name=matrix, +description={rectangular array of quantities}, + % plural is not simply obtained by appending an s, so specify +plural=matrices} + +\newcommand{\pardescription}{distinct section of piece of +writing.\par Beginning on new, usually indented, line} +\newglossaryentry{par}{name=paragraph, +description=\pardescription} + +\begin{document} + +\title{Sample Document Using glossary Package} +\author{Nicola Talbot} +\pagenumbering{alph}% prevent duplicate page link names if using PDF +\maketitle + +\pagenumbering{roman} +\tableofcontents + +\chapter{Introduction} +\pagenumbering{arabic} + +A \gls{glossary} is a very useful addition to any +technical document, although a \gls{glossary} can +also simply be a collection of glosses, which is +another thing entirely. Some documents have +multiple \glspl{glossary}. + +Once you have run your document through \LaTeX, you +will then need to run the \texttt{.glo} file through +\texttt{makeindex}. You will need to set the output +file so that it creates a \texttt{.gls} file instead +of an \texttt{.ind} file, and change the name of +the log file so that it doesn't overwrite the index +log file (if you have an index for your document). +Rather than having to remember all the command line +switches, you can call the \gls{Perl} script +\texttt{makeglossaries} which provides a convenient +wrapper. + +If a comma appears within the name or description, grouping +must be used, e.g.\ in the description of \gls{pagelist}. + +Plurals are assumed to have the letter s appended, but if +this is not the case, as in \glspl{mtrx}, then you need +to specify the plural when you define the entry. + +\Glspl{par} can cause a problem in commands. + +\printglossaries + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample4col.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\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} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleAcr.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass[a4paper]{report} + +\usepackage[colorlinks,plainpages=false]{hyperref} +\usepackage[style=long,toc]{glossaries} + +\makeglossaries + +\renewcommand*{\glstextformat}[1]{\textsf{#1}} + +\newacronym{svm}% label +{svm}% abbreviation +{support vector machine}% long form + +\newacronym{ksvm}{ksvm}{kernel support vector machine} + +\newacronym{rna}{rna}{ribonukleins\"aure} + +\begin{document} +\tableofcontents + +\chapter{Support Vector Machines} + +\Glspl{svm} are used widely in the area of pattern recognition. + +This is the text produced without a link: \glsentrytext{svm}. +This is the text produced on first use without a link: +\glsentryfirst{svm}. This is the entry's description without +a link: \glsentrydesc{svm}. + +This is the entry in uppercase: \GLS{svm}. + +\chapter{Kernel Support Vector Machines} + +The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses +the so called ``kernel trick''. Plural: \glspl{ksvm}. + +\glsresetall +Possessive: \gls{ksvm}['s]. +Make the glossary entry number bold for this +one \gls[format=hyperbf]{svm}. + +\chapter{Another chapter} + +You don't need to worry about makeindex's special characters: +\gls{rna}. + +\printglossary[title={Acronyms}] + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleAcrDesc.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass[a4paper]{report} + +\usepackage[colorlinks,plainpages=false]{hyperref} + +\usepackage[style=altlist, % use altlist style + toc, % add the glossary to the table of contents + sanitize={description=false}% don't sanitize description + ]{glossaries} + +\makeglossaries + +\newglossaryentry{svm}{ + % how the entry name should appear in the glossary +name={Support vector machine (SVM)}, + % how the description should appear in the glossary + % since I have used sanitize={description=false} + % I have to protect fragile commands +description={Statistical pattern recognition +technique~\protect\cite{svm}}, + % how the entry should appear in the document text +text={svm}, + % how the entry should appear the first time it is + % used in the document text +first={support vector machine (svm)}} + +\newglossaryentry{ksvm}{ +name={Kernel support vector machine (KSVM)}, +description={Statistical pattern recognition technique +using the ``kernel trick'' (see also SVM)}, +text={ksvm}, +first={kernel support vector machine}} + +\begin{document} +\tableofcontents + +\chapter{Support Vector Machines} + +The \gls{svm} is used widely in the area of pattern recognition. + % plural form with initial letter in uppercase: +\Glspl{svm} are \ldots + +This is the text produced without a link: \glsentrytext{svm}. +This is the text produced on first use without a link: +\glsentryfirst{svm}. This is the entry's description without +a link: \glsentrydesc{svm}. + +This is the entry in uppercase: \GLS{svm}. + +\chapter{Kernel Support Vector Machines} + +The \gls{ksvm} is \ifglsused{svm}{an}{a} \gls{svm} that uses +the so called ``kernel trick''. + +\glsresetall +Possessive: \gls{ksvm}['s]. +Make the glossary entry number bold for this +one \gls[format=hyperbf]{svm}. + +\begin{thebibliography}{1} +\bibitem{svm} \ldots +\end{thebibliography} + +\printglossary[title={Acronyms}] + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleDB.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass{article} + +\usepackage[colorlinks,plainpages=false]{hyperref} +\usepackage[nonumberlist]{glossaries} + +\newglossary[nlg]{symbols}{not}{ntn}{Symbols} + +\makeglossaries + +\loadglsentries{database1} +\loadglsentries[symbols]{database2} + +\begin{document} + +Adding all entries\glsaddall. + +\printglossaries + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleEq.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass[a4paper,12pt]{report} + +\usepackage{amsmath} +\usepackage[colorlinks]{hyperref} +\usepackage[style=long3colheader,counter=equation]{glossaries} + +\newcommand{\erf}{\operatorname{erf}} +\newcommand{\erfc}{\operatorname{erfc}} + +\makeglossaries + + % Change the glossary headings + +\renewcommand{\entryname}{Notation} +\renewcommand{\descriptionname}{Function Name} +\renewcommand{\pagelistname}{Number of Formula} + + % define glossary entries + +\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, +description=Gamma function, +sort=Gamma} + +\newglossaryentry{gamma}{name={\ensuremath{\gamma(\alpha,x)}}, +description=Incomplete gamma function, +sort=gamma} + +\newglossaryentry{iGamma}{name={\ensuremath{\Gamma(\alpha,x)}}, +description=Incomplete gamma function, +sort=Gamma} + +\newglossaryentry{psi}{name=\ensuremath{\psi(x)}, +description=Psi function,sort=psi} + +\newglossaryentry{erf}{name=\ensuremath{\erf(x)}, +description=Error function,sort=erf} + +\newglossaryentry{erfc}{name=\ensuremath{\erfc}, +description=Complementary error function,sort=erfc} + +\newglossaryentry{B}{name={\ensuremath{B(x,y)}}, +description=Beta function,sort=B} + +\newglossaryentry{Bx}{name={\ensuremath{B_x(p,q)}}, +description=Incomplete beta function,sort=Bx} + +\newglossaryentry{Tn}{name=\ensuremath{T_n(x)}, +description=Chebyshev's polynomials of the first kind,sort=Tn} + +\newglossaryentry{Un}{name=\ensuremath{U_n(x)}, +description=Chebyshev's polynomials of the second kind,sort=Un} + +\newglossaryentry{Hn}{name=\ensuremath{H_n(x)}, +description=Hermite polynomials,sort=Hn} + +\newglossaryentry{Ln}{name=\ensuremath{L_n^\alpha(x)}, +description=Laguerre polynomials,sort=Lna} + +\newglossaryentry{Znu}{name=\ensuremath{Z_\nu(z)}, +description=Bessel functions,sort=Z} + +\newglossaryentry{Phi}{name={\ensuremath{\Phi(\alpha,\gamma;z)}}, +description=confluent hypergeometric function,sort=Pagz} + +\newglossaryentry{knu}{name=\ensuremath{k_\nu(x)}, +description=Bateman's function,sort=kv} + +\newglossaryentry{Dp}{name=\ensuremath{D_p(z)}, +description=Parabolic cylinder functions,sort=Dp} + +\newglossaryentry{F}{name={\ensuremath{F(\phi,k)}}, +description=Elliptical integral of the first kind,sort=Fpk} + +\newglossaryentry{C}{name=\ensuremath{C}, +description=Euler's constant,sort=C} + +\newglossaryentry{G}{name=\ensuremath{G}, +description=Catalan's constant,sort=G} + +\begin{document} +\title{A Sample Document Using glossaries.sty} +\author{Nicola Talbot} +\maketitle + +\begin{abstract} +This is a sample document illustrating the use of the \textsf{glossaries} +package. The functions here have been taken from ``Tables of +Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik. +The glossary is a list of special functions, so +the equation number has been used rather than the page number. This +can be done using the \texttt{counter=equation} package +option. +\end{abstract} + +\printglossary[title={Index of Special Functions and Notations}] + +\chapter{Gamma Functions} + +\begin{equation} +\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt +\end{equation} + +\verb|\ensuremath| is only required here if using +hyperlinks. +\begin{equation} +\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x) +\end{equation} + +\begin{equation} +\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt +\end{equation} + +\begin{equation} +\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt +\end{equation} + +\newpage + +\begin{equation} +\gls{Gamma} = \Gamma(\alpha, x) + \gamma(\alpha, x) +\end{equation} + +\begin{equation} +\gls{psi} = \frac{d}{dx}\ln\Gamma(x) +\end{equation} + +\chapter{Error Functions} + +\begin{equation} +\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt +\end{equation} + +\begin{equation} +\gls{erfc} = 1 - \erf(x) +\end{equation} + +\chapter{Beta Function} + +\begin{equation} +\gls{B} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt +\end{equation} +Alternatively: +\begin{equation} +\gls{B} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi +\end{equation} + +\begin{equation} +\gls{B} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x) +\end{equation} + +\begin{equation} +\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt +\end{equation} + +\chapter{Polynomials} + +\section{Chebyshev's polynomials} + +\begin{equation} +\gls{Tn} = \cos(n\arccos x) +\end{equation} + +\begin{equation} +\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]} +\end{equation} + +\section{Hermite polynomials} + +\begin{equation} +\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2}) +\end{equation} + +\section{Laguerre polynomials} + +\begin{equation} +L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} +\frac{d^n}{dx^n}(e^{-x}x^{n+\alpha}) +\end{equation} + +\chapter{Bessel Functions} + +Bessel functions $Z_\nu$ are solutions of +\begin{equation} +\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} ++ \frac{1}{z}\,\frac{dZ_\nu}{dz} + +\left( 1-\frac{\nu^2}{z^2}Z_\nu = 0 \right) +\end{equation} + +\chapter{Confluent hypergeometric function} + +\begin{equation} +\gls{Phi} = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!} ++ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!} ++\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\, +\frac{z^3}{3!} + \cdots +\end{equation} + +\begin{equation} +\gls{knu} = \frac{2}{\pi}\int_0^{\pi/2} +\cos(x \tan\theta - \nu\theta)\,d\theta +\end{equation} + +\chapter{Parabolic cylinder functions} + +\begin{equation} +\gls{Dp} = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}} +\left\{ +\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)} +\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right) +-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)} +\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right) +\right\} +\end{equation} + +\chapter{Elliptical Integral of the First Kind} + +\begin{equation} +\gls{F} = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}} +\end{equation} + +\chapter{Constants} + +\begin{equation} +\gls{C} = 0.577\,215\,664\,901\ldots +\end{equation} + +\begin{equation} +\gls{G} = 0.915\,965\,594\ldots +\end{equation} + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleEqPg.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass[a4paper,12pt]{report} + +\usepackage{amsmath} +\usepackage[colorlinks]{hyperref} +\usepackage[style=long3colheader,toc, + counter=equation]{glossaries} + +\newcommand{\erf}{\operatorname{erf}} +\newcommand{\erfc}{\operatorname{erfc}} + +\renewcommand{\glossaryname}{Index of Special Functions and Notations} + +\renewcommand{\glossarypreamble}{Numbers in italic indicate the equation number, +numbers in bold indicate page numbers where the main definition occurs.\par} + + % set the glossary number style to italic + % hyperit is used instead of textit because + % the hyperref package is being used. +\renewcommand{\glsnumberformat}[1]{\hyperit{#1}} + + % 1st column heading +\renewcommand{\entryname}{Notation} + + % 2nd column heading +\renewcommand{\descriptionname}{Function Name} + + % 3rd column heading +\renewcommand{\pagelistname}{} + + % Redefine header row so that it + % adds a blank row after the title row +\renewcommand{\glossaryheader}{\bfseries\entryname & +\bfseries\descriptionname&\bfseries\pagelistname\\ +& & \\\endhead} + + % Define glossary entries + +\newglossaryentry{Gamma}{name=\ensuremath{\Gamma(z)}, +description=Gamma function,sort=Gamma} + +\newglossaryentry{gamma}{name=\ensuremath{\gamma(\alpha,x)}, +description=Incomplete gamma function,sort=gamma} + +\newglossaryentry{iGamma}{name=\ensuremath{\Gamma(\alpha,x)}, +description=Incomplete gamma function,sort=Gamma} + +\newglossaryentry{psi}{name=\ensuremath{\psi(x)}, +description=Psi function,sort=psi} + +\newglossaryentry{erf}{name=\ensuremath{\erf(x)}, +description=Error function,sort=erf} + +\newglossaryentry{erfc}{name=\ensuremath{\erfc(x)}, +description=Complementary error function,sort=erfc} + +\newglossaryentry{beta}{name=\ensuremath{B(x,y)}, +description=Beta function,sort=B} + +\newglossaryentry{Bx}{name=\ensuremath{B_x(p,q)}, +description=Incomplete beta function,sort=Bx} + +\newglossaryentry{Tn}{name=\ensuremath{T_n(x)}, +description=Chebyshev's polynomials of the first kind, +sort=Tn} + +\newglossaryentry{Un}{name=\ensuremath{U_n(x)}, +description=Chebyshev's polynomials of the second kind, +sort=Un} + +\newglossaryentry{Hn}{name=\ensuremath{H_n(x)}, +description=Hermite polynomials,sort=Hn} + +\newglossaryentry{Lna}{name=\ensuremath{L_n^\alpha(x)}, +description=Laguerre polynomials,sort=Lna} + +\newglossaryentry{Znu}{name=\ensuremath{Z_\nu(z)}, +description=Bessel functions,sort=Z} + +\newglossaryentry{Pagz}{name=\ensuremath{\Phi(\alpha,\gamma;z)}, +description=confluent hypergeometric function,sort=Pagz} + +\newglossaryentry{kv}{name=\ensuremath{k_\nu(x)}, +description=Bateman's function,sort=kv} + +\newglossaryentry{Dp}{name=\ensuremath{D_p(z)}, +description=Parabolic cylinder functions,sort=Dp} + +\newglossaryentry{Fpk}{name=\ensuremath{F(\phi,k)}, +description=Elliptical integral of the first kind,sort=Fpk} + +\newglossaryentry{C}{name=\ensuremath{C}, +description=Euler's constant,sort=C} + +\newglossaryentry{G}{name=\ensuremath{G}, +description=Catalan's constant,sort=G} + +\makeglossaries + +\pagestyle{headings} + +\begin{document} + +\title{Sample Document Using Interchangable Numbering} +\author{Nicola Talbot} +\maketitle + +\begin{abstract} +This is a sample document illustrating the use of the \textsf{glossaries} +package. The functions here have been taken from ``Tables of +Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik. + +The glossary lists both page numbers and equation numbers. +Since the majority of the entries use the equation number, +\texttt{counter=equation} was used as a package option. +Note that this example will only work where the +page number and equation number compositor is the same. So +it won't work if, say, the page numbers are of the form +2-4 and the equation numbers are of the form 4.6. +As most of the glossary entries should have an italic +format, it is easiest to set the default format to +italic. + +\end{abstract} + +\tableofcontents + +\printglossary[toctitle={Special Functions}] + +\chapter{Gamma Functions} + +The \glslink[format=hyperbf,counter=page]{Gamma}{gamma function} is +defined as +\begin{equation} +\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt +\end{equation} + +\begin{equation} +\glslink{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x) +\end{equation} + +\begin{equation} +\gls{gamma} = \int_0^x e^{-t}t^{\alpha-1}\,dt +\end{equation} + +\begin{equation} +\gls{iGamma} = \int_x^\infty e^{-t}t^{\alpha-1}\,dt +\end{equation} + +\newpage + +\begin{equation} +\glslink{Gamma}{\ensuremath{\Gamma(\alpha)}} = +\Gamma(\alpha, x) + \gamma(\alpha, x) +\end{equation} + +\begin{equation} +\gls{psi} = \frac{d}{dx}\ln\Gamma(x) +\end{equation} + +\chapter{Error Functions} + +The \glslink[format=hyperbf,counter=page]{erf}{error function} is defined as: +\begin{equation} +\gls{erf} = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt +\end{equation} + +\begin{equation} +\gls{erfc} = 1 - \erf(x) +\end{equation} + +\chapter{Beta Function} + +\begin{equation} +\gls{beta} = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt +\end{equation} +Alternatively: +\begin{equation} +\gls{beta} = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi +\end{equation} + +\begin{equation} +\gls{beta} = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x) +\end{equation} + +\begin{equation} +\gls{Bx} = \int_0^x t^{p-1}(1-t)^{q-1}\,dt +\end{equation} + +\chapter{Chebyshev's polynomials} + +\begin{equation} +\gls{Tn} = \cos(n\arccos x) +\end{equation} + +\begin{equation} +\gls{Un} = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]} +\end{equation} + +\chapter{Hermite polynomials} + +\begin{equation} +\gls{Hn} = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2}) +\end{equation} + +\chapter{Laguerre polynomials} + +\begin{equation} +\gls{Lna} = \frac{1}{n!}e^x x^{-\alpha} +\frac{d^n}{dx^n}(e^{-x}x^{n+\alpha}) +\end{equation} + +\chapter{Bessel Functions} + +Bessel functions $Z_\nu(z)$ are solutions of +\begin{equation} +\frac{d^2\glslink{Znu}{Z_\nu}}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} + +\left( +1-\frac{\nu^2}{z^2}Z_\nu = 0 +\right) +\end{equation} + +\chapter{Confluent hypergeometric function} + +\begin{equation} +\gls{Pagz} = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!} ++ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!} ++\frac{\alpha(\alpha+1)(\alpha+2)} + {\gamma(\gamma+1)(\gamma+2)} +\,\frac{z^3}{3!} ++ \cdots +\end{equation} + +\begin{equation} +\gls{kv} = \frac{2}{\pi}\int_0^{\pi/2} +\cos(x \tan\theta - \nu\theta)\,d\theta +\end{equation} + +\chapter{Parabolic cylinder functions} + +\begin{equation} +\gls{Dp} = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}} +\left\{ +\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)} +\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right) +-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)} +\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right) +\right\} +\end{equation} + +\chapter{Elliptical Integral of the First Kind} + +\begin{equation} +\gls{Fpk} = \int_0^\phi +\frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}} +\end{equation} + +\chapter{Constants} + +\begin{equation} +\gls{C} = 0.577\,215\,664\,901\ldots +\end{equation} + +\begin{equation} +\gls{G} = 0.915\,965\,594\ldots +\end{equation} + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleNtn.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass{report} + +\usepackage[plainpages=false,colorlinks]{hyperref} +\usepackage{html} +\usepackage[toc]{glossaries} + + % Define a new glossary type called notation +\newglossary[nlg]{notation}{not}{ntn}{Notation} + +\makeglossaries + + % Notation definitions + +\newglossaryentry{not:set}{type=notation, % glossary type +name={$\mathcal{S}$}, +description={A set}, +sort={S}} + +\newglossaryentry{not:U}{type=notation, +name={$\mathcal{U}$}, +description={The universal set}, +sort=U} + +\newglossaryentry{not:card}{type=notation, +name={$|\mathcal{S}|$}, +description={cardinality of $\mathcal{S}$}, +sort=cardinality} + +\newglossaryentry{not:fact}{type=notation, +name={$!$}, +description={factorial}, +sort=factorial} + + % Main glossary definitions + +\newglossaryentry{gls:set}{name=set, +description={A collection of distinct objects}} + +\newglossaryentry{gls:card}{name=cardinality, +description={The number of elements in the specified set}} + +\begin{document} +\title{Sample Document using the glossaries Package} +\author{Nicola Talbot} +\pagenumbering{alph} +\maketitle + +\begin{abstract} + %stop hyperref complaining about duplicate page identifiers: +\pagenumbering{Alph} +This is a sample document illustrating the use of the +\textsf{glossaries} package. In this example, a new glossary type +called \texttt{notation} is defined, so that the document can have a +separate glossary of terms and index of notation. The index of notation +doesn't have associated numbers. +\end{abstract} + + +\pagenumbering{roman} +\tableofcontents + +\printglossaries + %\printglossary + %\setglossarysection{section} + %\printglossary[type=notation] + +\chapter{Introduction} +\pagenumbering{arabic} + +\glslink{gls:set}{Sets} +are denoted by a caligraphic font +e.g.\ \gls{not:set}. + +Let \gls[format=hyperit]{not:U} denote the universal set. + +The \gls{gls:card} of a set $\mathcal{S}$ is denoted +\gls{not:card}. + +\chapter{Another Chapter} + +Another mention of the universal set \gls{not:U}. + +The factorial symbol: \gls{not:fact}. + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sampleSec.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +\documentclass{report} + +\usepackage[plainpages=false,colorlinks]{hyperref} +\usepackage[style=altlist,toc,counter=section]{glossaries} + +\makeglossaries + +\newglossaryentry{ident}{name=identity matrix, +description=diagonal matrix with 1s along the leading diagonal, +plural=identity matrices} + +\newglossaryentry{diag}{name=diagonal matrix, +description=matrix whose only non-zero entries are along +the leading diagonal, +plural=diagonal matrices} + +\newglossaryentry{sing}{name=singular matrix, +description=matrix with zero determinant, +plural=singular matrices} + +\begin{document} + +\pagenumbering{roman} +\tableofcontents + +\printglossaries + +\chapter{Introduction} +\pagenumbering{arabic} +This is a sample document illustrating the use of the +\textsf{glossaries} package. + +\chapter{Diagonal matrices} + +A \gls[format=hyperit]{diag} is a matrix where all elements not on the +leading diagonal are zero. This is the +primary definition, so an italic font is used for the page number. + +\newpage +\section{Identity matrix} +The \gls[format=hyperit]{ident} is a \gls{diag} whose leading +diagonal elements are all equal to 1. + +Here is another entry for a \gls{diag}. And this is the +plural: \glspl{ident}. + +This adds an entry into the glossary with a bold number, but +it doesn't create a hyperlink: \gls*[format=hyperbf]{ident}. + +\chapter{Singular Matrices} + +A \gls{sing} is a matrix with zero determinant. +\Glspl{sing} are non-invertible. Possessive: +a \gls{sing}['s] dimensions are not necessarily equal. + +Another \gls{ident} entry. + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*database1.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This is a sample database of glossary entries + % Only those entries used in the document with \glslink, \gls, + % \glspl, and uppercase variants will have entries in the + % glossary. Note that the type key is not used, as the + % glossary type can be specified in \loadglsentries + +\newglossaryentry{array}{name=array, +description={A list of values identified by a numeric value}} + +\newglossaryentry{binary}{name=binary, +description={Pertaining to numbers represented in base 2}} + +\newglossaryentry{comment}{name=comment, +description={A remark that doesn't affect the meaning of the +code}} + +\newglossaryentry{global}{name=global, +description={Something that maintains its state when it leaves +the current group}} + +\newglossaryentry{local}{name=local, +description={Something that only maintains its state until +it leaves the group in which it was defined/changed}} + +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*database2.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This is a sample database of glossary entries + % Only those entries used in the document with \glslink, \gls, + % \glspl, and uppercase variants will have entries in the + % glossary. Note that the type key is not used, as the + % glossary type can be specified in \loadglsentries + + % Don't need to worry about makeindex special characters +\newglossaryentry{quote}{name={"}, +description={the double quote symbol}} + +\newglossaryentry{at}{name={@}, +description={the ``at'' symbol}} + +\newglossaryentry{excl}{name={!}, +description={the exclamation mark symbol}} + +\newglossaryentry{bar}{name={$|$}, +description={the vertical bar symbol}} + +\newglossaryentry{hash}{name={\#}, +description={the hash symbol}} + +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries.perl> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +# File : glossaries.perl # Author : Nicola L.C. Talbot # Date : 14th June 2007 -# Last Modified : 21st Aug 2007 -# Version : 1.02 +# Last Modified : 22 February 2008 +# Version : 1.03 # Description : LaTeX2HTML (limited!) implementation of glossaries # package. Note that not all the glossaries.sty # macros have been implemented. -# This is a LaTeX2HTML style implementing the glossaries package, and -# is distributed as part of that package. -# Copyright 2007 Nicola L.C. Talbot -# This work may be distributed and/or modified under the -# conditions of the LaTeX Project Public License, either version 1.3 -# of this license of (at your option) any later version. -# The latest version of this license is in -# http://www.latex-project.org/lppl.txt -# and version 1.3 or later is part of all distributions of LaTeX -# version 2005/12/01 or later. -# -# This work has the LPPL maintenance status `maintained'. -# -# The Current Maintainer of this work is Nicola Talbot. +# This is a LaTeX2HTML style implementing the glossaries package, and +# is distributed as part of that package. +# Copyright 2007 Nicola L.C. Talbot +# This work may be distributed and/or modified under the +# conditions of the LaTeX Project Public License, either version 1.3 +# of this license of (at your option) any later version. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3 or later is part of all distributions of LaTeX +# version 2005/12/01 or later. +# +# This work has the LPPL maintenance status `maintained'. +# +# The Current Maintainer of this work is Nicola Talbot. + +# This work consists of the files glossaries.dtx and glossaries.ins +# and the derived files glossaries.sty, glossary-hypernav.sty, +# glossary-list.sty, glossary-long.sty, glossary-super.sty, +# glossaries.perl. Also makeglossaries and makeglossaries.bat + + +package main; + +# These are the only package options implemented. + +sub do_glossaries_style_altlist{ +} + +sub do_glossaries_toc{ +} + +sub do_glossaries_toc_true{ +} + +$GLSCURRENTFORMAT="textrm"; + +sub do_cmd_glossaryname{ + "Glossary$_[0]" +} + +$gls_mark{'main'} = ""; +$gls_file_mark{'main'} = ""; +$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) =('',''); + if ($INDEX_STYLES) { +if ($INDEX_STYLES =~/,/) { +local(@styles) = split(/\s*,\s*/,$INDEX_STYLES); + $sidx_style = join('','<', join('><',@styles) ,'>'); + $eidx_style = join('',''); +} else { + $sidx_style = join('','<', $INDEX_STYLES,'>'); + $eidx_style = join('',''); +} + } + &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 + . "\n" + : "
" + . $name + . "
" + . $glsentry{$entry}{'description'} + . $symbol . '. ' + . $glossary{$type}{$key} + . $linktext. "\n"); + $previous = $current; + } + $glossary = '
'.$glossary unless ($glossary =~ /^\s*/); + + $glossary =~ s/(]*>)()/$2$1/g; + + $str = &translate_commands("\\glossarypostamble"); + s/$gls_mark{$type}/$preglossary\n
\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'}; -# This work consists of the files glossaries.dtx and glossaries.ins -# and the derived files glossaries.sty, glossary-hypernav.sty, -# glossary-list.sty, glossary-long.sty, glossary-super.sty, -# glossaries.perl. Also makeglossaries and makeglossaries.bat + s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg; + ## if ($bbl_cnt == 1) { +s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo; + #} + $global{'max_id'} = $id; + s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o; + s/[\\]printindex/\\textohtmlindex /o; + &add_gls_dummy_commands; + &lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands); +} + +sub add_gls_dummy_commands{ + s/[\\]printglossary/\\textohtmlglossary/sg; + s/[\\]printglossaries/\\textohtmlglossaries/sg; +} + +sub get_firstkeyval{ + local($key,$_) = @_; + local($value); + + s/\b$key\s*=$OP(\d+)$CP(.*)$OP\1$CP\s*(,|$)/$value=$2;','/es; + undef($value) if $`=~/\b$key\s*=/; + + unless (defined($value)) + { + s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s; + $value=$2; + } + + ($value,$_); +} + +# need to get the value of the last key of a given name +# in the event of multiple occurences. +sub get_keyval{ + local($key,$_) = @_; + local($value); + + while (/\b$key\s*=/) + { + ($value,$_) = &get_firstkeyval($key, $_); + last unless defined($value); + } + + ($value,$_); +} + +# This is modified from do_cmd_textohtmlindex + +sub do_cmd_textohtmlglossary{ + local($_) = @_; + + local($keyval,$pat) = &get_next_optional_argument; + + local($type,$title,$toctitle,$style); + + ($type,$keyval) = &get_keyval('type', $keyval); + ($title,$keyval) = &get_keyval('title', $keyval); + ($toctitle,$keyval) = &get_keyval('toctitle', $keyval); + ($style,$keyval) = &get_keyval('style', $keyval); + + &make_textohtmlglossary($type,$toctitle,$title,$style).$_; +} + +sub make_textohtmlglossary{ + local($type,$toctitle,$title,$style) = @_; + + unless (defined($type)) {$type = 'main';} + + unless (defined $gls_mark{$type}) + { + &write_warnings("glossary type '$type' not implemented"); + } + + unless (defined($title) and $title) {$title = $gls_title{$type};} + unless (defined($toctitle) and $toctitle) {$toctitle = $title;} + + $toc_sec_title = $toctitle; + $glsfile{$type} = $CURRENT_FILE; + + $TITLE=&translate_commands($toctitle); + + if (%glossary_labels) { &make_glossary_labels(); } + + if (($SHORT_INDEX) && (%glossary_segment)) + { + &make_preglossary(); + } + else + { + $preglossary = &translate_commands("\\glossarypreamble"); + } + + local $idx_head = $section_headings{'textohtmlindex'}; + local($heading) = join('' + , &make_section_heading($title, $idx_head) + , $gls_mark{$type} ); + local($pre,$post) = &minimize_open_tags($heading); + join('',"
\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 = "
\n

Legend:

\n
"; + @keys = keys %glossary_segment; + foreach $key (@keys) { + local($tmp) = "segment$key"; + $tmp = $ref_files{$tmp}; + $body .= "\n
$key
".&make_named_href('',$tmp,$glossary_segment{$key}); + } + $preglossary = join('', $head, $body, "\n
") 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; + "
$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} = ""; + $gls_file_mark{$type} = ""; + $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); -package main; + $symbol = &missing_braces unless + (s/$next_pair_pr_rx/$symbol=$2;''/eo); -# These are the only package options implemented. + $insert = &missing_braces unless + (s/$next_pair_pr_rx/$insert=$2;''/eo); -sub do_glossaries_style_altlist{ + "$text$insert" . $_; } -sub do_glossaries_toc{ +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 do_glossaries_toc_true{ +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; } -$GLSCURRENTFORMAT="textrm"; +sub do_cmd_glsnamefont{ + local($_) = @_; + local($text); -sub do_cmd_glossaryname{ - "Glossary$_[0]" + $text = &missing_braces unless + (s/$next_pair_pr_rx/$text=$2;''/eo); + + "$text$_"; } -$gls_mark{'main'} = ""; -$gls_file_mark{'main'} = ""; -$gls_title{'main'} = "\\glossaryname"; -$delimN{'main'} = ", "; -$glsnumformat{'main'} = $GLSCURRENTFORMAT; -@{$gls_entries{'main'}} = (); -$gls_displayfirst{'main'} = "glsdisplayfirst"; -$gls_display{'main'} = "glsdisplay"; +sub do_cmd_newacronym{ + local($_) = @_; + local($label,$abbrev,$long,$opt); -%glsentry = (); + ($opt,$pat) = &get_next_optional_argument; -$acronymtype = 'main'; + $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); -sub do_glossaries_acronym{ - &do_glossaries_acronym_true -} + 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"; -sub do_glossaries_acronym_true{ - &make_newglossarytype("acronym", "\\acronymname"); - $acronymtype = 'acronym'; -} + $id = ++$global{'max_id'}; + $cmd .= "$OP$id$CP$entry,$opt$OP$id$CP"; -sub do_glossary_acronym_false{ - $acronymtype = 'main'; + &translate_commands($cmd).$_; } -sub do_cmd_acronymname{ - join('', 'Acronyms', $_[0]); -} +sub gls_entry_init{ + local($label, $type, $name, $desc) = @_; -sub do_cmd_acronymtype{ - join('', $acronymtype, $_[0]); + %{$glsentry{$label}} = + ( type => $type, + name => $name, + 'sort' => $name, + description => $description, + text => $name, + first => $name, + plural => "${name}s", + firstplural => "${name}s", + symbol => '', + flag => 0 + ); } -# modify set_depth_levels so that glossary is added +sub gls_get_type{ + local($label) = @_; + local($type) = ''; -sub replace_glossary_markers{ - foreach $type (keys %gls_mark) + if (&gls_entry_defined($label)) { - 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; + $type = $glsentry{$label}{'type'}; + } + else + { + &write_warnings("gls_get_type: glossary entry '$label' has not been defined"); } + + $type; } -# 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; +sub gls_set_type{ + local($label, $type) = @_; - 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 (&gls_entry_defined($label)) + { + $glsentry{$label}{'type'} = $type; + } + else + { + &write_warnings("gls_set_type: glossary entry '$label' has not been defined"); + } +} - 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 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"); + } -sub add_gls{ - local($sidx_style, $eidx_style) =('',''); - if ($INDEX_STYLES) { -if ($INDEX_STYLES =~/,/) { -local(@styles) = split(/\s*,\s*/,$INDEX_STYLES); - $sidx_style = join('','<', join('><',@styles) ,'>'); - $eidx_style = join('',''); -} else { - $sidx_style = join('','<', $INDEX_STYLES,'>'); - $eidx_style = join('',''); + $name; } - } - &add_real_gls + +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 gloskeysort{ - local($x, $y) = ($a, $b); - $x=~s/^(.*)###(\d+)$/\l\1/; - local($x_id) = $2; - $y=~s/^(.*)###(\d+)$/\l\1/; - local($y_id) = $2; +sub gls_get_description{ + local($label) = @_; + local($description) = ''; - local($n) = ($x cmp $y); + if (&gls_entry_defined($label)) + { + $description = $glsentry{$label}{'description'}; + } + else + { + &write_warnings("gls_get_description: glossary entry '$label' has not been defined"); + } - if ($n == 0) + $description; +} + +sub gls_set_description{ + local($label, $description) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'description'} = $description; + } + else { - $n = ($x_id <=> $y_id); + &write_warnings("gls_set_description: glossary entry '$label' has not been defined"); } - - $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}}; +sub gls_get_symbol{ + local($label) = @_; + local($symbol) = ''; - @keys = sort gloskeysort @keys; + if (&gls_entry_defined($label)) + { + $symbol = $glsentry{$label}{'symbol'}; + } + else + { + &write_warnings("gls_get_symbol: glossary entry '$label' has not been defined"); + } - $level = 0; + $symbol; +} - $delimN = $delimN{$type}; +sub gls_set_symbol{ + local($label, $symbol) = @_; - foreach $key (@keys) + if (&gls_entry_defined($label)) { - $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"); + $glsentry{$label}{'symbol'} = $symbol; + } + else + { + &write_warnings("gls_set_symbol: glossary entry '$label' has not been defined"); + } +} - local($symbol) = ($glsentry{$entry}{'symbol'} ? - " $glsentry{$entry}{symbol}" : ''); +sub gls_get_sort{ + local($label) = @_; + local($sort) = ''; - $glossary .= - # If it's the same string don't start a new line - (&index_key_eq($current, $previous) ? - $delimN - . $glossary{$type}{$key} - . $linktext - . "\n" - : "
" - . $name - . "
" - . $glsentry{$entry}{'description'} - . $symbol . '. ' - . $glossary{$type}{$key} - . $linktext. "\n"); - $previous = $current; + if (&gls_entry_defined($label)) + { + $sort = $glsentry{$label}{'sort'}; + } + else + { + &write_warnings("gls_get_sort: glossary entry '$label' has not been defined"); } - $glossary = '
'.$glossary unless ($glossary =~ /^\s*/); - - $glossary =~ s/(]*>)()/$2$1/g; - $str = &translate_commands("\\glossarypostamble"); - s/$gls_mark{$type}/$preglossary\n
\n$glossary<\/DL>$str\n/s; + $sort; } -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 - ); +sub gls_set_sort{ + local($label, $sort) = @_; - %section_commands = ( - %unnumbered_section_commands - , %section_commands - ); + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'sort'} = $sort; + } + else + { + &write_warnings("gls_set_sort: glossary entry '$label' has not been defined"); + } } -sub add_bbl_and_idx_dummy_commands { - local($id) = $global{'max_id'}; +sub gls_get_text{ + local($label) = @_; + local($text) = ''; - 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); -} + if (&gls_entry_defined($label)) + { + $text = $glsentry{$label}{'text'}; + } + else + { + &write_warnings("gls_get_text: glossary entry '$label' has not been defined"); + } -sub add_gls_dummy_commands{ - s/[\\]printglossary/\\textohtmlglossary/sg; - s/[\\]printglossaries/\\textohtmlglossaries/sg; + $text; } -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*=/; +sub gls_set_text{ + local($label, $text) = @_; - unless (defined($value)) + if (&gls_entry_defined($label)) { - s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s; - $value=$2; + $glsentry{$label}{'text'} = $text; + } + else + { + &write_warnings("gls_set_text: glossary entry '$label' has not been defined"); } - - ($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); +sub gls_get_plural{ + local($label) = @_; + local($plural) = ''; - while (/\b$key\s*=/) + if (&gls_entry_defined($label)) { - ($value,$_) = &get_firstkeyval($key, $_); - last unless defined($value); + $plural = $glsentry{$label}{'plural'}; + } + else + { + &write_warnings("gls_get_plural: glossary entry '$label' has not been defined"); } - ($value,$_); + $plural; } -# This is modified from do_cmd_textohtmlindex - -sub do_cmd_textohtmlglossary{ - local($_) = @_; +sub gls_set_plural{ + local($label, $plural) = @_; - local($keyval,$pat) = &get_next_optional_argument; + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'plural'} = $plural; + } + else + { + &write_warnings("gls_set_plural: glossary entry '$label' has not been defined"); + } +} - local($type,$title,$toctitle,$style); +sub gls_get_firstplural{ + local($label) = @_; + local($firstplural) = ''; - ($type,$keyval) = &get_keyval('type', $keyval); - ($title,$keyval) = &get_keyval('title', $keyval); - ($toctitle,$keyval) = &get_keyval('toctitle', $keyval); - ($style,$keyval) = &get_keyval('style', $keyval); + if (&gls_entry_defined($label)) + { + $firstplural = $glsentry{$label}{'firstplural'}; + } + else + { + &write_warnings("gls_get_firstplural: glossary entry '$label' has not been defined"); + } - &make_textohtmlglossary($type,$toctitle,$title,$style).$_; + $firstplural; } -sub make_textohtmlglossary{ - local($type,$toctitle,$title,$style) = @_; - - unless (defined($type)) {$type = 'main';} +sub gls_set_firstplural{ + local($label, $firstplural) = @_; - unless (defined $gls_mark{$type}) + if (&gls_entry_defined($label)) { - &write_warnings("glossary type '$type' not implemented"); + $glsentry{$label}{'firstplural'} = $firstplural; } + else + { + &write_warnings("gls_set_firstplural: glossary entry '$label' has not been defined"); + } +} - unless (defined($title) and $title) {$title = $gls_title{$type};} - unless (defined($toctitle) and $toctitle) {$toctitle = $title;} +sub gls_get_first{ + local($label) = @_; + local($first) = ''; - $toc_sec_title = $toctitle; - $glsfile{$type} = $CURRENT_FILE; + if (&gls_entry_defined($label)) + { + $first = $glsentry{$label}{'first'}; + } + else + { + &write_warnings("gls_get_first: glossary entry '$label' has not been defined"); + } - $TITLE=&translate_commands($toctitle); + $first; +} - if (%glossary_labels) { &make_glossary_labels(); } +sub gls_set_first{ + local($label, $first) = @_; - if (($SHORT_INDEX) && (%glossary_segment)) + if (&gls_entry_defined($label)) { - &make_preglossary(); + $glsentry{$label}{'first'} = $first; } else { - $preglossary = &translate_commands("\\glossarypreamble"); + &write_warnings("gls_set_first: glossary entry '$label' has not been defined"); } - - 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('',"
\n" , $pre); } -sub do_cmd_textohtmlglossaries{ - local($_) = @_; +sub gls_used{ + local($label) = @_; + local($flag) = 0; - foreach $type (keys %gls_mark) + if (&gls_entry_defined($label)) { - $id = ++$global{'max_id'}; - $_ = &make_textohtmlglossary($type,$gls_title{'main'}).$_; + $flag = $glsentry{$label}{'flag'}; + } + else + { + &write_warnings("gls_used: glossary entry '$label' has not been defined"); } - $_; + $flag; } -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 gls_entry_defined{ + local($label) = @_; -sub make_preglossary{ &make_real_preglossary } -sub make_real_preglossary{ - local($key, @keys, $head, $body); - $head = "
\n

Legend:

\n
"; - @keys = keys %glossary_segment; - foreach $key (@keys) { - local($tmp) = "segment$key"; - $tmp = $ref_files{$tmp}; - $body .= "\n
$key
".&make_named_href('',$tmp,$glossary_segment{$key}); - } - $preglossary = join('', $head, $body, "\n
") if ($body); + defined(%{$glsentry{$label}}); } -sub do_cmd_glossary { &do_real_glossary(@_) } -sub do_real_glossary { +sub do_cmd_newglossaryentry{ local($_) = @_; - local($type) = "main"; - local($anchor,$entry); + local($label,$name,$description,$symbol,$sort,$text,$first, + $plural,$firstplural,$type,$keyval); - local($type,$pat) = &get_next_optional_argument; + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; - $entry = &missing_braces unless - (s/$next_pair_pr_rx//o&&($entry=$2)); + $keyval = &missing_braces unless + s/$next_pair_pr_rx/$keyval=$2;''/eo; - $anchor = &make_glossary_entry($entry,$anchor_invisible_mark,$type); + ($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); - join('', $anchor, $_); -} + if (defined($type)) + { + $type = &translate_commands($type); + } + else + { + $type = 'main'; + } -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))); + &gls_entry_init($label, $type, $name, $description); - local($sort) = $glsentry{$entry}{'sort'}; + &gls_set_symbol($label, defined($symbol)?$symbol:''); - # 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; - "
$text<\/A>"; -} + $sort = "$name $description" unless (defined($sort) and $sort); -sub do_cmd_newglossary{ - local($_) = @_; - local($type,$out,$in,$opt,$pat,$title); + &gls_set_sort($label, $sort); - ($opt,$pat) = &get_next_optional_argument; + $text = $name unless (defined($text) and $text); - $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)); + &gls_set_text($label, $text); - ($opt,$pat) = &get_next_optional_argument; + $first = $text unless (defined($first) and $first); - &make_newglossarytype($type, $title); + &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 make_newglossarytype{ - local($type, $title) = @_; +sub reset_entry{ + local($label) = @_; - $gls_mark{$type} = ""; - $gls_file_mark{$type} = ""; - $gls_title{$type} = $title; - $delimN{$type} = ", "; - $glsnumformat{$type} = $GLSCURRENTFORMAT; - @{$gls_entries{$type}} = (); - $gls_displayfirst{$type} = "glsdisplayfirst"; - $gls_display{$type} = "glsdisplay"; + $glsentry{$label}{'flag'} = 0; } -sub do_cmd_glsdisplay{ - local($_) = @_; - local($text,$description,$symbol,$insert); +sub unset_entry{ + local($label) = @_; - $text = &missing_braces unless - (s/$next_pair_pr_rx/$text=$2;''/eo); + $glsentry{$label}{'flag'} = 1; +} - $description = &missing_braces unless - (s/$next_pair_pr_rx/$description=$2;''/eo); +sub do_cmd_glsreset{ + local($_) = @_; + local($label); - $symbol = &missing_braces unless - (s/$next_pair_pr_rx/$symbol=$2;''/eo); + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; - $insert = &missing_braces unless - (s/$next_pair_pr_rx/$insert=$2;''/eo); + &reset_entry($label); - "$text$insert" . $_; + $_; } -sub do_cmd_glsdisplayfirst{ +sub do_cmd_glsunset{ 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); + local($label); - $symbol = &missing_braces unless - (s/$next_pair_pr_rx/$symbol=$2;''/eo); + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; - $insert = &missing_braces unless - (s/$next_pair_pr_rx/$insert=$2;''/eo); + &unset_entry($label); - "$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 "; - } +sub do_cmd_ifglsused{ + local($_) = @_; + local($label,$true,$false); - $display; -} + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; -sub gls_get_display{ - local($type) = @_; - local($display)= $gls_display{$type}; + $true = &missing_braces unless + s/$next_pair_pr_rx/$true=$2;''/eo; - 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 "; - } + $false = &missing_braces unless + s/$next_pair_pr_rx/$false=$2;''/eo; - $display; + (&gls_used($label) ? $true : $false) . $_; } -sub do_cmd_glsnamefont{ +sub do_cmd_ifglsentryexists{ local($_) = @_; - local($text); + local($label,$true,$false); + + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; - $text = &missing_braces unless - (s/$next_pair_pr_rx/$text=$2;''/eo); + $true = &missing_braces unless + s/$next_pair_pr_rx/$true=$2;''/eo; - "$text$_"; + $false = &missing_braces unless + s/$next_pair_pr_rx/$false=$2;''/eo; + + (&gls_entry_defined($label) ? $true : $false) . $_; } -sub do_cmd_newacronym{ - local($_) = @_; - local($label,$abbrev,$long,$opt); +sub gls_add_entry{ + local($type, $label, $format, $text) = @_; - ($opt,$pat) = &get_next_optional_argument; + local($oldfmt) = $GLSCURRENTFORMAT; - $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); + if (defined($format)) + { + $format=~s/[\(\)]//; - 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"; + if ($format) + { + $GLSCURRENTFORMAT=$format; + } + } $id = ++$global{'max_id'}; - $cmd .= "$OP$id$CP$entry,$opt$OP$id$CP"; - &translate_commands($cmd).$_; + local($str) = &make_real_glossary_entry($label,$text,$type); + $GLSCURRENTFORMAT = $oldfmt; + + $str; } -sub gls_entry_init{ - local($label, $type, $name, $desc) = @_; +sub do_cmd_glsadd{ + local($_) = @_; + local($optarg,$pat,$label,$str,$id,$type,$format); + ($optarg,$pat) = &get_next_optional_argument; - %{$glsentry{$label}} = - ( type => $type, - name => $name, - 'sort' => $name, - description => $description, - text => $name, - first => $name, - plural => "${name}s", - firstplural => "${name}s", - symbol => '', - flag => 0 - ); -} + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); -sub gls_get_type{ - local($label) = @_; - local($type) = ''; + $type = &gls_get_type($label); - if (&gls_entry_defined($label)) + if (defined $type) { - $type = $glsentry{$label}{'type'}; + ($format,$optarg) = &get_keyval('format', $optarg); + $format='' unless(defined($format)); + + &gls_add_entry($type,$label,$format,""); } else { - &write_warnings("gls_get_type: glossary entry '$label' has not been defined"); + &write_warnings("gls_add: glossary entry '$label' undefined"); + $str = ''; } - $type; + $str . $_; } -sub gls_set_type{ - local($label, $type) = @_; +sub do_cmd_glsaddall{ + local($_) = @_; + local($optarg,$pat) = &get_next_optional_argument; - if (&gls_entry_defined($label)) + 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)) { - $glsentry{$label}{'type'} = $type; + @types = split /,/, $types; } - else + + foreach $type (@types) { - &write_warnings("gls_set_type: glossary entry '$label' has not been defined"); + # strip leasing and trailing spaces + $type=~s/^\s*([^\s]+)\s*$/\1/; + + foreach $label (@{$gls_entries{$type}}) + { + &gls_add_entry($type,$label,$format,""); + } } + + $_; } -sub gls_get_name{ - local($label) = @_; - local($name) = ''; +sub do_cmd_glsresetall{ + local($_) = @_; + local($types,$pat) = &get_next_optional_argument; - if (&gls_entry_defined($label)) + local(@types) = keys(%gls_mark); + + if (defined($types) and $types) { - $name = $glsentry{$label}{'name'}; + @types = split /,/, $types; } - else + + foreach $type (@types) { - &write_warnings("gls_get_name: glossary entry '$label' has not been defined"); + # strip leasing and trailing spaces + $type=~s/^\s*([^\s]+)\s*$/\1/; + + foreach $label (@{$gls_entries{$type}}) + { + &reset_entry($label); + } } - $name; + $_; } -sub gls_set_name{ - local($label, $name) = @_; +sub do_cmd_glsunsetall{ + local($_) = @_; + local($types,$pat) = &get_next_optional_argument; - if (&gls_entry_defined($label)) + local(@types) = keys(%gls_mark); + + if (defined($types) and $types) { - $glsentry{$label}{'name'} = $name; + @types = split /,/, $types; } - else + + foreach $type (@types) { - &write_warnings("gls_set_name: glossary entry '$label' has not been defined"); + # strip leasing and trailing spaces + $type=~s/^\s*([^\s]+)\s*$/\1/; + + foreach $label (@{$gls_entries{$type}}) + { + &reset_entry($label); + } } + + $_; } -sub gls_get_description{ - local($label) = @_; - local($description) = ''; +sub make_glslink{ + local($type,$label,$format,$text) = @_; + local($str) = ''; - if (&gls_entry_defined($label)) + if (defined $type) { - $description = $glsentry{$label}{'description'}; + $str = &gls_add_entry($type,$label,$format,$text); } else { - &write_warnings("gls_get_description: glossary entry '$label' has not been defined"); + &write_warnings("glossary '$type' undefined"); } - $description; + $str; } -sub gls_set_description{ - local($label, $description) = @_; +sub do_cmd_glslink{ + local($_) = @_; + local($optarg,$pat,$label,$text,$type,$format,$str); - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'description'} = $description; - } - else - { - &write_warnings("gls_set_description: glossary entry '$label' has not been defined"); - } + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + $text = &missing_braces unless + (s/$next_pair_pr_rx/$text=$2;''/eo); + + # v1.01 removed following lines (\glslink doesn't have + # a final optional argument! + #local ($space) = ''; + #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + #($optarg,$pat) = &get_next_optional_argument; + + $type = &gls_get_type($label); + + #&make_glslink($type, $label, $format, $text).$space . $_; + &make_glslink($type, $label, $format, $text) . $_; } -sub gls_get_symbol{ - local($label) = @_; - local($symbol) = ''; +sub do_cmd_glsentrydesc{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $symbol = $glsentry{$label}{'symbol'}; - } - else - { - &write_warnings("gls_get_symbol: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $symbol; + &gls_get_description($label).$_; } -sub gls_set_symbol{ - local($label, $symbol) = @_; +sub do_cmd_Glsentrydesc{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'symbol'} = $symbol; - } - else - { - &write_warnings("gls_set_symbol: glossary entry '$label' has not been defined"); - } + $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 gls_get_sort{ - local($label) = @_; - local($sort) = ''; +sub do_cmd_Glsentrytext{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $sort = $glsentry{$label}{'sort'}; - } - else - { - &write_warnings("gls_get_sort: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $sort; + ucfirst(&gls_get_text($label)).$_; } -sub gls_set_sort{ - local($label, $sort) = @_; +sub do_cmd_glsentryname{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'sort'} = $sort; - } - else - { - &write_warnings("gls_set_sort: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_name($label).$_; } -sub gls_get_text{ - local($label) = @_; - local($text) = ''; +sub do_cmd_Glsentryname{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $text = $glsentry{$label}{'text'}; - } - else - { - &write_warnings("gls_get_text: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $text; + ucfirst(&gls_get_name($label)).$_; } -sub gls_set_text{ - local($label, $text) = @_; +sub do_cmd_glsentryfirst{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'text'} = $text; - } - else - { - &write_warnings("gls_set_text: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_first($label).$_; } -sub gls_get_plural{ - local($label) = @_; - local($plural) = ''; +sub do_cmd_Glsentryfirst{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $plural = $glsentry{$label}{'plural'}; - } - else - { - &write_warnings("gls_get_plural: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $plural; + ucfirst(&gls_get_first($label)).$_; } -sub gls_set_plural{ - local($label, $plural) = @_; +sub do_cmd_glsentryplural{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'plural'} = $plural; - } - else - { - &write_warnings("gls_set_plural: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_plural($label).$_; } -sub gls_get_firstplural{ - local($label) = @_; - local($firstplural) = ''; +sub do_cmd_Glsentryplural{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $firstplural = $glsentry{$label}{'firstplural'}; - } - else - { - &write_warnings("gls_get_firstplural: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $firstplural; + ucfirst(&gls_get_plural($label)).$_; } -sub gls_set_firstplural{ - local($label, $firstplural) = @_; +sub do_cmd_glsentryfirstplural{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'firstplural'} = $firstplural; - } - else - { - &write_warnings("gls_set_firstplural: glossary entry '$label' has not been defined"); - } -} + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); -sub gls_get_first{ - local($label) = @_; - local($first) = ''; + local($text)=$glsentry{$label}{'firstplural'}; - if (&gls_entry_defined($label)) - { - $first = $glsentry{$label}{'first'}; - } - else + unless (defined($text)) { - &write_warnings("gls_get_first: glossary entry '$label' has not been defined"); + &write_warnings("glossary entry '$label' has not been defined"); + $text = ''; } - $first; + "$text$_"; + &gls_get_firstplural($label).$_; } -sub gls_set_first{ - local($label, $first) = @_; +sub do_cmd_Glsentryfirstplural{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $glsentry{$label}{'first'} = $first; - } - else - { - &write_warnings("gls_set_first: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_firstplural($label)).$_; } -sub gls_used{ - local($label) = @_; - local($flag) = 0; +sub do_cmd_glsentrysymbol{ + local($_) = @_; - if (&gls_entry_defined($label)) - { - $flag = $glsentry{$label}{'flag'}; - } - else - { - &write_warnings("gls_used: glossary entry '$label' has not been defined"); - } + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $flag; + &gls_get_symbol($label).$_; } -sub gls_entry_defined{ - local($label) = @_; +sub do_cmd_Glsentrysymbol{ + local($_) = @_; - defined(%{$glsentry{$label}}); + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_symbol($label)).$_; } -sub do_cmd_newglossaryentry{ +sub do_cmd_gls{ local($_) = @_; - local($label,$name,$description,$symbol,$sort,$text,$first, - $plural,$firstplural,$type,$keyval); + 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; + (s/$next_pair_pr_rx/$label=$2;''/eo); - $keyval = &missing_braces unless - s/$next_pair_pr_rx/$keyval=$2;''/eo; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - ($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); + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - if (defined($type)) + local($display) = ''; + + local($type) = &gls_get_type($label); + + if (&gls_used($label)) { - $type = &translate_commands($type); + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type); } else { - $type = 'main'; + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); } - &gls_entry_init($label, $type, $name, $description); + local($args) = ''; - &gls_set_symbol($label, defined($symbol)?$symbol:''); + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; - $sort = "$name $description" unless (defined($sort) and $sort); + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - &gls_set_sort($label, $sort); + $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); - $text = $name unless (defined($text) and $text); + ($optarg,$pat) = &get_next_optional_argument; - &gls_set_text($label, $text); + ($format,$optarg) = &get_keyval('format', $optarg); - $first = $text unless (defined($first) and $first); + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_set_first($label, $first); + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $plural = "${text}s" unless (defined($plural) and $plural); + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - &gls_set_plural($label, $plural); + local($display) = ''; - $firstplural = "${first}s" unless (defined($firstplural) and $firstplural); + local($type) = $glsentry{$label}{'type'}; - &gls_set_firstplural($label, $firstplural); + if (&gls_used($label)) + { + # entry has already been used - push @{$gls_entries{$type}}, $label; + $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); -sub reset_entry{ - local($label) = @_; + &unset_entry($label); + } - $glsentry{$label}{'flag'} = 0; -} + local($args) = ''; -sub unset_entry{ - local($label) = @_; + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; - $glsentry{$label}{'flag'} = 1; -} + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; -sub do_cmd_glsreset{ - local($_) = @_; - local($label); + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; - $label = &missing_braces unless - s/$next_pair_pr_rx/$label=$2;''/eo; + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; - &reset_entry($label); + local($link_text) = &translate_commands("$display$args"); - $_; + &make_glslink($type, $label, $format, $link_text) . $space . $_; } -sub do_cmd_glsunset{ +sub do_cmd_Gls{ local($_) = @_; - local($label); - - $label = &missing_braces unless - s/$next_pair_pr_rx/$label=$2;''/eo; - - &unset_entry($label); + local($optarg,$pat,$label,$text, $format, $insert); - $_; -} + ($optarg,$pat) = &get_next_optional_argument; -sub do_cmd_ifglsused{ - local($_) = @_; - local($label,$true,$false); + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless - s/$next_pair_pr_rx/$label=$2;''/eo; + (s/$next_pair_pr_rx/$label=$2;''/eo); - $true = &missing_braces unless - s/$next_pair_pr_rx/$true=$2;''/eo; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $false = &missing_braces unless - s/$next_pair_pr_rx/$false=$2;''/eo; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - (&gls_used($label) ? $true : $false) . $_; -} + local($display) = ''; -sub do_cmd_ifglsentryexists{ - local($_) = @_; - local($label,$true,$false); + local($type) = $glsentry{$label}{'type'}; - $label = &missing_braces unless - s/$next_pair_pr_rx/$label=$2;''/eo; + if (&gls_used($label)) + { + # entry has already been used - $true = &missing_braces unless - s/$next_pair_pr_rx/$true=$2;''/eo; + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used - $false = &missing_braces unless - s/$next_pair_pr_rx/$false=$2;''/eo; + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); - (&gls_entry_defined($label) ? $true : $false) . $_; -} + &unset_entry($label); + } -sub gls_add_entry{ - local($type, $label, $format, $text) = @_; + local($args) = ''; - local($oldfmt) = $GLSCURRENTFORMAT; + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; - if (defined($format) and $format) - { - $GLSCURRENTFORMAT=$format; - } + $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"; - local($str) = &make_real_glossary_entry($label,$text,$type); - $GLSCURRENTFORMAT = $oldfmt; + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; - $str; + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; } -sub do_cmd_glsadd{ +sub do_cmd_Glspl{ local($_) = @_; - local($optarg,$pat,$label,$str,$id,$type,$format); + 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); - $type = &gls_get_type($label); + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - if (defined $type) + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) { - ($format,$optarg) = &get_keyval('format', $optarg); - $format='' unless(defined($format)); + # entry has already been used - &gls_add_entry($type,$label,$format,""); + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; } else { - &write_warnings("gls_add: glossary entry '$label' undefined"); - $str = ''; + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); } - $str . $_; + 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_glsaddall{ +sub do_cmd_GLS{ local($_) = @_; - local($optarg,$pat) = &get_next_optional_argument; - - local($format,$types); + local($optarg,$pat,$label,$text, $format, $insert); - ($type,$optarg) = &get_keyval('types', $optarg); + ($optarg,$pat) = &get_next_optional_argument; ($format,$optarg) = &get_keyval('format', $optarg); - $format='' unless(defined($format)); - local(@types) = keys(%gls_mark); + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - if (defined($types)) - { - @types = split /,/, $types; - } + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - foreach $type (@types) + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) { - # strip leasing and trailing spaces - $type=~s/^\s*([^\s]+)\s*$/\1/; + # entry has already been used - foreach $label (@{$gls_entries{$type}}) - { - &gls_add_entry($type,$label,$format,""); - } + $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); -sub do_cmd_glsresetall{ - local($_) = @_; - local($types,$pat) = &get_next_optional_argument; + &unset_entry($label); + } - local(@types) = keys(%gls_mark); + local($args) = ''; - if (defined($types) and $types) - { - @types = split /,/, $types; - } + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; - foreach $type (@types) - { - # strip leasing and trailing spaces - $type=~s/^\s*([^\s]+)\s*$/\1/; + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; - foreach $label (@{$gls_entries{$type}}) - { - &reset_entry($label); - } - } + $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_glsunsetall{ +sub do_cmd_GLSpl{ local($_) = @_; - local($types,$pat) = &get_next_optional_argument; + local($optarg,$pat,$label,$text, $format, $insert); - local(@types) = keys(%gls_mark); + ($optarg,$pat) = &get_next_optional_argument; - if (defined($types) and $types) - { - @types = split /,/, $types; - } + ($format,$optarg) = &get_keyval('format', $optarg); - foreach $type (@types) - { - # strip leasing and trailing spaces - $type=~s/^\s*([^\s]+)\s*$/\1/; + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - foreach $label (@{$gls_entries{$type}}) - { - &reset_entry($label); - } - } + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $_; -} + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; -sub make_glslink{ - local($type,$label,$format,$text) = @_; - local($str) = ''; + local($display) = ''; - if (defined $type) + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) { - $str = &gls_add_entry($type,$label,$format,$text); + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; } else { - &write_warnings("glossary '$type' undefined"); + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); } - $str; + 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_glslink{ +# added 22 Feb 2008 +sub do_cmd_glstext{ local($_) = @_; - local($optarg,$pat,$label,$text,$type,$format,$str); + local($optarg,$pat,$label,$text, $format, $insert); ($optarg,$pat) = &get_next_optional_argument; @@ -5714,157 +9667,266 @@ sub do_cmd_glslink{ $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 = ' ';} - # v1.01 removed following lines (\glslink doesn't have - # a final optional argument! - #local ($space) = ''; - #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - #($optarg,$pat) = &get_next_optional_argument; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $type = &gls_get_type($label); + local($display) = ''; - #&make_glslink($type, $label, $format, $text).$space . $_; - &make_glslink($type, $label, $format, $text) . $_; + local($type) = &gls_get_type($label); + + $text = &gls_get_text($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; } -sub do_cmd_glsentrydesc{ +# added 22 Feb 2008 +sub do_cmd_Glstext{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_get_description($label).$_; -} + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} -sub do_cmd_Glsentrydesc{ - local($_) = @_; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); + local($display) = ''; - ucfirst(&gls_get_description($label)).$_; + local($type) = &gls_get_type($label); + + $text = &gls_get_text($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; } -sub do_cmd_glsentrytext{ +# added 22 Feb 2008 +sub do_cmd_GLStext{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_get_text($label).$_; -} + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} -sub do_cmd_Glsentrytext{ - local($_) = @_; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); + local($display) = ''; - ucfirst(&gls_get_text($label)).$_; + local($type) = &gls_get_type($label); + + $text = &gls_get_text($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; } -sub do_cmd_glsentryname{ +# added 22 Feb 2008 +sub do_cmd_glsname{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_get_name($label).$_; -} + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} -sub do_cmd_Glsentryname{ - local($_) = @_; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); + local($display) = ''; - ucfirst(&gls_get_name($label)).$_; + local($type) = &gls_get_type($label); + + $text = &gls_get_name($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; } -sub do_cmd_glsentryfirst{ +# added 22 Feb 2008 +sub do_cmd_Glsname{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_get_first($label).$_; -} + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} -sub do_cmd_Glsentryfirst{ - local($_) = @_; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); + local($display) = ''; - ucfirst(&gls_get_first($label)).$_; + local($type) = &gls_get_type($label); + + $text = &gls_get_name($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; } -sub do_cmd_glsentryplural{ +# added 22 Feb 2008 +sub do_cmd_GLSname{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_get_plural($label).$_; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_name($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; } -sub do_cmd_Glsentryplural{ +# added 22 Feb 2008 +sub do_cmd_glsfirst{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - ucfirst(&gls_get_plural($label)).$_; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_first($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; } -sub do_cmd_glsentryfirstplural{ +# added 22 Feb 2008 +sub do_cmd_Glsfirst{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - local($text)=$glsentry{$label}{'firstplural'}; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - unless (defined($text)) - { - &write_warnings("glossary entry '$label' has not been defined"); - $text = ''; - } + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - "$text$_"; - &gls_get_firstplural($label).$_; + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_first($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; } -sub do_cmd_Glsentryfirstplural{ +# added 22 Feb 2008 +sub do_cmd_GLSfirst{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - ucfirst(&gls_get_firstplural($label)).$_; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_first($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; } -sub do_cmd_glsentrysymbol{ +# added 22 Feb 2008 +sub do_cmd_glsfirstplural{ local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); $label = &missing_braces unless (s/$next_pair_pr_rx/$label=$2;''/eo); - &gls_get_symbol($label).$_; -} + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} -sub do_cmd_Glsentrysymbol{ - local($_) = @_; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $label = &missing_braces unless - (s/$next_pair_pr_rx/$label=$2;''/eo); + local($display) = ''; - ucfirst(&gls_get_symbol($label)).$_; + local($type) = &gls_get_type($label); + + $text = &gls_get_firstplural($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; } -sub do_cmd_gls{ +# added 22 Feb 2008 +sub do_cmd_Glsfirstplural{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -5885,43 +9947,40 @@ sub do_cmd_gls{ local($type) = &gls_get_type($label); - if (&gls_used($label)) - { - # entry has already been used + $text = &gls_get_firstplural($label); - $text = &gls_get_text($label); - $display = &gls_get_display($type); - } - else - { - # entry hasn't been used + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); +# added 22 Feb 2008 +sub do_cmd_GLSfirstplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); - &unset_entry($label); - } + ($optarg,$pat) = &get_next_optional_argument; - local($args) = ''; + ($format,$optarg) = &get_keyval('format', $optarg); - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; + local($display) = ''; - local($link_text) = &translate_commands("$display$args"); + local($type) = &gls_get_type($label); - &make_glslink($type, $label, $format, $link_text) .$space . $_; + $text = &gls_get_firstplural($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; } -sub do_cmd_glspl{ +# added 22 Feb 2008 +sub do_cmd_glsplural{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -5940,45 +9999,42 @@ sub do_cmd_glspl{ local($display) = ''; - local($type) = $glsentry{$label}{'type'}; + local($type) = &gls_get_type($label); - if (&gls_used($label)) - { - # entry has already been used + $text = &gls_get_plural($label); - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used + &make_glslink($type, $label, $format, $text) .$space . $_; +} - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); +# added 22 Feb 2008 +sub do_cmd_Glsplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); - &unset_entry($label); - } + ($optarg,$pat) = &get_next_optional_argument; - local($args) = ''; + ($format,$optarg) = &get_keyval('format', $optarg); - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; + local($display) = ''; - local($link_text) = &translate_commands("$display$args"); + local($type) = &gls_get_type($label); - &make_glslink($type, $label, $format, $link_text) . $space . $_; + $text = &gls_get_plural($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; } -sub do_cmd_Gls{ +# added 22 Feb 2008 +sub do_cmd_GLSplural{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -5997,45 +10053,42 @@ sub do_cmd_Gls{ local($display) = ''; - local($type) = $glsentry{$label}{'type'}; + local($type) = &gls_get_type($label); - if (&gls_used($label)) - { - # entry has already been used + $text = &gls_get_plural($label); - $text = &gls_get_text($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); +# added 22 Feb 2008 +sub do_cmd_glsdesc{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); - &unset_entry($label); - } + ($optarg,$pat) = &get_next_optional_argument; - local($args) = ''; + ($format,$optarg) = &get_keyval('format', $optarg); - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; + local($display) = ''; - local($link_text) = &translate_commands("$display$args"); + local($type) = &gls_get_type($label); - &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; + $text = &gls_get_description($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; } -sub do_cmd_Glspl{ +# added 22 Feb 2008 +sub do_cmd_Glsdesc{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -6054,45 +10107,42 @@ sub do_cmd_Glspl{ local($display) = ''; - local($type) = $glsentry{$label}{'type'}; + local($type) = &gls_get_type($label); - if (&gls_used($label)) - { - # entry has already been used + $text = &gls_get_description($label); - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); +# added 22 Feb 2008 +sub do_cmd_GLSdesc{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); - &unset_entry($label); - } + ($optarg,$pat) = &get_next_optional_argument; - local($args) = ''; + ($format,$optarg) = &get_keyval('format', $optarg); - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; + local($display) = ''; - local($link_text) = &translate_commands("$display$args"); + local($type) = &gls_get_type($label); - &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_; + $text = &gls_get_description($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; } -sub do_cmd_GLS{ +# added 22 Feb 2008 +sub do_cmd_glssymbol{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -6111,45 +10161,42 @@ sub do_cmd_GLS{ local($display) = ''; - local($type) = $glsentry{$label}{'type'}; + local($type) = &gls_get_type($label); - if (&gls_used($label)) - { - # entry has already been used + $text = &gls_get_symbol($label); - $text = &gls_get_text($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used + &make_glslink($type, $label, $format, $text) .$space . $_; +} - $text = &gls_get_first($label); - $display = &gls_get_displayfirst($type); +# added 22 Feb 2008 +sub do_cmd_Glssymbol{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); - &unset_entry($label); - } + ($optarg,$pat) = &get_next_optional_argument; - local($args) = ''; + ($format,$optarg) = &get_keyval('format', $optarg); - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; + local($display) = ''; - local($link_text) = &translate_commands("$display$args"); + local($type) = &gls_get_type($label); - &make_glslink($type, $label, $format, uc($link_text)).$space . $_; + $text = &gls_get_symbol($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; } -sub do_cmd_GLSpl{ +# added 22 Feb 2008 +sub do_cmd_GLSsymbol{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -6168,42 +10215,47 @@ sub do_cmd_GLSpl{ local($display) = ''; - local($type) = $glsentry{$label}{'type'}; + local($type) = &gls_get_type($label); - if (&gls_used($label)) - { - # entry has already been used + $text = &gls_get_symbol($label); - $text = &gls_get_plural($label); - $display = &gls_get_display($type);; - } - else - { - # entry hasn't been used + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} - $text = &gls_get_firstplural($label); - $display = &gls_get_displayfirst($type); +sub do_cmd_acrshort{ + &do_cmd_glstext(@_) +} - &unset_entry($label); - } +sub do_cmd_Acrshort{ + &do_cmd_Glstext(@_) +} - local($args) = ''; +sub do_cmd_ACRshort{ + &do_cmd_GLStext(@_) +} - local($id) = ++$global{'max_id'}; - $args .= "$OP$id$CP$text$OP$id$CP"; +sub do_cmd_acrlong{ + &do_cmd_glsdesc(@_) +} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; +sub do_cmd_Acrlong{ + &do_cmd_Glsdesc(@_) +} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; +sub do_cmd_ACRlong{ + &do_cmd_GLSdesc(@_) +} - $id = ++$global{'max_id'}; - $args .= "$OP$id$CP$insert$OP$id$CP"; +sub do_cmd_acrfull{ + &do_cmd_glsfirst(@_) +} - local($link_text) = &translate_commands("$display$args"); +sub do_cmd_Acrfull{ + &do_cmd_Glsfirst(@_) +} - &make_glslink($type, $label, $format, uc($link_text)).$space . $_; +sub do_cmd_ACRfull{ + &do_cmd_GLSfirst(@_) } sub do_cmd_glossarypreamble{ @@ -6245,6 +10297,7 @@ sub do_cmd_hyperbf{ &ignore_commands( <<_IGNORED_CMDS_ ); makeglossary makeglossaries +glossarystyle {} _IGNORED_CMDS_ 1; diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins index 170da75cd4e..9efa72599bc 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.ins +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.ins @@ -1,10 +1,10 @@ -% glossaries.ins generated using makedtx version 0.94b 2007/10/13 15:35 +% glossaries.ins generated using makedtx version 0.94b 2008/3/4 12:06 \input docstrip \preamble glossaries.dtx - Copyright 2007 Nicola Talbot + Copyright 2008 Nicola Talbot This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -18,7 +18,7 @@ The Current Maintainer of this work is Nicola Talbot. - This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries.perl. + This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. \endpreamble @@ -34,6 +34,50 @@ \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{glossaries-babel.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-babel.sty,package}} +\file{glossaries-dictionary-Danish.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-Danish.dict,package}} +\file{glossaries-dictionary-Dutch.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-Dutch.dict,package}} +\file{glossaries-dictionary-English.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-English.dict,package}} +\file{glossaries-dictionary-French.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-French.dict,package}} +\file{glossaries-dictionary-German.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-German.dict,package}} +\file{glossaries-dictionary-Irish.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-Irish.dict,package}} +\file{glossaries-dictionary-Italian.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-Italian.dict,package}} +\file{glossaries-dictionary-Magyar.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-Magyar.dict,package}} +\file{glossaries-dictionary-Spanish.dict}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-dictionary-Spanish.dict,package}} +\file{minimalgls.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{minimalgls.tex,package}} +\file{sample.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sample.tex,package}} +\file{sample4col.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sample4col.tex,package}} +\file{sampleAcr.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleAcr.tex,package}} +\file{sampleAcrDesc.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleAcrDesc.tex,package}} +\file{sampleDB.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleDB.tex,package}} +\file{sampleEq.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleEq.tex,package}} +\file{sampleEqPg.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleEqPg.tex,package}} +\file{sampleNtn.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleNtn.tex,package}} +\file{sampleSec.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{sampleSec.tex,package}} +\file{database1.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{database1.tex,package}} +\file{database2.tex}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{database2.tex,package}} \file{glossaries.perl}{\nopreamble\nopostamble\from{glossaries.dtx}{glossaries.perl}} } diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.perl b/Master/texmf-dist/source/latex/glossaries/glossaries.perl new file mode 100644 index 00000000000..8a64fbe3aca --- /dev/null +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.perl @@ -0,0 +1,2322 @@ +# File : glossaries.perl +# Author : Nicola L.C. Talbot +# Date : 14th June 2007 +# Last Modified : 22 February 2008 +# Version : 1.03 +# Description : LaTeX2HTML (limited!) implementation of glossaries +# package. Note that not all the glossaries.sty +# macros have been implemented. + +# This is a LaTeX2HTML style implementing the glossaries package, and +# is distributed as part of that package. +# Copyright 2007 Nicola L.C. Talbot +# This work may be distributed and/or modified under the +# conditions of the LaTeX Project Public License, either version 1.3 +# of this license of (at your option) any later version. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3 or later is part of all distributions of LaTeX +# version 2005/12/01 or later. +# +# This work has the LPPL maintenance status `maintained'. +# +# The Current Maintainer of this work is Nicola Talbot. + +# This work consists of the files glossaries.dtx and glossaries.ins +# and the derived files glossaries.sty, glossary-hypernav.sty, +# glossary-list.sty, glossary-long.sty, glossary-super.sty, +# glossaries.perl. Also makeglossaries and makeglossaries.bat + +package main; + +# These are the only package options implemented. + +sub do_glossaries_style_altlist{ +} + +sub do_glossaries_toc{ +} + +sub do_glossaries_toc_true{ +} + +$GLSCURRENTFORMAT="textrm"; + +sub do_cmd_glossaryname{ + "Glossary$_[0]" +} + +$gls_mark{'main'} = ""; +$gls_file_mark{'main'} = ""; +$gls_title{'main'} = "\\glossaryname"; +$delimN{'main'} = ", "; +$glsnumformat{'main'} = $GLSCURRENTFORMAT; +@{$gls_entries{'main'}} = (); +$gls_displayfirst{'main'} = "glsdisplayfirst"; +$gls_display{'main'} = "glsdisplay"; + + +$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) =('',''); + if ($INDEX_STYLES) { +if ($INDEX_STYLES =~/,/) { +local(@styles) = split(/\s*,\s*/,$INDEX_STYLES); + $sidx_style = join('','<', join('><',@styles) ,'>'); + $eidx_style = join('',''); +} else { + $sidx_style = join('','<', $INDEX_STYLES,'>'); + $eidx_style = join('',''); +} + } + &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 + . "\n" + : "
" + . $name + . "
" + . $glsentry{$entry}{'description'} + . $symbol . '. ' + . $glossary{$type}{$key} + . $linktext. "\n"); + $previous = $current; + } + $glossary = '
'.$glossary unless ($glossary =~ /^\s*/); + + $glossary =~ s/(]*>)()/$2$1/g; + + $str = &translate_commands("\\glossarypostamble"); + s/$gls_mark{$type}/$preglossary\n
\n$glossary<\/DL>$str\n/s; +} + +sub set_depth_levels { + # Sets $outermost_level + local($level); + # scan the document body, not the preamble, for use of sectioning commands + my ($contents) = $_; + if ($contents =~ /\\begin\s*((?:$O|$OP)\d+(?:$C|$CP))document\1|\\startdocument/s) { +$contents = $'; + } + foreach $level ("part", "chapter", "section", "subsection", + "subsubsection", "paragraph") { +last if (($outermost_level) = $contents =~ /\\($level)$delimiter_rx/); +last if (($outermost_level) = $contents =~ /\\endsegment\s*\[\s*($level)\s*\]/s); +if ($contents =~ /\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)\s*($level)\s*\2/s) +{ $outermost_level = $3; last }; + } + $level = ($outermost_level ? $section_commands{$outermost_level} : + do {$outermost_level = 'section'; 3;}); + + if ($REL_DEPTH && $MAX_SPLIT_DEPTH) { +$MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH; + } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 }; + + %unnumbered_section_commands = ( + 'tableofcontents', $level +, 'listoffigures', $level +, 'listoftables', $level +, 'bibliography', $level +, 'textohtmlindex', $level +, 'textohtmlglossary', $level +, 'textohtmlglossaries', $level + , %unnumbered_section_commands + ); + + %section_commands = ( + %unnumbered_section_commands + , %section_commands + ); +} + +sub add_bbl_and_idx_dummy_commands { + local($id) = $global{'max_id'}; + + s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg; + ## if ($bbl_cnt == 1) { +s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo; + #} + $global{'max_id'} = $id; + s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o; + s/[\\]printindex/\\textohtmlindex /o; + &add_gls_dummy_commands; + &lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands); +} + +sub add_gls_dummy_commands{ + s/[\\]printglossary/\\textohtmlglossary/sg; + s/[\\]printglossaries/\\textohtmlglossaries/sg; +} + +sub get_firstkeyval{ + local($key,$_) = @_; + local($value); + + s/\b$key\s*=$OP(\d+)$CP(.*)$OP\1$CP\s*(,|$)/$value=$2;','/es; + undef($value) if $`=~/\b$key\s*=/; + + unless (defined($value)) + { + s/(^|,)\s*$key\s*=\s*([^,]*)\s*(,|$)/,/s; + $value=$2; + } + + ($value,$_); +} + +# need to get the value of the last key of a given name +# in the event of multiple occurences. +sub get_keyval{ + local($key,$_) = @_; + local($value); + + while (/\b$key\s*=/) + { + ($value,$_) = &get_firstkeyval($key, $_); + last unless defined($value); + } + + ($value,$_); +} + +# This is modified from do_cmd_textohtmlindex + +sub do_cmd_textohtmlglossary{ + local($_) = @_; + + local($keyval,$pat) = &get_next_optional_argument; + + local($type,$title,$toctitle,$style); + + ($type,$keyval) = &get_keyval('type', $keyval); + ($title,$keyval) = &get_keyval('title', $keyval); + ($toctitle,$keyval) = &get_keyval('toctitle', $keyval); + ($style,$keyval) = &get_keyval('style', $keyval); + + &make_textohtmlglossary($type,$toctitle,$title,$style).$_; +} + +sub make_textohtmlglossary{ + local($type,$toctitle,$title,$style) = @_; + + unless (defined($type)) {$type = 'main';} + + unless (defined $gls_mark{$type}) + { + &write_warnings("glossary type '$type' not implemented"); + } + + unless (defined($title) and $title) {$title = $gls_title{$type};} + unless (defined($toctitle) and $toctitle) {$toctitle = $title;} + + $toc_sec_title = $toctitle; + $glsfile{$type} = $CURRENT_FILE; + + $TITLE=&translate_commands($toctitle); + + if (%glossary_labels) { &make_glossary_labels(); } + + if (($SHORT_INDEX) && (%glossary_segment)) + { + &make_preglossary(); + } + else + { + $preglossary = &translate_commands("\\glossarypreamble"); + } + + local $idx_head = $section_headings{'textohtmlindex'}; + local($heading) = join('' + , &make_section_heading($title, $idx_head) + , $gls_mark{$type} ); + local($pre,$post) = &minimize_open_tags($heading); + join('',"
\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 = "
\n

Legend:

\n
"; + @keys = keys %glossary_segment; + foreach $key (@keys) { + local($tmp) = "segment$key"; + $tmp = $ref_files{$tmp}; + $body .= "\n
$key
".&make_named_href('',$tmp,$glossary_segment{$key}); + } + $preglossary = join('', $head, $body, "\n
") 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; + "
$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} = ""; + $gls_file_mark{$type} = ""; + $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); + + "$text$_"; +} + +sub do_cmd_newacronym{ + local($_) = @_; + local($label,$abbrev,$long,$opt); + + ($opt,$pat) = &get_next_optional_argument; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + $abbrv = &missing_braces unless + (s/$next_pair_pr_rx/$abbrv=$2;''/eo); + $long = &missing_braces unless + (s/$next_pair_pr_rx/$long=$2;''/eo); + + local($cmd) = "\\newglossaryentry"; + local($id); + $id = ++$global{'max_id'}; + $cmd .= "$OP$id$CP$label$OP$id$CP"; + $id = ++$global{'max_id'}; + local($entry) = "type=$OP$id$CP\\acronymtype$OP$id$CP,"; + $id = ++$global{'max_id'}; + $entry .= "name=$OP$id$CP$abbrv$OP$id$CP,"; + $id = ++$global{'max_id'}; + $entry .= "description=$OP$id$CP$long$OP$id$CP,"; + $id = ++$global{'max_id'}; + $entry .= "text=$OP$id$CP$abbrv$OP$id$CP,"; + $id = ++$global{'max_id'}; + $entry .= "first=$OP$id$CP$long ($abbrv)$OP$id$CP,"; + $id = ++$global{'max_id'}; + $entry .= "plural=$OP$id$CP${abbrv}s$OP$id$CP,"; + $id = ++$global{'max_id'}; + $entry .= "firstplural=$OP$id$CP${long}s (${abbrv}s)$OP$id$CP"; + + $id = ++$global{'max_id'}; + $cmd .= "$OP$id$CP$entry,$opt$OP$id$CP"; + + &translate_commands($cmd).$_; +} + +sub gls_entry_init{ + local($label, $type, $name, $desc) = @_; + + %{$glsentry{$label}} = + ( type => $type, + name => $name, + 'sort' => $name, + description => $description, + text => $name, + first => $name, + plural => "${name}s", + firstplural => "${name}s", + symbol => '', + flag => 0 + ); +} + +sub gls_get_type{ + local($label) = @_; + local($type) = ''; + + if (&gls_entry_defined($label)) + { + $type = $glsentry{$label}{'type'}; + } + else + { + &write_warnings("gls_get_type: glossary entry '$label' has not been defined"); + } + + $type; +} + +sub gls_set_type{ + local($label, $type) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'type'} = $type; + } + else + { + &write_warnings("gls_set_type: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_name{ + local($label) = @_; + local($name) = ''; + + if (&gls_entry_defined($label)) + { + $name = $glsentry{$label}{'name'}; + } + else + { + &write_warnings("gls_get_name: glossary entry '$label' has not been defined"); + } + + $name; +} + +sub gls_set_name{ + local($label, $name) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'name'} = $name; + } + else + { + &write_warnings("gls_set_name: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_description{ + local($label) = @_; + local($description) = ''; + + if (&gls_entry_defined($label)) + { + $description = $glsentry{$label}{'description'}; + } + else + { + &write_warnings("gls_get_description: glossary entry '$label' has not been defined"); + } + + $description; +} + +sub gls_set_description{ + local($label, $description) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'description'} = $description; + } + else + { + &write_warnings("gls_set_description: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_symbol{ + local($label) = @_; + local($symbol) = ''; + + if (&gls_entry_defined($label)) + { + $symbol = $glsentry{$label}{'symbol'}; + } + else + { + &write_warnings("gls_get_symbol: glossary entry '$label' has not been defined"); + } + + $symbol; +} + +sub gls_set_symbol{ + local($label, $symbol) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'symbol'} = $symbol; + } + else + { + &write_warnings("gls_set_symbol: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_sort{ + local($label) = @_; + local($sort) = ''; + + if (&gls_entry_defined($label)) + { + $sort = $glsentry{$label}{'sort'}; + } + else + { + &write_warnings("gls_get_sort: glossary entry '$label' has not been defined"); + } + + $sort; +} + +sub gls_set_sort{ + local($label, $sort) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'sort'} = $sort; + } + else + { + &write_warnings("gls_set_sort: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_text{ + local($label) = @_; + local($text) = ''; + + if (&gls_entry_defined($label)) + { + $text = $glsentry{$label}{'text'}; + } + else + { + &write_warnings("gls_get_text: glossary entry '$label' has not been defined"); + } + + $text; +} + +sub gls_set_text{ + local($label, $text) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'text'} = $text; + } + else + { + &write_warnings("gls_set_text: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_plural{ + local($label) = @_; + local($plural) = ''; + + if (&gls_entry_defined($label)) + { + $plural = $glsentry{$label}{'plural'}; + } + else + { + &write_warnings("gls_get_plural: glossary entry '$label' has not been defined"); + } + + $plural; +} + +sub gls_set_plural{ + local($label, $plural) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'plural'} = $plural; + } + else + { + &write_warnings("gls_set_plural: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_firstplural{ + local($label) = @_; + local($firstplural) = ''; + + if (&gls_entry_defined($label)) + { + $firstplural = $glsentry{$label}{'firstplural'}; + } + else + { + &write_warnings("gls_get_firstplural: glossary entry '$label' has not been defined"); + } + + $firstplural; +} + +sub gls_set_firstplural{ + local($label, $firstplural) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'firstplural'} = $firstplural; + } + else + { + &write_warnings("gls_set_firstplural: glossary entry '$label' has not been defined"); + } +} + +sub gls_get_first{ + local($label) = @_; + local($first) = ''; + + if (&gls_entry_defined($label)) + { + $first = $glsentry{$label}{'first'}; + } + else + { + &write_warnings("gls_get_first: glossary entry '$label' has not been defined"); + } + + $first; +} + +sub gls_set_first{ + local($label, $first) = @_; + + if (&gls_entry_defined($label)) + { + $glsentry{$label}{'first'} = $first; + } + else + { + &write_warnings("gls_set_first: glossary entry '$label' has not been defined"); + } +} + +sub gls_used{ + local($label) = @_; + local($flag) = 0; + + if (&gls_entry_defined($label)) + { + $flag = $glsentry{$label}{'flag'}; + } + else + { + &write_warnings("gls_used: glossary entry '$label' has not been defined"); + } + + $flag; +} + +sub gls_entry_defined{ + local($label) = @_; + + defined(%{$glsentry{$label}}); +} + +sub do_cmd_newglossaryentry{ + local($_) = @_; + local($label,$name,$description,$symbol,$sort,$text,$first, + $plural,$firstplural,$type,$keyval); + + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; + + $keyval = &missing_braces unless + s/$next_pair_pr_rx/$keyval=$2;''/eo; + + ($name,$keyval) = &get_keyval('name', $keyval); + ($description,$keyval) = &get_keyval('description', $keyval); + ($symbol,$keyval) = &get_keyval('symbol', $keyval); + ($sort,$keyval) = &get_keyval('sort', $keyval); + ($text,$keyval) = &get_keyval('text', $keyval); + ($first,$keyval) = &get_keyval('first', $keyval); + ($firstplural,$keyval) = &get_keyval('firstplural', $keyval); + ($plural,$keyval) = &get_keyval('plural', $keyval); + ($type,$keyval) = &get_keyval('type', $keyval); + + if (defined($type)) + { + $type = &translate_commands($type); + } + else + { + $type = 'main'; + } + + &gls_entry_init($label, $type, $name, $description); + + &gls_set_symbol($label, defined($symbol)?$symbol:''); + + $sort = "$name $description" unless (defined($sort) and $sort); + + &gls_set_sort($label, $sort); + + $text = $name unless (defined($text) and $text); + + &gls_set_text($label, $text); + + $first = $text unless (defined($first) and $first); + + &gls_set_first($label, $first); + + $plural = "${text}s" unless (defined($plural) and $plural); + + &gls_set_plural($label, $plural); + + $firstplural = "${first}s" unless (defined($firstplural) and $firstplural); + + &gls_set_firstplural($label, $firstplural); + + push @{$gls_entries{$type}}, $label; + + $_; +} + +sub reset_entry{ + local($label) = @_; + + $glsentry{$label}{'flag'} = 0; +} + +sub unset_entry{ + local($label) = @_; + + $glsentry{$label}{'flag'} = 1; +} + +sub do_cmd_glsreset{ + local($_) = @_; + local($label); + + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; + + &reset_entry($label); + + $_; +} + +sub do_cmd_glsunset{ + local($_) = @_; + local($label); + + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; + + &unset_entry($label); + + $_; +} + +sub do_cmd_ifglsused{ + local($_) = @_; + local($label,$true,$false); + + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; + + $true = &missing_braces unless + s/$next_pair_pr_rx/$true=$2;''/eo; + + $false = &missing_braces unless + s/$next_pair_pr_rx/$false=$2;''/eo; + + (&gls_used($label) ? $true : $false) . $_; +} + +sub do_cmd_ifglsentryexists{ + local($_) = @_; + local($label,$true,$false); + + $label = &missing_braces unless + s/$next_pair_pr_rx/$label=$2;''/eo; + + $true = &missing_braces unless + s/$next_pair_pr_rx/$true=$2;''/eo; + + $false = &missing_braces unless + s/$next_pair_pr_rx/$false=$2;''/eo; + + (&gls_entry_defined($label) ? $true : $false) . $_; +} + +sub gls_add_entry{ + local($type, $label, $format, $text) = @_; + + local($oldfmt) = $GLSCURRENTFORMAT; + + if (defined($format)) + { + $format=~s/[\(\)]//; + + if ($format) + { + $GLSCURRENTFORMAT=$format; + } + } + + $id = ++$global{'max_id'}; + + local($str) = &make_real_glossary_entry($label,$text,$type); + $GLSCURRENTFORMAT = $oldfmt; + + $str; +} + +sub do_cmd_glsadd{ + local($_) = @_; + local($optarg,$pat,$label,$str,$id,$type,$format); + ($optarg,$pat) = &get_next_optional_argument; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + $type = &gls_get_type($label); + + if (defined $type) + { + ($format,$optarg) = &get_keyval('format', $optarg); + $format='' unless(defined($format)); + + &gls_add_entry($type,$label,$format,""); + } + else + { + &write_warnings("gls_add: glossary entry '$label' undefined"); + $str = ''; + } + + $str . $_; +} + +sub do_cmd_glsaddall{ + local($_) = @_; + local($optarg,$pat) = &get_next_optional_argument; + + local($format,$types); + + ($type,$optarg) = &get_keyval('types', $optarg); + + ($format,$optarg) = &get_keyval('format', $optarg); + $format='' unless(defined($format)); + + local(@types) = keys(%gls_mark); + + if (defined($types)) + { + @types = split /,/, $types; + } + + foreach $type (@types) + { + # strip leasing and trailing spaces + $type=~s/^\s*([^\s]+)\s*$/\1/; + + foreach $label (@{$gls_entries{$type}}) + { + &gls_add_entry($type,$label,$format,""); + } + } + + $_; +} + +sub do_cmd_glsresetall{ + local($_) = @_; + local($types,$pat) = &get_next_optional_argument; + + local(@types) = keys(%gls_mark); + + if (defined($types) and $types) + { + @types = split /,/, $types; + } + + foreach $type (@types) + { + # strip leasing and trailing spaces + $type=~s/^\s*([^\s]+)\s*$/\1/; + + foreach $label (@{$gls_entries{$type}}) + { + &reset_entry($label); + } + } + + $_; +} + +sub do_cmd_glsunsetall{ + local($_) = @_; + local($types,$pat) = &get_next_optional_argument; + + local(@types) = keys(%gls_mark); + + if (defined($types) and $types) + { + @types = split /,/, $types; + } + + foreach $type (@types) + { + # strip leasing and trailing spaces + $type=~s/^\s*([^\s]+)\s*$/\1/; + + foreach $label (@{$gls_entries{$type}}) + { + &reset_entry($label); + } + } + + $_; +} + +sub make_glslink{ + local($type,$label,$format,$text) = @_; + local($str) = ''; + + if (defined $type) + { + $str = &gls_add_entry($type,$label,$format,$text); + } + else + { + &write_warnings("glossary '$type' undefined"); + } + + $str; +} + +sub do_cmd_glslink{ + local($_) = @_; + local($optarg,$pat,$label,$text,$type,$format,$str); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + $text = &missing_braces unless + (s/$next_pair_pr_rx/$text=$2;''/eo); + + # v1.01 removed following lines (\glslink doesn't have + # a final optional argument! + #local ($space) = ''; + #if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + #($optarg,$pat) = &get_next_optional_argument; + + $type = &gls_get_type($label); + + #&make_glslink($type, $label, $format, $text).$space . $_; + &make_glslink($type, $label, $format, $text) . $_; +} + +sub do_cmd_glsentrydesc{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_description($label).$_; +} + +sub do_cmd_Glsentrydesc{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_description($label)).$_; +} + +sub do_cmd_glsentrytext{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_text($label).$_; +} + +sub do_cmd_Glsentrytext{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_text($label)).$_; +} + +sub do_cmd_glsentryname{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_name($label).$_; +} + +sub do_cmd_Glsentryname{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_name($label)).$_; +} + +sub do_cmd_glsentryfirst{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_first($label).$_; +} + +sub do_cmd_Glsentryfirst{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_first($label)).$_; +} + +sub do_cmd_glsentryplural{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_plural($label).$_; +} + +sub do_cmd_Glsentryplural{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_plural($label)).$_; +} + +sub do_cmd_glsentryfirstplural{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local($text)=$glsentry{$label}{'firstplural'}; + + unless (defined($text)) + { + &write_warnings("glossary entry '$label' has not been defined"); + $text = ''; + } + + "$text$_"; + &gls_get_firstplural($label).$_; +} + +sub do_cmd_Glsentryfirstplural{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_firstplural($label)).$_; +} + +sub do_cmd_glsentrysymbol{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + &gls_get_symbol($label).$_; +} + +sub do_cmd_Glsentrysymbol{ + local($_) = @_; + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + ucfirst(&gls_get_symbol($label)).$_; +} + +sub do_cmd_gls{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type); + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, $link_text) .$space . $_; +} + +sub do_cmd_glspl{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, $link_text) . $space . $_; +} + +sub do_cmd_Gls{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; +} + +sub do_cmd_Glspl{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_; +} + +sub do_cmd_GLS{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, uc($link_text)).$space . $_; +} + +sub do_cmd_GLSpl{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + &make_glslink($type, $label, $format, uc($link_text)).$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glstext{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_text($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glstext{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_text($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLStext{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_text($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glsname{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_name($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glsname{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_name($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLSname{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_name($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glsfirst{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_first($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glsfirst{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_first($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLSfirst{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_first($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glsfirstplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_firstplural($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glsfirstplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_firstplural($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLSfirstplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_firstplural($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glsplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_plural($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glsplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_plural($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLSplural{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_plural($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glsdesc{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_description($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glsdesc{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_description($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLSdesc{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_description($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_glssymbol{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_symbol($label); + + &make_glslink($type, $label, $format, $text) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_Glssymbol{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_symbol($label); + + &make_glslink($type, $label, $format, ucfirst($text)) .$space . $_; +} + +# added 22 Feb 2008 +sub do_cmd_GLSsymbol{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + $text = &gls_get_symbol($label); + + &make_glslink($type, $label, $format, uc($text)) .$space . $_; +} + +sub do_cmd_acrshort{ + &do_cmd_glstext(@_) +} + +sub do_cmd_Acrshort{ + &do_cmd_Glstext(@_) +} + +sub do_cmd_ACRshort{ + &do_cmd_GLStext(@_) +} + +sub do_cmd_acrlong{ + &do_cmd_glsdesc(@_) +} + +sub do_cmd_Acrlong{ + &do_cmd_Glsdesc(@_) +} + +sub do_cmd_ACRlong{ + &do_cmd_GLSdesc(@_) +} + +sub do_cmd_acrfull{ + &do_cmd_glsfirst(@_) +} + +sub do_cmd_Acrfull{ + &do_cmd_Glsfirst(@_) +} + +sub do_cmd_ACRfull{ + &do_cmd_GLSfirst(@_) +} + +sub do_cmd_glossarypreamble{ + local($_) = @_; + $_[0]; +} + +sub do_cmd_glossarypostamble{ + local($_) = @_; + $_[0]; +} + +sub do_cmd_glsnumformat{ + local($_) = @_; + + $_; +} + +sub do_cmd_hyperit{ + join('', "\\textit ", $_[0]); +} + +sub do_cmd_hyperrm{ + join('', "\\textrm ", $_[0]); +} + +sub do_cmd_hypertt{ + join('', "\\texttt ", $_[0]); +} + +sub do_cmd_hypersf{ + join('', "\\textsf ", $_[0]); +} + +sub do_cmd_hyperbf{ + join('', "\\textbf ", $_[0]); +} + +&ignore_commands( <<_IGNORED_CMDS_ ); +makeglossary +makeglossaries +glossarystyle {} +_IGNORED_CMDS_ + +1; diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Danish.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Danish.dict new file mode 100644 index 00000000000..11ebed0f117 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Danish.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-Danish.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-Danish.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{Danish} +\providetranslation{Glossary}{Ordliste} +\providetranslation{Acronyms}{Akronymer} +\providetranslation{Notation (glossaries)}{Symbolforklaring} +\providetranslation{Description (glossaries)}{Beskrivelse} +\providetranslation{Symbol (glossaries)}{Symbol} +\providetranslation{Page List (glossaries)}{Side} +\providetranslation{Symbols (glossaries)}{Symboler} +\providetranslation{Numbers (glossaries)}{Tal} +\endinput +%% +%% End of file `glossaries-dictionary-Danish.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Dutch.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Dutch.dict new file mode 100644 index 00000000000..abfff1740e5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Dutch.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-Dutch.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-Dutch.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{Dutch} +\providetranslation{Glossary}{Woordenlijst} +\providetranslation{Acronyms}{Acroniemen} +\providetranslation{Notation (glossaries)}{Benaming} +\providetranslation{Description (glossaries)}{Beschrijving} +\providetranslation{Symbol (glossaries)}{Symbool} +\providetranslation{Page List (glossaries)}{Pagina's} +\providetranslation{Symbols (glossaries)}{Symbolen} +\providetranslation{Numbers (glossaries)}{Cijfers} +\endinput +%% +%% End of file `glossaries-dictionary-Dutch.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-English.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-English.dict new file mode 100644 index 00000000000..64140682399 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-English.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-English.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-English.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{English} +\providetranslation{Glossary}{Glossary} +\providetranslation{Acronyms}{Acronyms} +\providetranslation{Notation (glossaries)}{Notation} +\providetranslation{Description (glossaries)}{Description} +\providetranslation{Symbol (glossaries)}{Symbol} +\providetranslation{Page List (glossaries)}{Page List} +\providetranslation{Symbols (glossaries)}{Symbols} +\providetranslation{Numbers (glossaries)}{Numbers} +\endinput +%% +%% End of file `glossaries-dictionary-English.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-French.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-French.dict new file mode 100644 index 00000000000..41e36266967 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-French.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-French.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-French.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{French} +\providetranslation{Glossary}{Glossaire} +\providetranslation{Acronyms}{Acronymes} +\providetranslation{Notation (glossaries)}{Terme} +\providetranslation{Description (glossaries)}{Description} +\providetranslation{Symbol (glossaries)}{Symbole} +\providetranslation{Page List (glossaries)}{Pages} +\providetranslation{Symbols (glossaries)}{Symboles} +\providetranslation{Numbers (glossaries)}{Nombres} +\endinput +%% +%% End of file `glossaries-dictionary-French.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-German.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-German.dict new file mode 100644 index 00000000000..03ce4a53d80 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-German.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-German.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-German.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{German} +\providetranslation{Glossary}{Glossar} +\providetranslation{Acronyms}{Akronyme} +\providetranslation{Notation (glossaries)}{Bezeichnung} +\providetranslation{Description (glossaries)}{Beschreibung} +\providetranslation{Symbol (glossaries)}{Symbol} +\providetranslation{Page List (glossaries)}{Seiten} +\providetranslation{Symbols (glossaries)}{Symbole} +\providetranslation{Numbers (glossaries)}{Zahlen} +\endinput +%% +%% End of file `glossaries-dictionary-German.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Irish.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Irish.dict new file mode 100644 index 00000000000..72f5e8f3e2c --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Irish.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-Irish.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-Irish.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{Irish} +\providetranslation{Glossary}{Gluais} +\providetranslation{Acronyms}{Acrainmneacha} +\providetranslation{Notation (glossaries)}{Ciall} +\providetranslation{Description (glossaries)}{Tuairisc} +\providetranslation{Symbol (glossaries)}{Comhartha} +\providetranslation{Page List (glossaries)}{Leathanaigh} +\providetranslation{Symbols (glossaries)}{Comhartha\'{\i}} +\providetranslation{Numbers (glossaries)}{Uimhreacha} +\endinput +%% +%% End of file `glossaries-dictionary-Irish.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Italian.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Italian.dict new file mode 100644 index 00000000000..f12f26816ce --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Italian.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-Italian.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-Italian.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{Italian} +\providetranslation{Glossary}{Glossario} +\providetranslation{Acronyms}{Acronimi} +\providetranslation{Notation (glossaries)}{Nomenclatura} +\providetranslation{Description (glossaries)}{Descrizione} +\providetranslation{Symbol (glossaries)}{Simbolo} +\providetranslation{Page List (glossaries)}{Elenco delle pagine} +\providetranslation{Symbols (glossaries)}{Simboli} +\providetranslation{Numbers (glossaries)}{Numeri} +\endinput +%% +%% End of file `glossaries-dictionary-Italian.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Magyar.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Magyar.dict new file mode 100644 index 00000000000..b364df126b0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Magyar.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-Magyar.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-Magyar.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{Magyar} +\providetranslation{Glossary}{Sz\'ojegyz\'ek} +\providetranslation{Acronyms}{Bet\H uszavak} +\providetranslation{Notation (glossaries)}{Kifejez\'es} +\providetranslation{Description (glossaries)}{Magyar\'azat} +\providetranslation{Symbol (glossaries)}{Jel\"ol\'es} +\providetranslation{Page List (glossaries)}{Oldalsz\'am} +\providetranslation{Symbols (glossaries)}{Jelek} +\providetranslation{Numbers (glossaries)}{Sz\'amjegyek} +\endinput +%% +%% End of file `glossaries-dictionary-Magyar.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Spanish.dict b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Spanish.dict new file mode 100644 index 00000000000..1579534bbed --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/dict/glossaries-dictionary-Spanish.dict @@ -0,0 +1,52 @@ +%% +%% This is file `glossaries-dictionary-Spanish.dict', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-dictionary-Spanish.dict,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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 \~} +\ProvidesDictionary{glossaries-dictionary}{Spanish} +\providetranslation{Glossary}{Glosario} +\providetranslation{Acronyms}{Siglas} +\providetranslation{Notation (glossaries)}{Entrada} +\providetranslation{Description (glossaries)}{Descripci\'on} +\providetranslation{Symbol (glossaries)}{S\'{\i}mbolo} +\providetranslation{Page List (glossaries)}{Lista de p\'aginas} +\providetranslation{Symbols (glossaries)}{S\'{\i}mbolos} +\providetranslation{Numbers (glossaries)}{N\'umeros} +\endinput +%% +%% End of file `glossaries-dictionary-Spanish.dict'. diff --git a/Master/texmf-dist/tex/latex/glossaries/glossaries-babel.sty b/Master/texmf-dist/tex/latex/glossaries/glossaries-babel.sty new file mode 100644 index 00000000000..695e13dc5a2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/glossaries/glossaries-babel.sty @@ -0,0 +1,137 @@ +%% +%% This is file `glossaries-babel.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glossaries.dtx (with options: `glossaries-babel.sty,package') +%% +%% glossaries.dtx +%% Copyright 2008 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. +%% +%% \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-babel}[2008/02/22 v1.0 (NLCT)] +\addto\captionsenglish{% +\renewcommand*{\glossaryname}{Glossary}% +\renewcommand*{\acronymname}{Acronyms}% +\renewcommand*{\entryname}{Notation}% +\renewcommand*{\descriptionname}{Description}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Page List}% +\renewcommand*{\glssymbolsgroupname}{Symbols}% +\renewcommand*{\glsnumbersgroupname}{Numbers}% +}% +\addto\captionsgerman{% +\renewcommand*{\glossaryname}{Glossar}% +\renewcommand*{\acronymname}{Akronyme}% +\renewcommand*{\entryname}{Bezeichnung}% +\renewcommand*{\descriptionname}{Beschreibung}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Seiten}% +\renewcommand*{\glssymbolsgroupname}{Symbole}% +\renewcommand*{\glsnumbersgroupname}{Zahlen}} +\addto\captionsngerman{% +\renewcommand*{\glossaryname}{Glossar}% +\renewcommand*{\acronymname}{Akronyme}% +\renewcommand*{\entryname}{Bezeichnung}% +\renewcommand*{\descriptionname}{Beschreibung}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Seiten}% +\renewcommand*{\glssymbolsgroupname}{Symbole}% +\renewcommand*{\glsnumbersgroupname}{Zahlen}} +\addto\captionsitalian{% +\renewcommand*{\glossaryname}{Glossario}% +\renewcommand*{\acronymname}{Acronimi}% +\renewcommand*{\entryname}{Nomenclatura}% +\renewcommand*{\descriptionname}{Descrizione}% +\renewcommand*{\symbolname}{Simbolo}% +\renewcommand*{\pagelistname}{Elenco delle pagine}% +\renewcommand*{\glssymbolsgroupname}{Simboli}% +\renewcommand*{\glsnumbersgroupname}{Numeri}} +\addto\captionsdutch{% +\renewcommand*{\glossaryname}{Woordenlijst}% +\renewcommand*{\acronymname}{Acroniemen}% +\renewcommand*{\entryname}{Benaming}% +\renewcommand*{\descriptionname}{Beschrijving}% +\renewcommand*{\symbolname}{Symbool}% +\renewcommand*{\pagelistname}{Pagina's}% +\renewcommand*{\glssymbolsgroupname}{Symbolen}% +\renewcommand*{\glsnumbersgroupname}{Cijfers}} +\addto\captionsspanish{% +\renewcommand*{\glossaryname}{Glosario}% +\renewcommand*{\acronymname}{Siglas}% +\renewcommand*{\entryname}{Entrada}% +\renewcommand*{\descriptionname}{Descripci\'on}% +\renewcommand*{\symbolname}{S\'{\i}mbolo}% +\renewcommand*{\pagelistname}{Lista de p\'aginas}% +\renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}% +\renewcommand*{\glsnumbersgroupname}{N\'umeros}} +\addto\captionsfrench{% +\renewcommand*{\glossaryname}{Glossaire}% +\renewcommand*{\acronymname}{Acronymes}% +\renewcommand*{\entryname}{Terme}% +\renewcommand*{\descriptionname}{Description}% +\renewcommand*{\symbolname}{Symbole}% +\renewcommand*{\pagelistname}{Pages}% +\renewcommand*{\glssymbolsgroupname}{Symboles}% +\renewcommand*{\glsnumbersgroupname}{Nombres}} +\addto\captionsdanish{% +\renewcommand*{\glossaryname}{Ordliste}% +\renewcommand*{\acronymname}{Akronymer}% +\renewcommand*{\entryname}{Symbolforklaring}% +\renewcommand*{\descriptionname}{Beskrivelse}% +\renewcommand*{\symbolname}{Symbol}% +\renewcommand*{\pagelistname}{Side}% +\renewcommand*{\glssymbolsgroupname}{Symboler}% +\renewcommand*{\glsnumbersgroupname}{Tal}} +\addto\captionsirish{% +\renewcommand*{\glossaryname}{Gluais}% +\renewcommand*{\acronymname}{Acrainmneacha}% +\renewcommand*{\entryname}{Ciall}% +\renewcommand*{\descriptionname}{Tuairisc}% +\renewcommand*{\symbolname}{Comhartha}% +\renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}% +\renewcommand*{\pagelistname}{Leathanaigh}% +\renewcommand*{\glsnumbersgroupname}{Uimhreacha}} +\addto\captionsmagyar{% +\renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}% +\renewcommand*{\acronymname}{Bet\H uszavak}% +\renewcommand*{\entryname}{Kifejez\'es}% +\renewcommand*{\descriptionname}{Magyar\'azat}% +\renewcommand*{\symbolname}{Jel\"ol\'es}% +\renewcommand*{\pagelistname}{Oldalsz\'am}% +\renewcommand*{\glssymbolsgroupname}{Jelek}% +\renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}% +} +\endinput +%% +%% End of file `glossaries-babel.sty'. diff --git a/Master/texmf-dist/tex/latex/glossaries/glossaries.sty b/Master/texmf-dist/tex/latex/glossaries/glossaries.sty index 2e390251c1c..e75d00d56eb 100644 --- a/Master/texmf-dist/tex/latex/glossaries/glossaries.sty +++ b/Master/texmf-dist/tex/latex/glossaries/glossaries.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossaries.sty,package') %% %% glossaries.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2008 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. %% %% \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 @@ -39,16 +39,31 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2007/10/13 v1.08 (NLCT)] +\ProvidesPackage{glossaries}[2008/02/22 v1.11 (NLCT)] \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] -\RequirePackage{xspace} +\RequirePackage{amsgen} \define@boolkey{glossaries.sty}[gls]{toc}[true]{} +\define@boolkey{glossaries.sty}[gls]{numberline}[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*{\@@glossarysecstar}{*} +\newcommand*{\@@glossaryseclabel}{} +\define@choicekey{glossaries.sty}{numberedsection}[\val\nr]{% +false,nolabel,autolabel}[nolabel]{% +\ifcase\nr\relax + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{}% +\or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{}% +\or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{\label{\@glo@type}}% +\fi} \newcommand*{\@glossary@default@style}{list} \define@key{glossaries.sty}{style}{% \renewcommand*{\@glossary@default@style}{#1}} @@ -92,6 +107,23 @@ name=true]{% \renewcommand*{\@gls@sanitizesymbol}{}% }{\setkeys[gls]{sanitize}{#1}}% } +\define@boolkey{glossaries.sty}[gls]{translate}[true]{} +\glstranslatefalse +\@ifpackageloaded{translator}{\glstranslatetrue}{% +\@ifpackageloaded{babel}{\glstranslatetrue}{}} +\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% +\ifthenelse{\boolean{glsacrdescription}}{}% +{\renewcommand*{\@gls@sanitizedesc}{}}% +} +\define@boolkey{glossaries.sty}[glsacr]{description}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% +} +\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% +} +\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% + \renewcommand*{\@gls@sanitizesymbol}{}% +} \ProcessOptionsX \ifthenelse{\equal{\glscounter}{section}}{% \@ifundefined{chapter}{}{% @@ -106,100 +138,19 @@ name=true]{% \providecommand*{\pagelistname}{Page List} \providecommand*{\glssymbolsgroupname}{Symbols} \providecommand*{\glsnumbersgroupname}{Numbers} -\@ifpackageloaded{babel}{% -\addto\captionsenglish{% -\renewcommand*{\glossaryname}{Glossary}% -\renewcommand*{\acronymname}{Acronyms}% -\renewcommand*{\entryname}{Notation}% -\renewcommand*{\descriptionname}{Description}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Page List}% -\renewcommand*{\glssymbolsgroupname}{Symbols}% -\renewcommand*{\glsnumbersgroupname}{Numbers}% -}% -\addto\captionsgerman{% -\renewcommand*{\glossaryname}{Glossar}% -\renewcommand*{\acronymname}{Akronyme}% -\renewcommand*{\entryname}{Bezeichnung}% -\renewcommand*{\descriptionname}{Beschreibung}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Seiten}% -\renewcommand*{\glssymbolsgroupname}{Symbole}% -\renewcommand*{\glsnumbersgroupname}{Zahlen}} -\addto\captionsngerman{% -\renewcommand*{\glossaryname}{Glossar}% -\renewcommand*{\acronymname}{Akronyme}% -\renewcommand*{\entryname}{Bezeichnung}% -\renewcommand*{\descriptionname}{Beschreibung}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Seiten}% -\renewcommand*{\glssymbolsgroupname}{Symbole}% -\renewcommand*{\glsnumbersgroupname}{Zahlen}} -\addto\captionsitalian{% -\renewcommand*{\glossaryname}{Glossario}% -\renewcommand*{\acronymname}{Acronimi}% -\renewcommand*{\entryname}{Nomenclatura}% -\renewcommand*{\descriptionname}{Descrizione}% -\renewcommand*{\symbolname}{Simbolo}% -\renewcommand*{\pagelistname}{Elenco delle pagine}% -\renewcommand*{\glssymbolsgroupname}{Simboli}% -\renewcommand*{\glsnumbersgroupname}{Numeri}} -\addto\captionsdutch{% -\renewcommand*{\glossaryname}{Woordenlijst}% -\renewcommand*{\acronymname}{Acroniemen}% -\renewcommand*{\entryname}{Benaming}% -\renewcommand*{\descriptionname}{Beschrijving}% -\renewcommand*{\symbolname}{Symbool}% -\renewcommand*{\pagelistname}{Pagina's}% -\renewcommand*{\glssymbolsgroupname}{Symbolen}% -\renewcommand*{\glsnumbersgroupname}{Cijfers}} -\addto\captionsspanish{% -\renewcommand*{\glossaryname}{Glosario}% -\renewcommand*{\acronymname}{Siglas}% -\renewcommand*{\entryname}{Entrada}% -\renewcommand*{\descriptionname}{Descripci\'on}% -\renewcommand*{\symbolname}{S\'{\i}mbolo}% -\renewcommand*{\pagelistname}{Lista de p\'aginas}% -\renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}% -\renewcommand*{\glsnumbersgroupname}{N\'umeros}} -\addto\captionsfrench{% -\renewcommand*{\glossaryname}{Glossaire}% -\renewcommand*{\acronymname}{Acronymes}% -\renewcommand*{\entryname}{Terme}% -\renewcommand*{\descriptionname}{Description}% -\renewcommand*{\symbolname}{Symbole}% -\renewcommand*{\pagelistname}{Pages}% -\renewcommand*{\glssymbolsgroupname}{Symboles}% -\renewcommand*{\glsnumbersgroupname}{Nombres}} -\addto\captionsdanish{% -\renewcommand*{\glossaryname}{Ordliste}% -\renewcommand*{\acronymname}{Akronymer}% -\renewcommand*{\entryname}{Symbolforklaring}% -\renewcommand*{\descriptionname}{Beskrivelse}% -\renewcommand*{\symbolname}{Symbol}% -\renewcommand*{\pagelistname}{Side}% -\renewcommand*{\glssymbolsgroupname}{Symboler}% -\renewcommand*{\glsnumbersgroupname}{Tal}} -\addto\captionsirish{% -\renewcommand*{\glossaryname}{Gluais}% -\renewcommand*{\acronymname}{Acrainmneacha}% 'Acronyms' -\renewcommand*{\entryname}{Ciall}% -\renewcommand*{\descriptionname}{Tuairisc}% -\renewcommand*{\symbolname}{Comhartha}% -\renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}%OR -\renewcommand*{\pagelistname}{Leathanaigh}% -\renewcommand*{\glsnumbersgroupname}{Uimhreacha}} -\addto\captionsmagyar{% -\renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}% -\renewcommand*{\acronymname}{Bet\H uszavak}% -\renewcommand*{\entryname}{Kifejez\'es}% -\renewcommand*{\descriptionname}{Magyar\'azat}% -\renewcommand*{\symbolname}{Jel\"ol\'es}% -\renewcommand*{\pagelistname}{Oldalsz\'am}% -\renewcommand*{\glssymbolsgroupname}{Jelek}% -\renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}% -} -}{} +\ifglstranslate +\@ifpackageloaded{translator}{\usedictionary{glossaries-dictionary}% +\renewcommand*{\glossaryname}{\translate{Glossary}}% +\renewcommand*{\acronymname}{\translate{Acronyms}}% +\renewcommand*{\entryname}{\translate{Notation (glossaries)}}% +\renewcommand*{\descriptionname}{\translate{Description (glossaries)}}% +\renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}% +\renewcommand*{\pagelistname}{\translate{Page List (glossaries)}}% +\renewcommand*{\glssymbolsgroupname}{\translate{Symbols (glossaries)}}% +\renewcommand*{\glsnumbersgroupname}{\translate{Numbers (glossaries)}}% +}{% +\@ifpackageloaded{babel}{\RequirePackage{glossaries-babel}}{}} +\fi \newcommand*{\glspostdescription}{.} \providecommand*{\istfilename}{\jobname.ist} \newcommand*{\@istfilename}[1]{} @@ -217,19 +168,38 @@ name=true]{% \@glossarysection{#1}{#2}}{\@p@glossarysection{#1}{#2}}% \@mkboth{\glossarytoctitle}{\glossarytoctitle}% } +\newcommand*{\setglossarysection}[1]{% +\setkeys{glossaries.sty}{section=#1}} \newcommand*{\@glossarysection}[2]{% -\csname\@@glossarysec\endcsname*{#2}% -\@gls@toc{#1}{\@@glossarysec}} +\ifx\@@glossarysecstar\@empty + \csname\@@glossarysec\endcsname{#2}% +\else + \csname\@@glossarysec\endcsname*{#2}% + \@gls@toc{#1}{\@@glossarysec}% +\fi +\@@glossaryseclabel} \newcommand*{\@p@glossarysection}[2]{% \gls@doclearpage -\phantomsection\@gls@toc{#1}{\@@glossarysec}% -\csname\@@glossarysec\endcsname*{#2}} +\phantomsection +\ifx\@@glossarysecstar\@empty + \csname\@@glossarysec\endcsname{#2}% +\else + \@gls@toc{#1}{\@@glossarysec}% + \csname\@@glossarysec\endcsname*{#2}% +\fi +\@@glossaryseclabel} \newcommand{\gls@doclearpage}{% \ifthenelse{\equal{\@@glossarysec}{chapter}}{% \@ifundefined{cleardoublepage}{\clearpage}{\cleardoublepage}}{}% } \newcommand*{\@gls@toc}[2]{% -\ifglstoc \addcontentsline{toc}{#2}{#1}\fi} +\ifglstoc + \ifglsnumberline + \addcontentsline{toc}{#2}{\numberline{}#1}% + \else + \addcontentsline{toc}{#2}{#1}% + \fi +\fi} \newcommand*{\forallglossaries}[3][\@glo@types]{% \@for#2:=#1\do{\ifthenelse{\equal{#2}{}}{}{#3}}} \newcommand*{\forglsentries}[3][\glsdefaulttype]{% @@ -475,7 +445,7 @@ counter as its value}}{% \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% } \def\@gls@updatechecked#1\@nil#2{\def#2{#1}} -\toksdef\@gls@tmpb=2 +\newtoks\@gls@tmpb \def\@gls@checkquote#1"#2"#3\null{% \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% \toks@={#1}% @@ -669,93 +639,405 @@ counter as its value}}{% \newcommand*{\gls}{\@ifstar\@sgls\@gls} \newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]} \newcommand*{\@gls}[2][]{% -\@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}} +\new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}} \def\@gls@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#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}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + \else + \@gls@link[#1]{#2}{\@glo@text}% + \fi +}% \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}[]}} +\new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}} \def\@Gls@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#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}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\expandafter\MakeUppercase\@glo@text}% + \else + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \fi +}% \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}[]}} +\new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}} \def\@GLS@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#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}}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% + \else + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% + \fi +}% \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}[]}} +\new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}} \def\@glspl@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#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}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + \else + \@gls@link[#1]{#2}{\@glo@text}% + \fi +}% \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}[]}} +\new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}} \def\@Glspl@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#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}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\expandafter\MakeUppercase\@glo@text}% + \else + \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \fi +}% \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}[]}} +\new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}} \def\@GLSpl@#1#2[#3]{% \glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link@opts{#1}% +\def\@gls@link@label{#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}}% +\ifglsused{#2}{% + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}{% + \ifglsacrfootnote + \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% + \else + \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% + \fi +}% \glsunset{#2}}% -\xspace} +} +\newcommand*{\glstext}{\@ifstar\@sglstext\@glstext} +\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]} +\newcommand*{\@glstext}[2][]{% +\new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} +\def\@glstext@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\GLStext}{\@ifstar\@sGLStext\@GLStext} +\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]} +\newcommand*{\@GLStext}[2][]{% +\new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} +\def\@GLStext@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +\newcommand*{\Glstext}{\@ifstar\@sGlstext\@Glstext} +\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]} +\newcommand*{\@Glstext}[2][]{% +\new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} +\def\@Glstext@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst} +\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]} +\newcommand*{\@glsfirst}[2][]{% +\new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} +\def\@glsfirst@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst} +\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]} +\newcommand*{\@Glsfirst}[2][]{% +\new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} +\def\@Glsfirst@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst} +\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[hyper=false,#1]} +\newcommand*{\@GLSfirst}[2][]{% +\new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} +\def\@GLSfirst@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +\newcommand*{\glsplural}{\@ifstar\@sglsplural\@glsplural} +\newcommand*{\@sglsplural}[1][]{\@glsplural[hyper=false,#1]} +\newcommand*{\@glsplural}[2][]{% +\new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}} +\def\@glsplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural} +\newcommand*{\@sGlsplural}[1][]{\@Glsplural[hyper=false,#1]} +\newcommand*{\@Glsplural}[2][]{% +\new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}} +\def\@Glsplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural} +\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]} +\newcommand*{\@GLSplural}[2][]{% +\new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} +\def\@GLSplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +\newcommand*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural} +\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]} +\newcommand*{\@glsfirstplural}[2][]{% +\new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} +\def\@glsfirstplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural} +\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]} +\newcommand*{\@Glsfirstplural}[2][]{% +\new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} +\def\@Glsfirstplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural} +\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[hyper=false,#1]} +\newcommand*{\@GLSfirstplural}[2][]{% +\new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}} +\def\@GLSfirstplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +\newcommand*{\glsname}{\@ifstar\@sglsname\@glsname} +\newcommand*{\@sglsname}[1][]{\@glsname[hyper=false,#1]} +\newcommand*{\@glsname}[2][]{% +\new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}} +\def\@glsname@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\Glsname}{\@ifstar\@sGlsname\@Glsname} +\newcommand*{\@sGlsname}[1][]{\@Glsname[hyper=false,#1]} +\newcommand*{\@Glsname}[2][]{% +\new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}} +\def\@Glsname@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\GLSname}{\@ifstar\@sGLSname\@GLSname} +\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]} +\newcommand*{\@GLSname}[2][]{% +\new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} +\def\@GLSname@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +\newcommand*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc} +\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]} +\newcommand*{\@glsdesc}[2][]{% +\new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} +\def\@glsdesc@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc} +\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]} +\newcommand*{\@Glsdesc}[2][]{% +\new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} +\def\@Glsdesc@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc} +\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]} +\newcommand*{\@GLSdesc}[2][]{% +\new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} +\def\@GLSdesc@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +\newcommand*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol} +\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]} +\newcommand*{\@glssymbol}[2][]{% +\new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} +\def\@glssymbol@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +\newcommand*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol} +\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]} +\newcommand*{\@Glssymbol}[2][]{% +\new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} +\def\@Glssymbol@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +}% +} +\newcommand*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol} +\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]} +\newcommand*{\@GLSsymbol}[2][]{% +\new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} +\def\@GLSsymbol@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\protected@edef\@glo@text{% +\csname gls@\@glo@type @display\endcsname +{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} \newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} \newcommand*{\Glsentryname}[1]{\expandafter \MakeUppercase\csname glo@#1@name\endcsname} @@ -976,15 +1258,211 @@ style `#1' undefined}{}}{% \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} + \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} +\newcommand*{\acrshort}[2][]{% +\new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}} +\def\@acrshort#1#2[#3]{\@glstext@{#1}{#2}[#3]} +\newcommand*{\Acrshort}[2][]{% +\new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}} +\def\@Acrshort#1#2[#3]{\@glstext@{#1}{#2}[#3]} +\newcommand*{\ACRshort}[2][]{% +\new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}} +\def\@ACRshort#1#2[#3]{\@glstext@{#1}{#2}[#3]} +\newcommand*{\acrlong}[2][]{% +\new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}} +\def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} +\newcommand*{\Acrlong}[2][]{% +\new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}} +\def\@Acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} +\newcommand*{\ACRlong}[2][]{% +\new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}} +\def\@ACRlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} +\newcommand*{\acrfull}[2][]{% +\new@ifnextchar[{\@acrfull{#1}{#2}}{\@acrfull{#1}{#2}[]}} +\def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} +\newcommand*{\Acrfull}[2][]{% +\new@ifnextchar[{\@Acrfull{#1}{#2}}{\@Acrfull{#1}{#2}[]}} +\def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} +\newcommand*{\ACRfull}[2][]{% +\new@ifnextchar[{\@ACRfull{#1}{#2}}{\@ACRfull{#1}{#2}[]}} +\def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} +\newcommand{\acronymfont}[1]{#1} +\ifglsacrdescription + \ifglsacrfootnote + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + symbol={#4},% + #1}} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} + \def\@acrlong#1#2[#3]{\@glssymbol@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]} + \def\@acrfull#1#2[#3]{\@glssymbol@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glssymbol@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3] + (\acronymfont{\@GLStext@{#1}{#2}[#3]})} + \defglsdisplayfirst[\acronymtype]{% + \acronymfont{#1}#4\noexpand\footnote{% + \noexpand\glslink[\@gls@link@opts]{\@gls@link@label}{#3}}}% + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{#1}} + \fi + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi + \else + \ifglsacrdua + \ifglsacrsmallcaps + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \fi + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#4},% + first={#4},% + symbol={#3},% + #1}} + \def\@acrshort#1#2[#3]{\acronymfont{\@glssymbol@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glssymbol@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLSsymbol@{#1}{#2}[#3]}} + \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} + \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] + (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})} + \defglsdisplayfirst[\acronymtype]{#1#4} + \defglsdisplay[\acronymtype]{#1#4} + \else + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + first={#4},% + symbol={#3},% + #1}} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} + \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} + \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] + (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})} + \defglsdisplayfirst[\acronymtype]{#1#4 (\acronymfont{#3})} + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4} + \ifglsacrsmallcaps + \renewcommand{\acronymfont}[1]{\textsc{#1}} + \fi + \fi + \fi +\else + \ifglsacrfootnote + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + description={#4},% + #1}} + \defglsdisplayfirst[\acronymtype]{% + \acronymfont{#1}#4\noexpand\footnote{% + \noexpand\glslink[\@gls@link@opts]{\@gls@link@label}{#2}}}% + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}% + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} + \def\@acrlong#1#2[#3]{\@glsdesc@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsdesc@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSdesc@{#1}{#2}[#3]} + \def\@acrfull#1#2[#3]{\@glsdesc@{#1}{#2}[#3] + (\@glstext@{#1}{#2}[#3])} + \def\@Acrfull#1#2[#3]{\@Glsdesc@{#1}{#2}[#3] + (\@glstext@{#1}{#2}[#3])} + \def\@ACRfull#1#2[#3]{\@GLSdesc@{#1}{#2}[#3] + (\@GLStext@{#1}{#2}[#3])} + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{#1}}% + \fi + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi + \else + \ifglsacrsmallcaps + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + first={#4},% + description={#4},% + symbol={#3},% + #1}} + \defglsdisplayfirst[\acronymtype]{#1#4 (\acronymfont{#3})} + \defglsdisplay[\acronymtype]{\acronymfont{#1}#4} + \renewcommand*{\acronymfont}[1]{\textsc{#1}} + \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} + \def\@Acrshort#1#2[#3]{\acronymfont{\@Glstext@{#1}{#2}[#3]}} + \def\@ACRshort#1#2[#3]{\acronymfont{\@GLStext@{#1}{#2}[#3]}} + \def\@acrlong#1#2[#3]{\@glsfirst@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glsfirst@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLSfirst@{#1}{#2}[#3]} + \def\@acrfull#1#2[#3]{\@glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glsfirst@{#1}{#2}[#3] + (\acronymfont{\@glstext@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLSfirst@{#1}{#2}[#3] + (\acronymfont{\@GLStext@{#1}{#2}[#3]})} + \ifglsacrdua + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \fi + \else + \ifglsacrdua + \renewcommand{\newacronym}[4][]{% + \newglossaryentry{#2}{type=\acronymtype,% + name={#3},% + description={#4},% + text={#4},% + symbol={#3},% + #1}} + \defglsdisplayfirst[\acronymtype]{#1#4} + \defglsdisplay[\acronymtype]{#1#4} + \def\@acrshort#1#2[#3]{\@glssymbol@{#1}{#2}[#3]} + \def\@Acrshort#1#2[#3]{\@Glssymbol@{#1}{#2}[#3]} + \def\@ACRshort#1#2[#3]{\@GLSsymbol@{#1}{#2}[#3]} + \def\@acrlong#1#2[#3]{\@glstext@{#1}{#2}[#3]} + \def\@Acrlong#1#2[#3]{\@Glstext@{#1}{#2}[#3]} + \def\@ACRlong#1#2[#3]{\@GLStext@{#1}{#2}[#3]} + \def\@acrfull#1#2[#3]{\@glstext@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@Acrfull#1#2[#3]{\@Glstext@{#1}{#2}[#3] + (\acronymfont{\@glssymbol@{#1}{#2}[#3]})} + \def\@ACRfull#1#2[#3]{\@GLStext@{#1}{#2}[#3] + (\acronymfont{\@GLSsymbol@{#1}{#2}[#3]})} + \fi + \fi + \fi +\fi \RequirePackage{glossary-hypernav} \RequirePackage{glossary-list} \RequirePackage{glossary-long} diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty index 8e7e9b6d670..0b165f3f5c2 100644 --- a/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-hypernav.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossary-hypernav.sty,package') %% %% glossaries.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2008 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. %% %% \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 diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty index fe07f6ae2ab..66bc2e17350 100644 --- a/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-list.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossary-list.sty,package') %% %% glossaries.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2008 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. %% %% \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 @@ -38,7 +38,7 @@ %% Right bracket \] Circumflex \^ Underscore \_ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} -\ProvidesPackage{glossary-list}[2007/10/04 v1.02 (NLCT)] +\ProvidesPackage{glossary-list}[2008/02/16 v1.03 (NLCT)] \newglossarystyle{list}{% \renewenvironment{theglossary}{\begin{description}}{\end{description}}% \renewcommand*{\glossaryheader}{}% @@ -69,6 +69,13 @@ \item[]\glsnavigation}% \renewcommand*{\glsgroupheading}[1]{% \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +\newlength\glslistdottedwidth +\setlength{\glslistdottedwidth}{.5\linewidth} +\newglossarystyle{listdotted}{% +\glossarystyle{list}% +\renewcommand*{\glossaryentryfield}[5]{% +\item[]\makebox[\glslistdottedwidth][l]{\@glstarget{glo:##1}{##2}% +\unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}} \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 index b74e44fe426..c17680f813c 100644 --- a/Master/texmf-dist/tex/latex/glossaries/glossary-long.sty +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-long.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossary-long.sty,package') %% %% glossaries.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2008 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. %% %% \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 diff --git a/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty b/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty index 80deb72b175..b05bbd1cf8a 100644 --- a/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty +++ b/Master/texmf-dist/tex/latex/glossaries/glossary-super.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossary-super.sty,package') %% %% glossaries.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2008 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. %% %% \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 diff --git a/Master/tlpkg/bin/ctan2tds b/Master/tlpkg/bin/ctan2tds index adda207427a..22d0c4253e9 100755 --- a/Master/tlpkg/bin/ctan2tds +++ b/Master/tlpkg/bin/ctan2tds @@ -180,6 +180,7 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw 'gfsneohellenic', "&MAKEflatten", 'gfsporson', "&MAKEflatten", 'gfssolomos', "&MAKEflatten", + 'glossaries', "&MAKEcopy", 'glhyph', "die 'hyphenation madness needs work, sorry'", 'graphics', "&MAKEcopy", # we use latex-tds/graphics.zip 'graphicxsp', "die 'skipping, requires adobe distiller'", @@ -419,6 +420,7 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw %specialpostaction = ( 'babel' => '&POSTbabel', 'fpl' => '&POSTfpl', + 'glossaries' => '&POSTglossaries', 'ibygrk' => '&POSTibygrk', 'interactiveworkbook' => '&POSTinteractiveworkbook', 'pgf' => '&POSTpgf', @@ -3278,6 +3280,13 @@ sub POSTfpl &SYSTEM ("$MV README.source $DEST/source/fonts/fpl/README"); } +sub POSTglossaries +{ + my $wdir = "$TOPDEST/bin/win32"; + &SYSTEM ("mkdir -p $wdir"); + &SYSTEM ("$CP $DEST/scripts/glossaries/makeglossaries.bat $wdir"); +} + sub FLATTEN_PREHOOK_ibygrk { print "\t FLATTEN_PREHOOK_$package - handle ibycus4.map\n"; diff --git a/Master/tlpkg/tlpsrc/glossaries.tlpsrc b/Master/tlpkg/tlpsrc/glossaries.tlpsrc index 80dc2a297b7..4e3605b725f 100644 --- a/Master/tlpkg/tlpsrc/glossaries.tlpsrc +++ b/Master/tlpkg/tlpsrc/glossaries.tlpsrc @@ -1,2 +1,3 @@ name glossaries category Package +binpattern f bin/${ARCH}/makeglossaries -- cgit v1.2.3