______________________________________________________________________________________
+
* Strips standard LTEX commands) so, for
-example, commands) so, for example, \AA is treated the same as A.
-
is treated
+the same as A.
+
† Only with the hybrid method provided with glossaries-extraOnly with the hybrid method provided with glossaries-extra.
-
‡ Provided sort=none sort=none is used.
-
§ Entries with the same sort value are merged.
-
♢ ♢ Requires some setting up.
-
¶ The locations must be set explicitly through the custom location The locations must be set explicitly through the custom location field provided by glossaries-extra.
-
# Unlimited but unreliable.
-
※ Entries are defined in .bib bib format. \newglossaryentry should not be used explicitly.
-
⁑ Provided docdefs=true or docdefs=restricted ⁑ Provided docdef=true or docdef=restricted but not recommended.
-
⋆ Provided docdefs=false or docdefs=restricted⋆ Provided docdef=false or docdef=restricted.
-
✾ Irrelevant with sort=none. (The record=only sort=none. (The record=only option automatically switches this on.)
-
-
+
+
+ id="x1-5017r1">
🔗Option 1 (TEX)
-This option doesn’t require an external indexing application but, with the default
-alphabetic sorting, it’s very slow with severe limitations. If you want a sorted list, it
-doesn’t work well for extended Latin alphabets or non-Latin alphabets. However, if
-you use the sanitizesort=false package option (the default for Option 1) then the
+
Example Document:
+
+
+
+
+\documentclass{article}
+
\usepackage{glossaries}
+
+
+
+
\makenoidxglossaries % use TeX to sort
+
+
+
+
+
+\newglossaryentry{sample}{name={sample},
+
description={an example}}
+
\begin{document}
+
\gls{sample}.
+
+
+
+
\printnoidxglossary
+
\end{document}
+
+
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries
+(after \makenoidxglossaries).
+ This option doesn’t require an external indexing application but, with the default alphabetic sorting, it’s
+very slow with severe limitations. If you want a sorted list, it doesn’t work well for extended Latin alphabets or
non-Latin alphabets. However, if you use the sanitizesort=false package option (the default for Option 1) then
+the standard LATEX accent commands will be ignored, so if an entry’s name is set to
-{\’e}lite then the sort value will default to EX
accent commands will be ignored, so if an entry’s name is set to {\’e}lite then the sort
+value will default to elite if sanitizesort=false is used and
-will default to sanitizesort=false is used and will default to \’elite if sanitizesort=true is used. If you have any other kinds of
-commands that don’t expand to ASCII characters, such as \alpha or \si, then you
-must use sanitizesort=true or change the sort method (sort=use or sort=def) in the
+class="cmss-10">sanitizesort=true is used. If
+you have any other kinds of commands that don’t expand to ASCII characters, such as \alpha or
+\si, then you must use sanitizesort=true or change the sort method (sort=use or sort=def) in the
package options or explicitly set the sort key when you define the relevant entries. For
-example:
-
-
-
-
-\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
-
sort={alpha},description={...}}
-
-
-
This option works best with the sort=def or sort=use setting. For any other setting, be
-prepared for a long document build time, especially if you have a lot of entries defined. This
-option is intended as a last resort for alphabetical sorting. This option allows a
-mixture of sort methods. (For example, sorting by word order for one glossary and order of
-use for another.) This option is not suitable for hierarchical glossaries and does not form
+class="cmtt-10">sort
key when you define the relevant entries. For example:
+
+
+
\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+
sort={alpha},description={...}}
+
+
+
The
glossaries-extra package has a modified
symbols package option that provides
\glsxtrnewsymbol, which
+automatically sets the
sort key to the entry label (instead of the
name).
+
+
This option works best with the sort=def or sort=use setting. For any other setting, be prepared for a long
+document build time, especially if you have a lot of entries defined. This option is intended as a last resort for
+alphabetical sorting. This option allows a mixture of sort methods. (For example, sorting by word order for one
+glossary and order of use for another.) This option is not suitable for hierarchical glossaries and does not form
ranges in the number lists. If you really can’t use an indexing application consider using
-Option 5 instead.
-
+ id="dx1-6019">s. If you really can’t use an indexing application consider using Option 5
+instead.
+
- Add
-
-
-
+ class="enumerate" id="x1-6021x1">Add
+
+
+
\makenoidxglossaries
-
to your preamble (before you start defining your entries, as described in §4 Defining
- Glossary Entries).
+
to your preamble (before you start defining your entries, as described in §4 Defining Glossary
+ Entries).
- Put
-
-
-
+ class="enumerate" id="x1-6023x2">Put
+
+
+
\printnoidxglossary
-
where you want your list of entries to appear (described in §10 Displaying a glossary).
- Alternatively, to display all glossaries use the iterative command:
-
-
+
where you want your list of entries to appear (described in §10 Displaying a glossary). Alternatively, to
+ display all glossaries use the iterative command:
+
+
-
+
\printnoidxglossaries
-
+
- Run LATEX twice on your document. (As you would do to make a table of contents
- appear.) For example, click twice on the “typeset” or “build” or “PDFLATEX” button
- in your editor.
-
Complete example:
-
-
+ class="enumerate" id="x1-6025x3">Run LATEX twice on your document. (As you would do to make a table of contents appear.) For
+ example, click twice on the “typeset” or “build” or “PDFLATEX” button in your editor.
+
+
-
+
🔗Option 2 (makeindex)
+
Example document:
+
+
+
+
\documentclass{article}
\usepackage{glossaries}
-
\makenoidxglossaries % use TeX to sort
-
\newglossaryentry{sample}{name={sample},
-
description={an example}}
+
+
+
+
\makeglossaries % open glossary files
+
+
+
+
+
+\newglossaryentry{sample}{name={sample},
+
description={an example}}
\begin{document}
\gls{sample}.
-
\printnoidxglossary
-
\end{document}
-
-
-
-
-
Option 2 (makeindex)
-
This option uses a
+
+
\printglossary
+
\end{document}
+
+
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries
+(after \makeglossaries).
+
This option uses a CLI application called makeindex to sort the entries. This application
-comes with all modern T to sort the entries. This application comes with all
+modern TEX distributions, but it’s hard-coded for the non-extended Latin
-alphabet. It can’t correctly sort accent commands (such as Latin alphabet. It can’t correctly sort
+accent commands (such as \’ or \c) and fails with UTF-8
-characters, especially for any sort values that start with a UTF-8 character (as it separates
-the octets resulting in an invalid file encoding). This process involves making LATEX write
-the glossary information to a temporary file which \c) and fails with UTF-8 characters, especially for any sort values that start
+with a UTF-8 character (as it separates the octets resulting in an invalid file encoding). This process involves
+making LATEX write the glossary information to a temporary file which makeindex reads. Then reads. Then makeindex writes
-a new file containing the code to typeset the glossary. Then \printglossary reads this file in
-on the next run.
-
This option works best if you want to sort entries according to the English alphabet and
-you don’t want to install Perl (or Java or you don’t want to use glossaries-extra). This method
-can also work with the restricted shell escape since
+writes a new file containing the code to typeset the glossary. Then \printglossary reads this file in on the
+next run.
+
This option works best if you want to sort entries according to the English alphabet and you don’t want to
+install Perl or Java. This method can also work with the restricted shell escape since makeindex is considered a trusted
-application. (So you should be able to use the is considered a
+trusted application. (So you should be able to use the automake package option provided the shell
-escape hasn’t been completely disabled.)
-
This method can form ranges in the package option provided the shell escape hasn’t
+been completely disabled.)
+
This method can form ranges in the number list but only accepts limited number formats:
- but only accepts limited number formats: \arabic, \roman, \roman,
+\Roman, \alph and \Alph.
-
This option does not allow a mixture of sort methods. All glossaries must be sorted
-according to the same method: word/letter ordering or order of use or order of definition. If
-you need word ordering for one glossary and letter ordering for another you’ll have to
-explicitly call This option does not allow a mixture of sort methods. All glossaries must be sorted according to the same
+method: word/letter ordering or order of use or order of definition. If you need word ordering for one
+glossary and letter ordering for another you’ll have to explicitly call makeindex
for each glossary type. (The glossaries-extra package allows a hybrid
-mix of Options for each glossary
+type.
+
+
+
- If you want to use If you want to use makeindex’s ’s -g option you must change the quote character using
-
-
- option you must change the quote character using \GlsSetQuote. For example:
-
-
-
+ id="dx1-7017">. For
+ example:
+
+
+
\GlsSetQuote{+}
-
This must be used before This must be used before \makeglossaries. Note that if you are using babel, the
- shorthands aren’t enabled until the start of the document, so you won’t be able to use
- the shorthands in definitions made in the preamble.
+ id="dx1-7018">, the shorthands aren’t
+ enabled until the start of the document, so you won’t be able to use the shorthands in definitions made in
+ the preamble.
- Add
-
-
-
+ class="enumerate" id="x1-7020x2">Add
+
+
+
\makeglossaries
-
to your preamble (before you start defining your entries, as described in §4 Defining
- Glossary Entries).
+
to your preamble (before you start defining your entries, as described in §4 Defining Glossary
+ Entries).
- Put
-
-
-
+ class="enumerate" id="x1-7022x3">Put
+
+
+
\printglossary
-
where you want your list of entries to appear (described in §10 Displaying a glossary).
- Alternatively, to display all glossaries use the iterative command:
-
-
+
where you want your list of entries to appear (described in §10 Displaying a glossary). Alternatively, to
+ display all glossaries use the iterative command:
+
+
-
+
\printglossaries
-
+
- Run LATRun LATEX on your document. This creates files with the extensions .glo and .ist
- (for example, if your LATglo and ist (for example, if your
+ LATEX document is called myDoc.tex, then you’ll have two
- extra files called myDoc.glo and myDoc.ist). If you look at your document
- at this point, you won’t see the glossary as it hasn’t been created yet. (If
- you use glossaries-extra you’ll see the section heading and some boilerplate
+class="cmtt-10">myDoc.tex, then you’ll have two extra files called myDoc.glo and
+ myDoc.ist). If you look at your document at this point, you won’t see the glossary as it hasn’t been
+ created yet. (If you use glossaries-extra you’ll see the section heading and some boilerplate
text.)
-
+
If you have used package options such as symbols there will also be other sets of files corresponding to the
+ extra glossaries that were created by those options.
+
- Run 🔗 Run makeindex with the with the .glo file as the input file and the .ist file as the style so
- that it creates an output file with the extension .gls. If you have access to a
- terminal or a command prompt (for example, the MSDOS command prompt for
- Windows users or the bash console for Unix-like users) then you need to run the
- command:
-
-
-
- makeindex -s myDoc.ist -o myDoc.gls myDoc.glo
-
- (Replace .ist file as the style so that it creates an
+ output file with the extension .gls. If you have access to a terminal or a command prompt (for example,
+ the MSDOS command prompt for Windows users or the bash console for Unix-like users) then you need to
+ run the command:
+
+
makeindex -s myDoc.ist -o myDoc.gls myDoc.glo
+
+
+ (Replace myDoc with the base name of your LATEX document file. Avoid spaces in the
- file name if possible.) If you don’t know how to use the command prompt,
- then you can probably access EX document file. Avoid spaces in the file name if
+ possible. The $ symbol indicates the command prompt and should be omitted.)
+ The file extensions vary according to the glossary
type. See
§1.4.4 Using makeindex via your text editor, but each editor
- has a different method of doing this, so I can’t give a general description.
- You will have to check your editor’s manual. The simplest approach is to use
-
explicitly (Option 2)
+ for further details. makeindex must be called for each set of files.
+
+
If you don’t know how to use the command prompt, then you can probably access makeindex
via your
+ text editor, but each editor has a different method of doing this. See Incorporating makeglossaries or
+ makeglossaries-lite or bib2gls into the document build for some examples.
+ Alternatively, run makeindex indirectly via the makeglossaries script:
+
+
makeglossaries myDoc
+
+
+
+
+ Note that the file extension isn’t supplied in this case. (Replace makeglossaries with
+ makeglossaries-lite if you don’t have Perl installed.) This will pick up all the file extensions
+ from the aux file and run makeindex the appropriate number of times with all the necessary
+ switches.
+
The simplest approach is to use arara and add the following comment lines to the start of your document:
+ id="dx1-7041"> and add the following comment lines to the start of your document:
(Replace makeglossaries with makeglossaries-lite if you don’t have Perl
- installed.)
- The default sort is word order (“sea lion” comes before “seal”). If you want letter
- ordering you need to add the makeglossarieslite in the second line above if you don’t have Perl
+ installed. Note that there’s no hyphen in this case.)
+
The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to
+ add the -l switch:
-
-
-
-
- makeindex -l -s myDoc.ist -o myDoc.gls myDoc.glo
-
- (See §1.5.4 switch:
+
+
makeindex -l -s myDoc.ist -o myDoc.gls myDoc.glo
+
+
+ (See §1.4.4 Using makeindex explicitly (Option 2) for further details on using
- explicitly (Option 2) for further details on using makeindex explicitly.) If you use explicitly.) If you
+ use makeglossaries or or makeglossaries-lite
- then use the order=letter package option and the then use the order=letter package option and the -l option will be added
- automatically.
+ id="dx1-7048"> option
+ will be added automatically.
- Once you have successfully completed the previous step, you can now run LATEX on
- your document again. You’ll need to repeat the process if you have used the 🔗 Once you have successfully completed the previous step, you can now run LATEX on your document
+ again.
+
You’ll need to repeat the last step if you have used the toc option
- (unless you’re using glossaries-extra) to ensure the section heading is added
- to the table of contents. You’ll also need to repeat the process if you have
- any cross-references which can’t be indexed until the glossary file has been
- created.
-
Complete example:
-
-
-
-
-\documentclass{article}
-
\usepackage{glossaries}
-
\makeglossaries % open glossary files
-
\newglossaryentry{sample}{name={sample},
-
description={an example}}
-
\begin{document}
-
\gls{sample}.
-
\printglossary
-
\end{document}
-
-
+ id="dx1-7051"> option (unless you’re using glossaries-extra) to ensure the
+section heading is added to the table of contents. You’ll also need to repeat steps 5 and 6 if you have any
+cross-references which can’t be indexed until the glossary file has been created.
-
+ id="x1-7052r3">
+
🔗Option 3 (xindy)
-
This option uses a Example document:
+
+
+
+
\documentclass{article}
+
\usepackage[xindy]{glossaries}
+
\makeglossaries % open glossary files
+
+
+
+
+
+\newglossaryentry{sample}{name={sample},
+
description={an example}}
+
\begin{document}
+
\gls{sample}.
+
+
+
+
\printglossary
+
\end{document}
+
+
You can place all your entry definitions in a separate file and load it in the preamble with \loadglsentries
+(after \makeglossaries).
+
This option uses a CLI application called xindy to sort the entries. This application is more
-flexible than to sort the entries. This application is more flexible than
+makeindex and is able to sort extended Latin alphabets or non-Latin alphabets,
-however it does still have some limitations.
-
The non-Latin alphabets, however it does still have some
+limitations.
+
The xindy application comes with both T application comes with both TEX Live and MiKTEX, but since xindy is a
-Perl script, you will also need to install Perl, if you don’t already have it. In a similar way to
-Option 2, this option involves making LATEX write the glossary information to
-a temporary file which is a Perl script, you will
+also need to install Perl, if you don’t already have it. In a similar way to Option 2, this option involves making
+LATEX write the glossary information to a temporary file which xindy reads. Then reads. Then xindy writes a new file containing the
-code to typeset the glossary. Then writes a new file
+containing the code to typeset the glossary. Then \printglossary reads this file in on the next
run.
-
This is the best option with just the base glossaries package if you want to sort according
-to a language other than English or if you want non-standard location lists, but it can require
-some setting up (see §11 Xindy (Option 3)). There are some problems with certain sort
-values:
+
This is the best option with just the base glossaries package if you want to sort according to a language
+other than English or if you want non-standard location lists, but it can require some setting up (see §11 Xindy
+(Option 3)). There are some problems with certain sort values:
- entries with the same sort value are merged by xindy into a single glossary line
- so you must make sure that each entry has a unique sort value;
+ id="dx1-8010"> into a single glossary line so you must make
+ sure that each entry has a unique sort value;
- xindy forbids empty sort values;
+ id="dx1-8011"> forbids empty sort values;
- xindy automatically strips control sequences, the math-shift character $ and
- braces {} from the sort value, which is usually desired but this can cause the sort
- value to collapse to an empty string which automatically strips control sequences, the math-shift character $ and braces {} from the
+ sort value, which is usually desired but this can cause the sort value to collapse to an empty string
+ which xindy forbids.
-
In these problematic cases, you must set the sort field explicitly. For example:
-
-
-
-
-\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
-
sort={alpha},description={...}}
-
-
-
All glossaries must be sorted according to the same method (word/letter ordering, order
-of use, or order of definition). (The glossaries-extra package allows a hybrid mix
-of Options forbids.
+
In these problematic cases, you must set the sort field explicitly. For example:
+
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+
sort={alpha},description={...}}
+
+
+
+
+
The
glossaries-extra package has a modified
symbols package option that provides
\glsxtrnewsymbol, which
+automatically sets the
sort key to the entry label (instead of the
name).
+
+
All glossaries must be sorted according to the same method (word/letter ordering, order of use, or order of
+definition).
+
The
glossaries-extra package allows a hybrid mix of Options
1 and
3 to provide word/letter ordering with
Option 3 and order of
-use/definition with
Option 1. See the
glossaries-extra documentation for further
-details.)
-
+href="#option3">3 to provide word/letter ordering with
+Option 3 and order of use/definition with Option 1. See the glossaries-extra documentation for further details.
+
+
+
- Add the Add the xindy option to the option to the glossaries package option list:
-
-
-
+
+
+
\usepackage[xindy]{glossaries}
-
If you are using a non-Latin script you’ll also need to either switch off the creation of
- the number group:
-
-
+
If you are using a non-Latin script you’ll also need to either switch off the creation of the number
+ group:
+
+
-
+
\usepackage[xindy={glsnumbers=false}]{glossaries}
-
or use either or use either \GlsSetXdyFirstLetterAfterDigits{⟨letter⟩} or \GlsSetXdyNumberGroupOrder
- {⟨} (to indicate the first letter group to follow the
+ digits) or \GlsSetXdyNumberGroupOrder{⟨spec⟩} to indicate where the number group should be placed (see §11 Xindy (Option
- 3)).
+class="cmtt-10">}
to indicate where the number group should be placed (see
+ §11 Xindy (Option 3)).
- Add \makeglossaries to your preamble (before you start defining your entries, as
- described in §4 Defining Glossary Entries).
+ class="enumerate" id="x1-8023x2">Add \makeglossaries to your preamble (before you start defining your entries, as described in §4 Defining
+ Glossary Entries).
- Run LATRun LATEX on your document. This creates files with the extensions .glo and .xdy
- (for example, if your LATglo and xdy (for example, if your
+ LATEX document is called myDoc.tex, then you’ll have two extra
- files called myDoc.tex, then you’ll have two extra files called myDoc.glo and myDoc.xdy). If you look at your document at this point, you
- won’t see the glossary as it hasn’t been created yet. (If you’re using the extension
- package glossaries-extra, you’ll see the section header and some boilerplate
+class="cmtt-10">myDoc.xdy).
+ If you look at your document at this point, you won’t see the glossary as it hasn’t been created yet. (If
+ you’re using the glossaries-extra extension package, you’ll see the section header and some boilerplate
text.)
-
+
If you have used package options such as symbols there will also be other sets of files corresponding to the
+ extra glossaries that were created by those options.
+
- Run Run xindy with the with the .glo file as the input file and the .xdy file as a module so that it
- creates an output file with the extension .gls. You also need to set the language name
- and input encoding. If you have access to a terminal or a command prompt
- (for example, the MSDOS command prompt for Windows users or the bash
- console for Unix-like users) then you need to run the command (all on one
+class="cmtt-10">.xdy file as a module so that it creates an output
+ file with the extension .gls. You also need to set the language name and input encoding. If you have
+ access to a terminal or a command prompt (for example, the MSDOS command prompt for Windows
+ users or the bash console for Unix-like users) then you need to run the command (all on one
line):
-
-
-
- xindy -L english -C utf8 -I xindy -M myDoc
-
-t myDoc.glg -o myDoc.gls myDoc.glo
-
- (Replace
+
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
+
+
+ (Replace myDoc with the base name of your LATEX document file. Avoid spaces in the
- file name. If necessary, also replace EX document file. Avoid spaces in the file name. If
+ necessary, also replace english with the name of your language and utf8
- with your input encoding, for example, utf8 with your input encoding, for
+ example, -L german -C din5007-utf8.) Note that it’s
- much simpler to use makeglossaries instead:
-
-
-
-
- makeglossaries myDoc
-
- (Remember that din5007-utf8.)
+
The file extensions vary according to the glossary
type. See
§1.4.3 Using xindy is a Perl script so if you can use
explicitly (Option 3) for
+ further details.
xindy then you can also use
-
must be called for each set of files.
+
+
It’s much simpler to use makeglossaries, and if you don’t want to use makeglossaries because you don’t want
- to install Perl, then you can’t use instead:
+
+
makeglossaries myDoc
+
+
+
+
+ Note that the file extension isn’t supplied in this case. This will pick up all the file extensions from the aux
+ file and run xindy either.)
-
If you don’t know how to use the command prompt, then you can probably
- access the appropriate number of times with all the necessary switches.
+
There’s no benefit in using makeglossaries-lite with xindy. (Remember that xindy is a Perl
+ script so if you can use xindy or then you can also use makeglossaries via your text editor, but each editor has a
- different method of doing this, so I can’t give a general description. You
- will have to check your editor’s manual. Again, a convenient method is to
- use arara and add the follow comment lines to the start of your document:
-
+ id="dx1-8044">, and if you don’t want
+ to use
makeglossaries because you don’t want to install Perl, then you can’t use
xindy
+ either.)
+
If you don’t know how to use the command prompt, then you can probably access xindy or
+ makeglossaries via your text editor, but each editor has a different method of doing this. See
+ Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build for some
+ examples.
+
Again, a convenient method is to use arara and add the follow comment lines to the start of your
+ document:
-
The default sort is word order (“sea lion” comes before “seal”). If you want letter
- ordering you need to add the order=letter package option:
-
-
+
The default sort is word order (“sea lion” comes before “seal”). If you want letter ordering you need to
+ add the order=letter package option:
+
+
\usepackage[xindy,order=letter]{glossaries}
-
(and return to the previous step). This option is picked up by (and return to the previous step). This option is picked up by makeglossaries
. If you
- are explicitly using . If you are explicitly using
+ xindy then you’ll need to add -M ord/letorder to the options list.
- See §1.5.3 then you’ll need to add -M ord/letorder to the options list. See §1.4.3 Using xindy explicitly (Option 3) for further details on using explicitly
+ (Option 3) for further details on using xindy
- explicitly.
+ id="dx1-8053"> explicitly.
- Once you have successfully completed the previous step, you can now run
- LATEX on your document again. As with the previous option, you may need to
- repeat the process to ensure the table of contents and cross-references are
- resolved.
+ class="enumerate" id="x1-8055x5">Once you have successfully completed the previous step, you can now run LATEX on your document
+ again. As with makeindex (Option 2), you may need to repeat the previous step and this step to ensure
+ the table of contents and cross-references are resolved.
-
Complete example:
-
-
-
-
-\documentclass{article}
-
\usepackage[xindy]{glossaries}
-
\makeglossaries % open glossary files
-
\newglossaryentry{sample}{name={sample},
-
description={an example}}
-
\begin{document}
-
\gls{sample}.
-
\printglossary
-
\end{document}
-
-
-
+ id="x1-8057r4">
+
🔗Option 4 (bib2gls)
-
This option is only available with the extension package
glossaries-extraThis option is only available with the glossaries-extra. This method uses
+class="cmss-10">glossaries-extra
extension package. This method uses
bib2gls to both fetch entry definitions from .bib files and to hierarchically sort and
-collate.
-
All entries must be provided in one or more .bib files. (See the bib files and to hierarchically sort and collate.
+
Example document:
+
+
\documentclass{article}
+
\usepackage[record=nameref]{glossaries-extra}
+
\GlsXtrLoadResources[src={entries}]
+
\begin{document}
+
\gls{sample}, \gls{alpha}, \gls{html}.
+
\printunsrtglossary
+
\end{document}
+
+
where the file
entries.bib contains:
+
+
@entry{sample,
+
name={sample},
+
description={an example}
+
}
+
+
+
@symbol{alpha,
+
name={\ensuremath{\alpha}},
+
description={...}
+
}
+
@abbreviation{html,
+
short={HTML},
+
long={hypertext markup language}
+
}
+
+
+
All entries must be provided in one or more bib files. See the bib2gls user manual for
-the required format.) The glossaries-extra package needs to be loaded with the record package
-option
-
-
-
-
-\usepackage[record]{glossaries-extra}
+ id="dx1-9010"> user manual for the required
+format.
+
Note that the
sort key should not be used. Each entry type (
@entry,
@symbol,
@abbreviation)
+has a particular field that’s used for the sort value by default (
name, the label,
short). You will
+break this mechanism if you explicitly use the
sort key. See
bib2gls gallery: sorting for examples.
+
+
+
The glossaries-extra package needs to be loaded with the record package option:
+
+\usepackage[record]{glossaries-extra}
-
or (equivalently)
-
-
-
-
-\usepackage[record=only]{glossaries-extra}
+
or (equivalently)
+
+\usepackage[record=only]{glossaries-extra}
+
+
or (with at least
glossaries-extra v1.37 and
bib2gls v1.8):
+
+\usepackage[record=nameref]{glossaries-extra}
-
(It’s possible to use a hybrid of this method and Options The record=nameref option is the best method.
+
(It’s possible to use a hybrid of this method and Options 2 or 3 with record=alsoindex but in
-general there is little need for this and it complicates the build process.)
-
Each resource set is loaded with \GlsXtrLoadResources[⟨3 with record=alsoindex but in general there is
+little need for this and it complicates the build process.)
+
Each resource set is loaded with \GlsXtrLoadResources[⟨options⟩]. For example:
-
-
-
-
-\GlsXtrLoadResources
-
[% definitions in entries1.bib and entries2.bib:
-
src={entries1,entries2},
-
sort={de-CH-1996}% sort according to this locale
-
]
-
-
You can have multiple resource commands.
-
The glossary is displayed using
-
-
-
-
-\printunsrtglossary
-
-
Alternatively all glossaries can be displayed using the iterative command:
-
-
-
-
-\printunsrtglossaries
-
-
The document is build using:
-
-
-
-
-pdflatex myDoc
-
bib2gls myDoc
-
pdflatex myDoc
+class="cmtt-10">]. For example:
+
+
\GlsXtrLoadResources
+
[% definitions in entries1.bib and entries2.bib:
+
+
+
src={entries1,entries2},
+
sort={de-CH-1996}% sort according to this locale
+
]
-
If letter groups are required, you need the --group switch:
-
-
-
-
-bib2gls --group myDoc
+
The
bib files are identified as a comma-separated list in the value of the
src key. The
sort option identifies the
+sorting method. This may be a locale identifier for alphabetic sorting, but there are other sort methods
+available, such as character code or numeric. One resource set may cover multiple glossaries or one glossary may
+be split across multiple resource sets, forming logical sub-blocks.
+
If you want to ensure that all entries are selected, even if they haven’t been referenced in the document, then
+add the option selection=all. (There are also ways of filtering the selection or you can even have a
+random selection by shuffling and truncating the list. See the bib2gls user manual for further
+details.)
+
The glossary is displayed using:
+
-
Unlike Options Alternatively all glossaries can be displayed using the iterative command: The document is built using:
+
+
pdflatex myDoc
+
bib2gls myDoc
+
pdflatex myDoc
+
+
+If letter groups are required, you need the --group switch:
+
+
bib2gls --group myDoc
+
+
+or with arara:
+
+% arara: bib2gls: { group: on }
+
+
(You will also need an appropriate glossary style.)
+ Unlike Options 2 and 3, this method doesn’t create a file containing the typeset glossary but
-simply determines which entries are needed for the document, their associated locations and
-(if required) their associated letter group. This option allows a mixture of sort methods.
-(For example, sorting by word order for one glossary and order of use for another
-or even sorting one block of the glossary differently to another block in the same
-glossary.)
-
This method supports Unicode and (with at least Java 8) uses the Common
-Locale Data Repository, which provides more extensive language support than
-3, this method doesn’t create a file containing the typeset glossary but simply
+determines which entries are needed for the document, their associated locations and (if required) their
+associated letter group. This option allows a mixture of sort methods. For example, sorting by word order for
+
+
+one glossary and order of use for another or even sorting one block of the glossary differently to another block in
+the same glossary. See bib2gls gallery: sorting.
+
This method supports Unicode and uses the Common Locale Data Repository, which provides more extensive language support
+than xindy
.
Complete example:
-
-
-
-
-\documentclass{article}
-
\usepackage[record]{glossaries-extra}
-
\GlsXtrLoadResources[src={entries}]
-
\begin{document}
-
\gls{sample}.
-
\printunsrtglossary
-
\end{document}
-
-
where entries.bib contains
-
-
-
-
-@entry{sample,
-
name={sample},
-
description={an example}
-
}
-
-
See the can deduce a numerical value it will attempt to
+form ranges otherwise it will simply list the locations.
+
See glossaries-extra and bib2gls: An Introductory Guide or the bib2gls user manual for further details.
+ id="dx1-9040"> user manual for further details of
+this method, and also Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document
+build.
-
+ id="x1-9041r5">
+
🔗Option 5 (no sorting)
-
This option is only available with the extension package
glossaries-extraThis option is only available with the extension package glossaries-extra. No indexing
-application is required. This method is best used with the package option sort=none.
-
-
+href="#glo:indexingapp">indexing application
+is required.
+
Example document:
+
+
-
-\usepackage[sort=none]{glossaries-extra}
+
+\documentclass{article}
+
\usepackage[sort=none]{glossaries-extra}
+
\newglossaryentry{sample}{name={sample},
+
description={an example}}
+
\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+
description={...}}
+
\begin{document}
+
\gls{sample}.
+
+
+
+
\printunsrtglossary
+
\end{document}
-
There’s no “activation” command (such as
+ This method is best used with the package option sort=none (as shown above). There’s no “activation”
+command (such as \makeglossaries for Options 2 and 3).
-
All entries must be defined before the glossary is displayed (preferably in the preamble) in
-the required order, and child entries must be defined immediately after their parent entry if
-they must be kept together in the glossary
-
The glossary is displayed using
-
-
-
-
-\printunsrtglossary
-
- Alternatively all glossaries can be displayed using the iterative command:
-
-
-
-
-\printunsrtglossaries
-
- This will display all defined entries, regardless of whether or not they have been used in the
-document. The All entries must be defined before the glossary is displayed (preferably in the preamble) in the
+required order, and child entries must be defined immediately after their parent entry if they must be
+kept together in the glossary. (Some glossary styles indent entries that have a parent but it’s the
+indexing application that ensures the child entries are listed immediately after the parent. If you’re
+opting to use this manual approach then it’s your responsibility to define the entries in the correct
+order.) You can place all your entry definitions in a separate file and load it in the preamble with
+\loadglsentries.
+
The glossary is displayed using:
Alternatively all glossaries can be displayed using the iterative command: This will display all defined entries, regardless of whether or not they have been used in the document. The
+number lists have to be set explicitly otherwise they won’t appear. Note
-that this uses the same command for displaying the glossary as Option 4. This is
-because s have to be set explicitly otherwise they won’t appear. Note that this uses the same command for
+displaying the glossary as Option 4. This is because bib2gls takes advantage of this method by defining the wanted entries
-in the required order and setting the locations (and letter group information, if
+ id="dx1-10007"> takes advantage of this method by defining the
+wanted entries in the required order and setting the locations (and letter group information, if
required).
-
This just requires a single LATEX call
-
-
-
-
-pdflatex myDoc
-
- unless the glossary needs to appear in the table of contents, in which case a second run is
-required.
-
-
+
+
+
Therefore, the above example document has a glossary containing the entries: sample and α (in
+that order). Note that the alpha entry has been included even though it wasn’t referenced in the
+document.
+
This just requires a single LATEX call:
+
+
pdflatex myDoc
+
+
+unless the glossary needs to appear in the table of contents, in which case a second run is required:
+
+
pdflatex myDoc
+
pdflatex myDoc
+
+
+(Naturally if the document also contains citations, and so on, then additional steps are required. Similarly for all
+the other options above.)
+
See the glossaries-extra documentation for further details of this method.
+
+
-
-pdflatex myDoc
-
pdflatex myDoc
-
-
(Naturally if the document also contains citations, and so on, then additional steps are
-required. Similarly for all the other options above.)
-
Complete example:
-
-
+
🔗Option 6 (standalone)
+
glossaries-extraThis option is only available with the glossaries-extra extension
+package.
+Instead of creating a list, this has standalone definitions throughout the document. The entry name may or may
+not be in a section heading.
+
You can either define entries in the document preamble (or in an external file loaded with \loadglsentries), as
+with Option 5, for example:
+
+
-
+
\documentclass{article}
-
\usepackage[sort=none]{glossaries-extra}
-
\newglossaryentry{sample}{name={sample},
-
description={an example}}
-
\begin{document}
-
\gls{sample}.
-
\printunsrtglossary
+
\usepackage[colorlinks]{hyperref}
+
\usepackage[sort=none,
+
nostyles% <- no glossary styles are required
+
]{glossaries-extra}
+
\newglossaryentry{set}{name={set},
+
description={a collection of any kind of objects},
+
symbol={\ensuremath{\mathcal{S}}}
+
}
+
\newglossaryentry{function}{name={function},
+
description={a rule that assigns every element in the
+
domain \gls{set} to an element in the range \gls{set}},
+
symbol={\ensuremath{f(x)}}
+
}
+
+
+
+
\newcommand*{\termdef}[1]{%
+
\section{\glsxtrglossentry{#1} \glsentrysymbol{#1}}%
+
\begin{quote}\em\Glsentrydesc{#1}.\end{quote}%
+
}
+
+
+
+
+
+\begin{document}
+
\tableofcontents
+
\section{Introduction}
+
Sample document about \glspl{function} and \glspl{set}.
+
\termdef{set}
+
More detailed information about \glspl{set} with examples.
+
\termdef{function}
+
More detailed information about \glspl{function} with examples.
\end{document}
-
See the glossaries-extra documentation for further details.
-
-
-
Top
1.2 Sample Documents
-
The glossaries package is provided with some sample documents that illustrate the
-various functions. These should be located in the samples subdirectory (folder)
-of the glossaries documentation directory. This location varies according to your
-operating system and TEX distribution. You can use texdoc to locate the main
-glossaries documentation. For example, in a terminal or command prompt, type:
-
-
texdoc -l glossaries
-
-This should display a list of all the files in the glossaries documentation directory with
-their full pathnames. (The GUI version of texdoc may also provide you with the
-information.)
-
If you can’t find the sample files on your computer, they are also available from your nearest
-CTAN mirror at http://mirror.ctan.org/macros/latex/contrib/glossaries/samples/.
-
The sample documents are listed
-below If
-you prefer to use UTF-8 aware engines (xelatex or lualatex) remember that you’ll need to
-switch from fontenc & inputenc to fontspec where appropriate. The Or you can use bib2gls
if you want to manage a large database of terms. For example (requires glossaries-extra package
-provides some additional sample files.
-
-
-minimalgls.tex
- This document is a minimal working example. You can test your
- installation using this file. To create the complete document you will need to do the
- following steps:
-
- - Run minimalgls.tex through LATEX either by typing
-
latex minimalgls
-
-
-
- in a terminal or by using the relevant button or menu item in your text editor or
- front-end. This will create the required associated files but you will not see the
- glossary. If you use PDFLATEX you will also get warnings about non-existent
- references that look something like:
-
-
-
-
- pdfTeX warning (dest): name{glo:aca} has been
-
referenced but does not exist,
-
replaced by a fixed one
-
- These warnings may be ignored on the first run.
-
If you get a Missing \begin{document} error, then it’s most likely that
- your version of xkeyval is out of date. Check the log file for a warning
- of that nature. If this is the case, you will need to update the xkeyval
- package.
-
- - If you have Perl installed, run makeglossaries on the document (§1.5 Generating
- the Associated Glossary Files). This can be done on a terminal by typing
-
-
makeglossaries minimalgls
-
- otherwise do
-
makeglossaries-lite minimalgls
-
- If for some reason you want to call makeindex explicitly, you can do this in a
- terminal by typing (all on one line):
-
makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls
- minimalgls.glo
-
- (See §1.5.4 Using makeindex explicitly (Option 2) for further details on using
- makeindex explicitly.)
-
Note that if the file name contains spaces, you will need to use the double-quote
- character to delimit the name.
-
- - Run minimalgls.tex through LATEX again (as step 1)
- You should now have a complete document. The number following each entry in the
- glossary is the location number. By default, this is the page number where the entry
- was referenced.
-
There are three other files that can be used as a minimal working example:
- mwe-gls.tex, mwe-acr.tex and mwe-acr-desc.tex.
-
-
-sample-noidxapp.tex
- This document illustrates how to use the glossaries package without
- an external indexing application (Option 1). To create the complete document, you
- need to do:
-
latex sample-noidxapp
-
-
-
latex sample-noidxapp
-
-
-
-sample-noidxapp-utf8.tex
- As the previous example, except that it uses the inputenc
- package. To create the complete document, you need to do:
-
latex sample-noidxapp-utf8
-
latex sample-noidxapp-utf8
-
-
-
-sample4col.tex
- This document illustrates a four column glossary where the entries have a
- symbol in addition to the name and description. To create the complete document, you
- need to do:
-
latex sample4col
-
makeglossaries sample4col
-
latex sample4col
-
- or
-
latex sample4col
-
makeglossaries-lite sample4col
-
latex sample4col
-
- The vertical gap between entries is the gap created at the start of each group. This can
- be suppressed using the nogroupskip package option.
-
-
-sampleAcr.tex
- This document has some sample abbreviations. It also adds the glossary to
- the table of contents, so an extra run through LATEX is required to ensure the
- document is up to date:
-
latex sampleAcr
-
makeglossaries sampleAcr
-
latex sampleAcr
-
latex sampleAcr
-
- (or use makeglossaries-lite).
-
-
-sampleAcrDesc.tex
- This is similar to the previous example, except that the abbreviations
- have an associated description. As with the previous example, the glossary is
-
-
- added to the table of contents, so an extra run through LATEX is required:
-
-
latex sampleAcrDesc
-
makeglossaries sampleAcrDesc
-
latex sampleAcrDesc
-
latex sampleAcrDesc
-
-
-
+class="cmss-10">glossaries-extra
+v1.42, see below):
+
sampleDesc.tex - This is similar to the previous example, except that it defines the
- abbreviations using \newglossaryentry instead of \newacronym. As with the previous
- example, the glossary is added to the table of contents, so an extra run through
- LATEX is required:
-
latex sampleDesc
-
makeglossaries sampleDesc
-
latex sampleDesc
-
latex sampleDesc
-
-
-
+class="cmtt-10">\documentclass{article}
+
+
\usepackage[colorlinks]{hyperref}
+
\usepackage[record,
+
nostyles% <- no glossary styles are required
+
]{glossaries-extra}
+
+
\GlsXtrLoadResources[src=terms,sort=none,save-locations=false]
+
+
\newcommand*{\termdef}[1]{%
+
\section{\glsxtrglossentry{#1} \glossentrysymbol{#1}}%
+
\glsadd{#1}% <- index this entry
+
\begin{quote}\em\Glsentrydesc{#1}.\end{quote}%
+
}
+
+
+
+
+
+\begin{document}
+
\tableofcontents
+
\section{Introduction}
+
Sample document about \glspl{function} and \glspl{set}.
+
\termdef{set}
+
More detailed information about \glspl{set} with examples.
+
\termdef{function}
+
More detailed information about \glspl{function} with examples.
+
\end{document}
+
+ Where the file terms.bib contains:
+
+
@entry{set,
+
name={set},
+
description={a collection of any kind of objects},
+
symbol={\ensuremath{\mathcal{S}}}
+
}
+
@entry{function,
+
name={function},
+
description={a rule that assigns every element in the domain
+
\gls{set} to an element in the range \gls{set}},
+
symbol={\ensuremath{f(x)}}
+
}
+
+
The advantage in this approach (with \loadglsentries or bib2gls) is that you can use an existing database
+of entries shared across multiple documents, ensuring consistent notation for all of them.
+ In both cases, there’s no need to load all the glossary styles packages, as they’re not required, so I’ve used
+the nostyles package option to prevent them from being loaded.
+
In the first case, you need the sort=none package option (as in Option 5) and then define the terms in the
+preamble. No external tool is required. Just run LATEX as normal. (Twice to ensure that the table of contents
+is up to date.)
+
+
pdflatex myDoc
+
pdflatex myDoc
+
+
+
+
+
In the second case, you need the record package option (as in Option 4) since bib2gls is needed to select the
+required entries, but you don’t need a sorted list:
+
+
\GlsXtrLoadResources[src={terms},sort=none]
+
+
This will ensure that any entries indexed in the document (through commands like \gls or \glsadd) will be
+selected by bib2gls, but it will skip the sorting step. (The chances are you probably also won’t need location
+lists either. If so, you can add the option save-locations=false.)
+ Remember that for this second case you need to run bib2gls as per Option 4:
+
+
pdflatex myDoc
+
bib2gls myDoc
+
pdflatex myDoc
+
pdflatex myDoc
+
+
+
For both cases (with or without bib2gls), instead of listing all the entries using \printunsrtglossary, you
+use \glsxtrglossentry{⟨label⟩} where you want the name (and anchor with hyperref) to appear in the
+document. This will allow the link text created by commands like \gls to link to that point in the document.
+The description can simply be displayed with \glsentrydesc{⟨label⟩} or \Glsentrydesc{⟨label⟩}, as in the above
+examples. In both examples, I’ve defined a custom command \termdef to simplify the code and ensure
+consistency. Extra styling, such as placing the description in a coloured frame, can be added to this custom
+definition as required.
+
(Instead of using \glsentrydesc or \Glsentrydesc, you can use \glossentrydesc{⟨label⟩}, which
+will obey attributes such as glossdesc and glossdescfont. See the glossaries-extra manual for further
+details.)
+
The symbol (if required) can be displayed with either \glsentrysymbol{⟨label⟩} or \glossentrysymbol
sampleCustomAcr.tex
- This document has some sample abbreviations with a custom
- acronym style. It also adds the glossary to the table of contents, so an extra run through
- LATEX is required:
-
latex sampleCustomAcr
-
makeglossaries sampleCustomAcr
-
latex sampleCustomAcr
-
latex sampleCustomAcr
-
-
-
+class="cmtt-10">{⟨label⟩}. In the first example, I’ve used \glsentrysymbol. In the second I’ve used \glossentrysymbol. The
+latter is necessary with bib2gls if the symbol needs to go in a section title as the entries aren’t defined on the
+first LATEX run.
+
In normal document text, \glsentrysymbol will silently do nothing if the entry hasn’t been defined, but
+when used in a section heading it will expand to an undefined internal command when written to the aux file,
+which triggers an error.
+
The \glossentrysymbol command performs an existence check, which triggers a warning if the entry is undefined.
+(All entries will be undefined before the first bib2gls call.) You need at least glossaries-extra v1.42 to use this command in
+a section title.
+If hyperref has been loaded, this will use \texorpdfstring to allow a simple expansion for the PDF bookmarks
+(see the glossaries-extra user manual for further details).
+
If you want to test if the symbol field has been set, you need to use \ifglshassymbol outside of the section
+title. For example:
+
+
+
sampleFnAcrDesc.tex - This is similar to sampleAcrDesc.tex, except that it uses the
- footnote-sc-desc style. As with the previous example, the glossary is added to the table
- of contents, so an extra run through LATEX is required:
-
latex sampleFnAcrDesc
-
makeglossaries sampleFnAcrDesc
-
latex sampleFnAcrDesc
-
latex sampleFnAcrDesc
-
-
-
-
-
+class="cmtt-10">\ifglshassymbol{#1}%
+
{\section{\glsxtrglossentry{#1} \glossentrysymbol{#1}}}
+
{\section{\glsxtrglossentry{#1}}}
+
+
+ In both of the above examples, the section titles start with a lowercase character (because the name value is
+all lowercase in entry definitions). You can apply automatic case-change with the glossname attribute. For
+example:
+
+
\glssetcategoryattribute{general}{glossname}{firstuc}
+
+
or (for title-case)
+
+
\glssetcategoryattribute{general}{glossname}{title}
+
+
However, this won’t apply the case-change in the table of contents or bookmarks.
+ In the second example, you can instead use bib2gls to apply a case-change:
+
sample-FnDesc.tex - This example defines a custom display format that puts the description
- in a footnote on first use.
-
latex sample-FnDesc
-
makeglossaries sample-FnDesc
-
latex sample-FnDesc
-
-
-
+class="cmtt-10">\GlsXtrLoadResources[src=terms,
+
sort=none,save-locations=false,
+
replicate-fields={name=text},
+
name-case-change=firstuc
+
]
+
+
(Or name-case-change=title for title-case.) This copies the name value to the text field and
+then applies a case-change to the name field (leaving the text field unchanged). The name in the
+section titles now starts with a capital but the link text produced by commands like \gls is still
+lowercase.
+ In the first example (without bib2gls) you need to do this manually. For example:
+
sample-custom-acronym.tex - This document illustrates how to define your own acronym
- style if the predefined styles don’t suit your requirements.
-
latex sample-custom-acronym
-
makeglossaries sample-custom-acronym
-
latex sample-custom-acronym
-
+class="cmtt-10">\newglossaryentry{set}{name={Set},text={set},
+
description={a collection of any kind of objects},
+
symbol={\ensuremath{\mathcal{S}}}
+
}
+
+
+
+
+ Note that if you use the default save-locations=true with bib2gls, it’s possible to combine Options 4
+and 6 to have both standalone definitions and an index. Now I do need a glossary style. In this case I’m going
+to use bookindex, which is provided in the glossary-bookindex package (bundled with glossaries-extra). I don’t
+need any of the other style packages, so I can still keep the nostyles option and just load glossary-bookindex:
+
+
+\usepackage[record=nameref,% <- using bib2gls
+
nostyles,% <- don't load default style packages
+
stylemods=bookindex,% <- load glossary-bookindex.sty
+
style=bookindex% <- set the default style to 'bookindex'
+
]{glossaries-extra}
+
+
I also need to sort the entries, so the resource command is now:
+
+
\GlsXtrLoadResources[src=terms,% definitions in terms.bib
+
sort=en-GB,% sort by this locale
+
replicate-fields={name=text},
+
name-case-change={firstuc}
+
]
+
+
At the end of the document, I can add the glossary:
+
+
\printunsrtglossary[title=Index,target=false]
+
+
Note that I’ve had to switch off the hypertargets with target=false (otherwise there would be duplicate
+targets). If you want letter group headings you need to use the --group switch:
+
+
bib2gls --group myDoc
+
+
+or if you are using arara:
+
+% arara: bib2gls: { group: on }
+
+
+
+
+ The bookindex style doesn’t show the description, so only the name and location is displayed. Remember
+that the name has had a case-conversion so it now starts with an initial capital. If you feel this is inappropriate
+for the index, you can adjust the bookindex style so that it uses the text field instead. For example:
+
+
+
\renewcommand*{\glsxtrbookindexname}[1]{%
+
\glossentrynameother{#1}{text}}
+
+
See the glossaries-extra user manual for further details about this style.
+ Note that on the first LATEX run none of the entries will be defined. Once they are defined, the page
+numbers may shift due to the increased amount of document text. You may therefore need to repeat the
+document build to ensure the page numbers are correct.
+
If there are extra terms that need to be included in the index that don’t have a description, you can define
+them with @index in the bib file. For example:
+
+
@index{element}
+
@index{member,alias={element}}
+
+
They can be used in the document as usual:
+
+
+
+The objects that make up a set are the \glspl{element}
+
or \glspl{member}.
+
+ See glossaries-extra and bib2gls: An Introductory Guide or the bib2gls user manual for further
+details.
+
The glossaries package comes with a number of sample documents that illustrate the various functions. These
+are listed in §19 Sample Documents.
+
+
+Top
1.2 Dummy Entries for Testing
+
In addition to the sample files described above, glossaries also provides some files containing lorum
+ipsum dummy entries. These are provided for testing purposes and are on TEX’s path (in
+tex/latex/glossaries/test-entries) so they can be included via \input or \loadglsentries. The
+glossaries-extra package provides bib versions of all these files for use with bib2gls. The files are as
+follows:
+
-
+example-glossaries-brief.tex
- These entries all have brief descriptions. For example:
+
+
+
+ \newglossaryentry{lorem}{name={lorem},description={ipsum}}
+
+
-
sample-crossref.tex
- This document illustrates how to cross-reference entries in the
- glossary.
-
latex sample-crossref
-
makeglossaries sample-crossref
-
latex sample-crossref
-
+class="cmbx-10">example-glossaries-long.tex - These entries all have long descriptions. For example:
+
+
+
+ \newglossaryentry{loremipsum}{name={lorem ipsum},
+
description={dolor sit amet, consectetuer adipiscing
+
elit. Ut purus elit, vestibulum ut, placerat ac,
+
adipiscing vitae, felis. Curabitur dictum gravida
+
mauris.}}
+
+
-
sample-dot-abbr.tex
- This document illustrates how to use the post link hook to adjust the
- space factor after abbreviations.
-
latex sample-dot-abbr
-
makeglossaries sampledot-abbrf
-
latex sample-dot-abbr
-
+class="cmbx-10">example-glossaries-multipar.tex - These entries all have multi-paragraph descriptions. For example:
+
+
+
+ \longnewglossaryentry{loremi-ii}{name={lorem 1--2}}%
+
{%
+
Lorem ipsum ...
+
Nam dui ligula...
+
}
+
+
-
sampleDB.tex
- This document illustrates how to load external files containing the glossary
- definitions. It also illustrates how to define a new glossary type. This document has the
- number list suppressed and uses \glsaddall to add all the entries to the
- glossaries without referencing each one explicitly. To create the document do:
-
-
-
-
latex sampleDB
-
makeglossaries sampleDB
-
latex sampleDB
-
- or
-
latex sampleDB
-
makeglossaries-lite sampleDB
-
latex sampleDB
-
- The glossary definitions are stored in the accompanying files database1.tex and
- database2.tex. If for some reason you want to call makeindex explicitly you must have
- a separate call for each glossary:
-
- -
- Create
- the
- main
- glossary
- (all
- on
- one
- line):
-
-
makeindex
- -s
- sampleDB.ist
- -t
- sampleDB.glg
- -o
- sampleDB.gls
- sampleDB.glo
-
-
- -
- Create
- the
- secondary
- glossary
- (all
- on
-
-
- one
- line):
-
-
makeindex
- -s
- sampleDB.ist
- -t
- sampleDB.nlg
- -o
- sampleDB.not
- sampleDB.ntn
-
- Note that both makeglossaries and makeglossaries-lite do this all in one call,
- so they not only make it easier because you don’t need to supply all the switches
- and remember all the extensions but they also call makeindex the appropriate
- number of times.
- -
-sampleEq.tex
- This document illustrates how to change the location to something other
- than the page number. In this case, the equation counter is used since all glossary
- entries appear inside an equation environment. To create the document do:
-
-
latex sampleEq
-
makeglossaries sampleEq
-
latex sampleEq
-
+class="cmbx-10">example-glossaries-symbols.tex - These entries all use the symbol key. For example:
+
+
+
+ \newglossaryentry{alpha}{name={alpha},
+
symbol={\ensuremath{\alpha}},
+
description={Quisque ullamcorper placerat ipsum.}}
+
+
-
sampleEqPg.tex
- This is similar to the previous example, but the number lists
- are a mixture of page numbers and equation numbers. This example adds
- the glossary to the table of contents, so an extra LATEX run is required:
-
-
latex sampleEqPg
-
makeglossaries sampleEqPg
-
latex sampleEqPg
-
latex sampleEqPg
-
+class="cmbx-10">example-glossaries-symbolnames.tex - Similar to the previous file but the symbol key isn’t used. Instead the
+ symbol is stored in the name key. For example:
+
+
+
+ \newglossaryentry{sym.alpha}{sort={alpha},
+
name={\ensuremath{\alpha}},
+
description={Quisque ullamcorper placerat ipsum.}}
+
+
-
sampleSec.tex
- This document also illustrates how to change the location to something
- other than the page number. In this case, the section counter is used. This example
- adds the glossary to the table of contents, so an extra LATEX run is required:
-
-
-
-
latex sampleSec
-
makeglossaries sampleSec
-
latex sampleSec
-
latex sampleSec
-
+class="cmbx-10">example-glossaries-images.tex - These entries use the user1 key to store the name of an image file. (The
+ images are provided by the mwe package and should be on TEX’s path.) One entry doesn’t have an
+ associated image to help test for a missing key. The descriptions are long to allow for tests with the text
+ wrapping around the image. For example:
+
+
+
+ \longnewglossaryentry{sedfeugiat}{name={sed feugiat},
+
user1={example-image}}%
+
{%
+
Cum sociis natoque...
+
Etiam...
+
}
+
+
-
sampleNtn.tex
- This document illustrates how to create an additional glossary type. This
- example adds the glossary to the table of contents, so an extra LATEX run is required:
-
-
latex sampleNtn
-
makeglossaries sampleNtn
-
latex sampleNtn
-
latex sampleNtn
-
- Note that if you want to call makeindex explicitly instead of using makeglossaries or
- makeglossaries-lite then you need to call makeindex twice:
-
- -
- Create
- the
- main
- glossary
- (all
- on
- one
- line):
-
-
makeindex
- -s
- sampleNtn.ist
- -t
- sampleNtn.glg
- -o
- sampleNtn.gls
- sampleNtn.glo
-
-
-
-
- -
- Create
- the
- secondary
- glossary
- (all
- on
- one
- line):
-
-
makeindex
- -s
- sampleNtn.ist
- -t
- sampleNtn.nlg
- -o
- sampleNtn.not
- sampleNtn.ntn
-
-
- -
+class="cmbx-10">example-glossaries-acronym.tex
- These entries are all abbreviations. For example:
+
+
+
+ \newacronym[type=\glsdefaulttype]{lid}{LID}{lorem ipsum
+
dolor}
+
+
+
If you use the
glossaries-extra extension package, then
\newacronym is redefined to use
\newabbreviation
+ with the
category key set to
acronym (rather than the default
abbreviation). This means that you need
+ to set the abbreviation style for the
acronym category. For example:
+
+
+
+
+ \setabbreviationstyle[acronym]{long-short}
+
+
+
+
-
sample.tex
- This document illustrates some of the basics, including how to create child
- entries that use the same name as the parent entry. This example adds the glossary to
- the table of contents and it also uses \glsrefentry, so an extra LATEX run is
- required:
-
latex sample
-
makeglossaries sample
-
latex sample
-
latex sample
-
- You can see the difference between word and letter ordering if you substitute
+class="cmbx-10">example-glossaries-acronym-desc.tex - This file contains entries that are all abbreviations that use the
order=word with order=letter. (Note that this will only have an effect if you use
- makeglossaries or makeglossaries-lite. If you use makeindex explicitly, you will
- need to use the -l switch to indicate letter ordering.)
+class="cmtt-10">description key. For example:
+
+
+
+ \newacronym[type=\glsdefaulttype,
+
description={fringilla a, euismod sodales,
+
sollicitudin vel, wisi}]{ndl}{NDL}{nam dui ligula}
+
+
+
If you use the
glossaries-extra extension package, then
\newacronym is redefined to use
\newabbreviation
+ with the
category key set to
acronym (rather than the default
abbreviation). This means that you need
+ to set the abbreviation style for the
acronym category. For example:
+
+
+
+
+ \setabbreviationstyle[acronym]{long-short-desc}
+
+
+
-
sample-inline.tex
- This document is like sample.tex, above, but uses the inline glossary
- style to put the glossary in a footnote.
-
-
+class="cmbx-10">example-glossaries-acronyms-lang.tex
- These entries are all abbreviations, where some of them have
+ a translation supplied in the user1 key. For example:
+
+
+
+ \newacronym[type=\glsdefaulttype,user1={love itself}]
+
{li}{LI}{lorem ipsum}
+
+
+
If you use the
glossaries-extra extension package, then
\newacronym is redefined to use
\newabbreviation
+ with the
category key set to
acronym (rather than the default
abbreviation). This means that you need
+ to set the abbreviation style for the
acronym category. For example:
+
+
+
+
+ \setabbreviationstyle[acronym]{long-short-user}
+
+
+
+
-
sampletree.tex
- This document illustrates a hierarchical glossary structure where child
- entries have different names to their corresponding parent entry. To create the
- document do:
-
latex sampletree
-
-
-
makeglossaries sampletree
-
latex sampletree
-
+class="cmbx-10">example-glossaries-parent.tex - These are hierarchical entries where the child entries use the name key. For
+ example:
+
+
+
+ \newglossaryentry{sedmattis}{name={sed mattis},
+
description={erat sit amet}
+
\newglossaryentry{gravida}{parent={sedmattis},
+
name={gravida},description={malesuada}}
+
+
-
sample-dual.tex
- This document illustrates how to define an entry that both appears in
- the list of acronyms and in the main glossary. To create the document do:
-
-
latex sample-dual
-
makeglossaries sample-dual
-
latex sample-dual
-
+class="cmbx-10">example-glossaries-childnoname.tex - These are hierarchical entries where the child entries don’t use the
+ name key. For example:
+
+
+
+ \newglossaryentry{scelerisque}{name={scelerisque},
+
description={at}}
+
\newglossaryentry{vestibulum}{parent={scelerisque},
+
description={eu, nulla}}
+
+
-
sample-langdict.tex
- This document illustrates how to use the glossaries package to create
- English to French and French to English dictionaries. To create the document do:
-
-
latex sample-langdict
-
makeglossaries sample-langdict
-
latex sample-langdict
-
+class="cmbx-10">example-glossaries-cite.tex - These entries use the user1 key to store a citation key (or comma-separated list
+ of citation keys). The citations are defined in xampl.bib, which should be available on all modern
+ TEX distributions. One entry doesn’t have an associated citation to help test for a missing key. For
+ example:
+
+
+
+ \newglossaryentry{fusce}{name={fusce},
+
description={suscipit cursus sem},user1={article-minimal}}
+
+
-
samplexdy.tex
- This document illustrates how to use the glossaries package with example-glossaries-url.tex
- These entries use the user1 key to store an URL associated with the entry. For
+ example:
+
+
+
+ \newglossaryentry{aenean-url}{name={aenean},
+
description={adipiscing auctor est},
+
user1={http://uk.tug.org/}}
+
+
+ The sample file glossary-lipsum-examples.tex in the doc/latex/glossaries/samples directory uses all
+these files. See also https://www.dickimaw-books.com/gallery/#glossaries.
+
glossaries-extraThe glossaries-extra package provides the additional test file:
+
-
+example-glossaries-xr.tex
- These entries use the see key provided by the base glossaries package and also the
+ alias and seealso keys that require glossaries-extra. For example:
+
+
+
+ \newglossaryentry{alias-lorem}{name={alias-lorem},
+
description={ipsum},alias={lorem}}
+
\newglossaryentry{amet}{name={amet},description={consectetuer},
+
see={dolor}}
+
\newglossaryentry{arcu}{name={arcu},description={libero},
+
seealso={placerat,vitae,curabitur}}
+
+
+
+
+Top
1.3 Multi-Lingual Support
+
The
glossaries package uses the
tracklang package to determine the document languages. Unfortunately, because
+there isn’t a standard language identification framework provided with
LATEX,
tracklang isn’t always able to
+detect the selected languages either as a result of using an unknown interface or where the interface doesn’t
+provide a way of detecting the language. See
Localisation with tracklang.tex for further details.
+
+
+
As from version 1.17, the glossaries package can be used with xindy
- instead of as well as makeindex. The document uses UTF8 encoding (with the . If you are writing in a
+language that uses an extended Latin alphabet or non-Latin alphabet it’s best to use Option 3 (xindy) or
+Option 4 (bib2gls) as makeindex (Option 2) is hard-coded for the non-extended Latin alphabet and Option 1
+can only perform limited ASCII comparisons.
+
This means that with Options 3 or 4 you are not restricted to the A, …, Z letter groups. If you want to use
+xindy, remember to use the xindy package option. For example:
+
+
+
+
+\documentclass[frenchb]{article}
+
\usepackage[utf8]{inputenc}
+
\usepackage[T1]{fontenc}
+
\usepackage{babel}
+
\usepackage[xindy]{glossaries}
+
+ If you want to use bib2gls, you need to use the record option with glossaries-extra and supply the definitions in
+bib files. (See the bib2gls user manual for further details.)
+
Note that although a
non-Latin character, such as é, looks like a plain character in your
tex file, with
+standard
LATEX it’s actually a macro and can therefore cause expansion problems. You may need to switch
+off the field expansions with
\glsnoexpandfields. This issue doesn’t occur with XeLaTeX or Lua
LATEX.
+
+
+
With inputenc package).
- The encoding is picked up by makeglossaries. By default, this document will
- create a , if you use a non-Latin character (or other expandable) character at the start of an entry
+name, you must place it in a group, or it will cause a problem for commands that convert the first letter to
+upper case (e.g. \Gls). For example:
+
+\newglossaryentry{elite}{name={{é}lite},
+
description={select group or class}}
+
+
For further details, see the “UTF-8” section in the mfirstuc user manual.
+ If you are using xindy style file called samplexdy.xdy, but if you uncomment the
- lines
-
-
-
- \setStyleFile{samplexdy-mc}
-
\noist
-
\GlsSetXdyLanguage{}
-
- it will set the style file to samplexdy-mc.xdy instead. This provides an additional letter
- group for entries starting with “Mc” or “Mac”. If you use makeglossaries or
- makeglossaries-lite, you don’t need to supply any additional information. If you
- don’t use makeglossaries, you will need to specify the required information. Note that
- if you set the style file to samplexdy-mc.xdy you must also specify \noist, otherwise
- the glossaries package will overwrite samplexdy-mc.xdy and you will lose the “Mc”
- letter group.
-
To create the document do:
-
latex samplexdy
-
makeglossaries samplexdy
-
latex samplexdy
-
- If you don’t have Perl installed then you can’t use or bib2gls, the application needs to know the encoding of the tex file. This
+information is added to the aux file and can be picked up by makeglossaries, but you also can’t
- use xindy! However, if for some reason you want to call and bib2gls. If you use xindy explicitly instead of using
-
+explicitly instead of via makeglossaries (or makeglossaries-lite):
-
- -
- if
- you
- are
- using
- the
- default
- style
- file
- samplexdy.xdy,
- then
- do
- (no
- line
- breaks):
-
-
xindy
- -L
- english
-
-
- -C
- utf8
- -I
- xindy
- -M
- samplexdy
- -t
- samplexdy.glg
- -o
- samplexdy.gls
- samplexdy.glo
-
-
- -
- if
- you
- are
- using
- samplexdy-mc.xdy,
- then
- do
- (no
- line
- breaks):
-
-
xindy
- -I
- xindy
- -M
- samplexdy-mc
- -t
- samplexdy.glg
- -o
- samplexdy.gls
- samplexdy.glo
-
-
- -
+ id="dx1-13026">, you may need to specify the encoding using the -C option. Read the
samplexdy2.tex
- This document illustrates how to use the glossaries package where the
- location numbers don’t follow a standard format. This example will only work with
- xindy. To create the document do:
-
pdflatex samplexdy2
-
-
-
makeglossaries samplexdy2
-
pdflatex samplexdy2
-
- The
- explicit
- xindy
- call
- is:
-
-
xindy
- -L
- english
- -C
- utf8
- -I
- xindy
- -M
- samplexdy2
- -t
- samplexdy2.glg
- -o
- samplexdy2.gls
- samplexdy2.glo
-
- See §11.2 Locations and Number lists for further details.
-
-
-samplexdy3.tex
- This document is like samplexdy.tex but uses the command
- \Numberstring from the fmtcount package to format the page numbers.
-
-
-sampleutf8.tex
- This is another example that uses xindy. Unlike manual for further details of this option.
+
As from v4.24, if you are writing in German (for example, using the ngerman
+package
+or babel with the ngerman package option), and you want to use makeindex, xindy can
- cope with non-Latin characters. This document uses UTF8 encoding. To create the
- document do:
-
latex sampleutf8
-
makeglossaries sampleutf8
-
latex sampleutf8
-
- The
- explicit
- xindy
- call
-
-
- is
- (no
- line
- breaks):
-
-
xindy
- -L
- english
- -C
- utf8
- -I
- xindy
- -M
- sampleutf8
- -t
- sampleutf8.glg
- -o
- sampleutf8.gls
- sampleutf8.glo
-
-
If you remove the xindy option from sampleutf8.tex and do:
-
latex sampleutf8
-
makeglossaries sampleutf8
-
latex sampleutf8
-
- or
-
latex sampleutf8
-
makeglossaries-lite sampleutf8
-
latex sampleutf8
-
- you
- will
- see
- that
- the
- entries
- that
- start
- with
- an
- extended
-
-
- Latin
- character
- now
- appear
- in
- the
- symbols
- group,
- and
- the
- word
- “manœuvre”
- is
- now
- after
- “manor”
- instead
- of
- before
- it.
- If
- you
- want
- to
- explicitly
- call
- ’s -g option, you’ll need to change
+makeindex
- (no
- line
- breaks):
-
-
makeindex
- -s
- sampleutf8.ist
- -t
- sampleutf8.glg
- -o
- sampleutf8.gls
- sampleutf8.glo
-
-
-
-sample-index.tex
- This document uses the glossaries package to create both a glossary and
- an index. This requires two ’s quote character using:
+
\GlsSetQuote{⟨
character⟩
}
+
+Note that ⟨character⟩ may not be one of ? (question mark), | (pipe) or ! (exclamation mark). For
+example:
+
+
+
+
+\GlsSetQuote{+}
+
+ This must be done before \makeglossaries and any entry definitions. It’s only applicable for makeindex. This
+option in conjunction with ngerman will also cause makeglossaries (or makeglossaries-lite) calls to ensure
- the document is up to date:
-
-
-
latex sample-index
-
makeglossaries sample-index
-
latex sample-index
-
makeglossaries sample-index
-
latex sample-index
-
-
-
-sample-newkeys.tex
- This document illustrates how add custom keys (using \glsaddkey).
-
-
-sample-storage-abbr.tex
- This document illustrates how add custom storage keys (using
- \glsaddstoragekey).
-
-
-sample-storage-abbr-desc.tex
- An extension of the previous example where the user
- needs to provide a description.
-
-
-sample-chap-hyperfirst.tex
- This document illustrates how to add a custom key using
- \glsaddstoragekey and hook into the \gls-like and \glstext-like mechanism used to
- determine whether or not to hyperlink an entry.
-
-
-sample-font-abbr.tex
- This document illustrates how to different fonts for abbreviations
- within the style.
-
-
-sample-numberlist.tex
- This document illustrates how to reference the number list in the
- document text. This requires an additional LATEX run:
-
latex sample-numberlist
-
makeglossaries sample-numberlist
-
latex sample-numberlist
-
latex sample-numberlist
-
-
-
-samplePeople.tex
- This document illustrates how you can hook into the standard sort
- mechanism to adjust the way the sort key is set. This requires an additional run to
- ensure the table of contents is up-to-date:
-
latex samplePeople
-
makeglossaries samplePeople
-
latex samplePeople
-
-
-
latex samplePeople
-
-
-
-sampleSort.tex
- This is another document that illustrates how to hook into the standard
- sort mechanism. An additional run is required to ensure the table of contents is
- up-to-date:
-
latex sampleSort
-
makeglossaries sampleSort
-
latex sampleSort
-
latex sampleSort
-
-
-
-sample-nomathhyper.tex
- This document illustrates how to selectively enable and disable
- entry hyperlinks in \glsentryfmt.
-
-
-sample-entryfmt.tex
- This document illustrates how to change the way an entry is
- displayed in the text.
-
-
-sample-prefix.tex
- This document illustrates the use of the glossaries-prefix package.
- An additional run is required to ensure the table of contents is up-to-date:
-
-
latex sample-prefix
-
makeglossaries sample-prefix
-
latex sample-prefix
-
latex sample-prefix
-
-
-
+ id="dx1-13039"> to use the -g switch when invoking
sampleaccsupp.tex
- This document uses the experimental glossaries-accsupp package. The
- symbol is set to the replacement text. Note that some PDF viewers don’t use the
- accessibility support. Information about the glossaries-accsupp package can be found in
- §18 Accessibility Support.
-
-
+class="cmtt-10">makeindex.
+
Be careful of
babel’s shorthands. These aren’t switched on until the start of the document, so any entries
+defined in the preamble won’t be able to use those shorthands. However, if you define the entries in the
+document and any of those shorthands happen to be special characters for
makeindex or
xindy (such as the
+double-quote) then this will interfere with code that tries to escape any of those characters that occur in the
sample-ignored.tex - This document defines an ignored glossary for common terms that
- don’t need a definition.
-
-
-
-
+class="cmtt-10">sort key.
+
+
In general, it’s best not to use babel’s shorthands in entry definitions. For example:
+
+
+
+
+\documentclass{article}
+
\usepackage[ngerman]{babel}
+
\usepackage{glossaries}
+
\GlsSetQuote{+}
+
\makeglossaries
+
\newglossaryentry{rna}{name={ribonukleins\"aure},
+
sort={ribonukleins"aure},
+
description={eine Nukleins\"aure}}
+
\begin{document}
+
\gls{rna}
+
\printglossaries
+
\end{document}
+
+
+
The ngerman package has the shorthands on in the preamble, so they can be used in definitions if
sample-entrycount.tex
- This document uses \glsenableentrycount and \cgls (described
- in §14.1 Counting the Number of Times an Entry has been Used (First Use
- Flag Unset)) so that acronyms only used once don’t appear in the list of
- acronyms.
-
-
-
Top
1.3 Dummy Entries for Testing
-
In addition to the sample files described above, \GlsSetQuote has been used to change the makeindex quote character. Example:
+
+
+
+
+\documentclass{article}
+
\usepackage[ngerman]{babel}
+
\usepackage{glossaries}
+
\GlsSetQuote{+}
+
\makeglossaries
+
\newglossaryentry{rna}{name={ribonukleins"aure},
+
description={eine Nukleins"aure}}
+
\begin{document}
+
\gls{rna}
+
\printglossaries
+
\end{document}
+
+
+
+
+
Top
1.3.1 Changing the Fixed Names
+
The fixed names are produced using the commands listed in table 1.2. If you aren’t using a language package
+such as babel or polyglossia that uses caption hooks, you can just redefine these commands as appropriate. If
+you are using babel or polyglossia, you need to use their caption hooks to change the defaults.
+See changing the words babel uses or read the babel or polyglossia documentation. If you have
+loaded babel, then glossaries also provides some files containing
-lorum ipsum dummy entries. These are provided for testing purposes and are on TEX’s path
-(in tex/latex/glossaries/test-entries) so they can be included via \input or
+ id="dx1-14008"> will attempt to load translator, unless you have used the notranslate,
\loadglsentries. The files are as follows:
-
-
+class="cmss-10">translate=false or translate=babel package options. If the translator package is loaded, the translations
+are provided by dictionary files (for example, glossaries-dictionary-English.dict). See the
example-glossaries-brief.tex
- These entries all have brief descriptions. For example:
-
-
-
- \newglossaryentry{lorem}{name={lorem},description={ipsum}}
-
-
-
-
+class="cmss-10">translator package for advice on changing translations provided by translator dictionaries. If you
+can’t work out how to modify these dictionary definitions, try switching to babel’s interface using
example-glossaries-long.tex
- These entries all have long descriptions. For example:
-
-
-
- \newglossaryentry{loremipsum}{name={lorem ipsum},
-
description={dolor sit amet, consectetuer adipiscing
-
elit. Ut purus elit, vestibulum ut, placerat ac,
-
adipiscing vitae, felis. Curabitur dictum gravida
-
mauris.}}
+class="cmss-10">translate
=babel:
+
+
+
+
+\documentclass[english,french]{article}
+
\usepackage{babel}
+
\usepackage[translate=babel]{glossaries}
-
-
-
-example-glossaries-multipar.tex
- These entries all have multi-paragraph descriptions.
-
-
-example-glossaries-symbols.tex
- These entries all use the symbol key. For example:
-
-
-
- \newglossaryentry{alpha}{name={alpha},
-
symbol={\ensuremath{\alpha}},
-
description={Quisque ullamcorper placerat ipsum.}}
-
-
-
-
-example-glossaries-symbolnames.tex
- Similar to the previous file but the symbol key isn’t
- used. Instead the symbol is stored in the name key. For example:
-
-
-
- \newglossaryentry{sym.alpha}{sort={alpha},
-
name={\ensuremath{\alpha}},
-
description={Quisque ullamcorper placerat ipsum.}}
-
-
-
-
-example-glossaries-images.tex
- These entries use the user1 key to store the name of an
- image file. (The images are provided by the mwe package and should be on TEX’s
- path.) One entry doesn’t have an associated image to help test for a missing
- key.
-
-
-example-glossaries-acronym.tex
- These entries are all abbreviations. For example:
-
-
-
- \newacronym[type=\glsdefaulttype]{lid}{LID}{lorem ipsum
-
dolor}
-
-
-
-
-example-glossaries-acronym-desc.tex
- These entries are all abbreviations that use the
- description key. For example:
-
-
-
- \newacronym[type=\glsdefaulttype,
-
description={fringilla a, euismod sodales,
-
sollicitudin vel, wisi}]{ndl}{NDL}{nam dui ligula}
-
-
-
-
-example-glossaries-acronyms-lang.tex
- These entries are all abbreviations, where some of
- them have a translation supplied in the user1 key. For example:
-
-
-
- \newacronym[type=\glsdefaulttype,user1={love itself}]
-
{li}{LI}{lorem ipsum}
-
-
-
-
-example-glossaries-parent.tex
- These are hierarchical entries where the child entries use
- the name key. For example:
-
-
-
- \newglossaryentry{sedmattis}{name={sed mattis},
-
description={erat sit amet}
-
\newglossaryentry{gravida}{parent={sedmattis},
-
name={gravida},description={malesuada}}
-
-
-
-
-example-glossaries-childnoname.tex
- These are hierarchical entries where the child
- entries don’t use the name key. For example:
-
-
-
- \newglossaryentry{scelerisque}{name={scelerisque},
-
description={at}}
-
-
-
-
-example-glossaries-cite.tex
- These entries use the user1 key to store a citation
- key (or comma-separated list of citation keys). The citations are defined in
- xampl.bib, which should be available on all modern TEX distributions. One
- entry doesn’t have an associated citation to help test for a missing key. For
- example:
-
-
-
- \newglossaryentry{fusce}{name={fusce},
-
description={suscipit cursus sem},user1={article-minimal}}
-
-
-
-
-example-glossaries-url.tex
- These entries use the user1 key to store an URL associated
- with the entry. For example:
-
-
-
- \newglossaryentry{aenean-url}{name={aenean},
-
description={adipiscing auctor est},
-
user1={http://uk.tug.org/}}
-
-
-
The sample file glossary-lipsum-examples.tex in the doc/latex/glossaries/samples
-directory uses all these files. See also http://www.dickimaw-books.com/gallery/#glossaries.
-The glossaries-extra package provides additional test files.
-
-
-
Top
1.4 Multi-Lingual Support
-
As from version 1.17, the glossaries package can be used with xindy as well as makeindex. If
-you are writing in a language that uses an extended Latin alphabet or non-Latin alphabet it’s
-best to use Option 3 (xindy) or Option 4 (bib2gls) as makeindex (Option 2) is hard-coded
-for the non-extended Latin alphabet and Option 1 can performed limited ASCII
-comparisons.
-
This means that with Options 3 or 4 you are not restricted to the A, …, Z letter
-groups. If you want to use xindy, remember to use the xindy package option. For
-example:
-
-
-
-
-\documentclass[frenchb]{article}
-
\usepackage[utf8]{inputenc}
-
\usepackage[T1]{fontenc}
-
\usepackage{babel}
-
\usepackage[xindy]{glossaries}
-
-
If you want to use bib2gls, you need to use the record option with glossaries-extra
-and supply the definitions in .bib files. (See the bib2gls user manual for further
-details.)
-
Note that although a
non-Latin character, such as é, looks like a plain character
-in your
.tex file, with standard
LATEX it’s actually a macro and can therefore
-cause expansion problems. You may need to switch off the field expansions with
-
\glsnoexpandfields. This issue doesn’t occur with XeLaTeX or Lua
LATEX.
-
-
-
With inputenc, if you use a non-Latin character (or other expandable) character at the
-start of an entry name, you must place it in a group, or it will cause a problem for
-commands that convert the first letter to upper case (e.g. \Gls). For example:
-
-
-\newglossaryentry}{elite}{name={{é}lite},
-
description={select group or class}}
-
-
(With newer versions of
mfirstuc and
datatool-base you may be able to omit this grouping.)
-For further details, see the “UTF-8” section in the
mfirstuc user manual.
-
If you are using xindy or bib2gls, the application needs to know the encoding of the
-.tex file. This information is added to the .aux file and can be picked up by makeglossaries
-and bib2gls. If you use xindy explicitly instead of via makeglossaries, you may need to
-specify the encoding using the -C option. Read the xindy manual for further details of this
-option.
-
As from v4.24, if you are writing in German (for example, using the ngerman
-package
-or babel with the ngerman package option), and you want to use makeindex’s -g option, you’ll
-need to change makeindex’s quote character using:
-
\GlsSetQuote \GlsSetQuote{⟨
character⟩
}
-
-Note that ⟨character⟩ may not be one of ? (question mark), | (pipe) or ! (exclamation mark).
-For example:
-
-
-
-
-\GlsSetQuote{+}
-
-
This must be done before \makeglossaries and any entry definitions. It’s only applicable
-for makeindex. This option in conjunction with ngerman will also cause makeglossaries to
-use the -g switch when invoking makeindex.
-
Be careful of
babel’s shorthands. These aren’t switched on until the start of the
-document, so any entries defined in the preamble won’t be able to use those shorthands.
-However, if you define the entries in the document and any of those shorthands happen to be
-special characters for
makeindex or
xindy (such as the double-quote) then this will interfere
-with code that tries to escape any of those characters that occur in the
sort key.
-
-
-
In general, it’s best not to use babel’s shorthands in entry definitions. For example:
-
-
-
-
-\documentclass{article}
-
\usepackage[ngerman]{babel}
-
\usepackage{glossaries}
-
\GlsSetQuote{+}
-
\makeglossaries
-
\newglossaryentry{rna}{name={ribonukleins\"aure},
-
sort={ribonukleins"aure},
-
description={eine Nukleins\"aure}}
-
\begin{document}
-
\gls{rna}
-
\printglossaries
-
\end{document}
-
-
-
The ngerman package has the shorthands on in the preamble, so they can be used if
-\GlsSetQuote has changed the makeindex quote character. Example:
-
-
-
-
-\documentclass{article}
-
\usepackage[ngerman]{babel}
-
\usepackage{glossaries}
-
\GlsSetQuote{+}
-
\makeglossaries
-
\newglossaryentry{rna}{name={ribonukleins"aure},
-
description={eine Nukleins"aure}}
-
\begin{document}
-
\gls{rna}
-
\printglossaries
-
\end{document}
-
-
-
-
-
Top
1.4.1 Changing the Fixed Names
-
The fixed names are produced using the commands listed in table 1.2. If you aren’t using a
-language package such as babel or polyglossia that uses caption hooks, you can just redefine
-these commands as appropriate. If you are using babel or polyglossia, you need to use their
-caption hooks to change the defaults. See changing the words babel uses or read the and then use babel or
-polyglossia documentation. If you have loaded ’s caption hook mechanism. Note that if you pass the language options directly to babel, then glossaries will attempt to load
-translator, unless you have used the notranslate, translate=false or translate=babel package
-options. If the
+rather that using the document class options or otherwise passing the same options to translator package is loaded, the translations are provided by dictionary files
-(for example, glossaries-dictionary-English.dict). See the translator package for advice
-on changing translations provided by , then translator dictionaries. If you can’t work out
-how to modify these dictionary definitions, try switching to
+won’t pick up the language and no dictionaries will be loaded and babel’s interface using
-translate=babel:
-
-
-
-
-\documentclass[english,french]{article}
-
\usepackage{babel}
-
\usepackage[translate=babel]{glossaries}
-
- and then use babel’s caption hook mechanism. Note that if you pass the language options
-directly to babel rather that using the document class options or otherwise passing the same
-options to translator, then translator won’t pick up the language and no dictionaries will be
-loaded and babel’s caption hooks will be used instead.
+ id="dx1-14022">’s caption hooks will be used
+instead.
-
-
-
-
-
+
+
Table 1.2: Customised Text
-
-
+
+
Command Name | Translator
Key
Word | Purpose |
+class="cmbx-10">Word Purpose |
\glossaryname | Glossary | Title
+class="td11"> Glossary | Title
of
the
main
- glossary. |
+ glossary.
\acronymname | Acronyms | Title
+class="td11"> Acronyms | Title
of
the
list
@@ -4681,17 +5924,17 @@ class="td10"> Title
option
acronym). |
+ id="dx1-14026">).
\entryname | Notation
(glossaries) | Header
+class="cmtt-10">(glossaries) | Header
for
first
column
@@ -4707,17 +5950,17 @@ class="td10"> Header
glossaries
that
support
- headers). |
+ headers).
\descriptionname | Description
(glossaries) | Header
+class="cmtt-10">(glossaries) | Header
for
second
column
@@ -4733,17 +5976,17 @@ class="td10"> Header
glossaries
that
support
- headers). |
+ headers).
\symbolname | Symbol
(glossaries) | Header
+class="cmtt-10">(glossaries) | Header
for
symbol
column
@@ -4756,19 +5999,19 @@ class="td10"> Header
that
support
this
- option. |
+ option.
\pagelistname | Page
List
(glossaries) | Header
+class="cmtt-10">(glossaries) | Header
for
page
list
@@ -4781,17 +6024,17 @@ class="td10"> Header
that
support
this
- option. |
+ option.
\glssymbolsgroupname | Symbols
(glossaries) | Header
+class="cmtt-10">(glossaries) | Header
for
symbols
section
@@ -4804,17 +6047,17 @@ class="td10"> Header
that
support
this
- option. |
+ option.
\glsnumbersgroupname | Numbers
(glossaries) | Header
+class="cmtt-10">(glossaries) | Header
for
numbers
section
@@ -4827,153 +6070,162 @@ class="td10"> Header
that
support
this
- option. |
-
-
+ option.
+