From 5ed74e52078fd4969d9d48a906b911b9e34aad27 Mon Sep 17 00:00:00 2001
From: Karl Berry
User Manual for glossaries.sty v4.41
+class="cmr-17">User Manual for glossaries.sty v4.42
2018-07-23http://www.dickimaw-books.com/
In the case of automake=true, the associated files are created at the end of the + document ready for the next LATEX run. Since there is a possibility of commands such + as \gls occurring on the last page of the document, it’s not possible to use \immediate + to close the associated file or with \write18 since the writing of the final + indexing lines may have been delayed. In certain situations this can mean that + the \write18 fails. In such cases, you will need to use automake=immediate + instead. +
With automake=immediate, you will get a warning on the first LATEX run as the + associated glossary files don’t exist yet. +
Since this mechanism can be a security risk, some TEX distributions disable it + completely, in which case this option won’t have an effect. (If this option doesn’t appear + to work, search the log file for “runsystem” and see if it is followed by “enabled” or “disabled”.) -
Some distributions allow Some distributions allow \write18 in a restricted mode. This mode has a limited
number of trusted applications, which usually includes makeindex but may not include
+ id="dx1-26089"> but may not include
xindy. So if you have the restricted mode on, . So if you have the restricted mode on, automake should work with should work with makeindex
+ id="dx1-26092">
but may not work with xindy.
- However even in unrestricted mode this option may not work with .
+
+
+ However even in unrestricted mode this option may not work with xindy as as xindy uses
+ id="dx1-26095"> uses
language names that don’t always correspond with \babel’s language names. (The
+ id="dx1-26096">’s language names. (The
makeglossaries script applies mappings to assist you.) Note that you still need
+ id="dx1-26097"> script applies mappings to assist you.) Note that you still need
at least two LATEX runs to ensure the document is up-to-date with this
setting.
- Since this package option attempts to run the Since this package option attempts to run the indexing application on every
LATEX run, its use should be considered a last resort for those who can’t work out
how to incorporate the indexing application into their document build. The default
value for this option is automake=false.
+ id="dx1-26098">
+
-
It will also define -
It will also define +
+
that’s equivalent to
If you are using If you are using Option 1, you need to use If the If the acronym package option is used, \acronymtype\newacronym
+
No check is performed to determine if the listed glossaries exist, so you can add
+ No check is performed to determine if the listed glossaries exist, so you can add
glossaries you haven’t defined yet. For example:
@@ -8742,32 +8785,32 @@ class="cmtt-10">main You can use
- You can use
+
+
instead of or in addition to the acronymlists option. This will add the glossaries given in
⟨list⟩ to the list of glossaries that are identified as lists of acronyms. To replace the list of
acronym lists with a new list use:
-
- You can determine if a glossary has been identified as being a list of acronyms
+
+ You can determine if a glossary has been identified as being a list of acronyms
using:
-
+
+
+
The package options listed in this section are now deprecated but are kept for
+ The package options listed in this section are now deprecated but are kept for
backward-compatibility. Use \setacronymstyle instead. See \newacronym or (with or (with smallcaps)
@@ -8833,7 +8876,7 @@ class="cmss-10">smallcaps or (with or (with smaller)
@@ -8842,7 +8885,7 @@ class="cmss-10">smaller or (with or (with footnote)
@@ -8851,7 +8894,7 @@ class="cmss-10">footnote or (with or (with footnote and smallcapssmallcaps
\newglossary[alg2]{acronym2}{acr2}{acn2}%
{Statistical Acronyms}
-
-
-
- 2.5.1 Deprecated Acronym Style Options
-
or (with or (with footnote and smallersmaller
or (with \setacronymstyle{dua-desc}
+
or (with or (with description)
@@ -8906,7 +8949,7 @@ class="cmss-10">description or (with or (with description and footnotefootnote
+
+
This option may be replaced by:
@@ -8943,7 +8986,7 @@ class="cmtt-10">\acronymfont or (with or (with description)
@@ -8952,7 +8995,7 @@ class="cmss-10">description or (with or (with description and footnotefootnote
+
or (with or (with smallcaps)
@@ -8987,7 +9030,7 @@ class="cmss-10">smallcaps or (with or (with smaller)
@@ -8996,7 +9039,7 @@ class="cmss-10">smaller or (with or (with description)
@@ -9005,7 +9048,7 @@ class="cmss-10">description or (with or (with smallcaps and descriptiondescription or (with or (with smaller and descriptiondescription
+
or (with or (with description)
@@ -9051,15 +9094,15 @@ class="cmss-10">description
+
+
Other available options that don’t fit any of the above categories are:
+ Other available options that don’t fit any of the above categories are:
It also defines
- It also defines
+
+
which is a synonym for If you use If you use Option 1, you need to use:
- The
+ The glossaries-extra package has a slightly modified version of this option which
additionally provides \glsxtrnewsymbolnumbers It also defines
- It also defines
+
+
which is a synonym for If you use If you use Option 1, you need to use:
- The
+ The glossaries-extra package has a slightly modified version of this option which
additionally provides \glsxtrnewnumberindex It also defines
- It also defines
+
+
which is a synonym for
+
which is a synonym for If you use If you use Option 1, you need to use:
+
- Since the index isn’t designed for terms with descriptions, you might also want to
+ Since the index isn’t designed for terms with descriptions, you might also want to
disable the hyperlinks for this glossary using the package option nohypertypes=index or
@@ -9277,34 +9320,47 @@ class="cmtt-10">\GlsDeclareNoHyperList The example file The example file sample-index.tex illustrates the use of the index package
option.
The use of those kernel commands (instead of the appropriate commands documented
+ The use of those kernel commands (instead of the appropriate commands documented
in this user guide) are deprecated, and you will now get a warning if you try using
them.
- In the event that you require the original form of these kernel commands,
+ In the event that you require the original form of these kernel commands,
for example, if you need to use the glossaries package with another class or
package that also performs glossary-style indexing, then you can restore these
@@ -9326,68 +9382,68 @@ class="cmss-10">glossaries package with another class or
glossaries package) with the package option kernelglossredefs=false. You may
+ id="dx1-29036">. You may
also need to use the nomain option in the event of file extension conflicts. (In
+ id="dx1-29037"> option in the event of file extension conflicts. (In
which case, you must provide a new default glossary for use with the glossaries
+ id="dx1-29038">
package.)
- This option may take one of three values: This option may take one of three values: true (redefine with warnings, default),
false (restore previous definitions) or nowarn (redefine without warnings, not
recommended).
- Note that the only glossary-related commands provided by the LAT Note that the only glossary-related commands provided by the LATEX kernel are
\makeglossary and \glossary. Other packages or classes may provide additional
+
+
glossary-related commands or environments that conflict with glossaries (such as
\printglossary and theglossary). These non-kernel commands aren’t affected by this
+ id="dx1-29039">). These non-kernel commands aren’t affected by this
package option, and you will have to find some way to resolve the conflict if you require
both glossary mechanisms. (The glossaries package will override the existing definitions
+ id="dx1-29041"> package will override the existing definitions
of \printglossary and theglossary.)
-
-
- In general, if possible, it’s best to stick with just one package that provides a glossary
+ id="dx1-29042">.)
+ In general, if possible, it’s best to stick with just one package that provides a glossary
mechanism. (The glossaries package does check for the doc package and patches
+ id="dx1-29044"> package and patches
\PrintChanges.)
+
Some of the options described above may also be set after the Some of the options described above may also be set after the glossaries package has been
loaded using
-
+
The following package options can’t be used in \setupglossaries: \GlsSetXdyLanguage§11 Xindy (Option 3) for further details).
-
+
In the preamble you need to indicate whether you want to use In the preamble you need to indicate whether you want to use Option 1, Option 2 or
bib2glsglossaries-extra manuals.)
The command
- The command
+
+
must be placed in the preamble. This sets up the internal commands required to make
Option 1 work. \makenoidxglossaries none of the glossaries will be
displayed.
-
+
The command
- The command
+
+
must be placed in the preamble in order to create the customised makeindex\makeglossaries Similarly, there are some commands that must not be used before Similarly, there are some commands that must not be used before \makeglossaries.
- You can suppress the creation of the customised
+ You can suppress the creation of the customised xindy
+
That this command must not be used after \makeglossaries.
-
+
- The default name for the customised style file is given by The default name for the customised style file is given by \jobname.ist\jobname
+
where ⟨name⟩ is the name of the style file without the extension. Note that this command must
not be used after \makeglossaries.
- Each glossary entry is assigned a Each glossary entry is assigned a number list
+
For example:
@@ -9598,19 +9654,19 @@ For example:
This command must not be used after This command must not be used after \makeglossaries.
- If you use If you use Option 3, you can have a different compositor for page numbers starting with
an upper case alphabetical character using:
-
+
This command has no effect if you use Option 2. For example, if you want number list
\glsSetCompositor{.}\glsSetAlphaCompositor{-}
See See §5 Number lists for further information about number list
- All glossary entries must be defined before they are used, so it is better to define them in
+ All glossary entries must be defined before they are used, so it is better to define them in
the preamble to ensure this. In fact, some commands such as \longnewglossaryentry
may only be used in the preamble. See §4.8 Drawbacks With Defining Entries in the Document
Environment.)
-
- Only those entries that are indexed in the document (using any of the commands
+
+ Only those entries that are indexed in the document (using any of the commands
described in §6 §10
Displaying a glossary to find out how to display the glossary.
- New glossary entries are defined using the command:
- New glossary entries are defined using the command:
+
+
This is a short command, so values in ⟨key-val list⟩ can’t contain any paragraph breaks. Take
care to enclose values containing any commas (,) or equal signs (=) with braces to hide them
from the key=value list parser. Be careful to ensure that no spurious spaces are included at
the start and end of the braces.
- If you have a long description that needs to span multiple paragraphs, use
- If you have a long description that needs to span multiple paragraphs, use
+
+
instead. Note that this command may only be used in the preamble. Be careful of unwanted
spaces. \longnewglossaryentry will remove trailing spaces in the description (via \longnewglossaryentry that doesn’t append either There are also commands that will only define the entry if it hasn’t already been
+ There are also commands that will only define the entry if it hasn’t already been
defined:
-
+
and
-
+
(These are both preamble-only commands.)
- For all the above commands, the first argument, ⟨ For all the above commands, the first argument, ⟨label⟩, must be a unique label with which
to identify this entry. This can’t contain any non-expandable commands
@@ -9772,7 +9828,7 @@ construct internal commands that store the associated information (similarly to
commands like \label) and therefore must be able to expand to a valid control sequence
name.
-
- The second argument, ⟨
+ The second argument, ⟨key=value list⟩, is a ⟨key⟩=⟨value⟩ list that supplies the relevant
@@ -9835,39 +9891,39 @@ class="description">The name of the entry (as it will appear in the glossary). I
and the parent key is supplied, this value will be the same as the parent’s name.
-
+
+
to suppress the description terminator for this entry. For example, if this
entry is a parent entry that doesn’t require a description, you can do
description={\nopostdesc}. If you want a paragraph break in the description
use
-
+
or, better, use \longnewglossaryentry. However, note that not all glossary styles
support multi-line descriptions. If you are using one of the tabular-like glossary styles
@@ -9983,7 +10039,7 @@ class="cmss-10">firstplural Note: prior to version 1.13, the default value of firstplural was always taken by
@@ -10053,7 +10109,7 @@ class="cmtt-10">\glsprestandardsort Option 1 by default strips the standard LATEX accents (that is, accents generated by
@@ -10074,7 +10130,7 @@ href="#option1">Option 1 This is equivalent to:
+ This is equivalent to:
Unless you use the package option Unless you use the package option sanitizesort=true, in which case it’s equivalent
to:
@@ -10099,9 +10155,9 @@ class="cmss-10">sanitizesort=true This will place the entry before the “A” letter group since the sort value starts with a
+ This will place the entry before the “A” letter group since the sort value starts with a
symbol.
- Similarly if you use the Similarly if you use the inputenc package: With Options With Options 2 and 3, the default value of sortnamesanitizesort=false).
- Take care if you use Take care if you use Option 1 and the name contains fragile commands. You will either
@@ -10237,7 +10293,7 @@ class="cmss-10">sanitizesort=truedef or use sort methods).
+
This key essentially provides a convenient shortcut that performs This key essentially provides a convenient shortcut that performs
+
Since it’s useful to suppress the indexing while working on a draft document,
consider using the seenoindexsee key while
\makeglossaries is commented out.
- If you use the If you use the see key, you may want to consider using the seeOption 4.
The following keys are reserved for The following keys are reserved for \newacronym (see short and shortplural.
-
- Note that if the name starts with
+ Note that if the name starts with non-Latin character Note that the same applies if you are using the Note that the same applies if you are using the inputenc package: Note that in both of the above examples, you will also need to supply the Note that in both of the above examples, you will also need to supply the sort key if you
are using sanitizesort=true You may have noticed from above that you can specify the plural form when you define a
+ You may have noticed from above that you can specify the plural form when you define a
term. If you omit this, the plural will be obtained by appending
-
+
to the singular form. This command defaults to the letter “s”. For example:
@@ -10499,7 +10555,7 @@ to the singular form. This command defaults to the letter “s”. For e
\newglossaryentry{cow}{name=cow,description={a fully grown
defines a new entry whose singular form is “cow” and plural form is “cows”. However, if you
+ defines a new entry whose singular form is “cow” and plural form is “cows”. However, if you
are writing in archaic English, you may want to use “kine” as the plural form, in which case
you would have to do:
@@ -10509,8 +10565,8 @@ you would have to do:
\newglossaryentry{cow}{name=cow,plural=kine,
- If you are writing in a language that supports multiple plurals (for a given term) then use
+
+ If you are writing in a language that supports multiple plurals (for a given term) then use
the plural key for one of them and one of the user keys to specify the other plural form. For
@@ -10525,7 +10581,7 @@ example:
You can then use You can then use \glspl{cow} to produce “cows” and \glsuseri{cow} to produce “kine”.
You can, of course, define an easy to remember synonym. For example:
@@ -10535,7 +10591,7 @@ You can, of course, define an easy to remember synonym. For example:
Then you don’t have to remember which key you used to store the second plural.
+ Then you don’t have to remember which key you used to store the second plural.
Alternatively, you can define your own keys using \glsaddkey, described in §4.3 Additional
Keys.
- If you are using a language that usually forms plurals by appending a different letter, or
+ If you are using a language that usually forms plurals by appending a different letter, or
sequence of letters, you can redefine \glspluralsuffix as required. However, this must be
done pluralfirstplural
+
You can use the six user keys to provide alternatives, such as participles. For example:
+ You can use the six user keys to provide alternatives, such as participles. For example:
With the above definitions, I can now define terms like this:
+ With the above definitions, I can now define terms like this:
and use them in the text:
+ and use them in the text:
- Alternatively, you can define your own keys using
+ Alternatively, you can define your own keys using \glsaddkey, described below in §4.3
Additional Keys.
-
+
You can now also define your own custom keys using the commands described in this section.
+ You can now also define your own custom keys using the commands described in this section.
There are two types of keys: those for use within the document and those to store information
used behind the scenes by other commands.
- For example, if you want to add a key that indicates the associated unit for a term, you
+ For example, if you want to add a key that indicates the associated unit for a term, you
might want to reference this unit in your document. In this case use \glsaddkey described in
§4.3.2 Storage
Keys.
- In both cases, a new command ⟨ In both cases, a new command ⟨no link cs⟩ will be defined that can be used to access the
value of this key (analogous to commands such as \glsentrytext). This can be used in an
@@ -10634,13 +10690,13 @@ The new keys must be added using \glsaddkey or \glsaddstoragekey before glossary
entries are defined.
-
+
A custom key that can be used in the document is defined using:
- A custom key that can be used in the document is defined using:
+
+
where:
The starred version of The starred version of \glsaddkey switches on expansion for this key. The unstarred version
doesn’t override the current expansion setting.
- Example 3 (Defining Custom Keys)
- Suppose I want to define two new keys, Suppose I want to define two new keys, ed and ing, that default to the entry text followed
by “ed” and “ing”, respectively. The default value will need expanding in both cases, so I
@@ -10751,7 +10807,7 @@ need to use the starred form:
Now I can define some entries:
+ Now I can define some entries:
- These entries can later be used in the document:
+
+ These entries can later be used in the document:
For a complete document, see the sample file For a complete document, see the sample file sample-newkeys.tex.
- ____________________________
+
+ ____________________________
A custom key that can be used for simply storing information is defined using:
- A custom key that can be used for simply storing information is defined using:
+
+
where the arguments are as the first three arguments of \glsaddkey, described above in
§4.3.1 Document Keys.
- This is essentially the same as This is essentially the same as \glsaddkey except that it doesn’t define the additional
commands. You can access or update the value of your new field using the commands
described in § Example 4 (Defining Custom Storage Key (Acronyms and
Initialisms))
- Suppose I want to define acronyms and other forms of abbreviations, such as initialisms,
+ Suppose I want to define acronyms and other forms of abbreviations, such as initialisms,
but I want them all in the same glossary and I want the acronyms on first use to be displayed
with the short form followed by the long form in parentheses, but the opposite way round for
other forms of abbreviations. (The glossaries-extra package provides a simpler way of achieving
this.)
- Here I can define a new key that determines whether the term is actually an acronym
+ Here I can define a new key that determines whether the term is actually an acronym
rather than some other form of abbreviation. I’m going to call this key abbrtype (since type
@@ -10846,8 +10902,8 @@ already exists):
- Now I can define a style that looks up the value of this new key to determine how to
+
+ Now I can define a style that looks up the value of this new key to determine how to
display the full form:
@@ -10926,15 +10982,15 @@ display the full form:
Remember that the new style needs to be set before defining any terms:
+ Remember that the new style needs to be set before defining any terms:
- Since it’s a bit confusing to use
+ Since it’s a bit confusing to use \newacronym for something that’s not technically an
acronym, let’s define a new command for initialisms:
@@ -10946,7 +11002,7 @@ acronym, let’s define a new command for initialisms:
Now the entries can all be defined:
+ Now the entries can all be defined:
On On first use, \gls{radar} will produce “radar (radio detecting and ranging)” but \gls{dsp}
will produce “DSP (digital signal processing)”.
- For a complete document, see the sample file For a complete document, see the sample file sample-storage-abbr.tex.
- ____________________________ In the above example, if
+ ____________________________ In the above example, if \newglossaryentry is explicitly used (instead of through
\newacronym) the abbrtype field.
- Example 5 (Defining Custom Storage Key (Acronyms and
Non-Acronyms with Descriptions))
- The previous example can be modified if the The previous example can be modified if the description also needs to be provided. Here
I’ve changed “word” to “acronym”:
@@ -11005,14 +11061,14 @@ I’ve changed “word” to “acronym”:
This may seem a little odd for non-abbreviated entries defined using This may seem a little odd for non-abbreviated entries defined using \newglossaryentry
directly, but \ifglshaslong can be used to determine whether or not to reference the value
of this new abbrtype field.
- The new acronym style has a minor modification that forces the user to specify a
+ The new acronym style has a minor modification that forces the user to specify a
description. In the previous example, the line:
@@ -11021,14 +11077,14 @@ description. In the previous example, the line:
\renewcommand*{\GenericAcronymFields}{%
needs to be changed to:
+ needs to be changed to:
Additionally, to accommodate the change in the default value of the Additionally, to accommodate the change in the default value of the abbrtype key, all
instances of
@@ -11037,15 +11093,15 @@ instances of
need to be changed to:
+ need to be changed to:
- Once this new style has been set, the new acronyms can be defined using the optional
+
+ Once this new style has been set, the new acronyms can be defined using the optional
argument to set the description:
@@ -11055,8 +11111,8 @@ argument to set the description:
- No change is required for the definition of
+ No change is required for the definition of \newinitialism but again the optional
argument is required to set the description:
@@ -11066,8 +11122,8 @@ argument is required to set the description:
\newinitialism[description={mathematical manipulation of an
- We can also accommodate contractions in a similar manner to the initialisms:
+
+ We can also accommodate contractions in a similar manner to the initialisms:
The contractions can similarly been defined using this new command:
+ The contractions can similarly been defined using this new command:
- Since the custom acronym style just checks if
+ Since the custom acronym style just checks if abbrtype is acronym, the contractions will
be treated the same as the initialisms, but the style could be modified by a further test of the
abbrtype value if required.
- To test regular non-abbreviated entries, I’ve also defined a simple word:
+ To test regular non-abbreviated entries, I’ve also defined a simple word:
- Now for a new glossary style that provides information about the abbreviation (in
+
+ Now for a new glossary style that provides information about the abbreviation (in
addition to the description):
@@ -11117,52 +11173,52 @@ addition to the description):
This uses This uses \ifglshaslong to determine whether or not the term is an abbreviation. If it has
an abbreviation, the full form is supplied in parentheses and \abbrtype (defined by
\glsaddstoragekey earlier) is used to indicate the type of abbreviation.
- With this style set, the With this style set, the apple entry is simply displayed in the glossary as
but the abbreviations are displayed in the form
+ but the abbreviations are displayed in the form
(for acronyms) or
+ (for acronyms) or
(for initalisms) or
+ (for initalisms) or
(for contractions).
- For a complete document, see (for contractions).
+ For a complete document, see sample-storage-abbr-desc.tex.
- ____________________________
+ ____________________________
+
When you define new glossary entries expansion is performed by default, except for the When you define new glossary entries expansion is performed by default, except for the name,
sort keys (these keys all have expansion
suppressed via \glssetnoexpandfield).
- You can switch expansion on or off for individual keys using
- You can switch expansion on or off for individual keys using
+
+
or
-
+
respectively, where ⟨field⟩ is the field tag corresponding to the key. In most cases, this is the
same as the name of the key except for those listed in table 4.1.
Any keys that haven’t had the expansion explicitly set using Any keys that haven’t had the expansion explicitly set using \glssetexpandfield or
\glssetnoexpandfield are governed by
-
+
and
-
- If your entries contain any fragile commands, I recommend you switch off expansion via
+
+ If your entries contain any fragile commands, I recommend you switch off expansion via
\glsnoexpandfields. (This should be used before you define the entries.)
As from version 1.17, it is possible to specify sub-entries. These may be used to order the
+ As from version 1.17, it is possible to specify sub-entries. These may be used to order the
glossary into categories, in which case the sub-entry will have a different name to its parent
entry, or it may be used to distinguish different definitions for the same word, in which
case the sub-entries will have the same name as the parent entry. Note that not all
@@ -11353,7 +11409,7 @@ href="#sec:pkgopts-printglos">§2.3 Glossary Appearance Options for further
details).
- Note that the parent entry will automatically be added to the glossary if any of its child
+ Note that the parent entry will automatically be added to the glossary if any of its child
entries are used in the document. If the parent entry is not referenced in the document, it will
not have a number listmakeindex has a restriction on the maximum
sub-entry depth.
-
+
To arrange a glossary with hierarchical categories, you need to first define the category and
+ To arrange a glossary with hierarchical categories, you need to first define the category and
then define the sub-entries using the relevant category entry as the value of the parent
key.
- Example 6 (Hierarchical Categories—Greek and Roman Mathematical
Symbols)
- Suppose I want a glossary of mathematical symbols that are divided into Greek letters
+ Suppose I want a glossary of mathematical symbols that are divided into Greek letters
and Roman letters. Then I can define the categories as follows:
@@ -11393,13 +11449,13 @@ and Roman letters. Then I can define the categories as follows:
- Note that in this example, the category entries don’t need a description so I have set the
+
+ Note that in this example, the category entries don’t need a description so I have set the
descriptions to \nopostdesc. This gives a blank description and suppresses the description
terminator.
- I can now define my sub-entries as follows:
+ I can now define my sub-entries as follows:
For a complete document, see the sample file For a complete document, see the sample file sampletree.tex.
- ____________________________
+
+ ____________________________
Sub-entries that have the same name as the parent entry, don’t need to have the
+ Sub-entries that have the same name as the parent entry, don’t need to have the
name key. For example, the word “glossary” can mean a list of technical words or a
@@ -11438,11 +11494,11 @@ entry:
Again, the parent entry has no description, so the description terminator needs to be
+ Again, the parent entry has no description, so the description terminator needs to be
suppressed using \nopostdesc.
- Now define the two different meanings of the word:
+ Now define the two different meanings of the word:
Note that if I reference the parent entry, the location will be added to the parent’s Note that if I reference the parent entry, the location will be added to the parent’s number
list In the above example, the plural form for both of the child entries is the same as the
+ In the above example, the plural form for both of the child entries is the same as the
parent entry, so the plural key was not required for the child entries. However, if the
@@ -11501,14 +11557,14 @@ sub-entries have different plurals, they will need to be specified. For example:
-
+
+
You can store all your glossary entry definitions in another file and use:
- You can store all your glossary entry definitions in another file and use:
+
+
where ⟨filename⟩ is the name of the file containing all the \newglossaryentry\glsdefaulttype This is a preamble-only command. You may also use This is a preamble-only command. You may also use \input to load the file but don’t use
bib2gls and use an application such as JabRef to manage the entry
definitions.
-
+ Example 7 (Loading Entries from Another File)
- Suppose I have a file called Suppose I have a file called myentries.tex which contains:
@@ -11593,14 +11649,14 @@ class="cmtt-10">myentries.tex and suppose in my document preamble I use the command:
+ and suppose in my document preamble I use the command:
then this will add the entries then this will add the entries tex and html to the glossary whose type is given by
main.
- ____________________________
+ ____________________________ Note: if you use \newacronym (see myacronyms.tex then (supposing I have defined a new glossary type called then (supposing I have defined a new glossary type called altacronym)
@@ -11637,7 +11693,7 @@ class="cmtt-10">altacronym will add will add aca to the glossary type acronym, if the package option acronymacronym If you have used the If you have used the acronym package option, there are two possible solutions to this
problem:
@@ -11664,14 +11720,14 @@ class="cmtt-10">myacronyms.tex and do:
+ and do:
+
Note that only those entries that have been used in the text will appear in the relevant
+ Note that only those entries that have been used in the text will appear in the relevant
glossaries. Note also that \loadglsentries may only be used in the preamble.
- Remember that you can use Remember that you can use \provideglossaryentry rather than \newglossaryentryterms.tex but suppose your document requires a more detailed description, you can do:
+ but suppose your document requires a more detailed description, you can do:
Now the Now the mallard definition in the terms.tex file will be ignored.
-
+
As from version 3.02, you can move an entry from one glossary to another using:
- As from version 3.02, you can move an entry from one glossary to another using:
+
+
where ⟨label⟩ is the unique label identifying the required entry and ⟨target glossary label⟩ is the
unique label identifying the glossary in which to put the entry.
- Note that no check is performed to determine the existence of the target glossary. If
+ Note that no check is performed to determine the existence of the target glossary. If
you want to move an entry to a glossary that’s skipped by \printglossaries,
@@ -11754,15 +11810,15 @@ href="#sec:newglossary">§12 Defining New
Glossaries.)
-
-
+
+
Originally, Originally, \newglossaryentry (and \newacronym3 but provides a package option to allow document
definitions.)
-
+
+
To overcome the first two problems, as from version 4.0 the To overcome the first two problems, as from version 4.0 the glossaries package modifies the
definition of \newglossaryentry at the beginning of the document environment if it doesn’t already exist. This means that the entry can now
be looked up in the glossary, even if the glossary occurs at the beginning of the
document.
- There are drawbacks to this mechanism: if you modify an entry definition, you need a
+ There are drawbacks to this mechanism: if you modify an entry definition, you need a
second run to see the effect of your modification; this method requires an extra \newwrite,
which may exceed T.glsdefs file when it’s
created at the end of the document (and therefore won’t be present on subsequent
runs).
- The The glossaries-extra package provides a setting (but only for Options 2 and
+
The above section covers technical issues that can cause your document to have compilation
+ The above section covers technical issues that can cause your document to have compilation
errors or produce incorrect output. This section focuses on good writing practice. The main
reason cited by users wanting to define entries within the document When you write technical documents, regardless of whether it’s a PhD thesis or an article
+ When you write technical documents, regardless of whether it’s a PhD thesis or an article
for a journal or proceedings, you must plan what you write in advance. If you plan in
advance, you should have a fairly good idea of the type of terminology that your
document will contain, so while you are planning, create a new file with all your
@@ -11898,11 +11954,11 @@ definition.
Each entry in the glossary has an associated Each entry in the glossary has an associated number list are more common with indexes rather than glossaries (although you can use
the indexonlyfirstfirst use of each
term.
- The The \glsaddall command (see number list, which looks
weird if the number list hasn’t been suppressed.
- With With Option 4, the indexing is performed by bib2glsOption 1 also allows any location but it doesn’t form
ranges.
Each location in the Each location in the number list The The glossaries package provides the command \glsignore which ignores its argument.
@@ -12037,7 +12093,7 @@ class="cmtt-10">sample This isn’t a problem with This isn’t a problem with bib2gls Complications can arise if you use different encap values for the same location. For
+ Complications can arise if you use different encap values for the same location. For
example, suppose on page 10 you have both the default glsnumberformat and textbf
@@ -12072,7 +12128,7 @@ be careful about if you use the format key or if you use a command that implicitly sets
it.
- In the case of In the case of xindy In the case of In the case of makeindex No discard occurs with No discard occurs with Option 1 so again you get the same location repeated in different
formats. With Option 4, bib2gls
+
Neither Neither Option 1 nor Option 4 care about the location syntax as long as it’s valid
LAT2 If you know that your locations will always expand to a format acceptable to your chosen
+ If you know that your locations will always expand to a format acceptable to your chosen
indexing application then use the package option esclocations=false3 as the problem doesn’t arise with the other
indexing options.
- Both Both makeindex There’s a certain amount of trickery needed to deal with this conflict and the code requires
+ There’s a certain amount of trickery needed to deal with this conflict and the code requires
the location to be in a form that doesn’t embed the counter’s internal register in
commands like \value. For example, suppose you have a robust command called
@@ -12214,7 +12270,7 @@ number:
Now let’s suppose that a term is indexed at the beginning of page 2 at the end of a
+ Now let’s suppose that a term is indexed at the beginning of page 2 at the end of a
paragraph that started on page 1. With xindy\c@page:
+
+
+
+
The following
+ The following don’t work:
+
If you have a numbering system where
+ If you have a numbering system where \⟨cs name⟩{page} expands to \c@page
class="cmtt-10">\tally{page}
+
Note that the backslash must be omitted from ⟨internal cs name⟩ and the corresponding
command must be able to process a count register as the (sole) argument.
- For example, suppose you have a style For example, suppose you have a style samplenum that is implemented as follows:
@@ -12347,7 +12403,7 @@ class="cmtt-10">samplenum (That is, it displays the value of the counter as a two-digit number.) Then to ensure the
+ (That is, it displays the value of the counter as a two-digit number.) Then to ensure the
location is correct for entries in page-spanning paragraphs, you need to do:
@@ -12355,11 +12411,11 @@ location is correct for entries in page-spanning paragraphs, you need to do:
(If you are using a different counter for the location, such as (If you are using a different counter for the location, such as section or equation, you don’t
need to worry about this provided the inner command is expandable.)
- If the inner macro (as given by If the inner macro (as given by \⟨internal cs name⟩) contains non-expandable
commands then you may need to redefine \expandafter\@samplenum\csname c@#1\endcsname}
Again, the inner macro needs to be identified using:
+ Again, the inner macro needs to be identified using:
However, since However, since \textsc isn’t fully expandable, the location is written to the file as
\textsc
\renewcommand*{\gls@samplenumpage}{\romannumeral\c@page}
- While this modification means that the While this modification means that the number list combined with
+ combined with
will now have lowercase Roman numerals in the location list (see will now have lowercase Roman numerals in the location list (see §11.2 Locations and
@@ -12456,7 +12512,7 @@ class="cmtt-10">\\ Another possibility that may work with both Another possibility that may work with both makeindex
-
+
- The mechanism that allows this to work temporarily redefines
+ The mechanism that allows this to work temporarily redefines \the and \number while it
processes the location. If this causes a problem you can disallow it using
-
+
but you will need to find some other way to ensure the location expands correctly.
-
+
Both Both makeindex
-
-
+
+
where the former command specifies the suffix to use for a 2 page list and the latter specifies
the suffix to use for longer lists. For example:
@@ -12577,7 +12633,7 @@ the suffix to use for longer lists. For example:
\glsSetSuffixF{f.}
Note that if you use Note that if you use xindy Note that if you use the Note that if you use the hyperref package, you will need to use \nohyperpage\glsSetSuffixFF{\nohyperpage{ff.}}
-
+
- It’s also possible to concatenate a sequence of consecutive locations into a range or have
+
+ It’s also possible to concatenate a sequence of consecutive locations into a range or have
suffixes with Option 4, but with bib2gls manual for further
details.
- Option 1 doesn’t form ranges. However, with this option you can iterate over an entry’s
number list
+
where ⟨label⟩ is the entry’s label and ⟨handler cs⟩ is a handler control sequence of the
form:
-
+
where ⟨prefix⟩ is the hyperreftextbf
+
where ⟨tag⟩ is the cross-referenced text (e.g. “see”) and ⟨xr list⟩ is a comma-separated list of
labels. (This actually has a third argument but it’s always empty when used with
Option 1.)
- For example, if on page 12 I have used
+ For example, if on page 12 I have used
and on page 18 I have used
+ and on page 18 I have used
then
+ then
will be equivalent to:
+ will be equivalent to:
There is a predefined handler that’s used to display the There is a predefined handler that’s used to display the number list
+
The predefined handler used for the cross-references in the glossary is:
-
+
which is described in §8.1 Customising Cross-reference Text.
-
-
+
+
As from version 4.24, there’s a hook that’s used near the end of As from version 4.24, there’s a hook that’s used near the end of \writeist before the file is
closed. You can set the code to be performed then using:
-
+
If you want the ⟨code⟩ to write any information to the file, you need to use
-
+
Make sure you use the correct format within ⟨style information⟩. For example, if you are using
makeindex \write\glswrite{line_max 80}%
This changes the page type precedence This changes the page type precedence and the maximum line length used by
makeindex.
- Remember that if you switch to Remember that if you switch to xindy, this will no longer be valid code.
Once you have defined a glossary entry using Once you have defined a glossary entry using \newglossaryentry (4 write the information to the .aux
file.)
- Note that repeated use of these commands for the same entry can cause the Note that repeated use of these commands for the same entry can cause the number list Aside from problems with expansion issues, PDF bookmarks and possible nested
+ Aside from problems with expansion issues, PDF bookmarks and possible nested
hyperlinks in the table of contents (or list of whatever) any use of the commands
described in \gls-Like Commands (First Use Flag Queried)
- The above warning is particularly important if you are using the
+ The above warning is particularly important if you are using the glossaries package in
conjunction with the hyperref\chapter[An overview of Perl]{An overview of \gls{perl}}
If you want to retain the formatting that’s available through commands like If you want to retain the formatting that’s available through commands like \acrshort (for
example, if you are using one of the small caps styles), then you might want to consider the
glossaries-extra package which provides commands for this purpose.
- If you want the If you want the link text These are limitations of the DVI format not of the These are limitations of the DVI format not of the glossaries package.
- It may be that you only want terms in certain glossaries to have hyperlinks, but not for
+
+ It may be that you only want terms in certain glossaries to have hyperlinks, but not for
other glossaries. In this case, you can use the package option nohypertypes to identify the
@@ -12968,17 +13024,17 @@ href="#sec:pkgopts-general">§2.1 General Options for further
details.
- The way the The way the link text
+
For example, to make all link text appear in a sans-serif font, do:
@@ -12988,7 +13044,7 @@ href="#glo:linktext">link text
\renewcommand*{\glstextformat}[1]{\textsf{#1}}
Further customisation can be done via Further customisation can be done via \defglsentryfmt or by redefining \glsentryfmt\glsentryfmt Each entry has an associated conditional referred to as the Each entry has an associated conditional referred to as the first use flag. Some of the
commands described in this chapter automatically unset this flag and can also use it
to determine what text should be displayed. These types of commands are the
@@ -13024,7 +13080,7 @@ href="#sec:glsunset">Unsetting and Resetting Entry Flags The The \gls-like and glossaries-extra package provides the option to add a third custom
variant.
-
- The keys listed below are available for the optional argument. The
+ The keys listed below are available for the optional argument. The glossaries-extra package
provides additional keys. (See the italic) you will need to create a command that applies bo
and use that command.
- In this document, the standard formats refer to the standard text block commands such
+ and use that command.
+ In this document, the standard formats refer to the standard text block commands such
as \textbf or format⟩ part must match. For example, format={(emph}
- If you are using hyperlinks and you want to change the font of the hyperlinked location,
+
+ If you are using hyperlinks and you want to change the font of the hyperlinked location,
don’t use \hyperpage (provided by the glossaries package provides number formats listed in
href="#tab:hyperxx">table 6.1.
Note that if the Note that if the \hyperlink command hasn’t been defined, the hyper⟨\hyperbsf
\newcommand{\hyperbsf}[1]{\textbf{\hypersf{#1}}}
and then use and then use hyperbsf as the value for the format
@@ -13326,7 +13382,7 @@ class="cmtt-10">xindy
+
+
This section describes the commands that unset (mark as used) the This section describes the commands that unset (mark as used) the first use flag on
completion, and in most cases they use the current state of the flag to determine the text to
be displayed. As described above, these commands all have a star-variant (hyper=true) and have an optional first argument that is a
class="cmti-10">key⟩=⟨value⟩
list.
- These commands use These commands use \glsentryfmt or the equivalent definition provided by
§6.3
Apart from Apart from \glsdisp, the commands described in this section also have a final optional
argument ⟨insert⟩ which may be used to insert material into the automatically generated
text.
-
- Don’t use any of the
+ Don’t use any of the \gls-like or \glstext-like commands in the ⟨insert⟩ argument.
- Take care using these commands within commands or environments that are processed
+
+ Take care using these commands within commands or environments that are processed
multiple times as this can confuse the first use flag query and state change. This includes
frames with overlays in beamertabularx by placing the following command (new to v4.28) in the
preamble:
-
+
This does nothing if tabularx hasn’t been loaded. There’s no patch available for beamer§14 Unsetting and Resetting Entry Flags for more details.
-
+
This command typically determines the link text from the values of the long or short keys.
- There are two upper case variants:
- There are two upper case variants:
+
+
and
-
+
which make the first letter of the link text or all the link text upper case, respectively. For the
former, the uppercasing of the first letter is performed by \makefirstuc.
-
+
The upper casing is performed as follows: which will appear as which will appear as Sample phrase.
Then Then \Gls{sample} will set the link textlink text
\MakeUppercase \oe-ligature
which will appear as Œ-ligature.
+ which will appear as Œ-ligature.
(Note the use of the (Note the use of the sort key in the above examples.)
- There are hundreds of LAT There are hundreds of LATEX packages that altogether define thousands of commands
with various syntax and it’s impossible for mfirstuclink textmfirstuc For example, starting with a math-shift symbol:
+ For example, starting with a math-shift symbol:
This falls into case 2 above, so the This falls into case 2 above, so the link text This attempts to uppercase the math-shift This attempts to uppercase the math-shift $, which will go wrong. In this case it’s not
appropriate to perform any case-changing, but it may be that you want to use \Gls
@@ -13630,7 +13686,7 @@ solution is to insert an empty brace at the start:
Now the Now the link text and the and the \uppercase becomes harmless.
- Another issue occurs when the Another issue occurs when the link text Now the Now the link text This will generate an error because there’s no entry with the label given by
+ This will generate an error because there’s no entry with the label given by
\MakeUppercase sample. The best solution here is to write the term out in the name description={another example}
- If the
+ If the link text Now the Now the link text This won’t work because This won’t work because \MakeUppercase blue isn’t a recognised colour name. In this case
you will have to define a helper command where the first argument is the text. For
@@ -13743,7 +13799,7 @@ example:
In fact, since the whole design ethos of LAT In fact, since the whole design ethos of LATEX is the separation of content and style, it’s
better to use a semantic command. For example:
@@ -13756,12 +13812,12 @@ better to use a semantic command. For example:
For further details see the For further details see the mfirstuc user manual.
- There are plural forms that are analogous to There are plural forms that are analogous to \gls:
-
-
+
-
+
+
These typically determine the link text from the plural or longplural or shortplural keys.
- and later you use it in math mode:
+ and later you use it in math mode:
This will result in This will result in Fα2 instead of insert⟩ optional argument:
-
+
+
This behaves in the same way as the above commands, except that the ⟨link text⟩ is explicitly
set. There’s no final optional argument as any inserted material can be added to the ⟨link text⟩
argument.
-
-
+
+
This section describes the commands that don’t change or reference the This section describes the commands that don’t change or reference the first use flag.
As described above, these commands all have a star-variant (hyper=false) and a
@@ -13901,7 +13957,7 @@ href="#sec:acronyms">§13 Apart from Apart from \glslink, the commands described in this section also have a final
@@ -13913,7 +13969,7 @@ class="tcrm-1000">§
+
This command explicitly sets the link text as given in the final argument.
-
-
+
+
This command always uses the value of the text key as the link text.
- There are also analogous commands:
- There are also analogous commands:
+
-
+
+
These convert the first character or all the characters to uppercase, respectively. See the note
on \Gls above for details on the limitations of converting the first letter to upper
case.
- There’s no equivalent command for title-casing, but you can use the more generic
+ There’s no equivalent command for title-casing, but you can use the more generic
command \glsentrytitlecase in combination with \glslink. For example:
(See (See §9 Using Glossary Terms Without Links.)
-
+
This command always uses the value of the first key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
-
+
+
This command always uses the value of the plural key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the firstplural key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the name key as the \glstext There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
-
+
+
This command always uses the value of the symbol key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the description key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
- If you want the title case version you can use
+
+ If you want the title case version you can use
-
+
+
This command always uses the value of the user1 key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the user2 key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the user3 key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the user4 key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the user5 key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
This command always uses the value of the user6 key as the link text.
- There are also analogous uppercasing commands:
- There are also analogous uppercasing commands:
+
-
+
-
+
+
The default format of the The default format of the link text
+
This may be redefined but if you only want the change the display style for a given glossary,
then you need to use
-
+
instead of redefining \glsentryfmt. The optional first argument ⟨type⟩ is the glossary type.
@@ -14600,7 +14656,7 @@ This defaults to \glsdefaulttype if omitted. The second argument is the entry format
definition.
-
- Within the ⟨
+ Within the ⟨definition⟩ argument of \defglsentryfmt, or if you want to redefine
\glsentryfmt, you may use the following commands:
-
+
This is the label of the entry being referenced. As from version 4.08, you can also access the
glossary entry type using:
-
+
This is defined using \edef so the replacement text is the actual glossary type rather than
\glsentrytype{\glslabel}.
-
+
This is the custom text supplied in \glsdisp. It’s always empty for \glsetoolbox
+
The custom text supplied in the final optional argument to \gls, \glspl and their upper case
variants.
-
+
If \glspl, \Glspl or true text⟩ otherwise it does ⟨false
text⟩.
-
+
If \gls, \glspl or first uc⟩. If \GLS or \GLSpl were used, this does ⟨all caps⟩.
-
+
This will do ⟨hyper true⟩ if the hyperlinks are on for the current reference, otherwise it will
do ⟨nohypertypes) or because it’s the first use and the hyperlinks have been suppressed on first
use.
- Note that Note that \glsifhyper is now deprecated. If you want to know if the command used to
reference this entry was used with the star or plus variant, you can use:
-
+
This will do ⟨unmodified⟩ if the unmodified version was used, or will do ⟨star⟩ if the starred
@@ -14772,7 +14828,7 @@ command shouldn’t be used to guess whether or not the hyperlink is on for
reference.
- Note that you can also use commands such as Note that you can also use commands such as \ifglsused within the definition of
\glsentryfmt (see §14 Unsetting and Resetting Entry Flags).
- The commands The commands \glslabel, \glstype\glspostlinkhook
- If you only want to make minor modifications to
+ If you only want to make minor modifications to \glsentryfmt, you can use
-
+
This uses the above commands to display just the first, pluralfirstplural Alternatively, if want to change the entry format for abbreviations (defined via
+ Alternatively, if want to change the entry format for abbreviations (defined via
\newacronym) you can use:
-
+
This uses the values from the long, firstfirstplural
+
instead of from the first key, and the first use plural text is obtained via:
-
+
instead of from the firstplural key. In both cases, ⟨\firstacronymfont. There are also first letter upper case
versions:
-
+
and
-
+
By default these perform a protected expansion on their no-case-change equivalents and then
use \makefirstuc§
- As from version 4.16, both the
+ As from version 4.16, both the \gls-like and \glstext-like commands use
-
+
after the ⟨options⟩ are set. This macro does nothing by default but can be redefined. (For
example, to switch off the hyperlink under certain conditions.) This version also
introduces
-
+
which is done after the link text has been displayed and also after the first use flag has been
@@ -14994,11 +15050,11 @@ unset (see example 25).
- Example 8 (Custom Entry Display in Text)
- Suppose you want a glossary of measurements and units, you can use the Suppose you want a glossary of measurements and units, you can use the symbol key to
store the unit:
@@ -15010,7 +15066,7 @@ store the unit:
and now suppose you want and now suppose you want \gls{distance} to produce “distance (km)” on first use, then
you can redefine \glsentryfmt \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}%
- (Note that I’ve used
+ (Note that I’ve used \glsentrysymbol rather than \glssymbol to avoid nested
hyperlinks.)
- Note also that all of the Note also that all of the link text then then \gls{distance} will produce “distance (km)”.
- For a complete document, see the sample file For a complete document, see the sample file sample-entryfmt.tex.
- ____________________________
+ ____________________________ Example 9 (Custom Format for Particular Glossary)
- Suppose you have created a new glossary called 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
@@ -15077,7 +15133,7 @@ do:
Now suppose you have defined an entry as follows:
+ Now suppose you have defined an entry as follows:
The The first time you reference this entry it will be displayed as: “set (denoted S)” (assuming
\gls was used).
- Alternatively, if you expect all the symbols to be set in math mode, you can
+ Alternatively, if you expect all the symbols to be set in math mode, you can
do:
@@ -15104,7 +15160,7 @@ do:
and define entries like this:
+ and define entries like this:
- ____________________________ Remember that if you use the
+ ____________________________ 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.
-
+
If you load the If you load the hyperref or htmlhyper You can disable or enable links using:
- You can disable or enable links using:
+
+
and
-
+
respectively. The effect can be localised by placing the commands within a group. Note that
you should only use \glsenablehyper if the commands \hypertargethyperref You can disable just the You can disable just the first use links using the package option hyperfirst=false. Note
@@ -15181,11 +15237,11 @@ href="#glo:firstuseflag">first use
flag Example 10 (First Use With Hyperlinked Footnote Description)
- Suppose I want the first use to have a hyperlink to the description in a footnote instead of
+ Suppose I want the first use to have a hyperlink to the description in a footnote instead of
hyperlinking to the relevant place in the glossary. First I need to disable the hyperlinks on
first use via the package option hyperfirst=falsehyperfirst=false Now I need to redefine Now I need to redefine \glsentryfmt (see ):
- Now the first use won’t have hyperlinked text, but will be followed by a footnote. See the
+
+ Now the first use won’t have hyperlinked text, but will be followed by a footnote. See the
sample file sample-FnDesc.tex for a complete document.
- ____________________________ Note that the
+ ____________________________ Note that the hyperfirst option applies to all defined glossaries. It may be that you only
want to disable the hyperlinks on hyperfirst Example 11 (Suppressing Hyperlinks on First Use Just For
Acronyms)
- Suppose I want to suppress the hyperlink on Suppose I want to suppress the hyperlink on first use for acronyms but not for entries in
the main glossary. I can load the glossaries package using:
@@ -15255,20 +15311,20 @@ class="cmss-10">glossaries Once all glossary entries have been defined I then do:
+ Once all glossary entries have been defined I then do:
+
- ____________________________ For more complex requirements, you might find it easier to switch off all hyperlinks via
+
+ ____________________________ For more complex requirements, you might find it easier to switch off all hyperlinks via
\glsdisablehyper and put the hyperlinks (where required) within the definition of
@@ -15286,11 +15342,11 @@ class="tcrm-1000">§ Example 12 (Only Hyperlink in Text Mode Not Math Mode)
- This is a bit of a contrived example, but suppose, for some reason, I only want the
+ This is a bit of a contrived example, but suppose, for some reason, I only want the
\gls-like commands to have hyperlinks when used in text mode, but not in math mode.
@@ -15313,24 +15369,24 @@ class="cmtt-10">\glsentryfmt Note that this doesn’t affect the Note that this doesn’t affect the \glstext-like commands, which will have the hyperlinks off
unless they’re forced on using the plus variant.
- See the sample file See the sample file sample-nomathhyper.tex for a complete document.
- ____________________________
+ ____________________________ Example 13 (One Hyper Link Per Entry Per Chapter)
- Here’s a more complicated example that will only have the hyperlink on the first time an
+ Here’s a more complicated example that will only have the hyperlink on the first time an
entry is used per chapter. This doesn’t involve resetting the first use flag. Instead it adds
a new key using
\glsaddstoragekey{chapter}{0}{\glschapnum}
This creates a new user command called This creates a new user command called \glschapnum that’s analogous to \glsentrytext.
The default value for this key is 0. I then define my glossary entries as usual.
- Next I redefine the hook Next I redefine the hook \glslinkpostsetkeys (see \glsifhyperon.
Note that this will be confused if you use Note that this will be confused if you use \gls etc when the chapter counter is 0. (That is,
before the first \chapter.)
- See the sample file See the sample file sample-chap-hyperfirst.tex for a complete document.
- ____________________________
+ ____________________________ It is possible to add a line to the glossary file without generating any text at that point in
+ It is possible to add a line to the glossary file without generating any text at that point in
the document using:
-
+
This is similar to the \glstext-like commands, only it doesn’t produce any text (so
@@ -15442,16 +15498,16 @@ class="cmtt-10">set
- To add all entries that have been defined, use:
-
+ To add all entries that have been defined, use:
+
+
The optional argument is the same as for \glsadd, except there is also a key typesnotation
-
+
- There is now a variation of
+ There is now a variation of \glsaddall that skips any entries that have already been
used:
-
+
This command uses \glsadd[format=@gobble] which will ignore this location in the number
list. The optional argument ⟨list⟩ is a comma-separated list of glossary types. If omitted, it
defaults to the list of all defined glossaries.
- If you want to use If you want to use \glsaddallunused, it’s best to place the command at the end of the
document to ensure that all the commands you intend to use have already been
used. Otherwise you could end up with a spurious comma or dash in the location
list.
- The example file The example file sample-dual.tex makes use of \glsadd to allow for an entry that
@@ -15526,7 +15582,7 @@ class="cmss-10">acronym A new command is then defined to make it easier to define dual entries:
+ A new command is then defined to make it easier to define dual entries:
This has the following syntax: This has the following syntax: Now you can reference the acronym with Now you can reference the acronym with \gls{svm} or you can reference the entry in the
main glossary with \gls{main-svm}.
- ____________________________
+ ____________________________
- There are several ways of cross-referencing entries in the glossary:
+
+ There are several ways of cross-referencing entries in the glossary:
Note that with this method, if you don’t use the cross-referenced term in the main part
+ Note that with this method, if you don’t use the cross-referenced term in the main part
of the document, you will need two runs of makeglossariesmakeglossariesmakeglossaries filename
+
Note that in this case, the entry with the Note that in this case, the entry with the see key will automatically be added to the
glossary, but the cross-referenced entry won’t. You therefore need to ensure that you
@@ -15656,7 +15712,7 @@ href="#sec:glsadd">§7 The “see” tag is produce using The “see” tag is produce using \seename, but can be overridden in specific instances
using square brackets at the start of the seedescription={Series expansion},
Take care if you want to use the optional argument of commands such as Take care if you want to use the optional argument of commands such as \newacronym
or \newterm\newterm[see={[see also]seal}]{sea lion}
Similarly if the value contains a list. For example:
+ Similarly if the value contains a list. For example:
+
+
where ⟨xr label list⟩ is a comma-separated list of entry labels to be cross-referenced, ⟨label⟩
@@ -15736,12 +15792,12 @@ class="cmtt-10">\seename Note that this automatically adds the entry given by ⟨ Note that this automatically adds the entry given by ⟨label⟩ to the glossary
but doesn’t add the cross-referenced entries (specified by ⟨xr label list⟩) to the
glossary. In both cases 2 and 3 above, the cross-referenced information appears in the In both cases 2 and 3 above, the cross-referenced information appears in the number list When you use either the When you use either the see key or the command \glssee, the cross-referencing information
will be typeset in the glossary according to:
-
- The list of labels is dealt with by
+ The list of labels is dealt with by \glsseelist, which iterates through the list and
typesets each entry in the label. The entries are separated by
-
+
or (for the last pair)
-
+
These default to “,\space” and “\space\andname\space” respectively. The list entry text is
displayed using:
-
+
-
+
+
The commands described in this section display entry details without adding any
+ The commands described in this section display entry details without adding any
information to the glossary. They don’t use \glstextformat, they don’t have any optional
@@ -15889,7 +15945,7 @@ href="#glo:firstuseflag">first use flag and, apart from \glshyperlink, they don’t
produce hyperlinks.
-
- If you want to title case a field, you can use:
-
+ If you want to title case a field, you can use:
+
+
where ⟨label⟩ is the label identifying the glossary entry, ⟨field⟩ is the field label (see
\glsentrytitlecase{sample}{desc}
(If you want title-casing in your glossary style, you might want to investigate the
+ (If you want title-casing in your glossary style, you might want to investigate the
glossaries-extra package.)
- Note that this command has the same limitations as Note that this command has the same limitations as \makefirstuc which is used by
commands like \Gls and §6.1
-
+
+
These commands display the name of the glossary entry given by ⟨label⟩, as specified by the
\glsentrytext or \glsentryfirst instead of
\glsentryname.
-
-
+
+
This is like \glsnamefont{
\renewcommand*{\glsnamefont}[1]{\textmd{\sffamily #1}}
-
+
+
This is like \glossentryname but makes the first letter of the name upper case.
-
-
+
+
These commands display the subsequent use text for the glossary entry given by ⟨label⟩, as
specified by the \Glsentrytext makes the first letter upper case. The firs
expandable (unless the text contains unexpandable commands). The second form is not
expandable. Neither checks for the existence of ⟨label⟩.
-
-
+
+
These commands display the subsequent use plural text for the glossary entry given by ⟨label⟩,
as specified by the label⟩.
-
-
+
+
These commands display the first use text for the glossary entry given by ⟨label⟩,
@@ -16096,22 +16152,22 @@ The first form is expandable (unless the value of that key contains unexpandable
commands). The second form is not expandable. Neither checks for the existence of
⟨label⟩.
-
-
+
+
These commands display the plural form of the first use text for the glossary entry given by
⟨label⟩.
-
-
+
+
These commands display the description for the glossary entry given by ⟨label⟩. \Glsentrydesc
@@ -16148,14 +16204,14 @@ makes the first letter upper case. The first form is expandable (unless the valu
contains unexpandable commands). The second form is not expandable. Neither checks for
the existence of ⟨label⟩.
-
+
This is like \glsentrydesc{⟨label⟩} but also checks for the existence of ⟨label⟩. This
command is not expandable. It’s used in the predefined glossary styles to display the
description.
-
+
This is like \glossentrydesc but converts the first letter to upper case. This command is not
expandable.
-
-
+
+
These commands display the plural description for the glossary entry given by ⟨label⟩.
\Glsentrydescplural makes the first letter upper case. Th
the value of that key contains unexpandable commands). The second form is not expandable.
Neither checks for the existence of ⟨label⟩.
-
-
+
+
These commands display the symbol for the glossary entry given by ⟨label⟩. \Glsentrysymbol
@@ -16220,7 +16276,7 @@ makes the first letter upper case. The first form is expandable (unless the valu
contains unexpandable commands). The second form is not expandable. Neither checks for
the existence of ⟨label⟩.
-
+
This command doesn’t display anything. It merely fetches the value associated with the given
field (where the available field names are listed in table 4.1) and stores the result in the
@@ -16245,15 +16301,15 @@ class="cmtt-10">\tmp
-
+
+
This is like \glsentrysymbol{⟨label⟩} but also checks for the existence of ⟨label⟩. This command
is not expandable. It’s used in some of the predefined glossary styles to display the
symbol.
-
+
This is like \glossentrysymbol but converts the first letter to upper case. This command is
not expandable.
-
-
+
+
These commands display the plural symbol for the glossary entry given by ⟨label⟩.
\Glsentrysymbolplural makes the first letter upper case.
(unless the value of that key contains unexpandable commands). The second form is not
expandable. Neither checks for the existence of ⟨label⟩.
-
-
+
-
+
-
+
- 2.6 Other Options
-
-
-
-
- 2.7 Setting Options After the Package is Loaded
-
-3. Setting Up
-3.1 Option 1
-
-3.2 Options 2 and 3
-
-
-
-
-
-4. Defining Glossary Entries
-
-
-\unskip
-
-
-
-
description={select group of people}
}
sort={elite}
}
}
4.1 Plurals
-
-
female of any bovine animal}}
description={a fully grown female of any bovine animal}}
(plural cows, archaic plural kine)},%
user1={kine}}
4.2 Other Grammatical Constructs
- }%
}
\newword[\edkey={ran},\ingkey={running}]{run}{to move fast using
the legs}
Jane \glsd{play} in the park yesterday.
Peter and Jane \glsd{run} in the park last week.
4.3 Additional Keys
-4.3.1 Document Keys
-
-
{\Glsing}% command analogous to \Glstext
{\GLSing}% command analogous to \GLStext
ing={waddling},%
description={}}
The duck was \glsing{waddle} round the dog.
The dog \glsed{run} away from the duck.
4.3.2 Storage Keys
-
-
{word}% default value if not explicitly set
{\abbrtype}% custom command to access the value if required
\renewcommand*{\acrpluralsuffix}{\glspluralsuffix}%
}
\newacronym[abbrtype=initialism,#1]{#2}{#3}{#4}%
}
\newinitialism{dsp}{DSP}{digital signal processing}
\newinitialism{atm}{ATM}{automated teller machine}
{acronym}% default value if not explicitly set
{\abbrtype}% custom command to access the value if required
description={\the\glslongtok}}%
speed of aircraft, ships, etc}]{radar}{radar}{radio detecting
and ranging}
information signal}]{dsp}{DSP}{digital signal processing}
\newacronym[abbrtype=contraction,#1]{#2}{#3}{#4}%
}
deck}]{focsle}{fo'c's'le}{forecastle}
\glossentrydesc{##1}\glspostdescription\space ##2}%
}
-
-
-
-4.4 Expansion
-
-
-
-
-4.5 Sub-Entries
-4.5.1 Hierarchical Categories
-
\newglossaryentry{romanletter}{name={Roman letters},
description={\nopostdesc}}
description={Euler's constant},
parent=romanletter}
4.5.2 Homographs
-
description={\nopostdesc},
plural={glossaries}}
parent={glossary}}
plural={bravoes},
parent=bravo}
4.6 Loading Entries From a File
-
-
name={html},
description={A mark up language}}
contrived acronym}
\loadglsentries{myacronyms}
\let\acronymtype\orgacronymtype
description={a type of duck}}
description={a dabbling duck where the male has a green head}}
\loadglsentries{terms}
4.7 Moving Entries to Another Glossary
-
-4.8 Drawbacks With Defining Entries in the Document Environment
-4.8.1 Technical Issues
-
character should not be active when using
class="cmti-10">key⟩=⟨value⟩ arguments.
-4.8.2 Good Practice Issues
-5. Number lists
-5.1 Encap Values
-5.2 Locations
-
\tallynum{\expandafter\the\csname c@#1\endcsname}}
\expandafter\tallynum\expandafter{\the\csname c@#1\endcsname}}
-
\expandafter\@samplenum\csname c@#1\endcsname}
\newcommand*{\@samplenum}[1]{\two@digits{#1}}
\newcommand*{\@samplenum}[1]{\textsc{\romannumeral#1}}
-5.3 Range Formations
-
-
-
\glsSetSuffixFF{ff.}
-
-
-
\myhandler{}{page}{emph}{18}%
-
-5.4 Style Hook
-
-
-
}
6. Links to Glossary Entries
-
\chapter{An overview of \texorpdfstring{\gls{perl}}{Perl}}
-6.1 The \gls-Like Commands (First Use Flag Queried)
-
-
-
-
-
description={an example}}
}
description={an example}
}
description={an example}
}
description={another example}
}
}
description={an example}}
sort={sample phrase},
description={an example}}
sort={sample phrase},
description={an example}}
-
-
-
description=sample}
-6.2 The \glstext-Like Commands (First Use Flag Not Queried)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-6.3 Changing the format of the link text
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
description={The length between two points},
symbol={km}}
}
}
\ifglsused{\glslabel}{}{\space
(denoted \glsentrysymbol{\glslabel})}}
symbol={$S$}
}
\ifglsused{\glslabel}{}{\space
(denoted $\glsentrysymbol{\glslabel}$)}}
symbol={S}
}
6.4 Enabling and disabling hyperlinks to glossary entries
-
-
-
\ifglsused{\glslabel}{}{\footnote{\glsentrydesc{\glslabel}}}%
}
}
\fi
}
7. Adding an Entry to the Glossary Without Generating Text
-
-
Lots of text about sets spanning many pages.
\glsadd[format=)]{set}
-
-
}
{support vector machine}% long form
{Statistical pattern recognition technique}% description
8. Cross-Referencing Entries
-
latex filename
see={TaylorsTheorem}}
see=[see also]{TaylorsTheorem}}
}
- 8.1 Customising Cross-reference Text
-
-
-
-
-
\glsadd{FourierSeries}\glsadd{TaylorsTheorem}).
9. Using Glossary Terms Without Links
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-