- •The
glossaries package: a guide for beginners
texdoc glossariesbegin
- •glossaries-extra
and bib2gls: an
introductory guide
texdoc bib2gls-begin
If an example shows the icon 📥🖹 then you can click on that icon to try downloading the example source code from a location relative to this document. You can also try using:
The glossaries package is a flexible package, but it’s also a
heavy-weight package that uses a lot of resources. As package
developer, I’m caught between those users who complain about the
drawbacks of a heavy-weight package with a large user manual and
those users who want more features (which necessarily adds to the
package weight and manual size).
The glossaries-extra package is an attempt to provide
a compromise for this conflict. Version 4.22 of the glossaries
package is the last version to incorporate any major new features.
Future versions of glossaries will mostly just be bug fixes.
New features will instead be added to glossaries-extra.
This means that the base glossaries package won’t increase
in terms of package loading time and allocation of resources, but
those users who do want extra features available will have more of a
chance of getting their feature requests accepted.
The glossaries-extra package internally loads the
glossaries package. As a general rule, it’s better to defer
loading the base glossaries package to glossaries-extra
rather than loading the two packages separately.
I’m not happy with some of the default settings assumed by the
glossaries package, and, judging from code I’ve seen, other
users also seem unhappy with them, as certain package options are
often used in questions posted on various sites. I can’t change the default
behaviour of glossaries as it would break backward
compatibility, but since glossaries-extra is a separate
package, I have decided to implement some of these commonly-used
options by default. You can switch them back if they’re not
appropriate.
The new defaults are:
The examples below illustrate the difference in explicit package
options between glossaries and glossaries-extra. There
may be other differences resulting from modifications to commands
provided by glossaries.
Abbreviations are defined with
Another noticeable change with glossaries-extra is that by
default
This change is mostly likely to be noticed by users with one or more
redundant empty glossaries who ignore transcript messages,
explicitly use makeindex/xindy on just the
non-empty glossary (or glossaries) and use the iterative
If you use makeglossaries, you’ll get the warning message:
If you simply change from glossaries to
glossaries-extra in this document, you’ll find a change in the
resulting PDF if you don’t use makeglossaries and you only
generate the acr file with makeindex.
The transcript file will still contain the message
about the missing gls, but now you’ll also see
information in the actual PDF document. The simplest remedy is to
follow the advice inserted into the document at that point, which is
to add the nomain package option:
The following documents and web pages are also available:
After glossaries-extra has been loaded, some of the glossaries-extra
package options may be changed with:
To change the base glossaries package’s options (that may be
changed after the package has loaded), continue to use:
The title of the new glossary is given by
If the abbreviations option is used and the
acronym option provided by the glossaries
package hasn’t been used, then
Note that there are no analogous options to the glossaries
package’s acronymlists option (or associated commands)
as the abbreviation mechanism is handled differently with
glossaries-extra.
This option also sets the regular attribute to
If glossaries-extra-bib2gls is also loaded then this option
will additionally provide
This option also sets the regular attribute to
If glossaries-extra-bib2gls is also loaded then this option
will additionally provide
As with the base glossaries package, this option redefines
The base package index option also defines:
This option also sets the regular attribute to
If you are using bib2gls, you may prefer to use the
post-description-dot resource option. If you do use that option,
make sure that you have nopostdot=true (or postpunc=none)
to prevent a double-dot.
The postpunc value may either be the required punctuation or
one of the following keywords:
Some options listed in other sections, such as the stylemods
and record options, also load supplementary packages.
If you want to define styles that can interface with the
accessibility support provided by glossaries-accsupp use
the
Note that
If you want to write a custom command that needs to generate a
warning or error for an undefined reference, you can use:
Commands like
With just the base glossaries package,
If all your glossaries occur at the end of the document, consider
using docdef=restricted instead.
This avoids the need for the glsdefs file. You will still need to take
care about any changes made to the category code of characters that are required
by the = mechanism (that is, the comma and
equal sign) and any makeindex or xindy special character that
occurs in the sort key or label. If any of those
characters are made active in the document (for example, through
babel shortcuts), then it can cause problems with the entry definition.
This option will allow
With this option, if an entry appears in the glossary before
it has been defined, an error will occur (or a warning if
the undefaction=warn option is used). If you edit your
document and either remove an entry or change its label, you may
need to delete the document’s temporary files (such as the
aux and gls files).
As with docdef=restricted,
entries may be defined in the preamble or anywhere in the document,
but they may only be referenced after they have been defined.
Entries must be defined before the associated glossary is displayed.
If you need a list of all entry labels for the use of an editor or
helper script you may also want to consider the package options
writeglslabels and writeglslabelnames provided by the
base glossaries package. Note that with these options and
with docdef=atom, only the entry labels that are visible
to LaTeX can be saved. So if you are using bib2gls you will
only get the labels of the entries that have already been selected by
bib2gls. The bib files can be found by parsing the
aux file for
Note that the short and long forms (
Since entries with the alias key are intended as synonyms for another
term, the target is expected to be indexed so entries with the alias
key set aren’t affected by this option.
For example:
Note that this special format
This function is implemented by code added to the end document hook
that determines whether or not to use the command
With the base
glossaries package, the see key was provided as a
shortcut for
The glossaries-extra package modifies the action of the
see key so that it also saves the value and will only
perform the automated
For example, if an entry is defined as
For example, if an entry is defined as
It’s therefore possible with this option to remove the cross-references from the
location lists and set their position within the glossary style.
Another method of preventing the automatic indexing is to
define the entries before the external indexing files have been
opened with
With the record setting on (that is, any value other than
off), then any of the
commands that would typically index the entry (such as
The hybrid method additionally performs the standard indexing action
that’s required for makeindex or xindy to work, but this
can’t be done until bib2gls has created the glstex files
that provide the entry definitions. In general, it’s best to avoid
the hybrid method.
This setting implements undefaction=warn,
autoseeindex=false, indexcrossrefs=false
sort=none, and automatically
loads the supplementary glossaries-extra-bib2gls package.
(There should be no need to explicitly load glossaries-extra-bib2gls.)
This option also defines the location and group
keys that are set by bib2gls to provide the location list
and group information required by the “unsrt” family of commands.
The document build process is (assuming the file is called
myDoc.tex):
See §11.6.6 for further details of this
option.
Note that
This hybrid approach is provided for the rare instances
where an existing xindy rule or module is too complicated to convert to
a bib2gls rule but the entries need to be fetched from a
bib file. There’s no benefit in using this option with makeindex.
This setting does not load glossaries-extra-bib2gls, as
bib2gls is only being used to fetch the entry definitions.
This setting must be used with
You may need to change the transcript file used by bib2gls to
avoid a clash with xindy’s transcript file. This can be done
with bib2gls’s --log-file or -t option.
The document build process is (assuming the file is called
myDoc.tex):
Alternatively, this setting can be implemented with:
This option should only be used once. If used again no new file will
be created. If the records will be
written to the normal aux file.
A document containing many records can result in a large
aux file with information that’s only relevant to
bib2gls. This option will create a new file called
.aux that will be used to store the
records. The file will be skipped by LaTeX but will be picked up
by bib2gls v3.0+ when it inputs the main aux file. Note that
this creates an extra write register.
Remember that within floats it’s the
This option works by incrementing wrglossary with
This uses
If the indexcounter option has been used, this setting will
also mark where the wrglossary counter has been incremented.
The marker is produced with the command:
If there are many targets within a single paragraph this can lead to
“too many floats”, so glossaries-extra provides a new
package option showtargets that can be used to easily switch
to inline annotations for outer mode (rather than having to redefine
The base glossaries package provides commands, such as
The glossaries user manual warns against using commands such
as
The glossaries-extra package provides a starred form:
Additionally, the symbols package option provides
In addition to the glossary entry keys provided by the base glossaries
package (summarised in §II) the
glossaries-extra package provides:
If you use bib2gls (see §11) then most of
the glossary entry keys can be used as analogous fields in the bib
file. For example, instead of writing the following code in your
tex file:
There are, however, some keys that are considered
internal fields by bib2gls,
in that they are defined as keys by
glossaries-extra and may be assigned in the glstex
file that’s input by
For example, the sort key (which is recommended with
xindy where the name contains symbols) should not be
used in the bib file. Instead, use the
sort-field resource option or the system of sort
fallbacks to choose the most appropriate field to obtain the sort
value (see Gallery: Sorting). The
group and location keys are also considered
internal fields and are only applicable
with the “unsrt” family of commands.
With the “unsrt” family of commands, if the location field isn’t set,
then it will try the loclist field instead, using the same
method as
The base glossaries package provides
Some languages, such as English, have a general rule that plurals
are formed from the singular with a suffix appended. This isn’t
an absolute rule. There are plenty of exceptions (for example,
geese, children, churches, elves, fairies, sheep). The
glossaries package allows the plural key to be
optional when defining entries. In some cases a plural may not make
any sense (for example, the term is a symbol) and in some cases
the plural may be identical to the singular.
To make life easier for languages where the majority of plurals can
simply be formed by appending a suffix to the singular, the
glossaries package lets the plural field default
to the value of the text field with
For languages that don’t have this general rule, the plural
field will always need to be supplied, where needed.
There are other plural fields, such as firstplural,
longplural and shortplural. Again, if you are using
a language that doesn’t have a simple suffix rule, you’ll have to
supply the plural forms if you need them (and if a plural makes
sense in the context).
If these fields are omitted, the glossaries package follows
these rules:
The last case is changed with glossaries-extra.
With this extension package, the shortplural field
defaults to the short field with
An entry can be made an alias of another entry using the
alias key. The value should be the label of the other
term. There’s no check for the other’s existence when the aliased
entry is defined. This is to allow the possibility of defining the
other entry after the aliased entry. (For example, when used with
bib2gls.)
If an entry
Note that with record=only, the location list
for aliased entries is controlled with bib2gls’s settings.
The value of the alias field can be accessed with
See §5.11 for accessing field values and
§5.15 for testing field values.
Some of these commands are subtly different from each other. For
example,
The commands described in this section don’t require the field to
have an associated glossary entry key, so you need to be
careful not to misspell the field labels.
With bib2gls, entries aren’t defined on the first LaTeX run.
This means that commands that test for existence will produce a
warning and (within the document environment) the
This command is written to the glstex file by bib2gls to
set fields that don’t have a corresponding key.
The acronym mechanism implemented by the base glossaries
package is insufficiently flexible for some documents. The
glossaries-extra package provides a completely different
mechanism to deal with abbreviations in a more flexible manner. The
two methods are incompatible. However, the glossaries-extra
package provides predefined styles that emulate the appearance
of the styles provided by the base package. If you have previously
used just the base glossaries package, consult
Table 4.2 for the closest matching abbreviation
style.
Abbreviations are defined using:
This command internally uses
The following example document sets up three different abbreviation
styles: long-short-sc for the abbreviation
category, long-only-short-only for the custom
If the category doesn’t have an associated style, the style for the
abbreviation category will be used, as with the
There are two categories that have an abbreviation style set by
default: abbreviation and acronym. These are initialised
as follows:
To make it easier to migrate a file containing entries defined with
If you have defined any acronym styles with
Terms defined with
The short and long keys (so don’t use those keys in
), but the short and long values may first be modified by
category attributes, such as markwords or
markshortwords. As with other entries, avoid nested links
(see §5.4). This means avoid using the
The longplural key defaults to
The short plural suffix
Some styles, such as the long-short-sc style, redefine
The name key is set according to the abbreviation style.
There should not be any need to explicitly set it.
Some styles require the description key to be set in
, but other styles will set the description
to the long form.
Abbreviations can be assigned to a particular glossary using
the type key in . The default for
The default type for
The following are general purpose hooks used within
In the above example, all entries are placed in the main (default)
glossary. The package options abbreviations and acronyms
can be used to split them off into separate glossaries.
If you use bib2gls, the analogous bib entry types are
Since
In general it’s best not to use
If you never want the short form with
In Example 4, compare the first section heading (which
references an abbreviation with
As with the base glossaries package, the unformatted short and long forms
can be obtained with
Each abbreviation style has a display full form, which is the
format produced with the first use of
In Example 5, the first use of
The following commands are included in the set of
To restore the original behaviour, redefine this command as follows:
If you are using the glossaries-prefix package (which can
be loaded via the prefix package option), then there are
commands similar to
The abbreviation shortcut commands can be enabled using
the shortcuts=abbreviations package option (or
shortcuts=abbr or shortcuts=ac).
The provided shortcut commands are listed in
Table 4.1. Note that
Initial tagging allows you to highlight the initials that form the
abbreviation when the long form is shown in the glossary.
This command (robustly) defines tagging attribute set to “true”. For those
cases it will use:
The control sequence
The first argument of
The style for a particular category is set using:
The style associated with the abbreviation category will be
used if an abbreviation is defined with a category that doesn’t have
an associated style.
Once you have defined an abbreviation with a given category, you
can’t subsequently change the style for that category. You can’t
have more than one style per category. The default style for the
abbreviation category is long-short and the
default style for the acronym category is
short-nolong.
There are two types of abbreviation styles: those that treat the
abbreviation as a regular entry (so that
The regular entry abbreviation styles set the regular
attribute to
The non-regular abbreviation styles don’t set the regular
attribute, unless it has already been set, in which case it will be
changed to
In both cases, the first use of
The short and long fields are set as appropriate
and may be accessed through commands like
The sample file
sample-abbr-styles.pdf
demonstrates all predefined styles described here.
The predefined styles have helper commands to make it easier to modify
the format. These are described in §4.5.1.3.
Table 4.2 lists the nearest equivalent
glossaries-extra abbreviation styles for
the predefined acronym styles provided by glossaries, but
note that the new styles use different formatting commands.
The example documents used to illustrate the predefined styles in
the sub-sections below are all in the form (document class and
options may vary):
The naming scheme for abbreviation styles is as follows:
This is for the parenthetical styles. The
If
If the
The modifier
The modifier
If the
Examples:
Some styles set the regular attribute. In some cases,
there’s a version of the style that doesn’t set this attribute.
For example, long-em-noshort-em sets the
regular attribute. The
long-em-noshort-em-noreg style is a minor variation
of that style that sets the attribute to
There are a few “noshort” styles, such as
long-hyphen-noshort-noreg, where there isn’t a
corresponding regular version. This is because the
style won’t work properly with the regular attribute set, but the
naming scheme is maintained for consistency with the other
“noshort” styles.
The display style uses
If
Examples:
Like description key must be provided
when defining abbreviations with this style.
Examples:
Not all combinations that fit the above syntax are provided.
Pre-version 1.04 styles that didn’t fit this naming scheme are either
provided with a synonym (where the former name wasn’t ambiguous) or
provided with a deprecated synonym (where the former name was
confusing).
The following abbreviation styles set the regular
attribute to
These styles only show the
short form on both first use and subsequent use.
See §4.5.1.3.1 and
§4.5.1.3.5 for style commands.
The long form is formatted with
The short form is formatted with
The name is set to the short form (
The name is set to the short form followed by the long form in
parentheses (
These styles only show the long
form on both first use and subsequent use. See
§4.5.1.3.1 and
§4.5.1.3.6 for style commands.
The long form is formatted with
The short form is formatted with
The name is set to the long form (
The following abbreviation styles will set the
regular attribute to
The non-regular styles are too complicated to use
These styles show the
long form followed by the short form in parentheses on
first use. On subsequent use only the short form is shown.
See §4.5.1.3.1 and §4.5.1.3.2
for style commands.
The long form is formatted with
The short form is formatted with
The name is set to the short form (
The name and sort are set to the long form followed by the short form in
parentheses (
These styles are like the
long (short) styles in §4.5.1.2.1
but additional content can be supplied in the field identified by
These styles use the commands
If you need to change the font, you can redefine the associated
commands (listed above). However, since small caps are awkward
because the short plural suffix needs to counteract the
small caps, small caps versions are provided.
If you need to use
If you need to use
If you need to use
These styles show the
short form followed by the long form in parentheses on
first use. On subsequent use only the short form is shown.
See §4.5.1.3.1 and §4.5.1.3.2
for style commands.
The first use
and subsequent use of the
The long form is formatted with
The short form is formatted with
The name is set to the short form (
The name is set to the short form followed by the long form in
parentheses (
These styles are like the
short (long) styles in
§4.5.1.2.3
but additional content can be supplied in the field identified by
These styles use the commands
The description is obtained from
If you need to use
The description is obtained from
If you need to use
These styles test
if the inserted material start with a hyphen. See
§4.5.1.3.1, §4.5.1.3.2
and §4.5.1.3.7 for style commands.
Note that
Note that the inline full form (
Note that as with the
long-hyphen-postshort-hyphen style, the insert isn’t
included in the post-link hook by default for the
inline full form. If you want the
insert to show in the post-link hook for the
inline full form you need to redefine
Note that as with the long-hyphen-postshort-hyphen style,
the insert isn’t included in the post-link hook by default for
the inline full form. If you want the insert to show in the
post-link hook for the inline full form you need to redefine
Note that as with the long-hyphen-postshort-hyphen style,
the insert isn’t included in the post-link hook by default for
the inline full form. If you want the insert to show in the
post-link hook for the inline full form you need to redefine
These styles only show the
long form on first use and only show the short form on
subsequent use. The
inline full form is the same as the display full form. See
§4.5.1.3.1, §4.5.1.3.2
and §4.5.1.3.8 for style commands.
The inline full form uses a parenthetical style with the long
form followed by the short form in parentheses.
These styles show the
short form (
The inline full form uses the same
parenthetical style as short-long (
The long form is formatted with
The short form is formatted with
The name is set to the short form (
This style automatically sets the nohyperfirst attribute
to
The name is set to the short form followed by the long form in
parentheses (
These styles only show the
short form on both first use and subsequent use.
See §4.5.1.3.1 and
§4.5.1.3.5 for style commands.
They are essentially identical to the corresponding regular style
listed in §4.5.1.2.8 except that
they change the regular attribute to
These styles only show the
long form on both first use and subsequent use.
See §4.5.1.3.1 and
§4.5.1.3.6 for style commands.
They are essentially identical to the corresponding regular style
listed in §4.5.1.2.9 except that
they change the regular attribute to
These commands are used by the predefined abbreviation styles. These
are considered user commands, which you can redefine to customize
the style.
These commands apply to all styles.
These commands apply to the parenthetical
styles, such as long-short.
These commands apply to the “user”
styles, such as long-short-user.
The inner formatting with both
For example, to emphasize the user value and separate it with a
semi-colon instead of a comma:
If you redefine this command, you will also need to redefine the
following one in a similar manner.
These commands are only used by the footnote styles.
These commands are used by the
“nolong” styles.
These commands are used by the
“noshort” styles.
These are commands used by the “hyphen”
styles. They are designed to work with the markwords
and markshortwords attributes.
These are commands used by the “only”
styles, such as long-only-short-only.
These are commands used by styles that
use a particular font shape or size, identified by one of the
following two-letter tags: “sc” (
These commands should typically not be needed in a document, but are
provided for advanced users. See §4.5.1.3
for commands to adjust the predefined abbreviation styles.
If no abbreviation style has been set for the given category, the
style associated with the abbreviation category is used.
This command is used:
If none of the predefined styles suit your requirements, you can
define your own custom style using:
The second argument sets up the information that’s required when an
abbreviation is defined (which is why the style must be set before
the abbreviations with that style are defined). The relevant
commands for this argument are listed in
§4.5.3.1.
The third argument defines the commands that determine how
the display style (
The style initialisation hooks should be placed in the second
argument (
The following is prepended to
When an entry is defined with
Note that when these hooks (except the last) are used, the entry hasn’t yet been
defined. However, some information will have already been picked up
from the arguments of
The original option list, as supplied to
The original short form, as supplied to
The original long form, as supplied to
For example, the long-short abbreviation style includes
the following in :
For example, the long-hyphen-postshort-hyphen style has:
List of Examples[link]
texdoc -l glossaries-extra-manual-example
where is the example number zero-padded to three digits to find out if the example files are installed on your device.
1. Introduction[link]
1.1. Package Defaults[link]
\printglossary
are redefined while
glossaries is loading). Note that this won’t have any effect if
the glossaries package has already been loaded before you load
the glossaries-extra package.
\newacronym
is
short-nolong. (That is, the long form is not shown on
first use.) To revert back to “ on
( )”first use do:
In the above example, long-short refers to the
glossaries-extra abbreviation style not the glossaries acronym style
of the same name. See §4 for further details.
\setabbreviationstyle
[acronym]{long-short}
1.2. Example Differences Between glossaries and
glossaries-extra[link]
1.2.1. Basic defaults[link]
This is essentially equivalent to:
\documentclass
{article}
\usepackage
{glossaries-extra}
The defaults for glossaries are toc=false and
nopostdot=false but for glossaries-extra the
defaults are toc=true and nopostdot=true.
However, glossaries-extra won’t change the settings if
glossaries has already been loaded. For example:
\documentclass
{article}
\usepackage
[toc,nopostdot]{glossaries}
\usepackage
{glossaries-extra}
This is now like:
\documentclass
{article}
\usepackage
{glossaries}
\usepackage
{glossaries-extra}
In general, it’s best to only load glossaries-extra and allow
it to implicitly load glossaries. This ensures better
integration.
\documentclass
{article}
\usepackage
[toc=false,nopostdot=false]
{glossaries-extra}
1.2.2. Language defaults[link]
This is like:
\documentclass
[british]{article}
\usepackage
{babel}
\usepackage
{glossaries-extra}
By default, the base glossaries package will load translator if
babel is detected, but the glossaries-extra won’t.
Remember that if glossaries has already been loaded before
glossaries-extra then it’s too late to specify the
translate option with glossaries-extra as the
localisation support will have already been established when
glossaries was loaded.
\documentclass
[british]{article}
\usepackage
{babel}
\usepackage
[toc,nopostdot,translate=babel]{glossaries}
\usepackage
{glossaries-extra}
1.2.3. Combined with memoir[link]
This is like:
\documentclass
{memoir}
\usepackage
{glossaries-extra}
However
\documentclass
{memoir}
\usepackage
[toc,nopostdot,noredefwarn]{glossaries}
\usepackage
{glossaries-extra}
This is like:
\documentclass
{memoir}
\usepackage
{glossaries}
\usepackage
{glossaries-extra}
Since by the time glossaries-extra has been loaded,
the base glossaries package has already redefined memoir’s
glossary-related commands.
\documentclass
{memoir}
\usepackage
[toc=false,nopostdot=false]{glossaries}
\usepackage
{glossaries-extra}
1.2.4. Abbreviations[link]
\newabbreviation
:
This is the closest match to:
\usepackage
{glossaries-extra}
\newabbreviation
{svm}{SVM}{support vector machine}
\begin{document}
First use: \gls
{svm}. Explicit full form:
\glsxtrfull
{svm}.
\end{document}
If you want to continue using \usepackage
{glossaries}
\newacronym
{svm}{SVM}{support vector machine}
\begin{document}
First use: \gls
{svm}. Explicit full form:
\acrfull
{svm}.
\end{document}
\newacronym
then you will need to
change the style for the acronym category:
\usepackage
{glossaries-extra}
\setabbreviationstyle
[acronym]{long-short}
\newacronym
{svm}{SVM}{support vector machine}
\begin{document}
First use: \gls
{svm}. Explicit full form:
\glsxtrfull
{svm}.
\end{document}
1.2.5. Glossary Mid-Build Placeholder (
\printglossary
)[link]\printglossary
will now display information text in the
document if the external glossary file doesn’t exist. This is
explanatory text to help new users who can’t work out what to do
next to complete the document build. Once the document is set up
correctly and the external files have been generated, this text will
disappear.
\printglossaries
command instead of \printglossary
. For
example, consider the following:
The above document will only display the list of
acronyms at the place where \documentclass
{article}
\usepackage
[acronym]{glossaries}
\makeglossaries
\newacronym
{laser}{laser}{light amplification by stimulated
emission of radiation}
\begin{document}
\gls
{laser}
\printglossaries
\end{document}
\printglossaries
occurs. However it
will also attempt to input the gls file associated with
the main
glossary.
Warning: File 'test.glo' is empty.
Have you used any entries defined in glossary 'main'?
Remember to use package option 'nomain' if you
don't want to use the main glossary.
(where the original file is called test.tex)
but if you simply call makeindex directly to generate the
acr file (without attempting to create the gls
file) then the transcript file will always contain the message:
No file test.gls.
This doesn’t occur with makeglossaries as it will create
the gls file containing the single command \null
.
\documentclass
{article}
\usepackage
[nomain,acronym,postdot]
{glossaries-extra}
\makeglossaries
\setabbreviationstyle
[acronym]{long-short}
\newacronym
{laser}{laser}{light amplification by stimulated
emission of radiation}
\begin{document}
\gls
{laser}
\printglossaries
\end{document}
\setabbreviationstyle
before \newacronym
.
See §4 for further details.
1.3. Further Reading[link]
texdoc glossaries-extra-code
2. Package Options[link]
you can simply do:
\usepackage
[nonumberlist]{glossaries}
\usepackage
[abbreviations]{glossaries-extra}
\usepackage
[abbreviations,nonumberlist]
{glossaries-extra}
2.1. Glossary Lists[link]
abbreviations
and redefines \glsxtrabbrvtype
to this
label. (The file extensions are glg-abr,
gls-abr and glo-abr.)
In addition, this option defines a shortcut command:
which is equivalent to:
If glossaries-extra-bib2gls is also loaded then this option
will additionally provide \printglossary
[type=\glsxtrabbrvtype
, ]
\printunsrtabbreviations
which uses \printunsrtglossary
instead.
\acronymname
if babel has been loaded. However, if
you’re using babel it’s likely you will need to change this.
(See §15 for further details.)
\abbreviationsname
command won’t be defined (unless it’s
defined by an included language file).
\acronymtype
will be set to \glsxtrabbrvtype
so that acronyms defined with
\newacronym
can be added to the list of abbreviations. If you
want acronyms in the main
glossary and other abbreviations in the
abbreviations
glossary then you will need to redefine
\acronymtype
to main
:
\renewcommand
*{\acronymtype
}{main}
Note that the sort key is set to the
not the as the symbol will likely contain commands.
If this isn’t appropriate, you can override it by using the sort key
in the optional argument.
\newglossaryentry
{ }{name={,
}sort={, }type={symbols},category={symbol},
}
true
for the symbol category and provides the
category post-description hook:
\printunsrtsymbols
which uses \printunsrtglossary
.
Note that the sort key is set to the .
If this isn’t appropriate, you can override it by using the sort key
in the optional argument.
\newglossaryentry
{ }{name={,
}sort={, }type={numbers},category={number},
}
true
for the number category and provides the
category post-description hook:
\printunsrtnumbers
which uses \printunsrtglossary
.
\printacronyms
and creates a new glossary with the label acronym
) but
if glossaries-extra-bib2gls is loaded then this option will
additionally provide \printunsrtacronyms
which uses \printunsrtglossary
.
\acronymtype
to acronym
. Note that this option doesn’t
change \glsxtrabbrvtype
.
\printunsrtindex
which uses \printunsrtglossary
.
\nopostdesc
) but retain \glsxtrpostdescription
so that
the category post-description hook can still be applied.
true
for the index category and defines an associated
category post-description hook:
2.2. Glossary Style Options[link]
\glspostdescription
to determine whether or not to insert a
full stop. The nopostdot option is modified by
glossaries-extra to reduce interference from the
postpunc option (described below).
\glspostdescription
. (Use stylemods to ensure that all the
predefined styles that show the description have this hook added.)
\glspostdescription
to display the
required punctuation. Note that this means the hook will no longer
check for the nopostdot conditional.
\glspostdescription
. (Use stylemods to ensure that all the
predefined styles that show the description have this hook added.)
\glspostdescription
to use a full stop but
also adjusts the space factor. This isn’t exactly the same as
nopostdot=false since it removes the conditional from
\glspostdescription
.
If you are using bib2gls, you may prefer to use the
post-description-dot resource option.
\glspostdescription
to a comma.
\glspostdescription
to do nothing. This isn’t
exactly the same as nopostdot=true since it removes the
conditional from \glspostdescription
.
\glspostdescription
. Extra hooks are also provided to make them
easier to customize.
The value may be one of the following:
This prevents the base glossaries package from loading the
default set of styles, but loads glossaries-extra-stylemods,
glossary-bookindex and glossary-longextra,
and then sets the default style to bookindex.
\usepackage
[nostyles,
stylemods={bookindex,longextra},
style=bookindex]{glossaries-extra}
2.3. Loading Other Packages[link]
\glossariesextrasetup
) as glossaries-extra needs to know
whether or not to provide accessibility support while it’s loading.
\glsaccess
type of commands instead of
\glsentry
(for example, \glsaccesstext
instead of
\glsentrytext
). If glossaries-accsupp hasn’t been loaded
those commands are equivalent (for example, \glsaccesstext
just does \glsentrytext
) but if it has been loaded, then the
\glsaccess
commands will add the accessibility
information. See §9 for further details.
2.4. Entry Definitions, References and Indexing[link]
\forglsentries
and
\glsaddall
.
??
(as with undefined labels or citations). The
unknown marker is produced with:
This defaults to two question marks.
\ifglsused
will only display ??
in the document text with
undefaction=warn if the entry hasn’t been defined, as the
underlying boolean variable doesn’t exist and so is neither true nor
false. (There will also be a warning in the transcript.) You may
prefer to use \GlsXtrIfUnusedOrUndefined
instead. See
§5.10 for further details.
\glsxtrundefaction
will either create an error with the given
and or will create a warning with the given
.
\newglossaryentry
can be used
(preamble-only or anywhere before the first glossary or
anywhere within the document).
\newabbreviation
and \glsxtrnewsymbol
that internally use
\newglossaryentry
are also governed by this option. Other
commands, such as \longnewglossaryentry
are always preamble-only.
\newglossaryentry
is allowed in
the document environment as long as you haven’t used
\makenoidxglossaries
. There are, however, problems that can
occur when entries are defined within the document environment
(see the glossaries documentation for further details).
To encourage preamble-only use, the glossaries-extra package
prohibits the use of \newglossaryentry
within the
document environment by default, but if you really want this
you can use this package option to allow it.
\longnewglossaryentry
and \newabbreviation
) are
written to the glstex files that are input in the preamble.
\newglossaryentry
within the
document environment. All entries must be defined in the
preamble.
\newglossaryentry
in the document
environment provided \makenoidxglossaries
hasn’t been used (as
per the base glossaries package).
This will create a temporary glsdefs file that contains the
entry definitions so that they can be available on the next LaTeX run at the beginning of the document to allow any glossaries
in the front matter to display correctly.
\newglossaryentry
in the document
environment provided the entry definitions all occur before the first
glossary is displayed.
\newglossaryentry
to be used in the document with
\makenoidxglossaries
, but note that \longnewglossaryentry
remains a preamble-only command.
\glsxtr@resource
(listed in the src
option or \jobname
.bib if src is
missing).
\glossariesextrasetup
.
\ac
) but use the glossaries-extra
abbreviation commands, such as \glsxtrshort
and
\glsxtrlong
, instead of the analogous base commands, such as
\acrshort
and \acrlong
. See §4.3.2
for further details.
\newglossaryentry
.
\glsxtrnewsymbol
(provided that the symbols
package option is also used).
\glsxtrnewnumber
(provided that the numbers
package option is also used).
\ac
). See the glossaries package
documentation for further details.
\acs
and \acl
) don’t
use \glsxtrshort
and \glsxtrlong
but use the original
\acrshort
and \acrlong
, which aren’t compatible with the
glossaries-extra abbreviation mechanism. The better option is
to use shortcuts=ac.
\newacronym
back to the base
glossaries package’s acronym mechanism. See §4.6
for further details.
Suppose that “marrow” is indexed (so that it appears in the glossary with the
cross-reference to “courgette”) but if courgette isn’t indexed anywhere in
the document (using commands like \newglossaryentry
{courgette}{name={courgette},
description={small vegetable marrow}}
\newglossaryentry
{marrow}{name={marrow},
description={long gourd with green skin},
seealso={courgette}}
\gls
or \glsadd
) then there will be
a broken cross-reference in the marrow location list pointing to courgette,
which doesn’t appear in the glossary. With indexcrossrefs=true,
the courgette entry will be indexed at the end of the document using \glsadd
with
format=glsxtrunusedformat, which corresponds to the command
\glsxtrunusedformat
.
\glsxtrunusedformat
simply does \unskip
and ignores its argument, which creates a blank location.
If any of the cross-referenced entries have been indexed but haven’t been marked
as used (for example, with \glsadd
) then this will cause a spurious comma in the
location list. This is a limitation of the way that makeindex and
xindy work as they are general purpose indexing applications which require
locations. If you have entries with cross-references, you may want to consider
switching to bib2gls instead.
\glsxtraddallcrossrefs
. This command iterates over all entries
in all glossaries, which adds to the overall document build time,
especially if you have defined a large number of entries, so this
defaults to indexcrossrefs=false, but it will be
automatically switched on if you use the see or
seealso keys in any entries. See also §5.9.
\glssee
. For example:
is equivalent to:
\newglossaryentry
{courgette}{name={courgette},
description={small vegetable marrow}}
\newglossaryentry
{zucchini}{name={zucchini},
description={},
see={courgette}}
This was designed for documents where only entries that are actually
used in the document are defined and ensures that the
cross-reference is included in the glossary, even though it may not
be referenced anywhere in the document. However, it becomes
problematic if neither entry is required in the document.
\newglossaryentry
{courgette}{name={courgette},
description={small vegetable marrow}}
\newglossaryentry
{zucchini}{name={zucchini},
description={}}
\glssee
{zucchini}{courgette}
\glssee
if
autoseeindex=true. Similarly for the seealso key.
\glssee
for the see
key (as per the base glossaries package) and \glsxtrindexseealso
for the seealso key.
then, with autoseeindex=true and the default
indexcrossrefs setting, this is equivalent to
\newglossaryentry
{foo}{name={foo},
description={},see={bar,baz}}
\newglossaryentry
{foo}{name={foo},description={}}
\glssee
{foo}{bar,baz}
\glossariesextrasetup
{indexcrossrefs=true}
\GlsXtrSetField
{foo}{see}{bar,baz}
\glsxtrusesee
and \glsxtruseseealso
) but
the cross-reference won’t be automatically indexed.
then, with autoseeindex=false and the default
indexcrossrefs setting, this is equivalent to
\newglossaryentry
{foo}{name={foo},
description={},see={bar,baz}}
\newglossaryentry
{foo}{name={foo},
description={}}
\GlsXtrSetField
{foo}{see}{bar,baz}
\makeglossaries
. Since the appropriate file isn’t
open, the information can’t be written to it. This will need
the package option seenoindex=ignore to prevent an error occurring.
\GlsXtrLoadResources
or \glsbibdata
.
\gls
,
\glstext
or \glsadd
) will add a record to
the aux file. bib2gls can then read this information to
find out which entries have been used. (Remember that commands like
\glsentryname
don’t index, so any use of these commands won’t
add a corresponding record.) See §11 for further details.
\makeglossaries
or \makenoidxglossaries
.
This setting implements undefaction=error.
\makeglossaries
nor \makenoidxglossaries
is permitted.
Use \GlsXtrLoadResources
(or \glsbibdata
)
to set up bib2gls resource options. Glossaries should be
displayed with the “unsrt” family of commands, such as \printunsrtglossary
.
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
If you want letter groups you will need the --group
or -g switch when invoking bib2gls:
pdflatex myDoc
bib2gls -g myDoc
pdflatex myDoc
\glssee
. (bib2gls deals with the
see field.) You may explicitly use \glssee
in the
document, but bib2gls will ignore the cross-reference if the
see field was already set for that entry.
\@currentlabel
and \@currentHref
. This means that the title can be included in
the entry locations, if available. This setting also supports
location hypertargets that don’t follow a simple
format,
which can’t be used with other indexing options.
\@currentHref
is always globally updated whenever
\refstepcounter
is used, but \@currentlabel
isn’t. This can
cause some undesired side-effects with some settings. Remember also
that the indexcounter option increments the associated
counter every time an entry is indexed, which affects this option.
If the location counter is the default page, only the
location number is shown.
\printglossary
). Note that this requires a slower and more
complicated build process (see below).
\makeglossaries
but not with
its optional argument.
Each glossary should be displayed using \printglossary
(or
\printglossaries
for all of them).
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
Note that, in this case, it’s redundant to call bib2gls with the
--group or -g switch as xindy
will insert the group heading information into the corresponding
glossary file.
\glslink
option.
\glslink
option.
\caption
command that actually uses
\refstepcounter
, so indexing before the caption will result in
the wrong reference. The commands for use in captions and sections,
such as \glsfmttext
and \glsfmtshort
, don’t index. (See
§5.3). You may
want to consider using \glsadd
after the caption (not before). For example:
\begin{figure}
[htbp]
\centering
\includegraphics
{example-image}
\caption
{Sample \glsfmttext
{foobar} figure}
\glsadd
{foobar}
\end{figure}
\refstepcounter
and adding \label
. This can cause a problem if the
indexing occurs in an equation environment as amsmath
forbids multiple occurrences of \label
(resulting in the
“Multiple \label
’s” error). It’s best to change the counter
to page or equation when in maths mode with this option.
For example:
\renewcommand
{\glslinkpresetkeys
}{%
\ifmmode
\setupglslink
{counter=page}\fi
}
\renewcommand
{\glsaddpresetkeys
}{%
\ifmmode
\setupglsadd
{counter=page}\fi
}
2.5. Debugging[link]
??
marker.
\documentclass
{article}
\usepackage
[debug]
{glossaries-extra}
\begin{document}
\gls
{example}
\end{document}
\glsshowtargetfonttext
for the annotation, which is
provided by the base glossaries package.
\glsxtrwrglossarylocfmt
.
\gls
, \glslink
,
\glstarget
or \glshypernumber
). The default is to
use marginal notes in TeX’s “outer” mode and inline annotations
for “inner” or maths modes. This uses \glsshowtargetinner
for inner and maths annotations and \glsshowtargetouter
for the
outer annotation.
\glsshowtargetouter
).
\glsshowtargetouter
to match debug=showtargets.
\glsshowtargetinner
to match debug=showtargets.
3. Defining Entries[link]
\newglossaryentry
, to define entries. The
glossaries-extra package provides some additional commands,
described in §3.1. For abbreviations, see
§4. If you use bib2gls, it will
write command definitions within the glstex file. See the
bib2gls user manual for further information about those
commands.
\gls
within field values. However, if you really need
this, the glossaries-extra package provides \glsxtrp
(see
§5.4). Alternatively, you may want to consider
multi (compound) entries instead (see §7).
3.1. Command Definitions[link]
\leavevmode
\unskip
\nopostdesc
at the end of the
description. The glossaries-extra package replaces this with a
single command:
which has the same effect, but can be redefined if required.
\glsxtrnewsymbol
, and the numbers package option provides
\glsxtrnewnumber
. See §2.1 for further
details.
3.2. Glossary Entry Keys[link]
\seealsoname
. The value should be a
comma-separated list of entry labels. As with the see key, this key
automatically indexes the cross-reference by default. The cross-reference will
be displayed in the location list using
\glsxtruseseealsoformat
(see §5.9).
Use autoseeindex=false to prevent the automatic
indexing. (With bib2gls, adjust the selection criteria.)
\glsxtrindexseealso
or \glssee
.
\gls
. Whenever the entry is indexed with
commands like \gls
, the indexing will be performed on the
target entry (the alias value). See §5.9
for further details.
You would write the following in a bib file:
\newglossaryentry
{duck}{name={duck},
description={a waterbird with webbed feet}}
\newabbreviation
{svm}{SVM}{support vector machine}
@entry
{duck,
name={duck},
description={a waterbird with webbed feet}
}
@abbreviation
{svm,
short={SVM},
long={support vector machine},
}
\GlsXtrLoadResources
, but
they should not be used in the bib files.
\glsxtrsetgrouptitle
. You will need to
invoke bib2gls with the --group (or -g) switch
to ensure that this key is set, when required.
\printnoidxglossary
.
\printnoidxglossary
to display the locations. If you
don’t want locations with bib2gls, either use
nonumberlist or use the
save-locations=false resource option.
\glsaddkey
and
\glsaddstoragekey
to allow custom keys to be defined. The
glossaries-extra package additionally provides:
\glsaddstoragekey
but does nothing if the key has
already been defined. As with \glsaddstoragekey
, the starred
version switches on field expansion for the given key (provided
that it hasn’t already been defined).
3.3. Plurals[link]
\glspluralsuffix
appended. This command is defined to be just the letter “s”.
This means that the majority of terms don’t need to have the
plural supplied as well, and you only need to use it for the
exceptions.
\glspluralsuffix
is appended to the first field, if that field has been
supplied. If the first field hasn’t been supplied but the
plural field has been supplied, then the firstplural
field defaults to the plural field. If the plural
field hasn’t been supplied, then both the plural and
firstplural fields default to the text field (or
name, if no text field) with \glspluralsuffix
appended.
\glspluralsuffix
is appended to the long field, if the
long field has been supplied.
\acrpluralsuffix
is appended to the short field.
\abbrvpluralsuffix
appended unless overridden by category attributes. This
suffix command is set by the abbreviation styles. This means that
every time an abbreviation style is implemented,
\abbrvpluralsuffix
is redefined, see §4.1.2
for further details.
3.4. Entry Aliases[link]
.
\glsxtralias
{ }
\glssee
{ }{ }
will link to ’s target. (Unless
the targeturl attribute has been set for ’s
category.)
\gls
{ }\gls
or
\glstext
. This prevents from having a
location list (aside from the cross-reference added with
\glssee
) unless it’s been explicitly indexed with \glsadd
or
if the indexing has been explicitly set using
noindex=false.
See §5.9.3 for adjusting the indexing hook.
\glsxtralias
(see §5.9.2).
3.5. Setting or Updating Fields[link]
\glsfielddef
(provided by the base glossaries
package), \glsxtrdeffield
and \GlsXtrSetField
all assign a
value to a field, but \glsfielddef
requires that both the entry
and the field exists (so it can’t be used to set an unknown internal field),
\GlsXtrSetField
requires that the entry
exists (so it can be used to set an internal field that doesn’t have
an associated key provided that the entry has been defined), and
\glsxtrdeffield
doesn’t perform any existence checks (which
means that it can be used to assign internal fields before the entry
is actually defined).
\newglossaryentry
, the plural key will automatically
be set as well, but if you change the value of the text
field after the entry has been defined, the plural field
won’t be changed. Particular care is required if the field
contributes in some way to the indexing information, as this
information is typically initialised when the entry is first
defined. This includes the sort and parent keys,
which should not be changed after the entry has been defined.
??
unknown marker. For example:
On the first LaTeX run, this produces:
At this point the \documentclass
{article}
\usepackage
[record]{glossaries-extra}
\GlsXtrLoadResources
[src={myentries},selection=all]
\begin{document}
Defining info
\glsxtrdeffield
{sample}{info}{some information}.
Defining note
\GlsXtrSetField
{sample}{note}{some note}.
Info: \glsxtrusefield
{sample}{info}.
Note: \glsxtrusefield
{sample}{note}.
\end{document}
sample
entry hasn’t been defined, so
referencing it in \GlsXtrSetField
results in a warning and the
double question mark ??
unknown marker in the text.
The field (note
) isn’t saved,
so nothing is shown when the field is referenced with
\glsxtrusefield
. Whereas \glsxtrdeffield
does save the
field with the label info
associated with the label
sample
, even though the sample
entry hasn’t actually
been defined. The field can then be later obtained with
\glsxtrusefield
. Once bib2gls has been run, the
sample
entry should now have its definition in the
glstex file, which is loaded by \GlsXtrLoadResources
and
the note
field can be set.
\csdef
command to locally set the field
given by its internal label
to for the entry identified by
. No existence check is performed.
\glsxtrdeffield
but (protected) fully expands the
value before assigning it to the field.
\glsxtrdeffield
otherwise it will append a comma
followed by (unexpanded) to the field value. No
existence check is performed. This field can be iterated over using
\glsxtrforcsvfield
or formatted using \glsxtrfieldformatcsvlist
.
See §5.13 for further details.
\listcsadd
. The field value can later be
iterated over using \glsxtrfielddolistloop
or
\glsxtrfieldforlistloop
.
\listcsgadd
to make a global change.
\listcseadd
to expand the value.
\listcsxadd
to make a global change.
\GlsXtrSetField
, \gGlsXtrSetField
,
\xGlsXtrSetField
, \eGlsXtrSetField
,
\GlsXtrLetField
, \csGlsXtrLetField
and
\GlsXtrLetFieldToField
to produce an error (or warning with
undefaction=warn) if the entry doesn’t exist. This
can be redefined to add extra checks (for example, to prohibit
changing certain fields).
\csdef
command to locally set the field
given by its internal label
to for the entry identified by
.
\GlsXtrSetField
but uses a global assignment.
\GlsXtrSetField
but (protected) fully expands the
value first.
\eGlsXtrSetField
but uses a global assignment.
\cslet
command to locally set the field
given by its internal label
to for the entry identified by
.
\csletcs
command to locally set the
field given by its internal label
to the control sequence given by
for the entry identified by .
4. Abbreviations[link]
4.1. Defining Abbreviations[link]
\gls
), is the short form (the abbreviation) and
is the long form (what the abbreviation is short for).
The optional argument may be used to set additional
keys (as per the options list in \newglossaryentry
), such as
type or category.
\newglossaryentry
and sets the
type to \glsxtrabbrvtype
and the
category to abbreviation. The category (see
§10) determines the abbreviation style.
The style for a particular category is set using
\setabbreviationstyle
. If the optional argument is omitted, the
abbreviation category is assumed (see §4.5 for
further details).
genus
category, and short-nolong for the custom
common
category. Note that the custom title
category
doesn’t have an associated style.
\setabbreviationstyle
{long-short-sc}
\setabbreviationstyle
[genus]{long-only-short-only}
\setabbreviationstyle
[common]{short-nolong}
\newabbreviation
{xml}{xml}{extensible markup language}
\newabbreviation
[category={genus}]{clostridium}{C.}{Clostridium}
\newabbreviation
[category={genus}]{myristica}{M.}{Myristica}
\newabbreviation
[category={common}]{html}{HTML}{hypertext markup language}
\newabbreviation
[category={title}]{dr}{Dr}{Doctor}
\begin{document}
First use: \gls
{xml}, \gls
{clostridium},
\gls
{myristica}, \gls
{html}, \gls
{dr}.
Next use: \gls
{xml}, \gls
{clostridium},
\gls
{myristica}, \gls
{html}, \gls
{dr}.
\end{document}
dr
entry
above, which uses the long-short-sc style because no
style has been associated with its custom title
category.
This means that abbreviations defined with the default
abbreviation category will show the long form followed by the
short form in parentheses on first use, and those defined with the
category set to acronym will only show the short
form (that is, the long form won’t be shown on first use).
\setabbreviationstyle
{long-short}
\setabbreviationstyle
[acronym]{short}
\newacronym
, the glossaries-extra package redefines
\newacronym
to do:
Note that this sets the category to acronym, which
means that any abbreviations defined with \newabbreviation
[type=\acronymtype
,category=acronym, ]
{ }{ }{ }
\newacronym
will use
the short style by default. If you want to use a
different style, you need to set the abbreviation style for the
acronym category. For example, to use the
long-short style:
This must be placed before the first instance of \setabbreviationstyle
[acronym]{long-short}
\newacronym
.
\newacronymstyle
, you will have to migrate them over to
\newabbreviationstyle
. However, most of the predefined
abbreviation styles are flexible enough to adapt to common
abbreviation formats. It is possible to revert \newacronym
back
to using the base glossaries package’s acronym mechanism
(§4.6), but it should generally not be
necessary.
\newabbreviation
(and \newacronym
) can
be referenced in the main document text using commands like \gls
.
(If you want to use shortcut commands like \ac
, use the
shortcuts=ac package option.)
Remember that you can use the prereset and
preunset options to reset or unset the first use flag
(see §5.10). Alternatively, you can use the
commands described in §4.3. For headings
and captions, see §5.3.2.
\glsfirst
, \glsfirstplural
, \glstext
and
\glsplural
with abbreviations. Many of the abbreviation styles
are too complex to work with these commands (particularly the
case-changing variants or with the final optional
argument or with innertextformat). Instead, use commands
like \gls
, \glsxtrshort
, \glsxtrlong
and \glsxtrfull
.
4.1.1. Abbreviation Fields: long and short[link]
\gls
-like and \glstext
-like commands within and
.
4.1.2. Abbreviation Fields: longplural and shortplural[link]
\glspluralsuffix
and the shortplural key
defaults to \abbrvpluralsuffix
. The
aposplural attribute will instead set the
shortplural to
and the 'noshortplural attribute will set
shortplural to just (see
§10). If these values are not appropriate,
you will need to explicitly set the longplural and
shortplural keys in .
\abbrvpluralsuffix
\abbrvpluralsuffix
is redefined by the
abbreviation style. Some styles, such as the long-short style,
simply redefine \abbrvpluralsuffix
to just:
\glspluralsuffix
.
\abbrvpluralsuffix
to include code to counteract the formatting
of the abbreviation.
\glsxtrabbrvpluralsuffix
not \abbrvpluralsuffix
.
If you don’t want the suffix added, then set the
noshortplural attribute to true
.
4.1.3. Abbreviation Fields: name and description[link]
4.1.4. Abbreviation Fields: type[link]
\newabbreviation
is:
\glsdefaulttype
(the default glossary),
but the abbreviations package option will redefine it to
abbreviations
.
\newacronym
is:
\glsdefaulttype
,
but the acronyms package option will redefine it to
acronym
.
4.1.5. General Hooks[link]
\newabbreviation
. Note that there are additional hooks that are
used by the abbreviation styles (see §4.5.3.1).
\glsxtrorgshort
.
4.2. Examples: makeindex vs
bib2gls[link]
Note that the long form of NASA isn’t displayed on the
first use of \documentclass
{article}
\usepackage
{glossaries-extra}
\makeglossaries
\newglossaryentry
{sample}{name={sample},
description={an example}}
\newabbreviation
{xml}{XML}{extensible markup language}
\newacronym
{nasa}{NASA}{National Aeronautics and Space Administration}
\begin{document}
First use: \gls
{sample}, \gls
{xml} and \gls
{nasa}.
Next use: \gls
{sample}, \gls
{xml} and \gls
{nasa}.
\printglossaries
\end{document}
. This is because the
acronym category uses the short style by default.
\gls
{nasa}@abbreviation
and @acronym
.
\documentclass
{article}
\begin{filecontents*}
{\jobname
.bib}
@entry
{sample,
name={sample},
description={an example}
}
@abbreviation
{xml,
short={XML},
long={extensible markup language}
}
@acronym
{nasa,
short={NASA},
long={National Aeronautics and
Space Administration}
}
\end{filecontents*}
\usepackage
[record]{glossaries-extra}
\GlsXtrLoadResources
\begin{document}
First use: \gls
{sample}, \gls
{xml} and \gls
{nasa}.
Next use: \gls
{sample}, \gls
{xml} and \gls
{nasa}.
\printunsrtglossaries
\end{document}
4.3. Referencing (Using) Abbreviations[link]
\newabbreviation
internally uses \newglossaryentry
,
you can reference abbreviations with the \gls
-like commands as with other entries.
Remember that you can use the prereset and
preunset options to reset or unset the first use flag
(see §5.10).
\glsfirst
,
\glsfirstplural
, \glstext
, \glsplural
or their
case-changing variants as many of the abbreviation styles are too
complicated for those commands. If you specifically want the full
form, use \gls
with prereset or use \glsxtrfull
.
If you specifically want the short form for a particular instance, use \gls
with
preunset or use \glsxtrshort
. If you only want the
long form for a particular instance, use \glsxtrlong
.
\gls
, use one of the “noshort”
styles, such as long-noshort. If you never want the long
form with \gls
, use one of the “nolong” styles, such as
short-nolong.
\glsfmtshort
and \glsfmtlong
(see
§5.3.2). Commands like \glsentryname
are likely to contain non-expandable content.
\usepackage
[colorlinks]{hyperref}
\usepackage
{glossaries-extra}
\makeglossaries
\newabbreviation
{svm}{SVM}{support vector machine}
\newabbreviation
{html}{HTML}{hypertext markup language}
\begin{document}
\tableofcontents
\section
{Introducing the \glsfmtlong
{svm}}
First use: \gls
{svm}.
Next use: \gls
{svm}.
\section
{Introducing \gls
{html} (incorrect)}
First use (not!): \gls
{html}.
Next use: \gls
{html}.
\glsreset
{html}
\section
{Introducing \glsxtrshort
{html} (incorrect)}
First use: \gls
{html}.
Next use: \gls
{html}.
\glsreset
{html}
\section
{Introducing \glsfmtshort
{html}}
First use: \gls
{html}.
Next use: \gls
{html}.
\printglossaries
\end{document}
\glsfmtlong
) with the second
section heading (which references an abbreviation with \gls
).
Note that the first use of the html
entry actually
occurs in the table of contents, which results in the full form
showing in the table of contents, but only the abbreviation is
shown in the actual section 2 heading. The PDF bookmark shows the entry label
(html
) not the abbreviation (HTML).
There is also a nested link for section 2 in the table of contents.
In some PDF viewers (such as Okular), this will lead to section 2
but, in others (such as Evince), it will lead to the HTML entry
target in the glossary. Similarly for section 3.
\glsentryshort
and \glsentrylong
or,
for the plural forms, \glsentryshortpl
and
\glsentrylongpl
. These are analogous to commands like
\glsentrytext
and may be used in expandable contexts. The
sentence case versions (\Glsentryshort
,
\Glsentrylong
, \Glsentryshort
, and \Glsentrylong
) are all robust
in glossaries v4.49 and lower. As from glossaries v4.50,
they can expand in PDF bookmarks, but outside of PDF bookmarks they
will expand to a robust internal command.
\acrshort
. These aren’t compatible with \newabbreviation
.
\gls
, and an
inline full form, which is the format produced by
\glsxtrfull
. For some styles, such as long-short,
the display and inline forms are identical.
\gls
compared with the inline full form for
the footnote abbreviation style. The
example also uses \glsfirst
to demonstrate that it produces an
undesirable result with the selected abbreviation style.
\setabbreviationstyle
{footnote}
\newabbreviation
{nasa}{NASA}
{National Aeronautics and Space Administration}
\begin{document}
\gls
{nasa}['s] space exploration\ldots
\glsxtrfull
{nasa}['s] space exploration\ldots
\glsfirst
{nasa}['s] space exploration\ldots
\end{document}
\gls
puts the long form in
the footnote but correctly inserts the final optional argument
before the footnote marker. The inline full form (obtained with
\glsxtrfull
) doesn’t use a footnote, but instead shows the long
form in parentheses after the short form. The insert material is
correctly placed after the short form.
Compare this with the final line, which uses \glsfirst
. This
shows the long form in the footnote, but the inserted material can’t
be shifted before the footnote marker, which results in the strange
“NASA²’s”.
\glstext
-like commands. They have the same
options as \glstext
and don’t change the first use flag.
They will index (unless noindex is used), create a
hyperlink (if enabled), and use the post-link hook.
\glsxtrifwasfirstuse
to do its first argument. This is done via
the command:
which is defined as:
This command takes the entry label as the argument, which is
ignored by default.
\newcommand
{\glsxtrsetlongfirstuse
}[1]{%
\let
\glsxtrifwasfirstuse
\@firstoftwo
}
This command is also used by the case-changing and plural variants
listed below.
\renewcommand
{\glsxtrsetlongfirstuse
}[1]{%
\letcs
\glsxtrifwasfirstuse
{@secondoftwo}%
}
\gls
.
\glspl
.
\glsxtrfull
, \glsxtrfullpl
and
the case-changing variations to initialise
\glsxtrifwasfirstuse
in case it’s required in the
post-link hook. The default definition is to simulate
first use. Note that changing this can cause unexpected results
with abbreviation styles that set the post-link hook, such as
short-postlong-user.
\glsxtrfull
, \glsxtrfullpl
and
the case-changing variations to initialise the \glsinsert
placeholder. The default definition is to use
\glsxtrsaveinsert
. If the insert isn’t saved, it can’t be used
within the post-link hook for the \glsxtrfull
etc.
This affects the behaviour of the “post-hyphen” abbreviation
styles, such as long-hyphen-postshort-hyphen.
4.3.1. Prefixes[link]
\glsxtrshort
and \glsxtrlong
that
insert the corresponding prefix and separator at the front if the
short or long form, if the prefix has been set and is non-empty. In all cases, the
separator is \glsprefixsep
, as with \pgls
.
\glsxtrshort
but inserts the prefix field
and separator, if the prefix value is set and non-empty.
\pglsxtrshort
but sentence case. Note the initial
“P” in the command name, which matches \Pgls
(similarly for
the other prefix sentence case commands).
\pglsxtrshort
but all caps.
\glsxtrshortpl
but inserts the prefixplural field
and separator, if the prefixplural value is set and non-empty.
\pglsxtrshortpl
but sentence case.
\pglsxtrshortpl
but all caps.
\glsxtrlong
but inserts the prefixfirst field
and separator, if the prefixfirst value is set and non-empty.
\pglsxtrlong
but sentence case.
\pglsxtrlong
but all caps.
\glsxtrlongpl
but inserts the prefixfirstplural field
and separator, if the prefixfirstplural value is set and non-empty.
\pglsxtrlongpl
but sentence case.
\pglsxtrlongpl
but all caps.
4.3.2. Abbreviation Shortcut Commands[link]
\glsxtrenablerecordcount
will switch the shortcuts that use the
\cgls
-like commands to the corresponding \rgls
-like
command.
Shortcut
Shortcut
Equivalent Command
(shortcuts=abbreviations)
(shortcuts=ac)
\ab
\ac
\cgls
\abp
\acp
\cglspl
\as
\acs
\glsxtrshort
\asp
\acsp
\glsxtrshortpl
\al
\acl
\glsxtrlong
\alp
\aclp
\glsxtrlongpl
\af
\acf
\glsxtrfull
\afp
\acfp
\glsxtrfullpl
\Ab
\Ac
\cgls
\Abp
\Acp
\cglspl
\As
\Acs
\Glsxtrshort
\Asp
\Acsp
\Glsxtrshortpl
\Al
\Acl
\Glsxtrlong
\Alp
\Aclp
\Glsxtrlongpl
\Af
\Acf
\Glsxtrfull
\Afp
\Acfp
\Glsxtrfullpl
\AB
\AC
\cGLS
\ABP
\ACP
\cGLSpl
\AS
\ACS
\GLSxtrshort
\ASP
\ACSP
\GLSxtrshortpl
\AL
\ACL
\GLSxtrlong
\ALP
\ACLP
\GLSxtrlongpl
\AF
\ACF
\GLSxtrfull
\AFP
\ACFP
\GLSxtrfullpl
\newabbr
\newabbr
\newabbreviation
4.4. Tagging Initials[link]
but may be redefined as required.
\underline
{ }\GlsXtrEnableInitialTagging
for safety reasons.
The starred version will overwrite any previous definition
of . As with redefining any commands, ensure that
you don’t redefine something important.
\GlsXtrEnableInitialTagging
is a
comma-separated list of category names. The tagging
attribute will automatically be set to true
for those categories.
You can later set this attribute for other categories (see
§10) but this must be done before the
glossary is displayed.
\itag
is
defined as the tagging command.
The underlining of the tagged letters only occurs in the
glossary and then only for entries with the tagging
attribute set.
\makeglossaries
\GlsXtrEnableInitialTagging
{acronym,abbreviation}{\itag
}
\setabbreviationstyle
[acronym]{short-nolong-desc}
\newacronym
[description={a system for detecting the
location and speed of ships, aircraft, etc, through
the use of radio waves}% description of this term
]
{radar}% identifying label
{radar}% short form
{\itag
{ra}dio \itag
{d}etection \itag
{a}nd
\itag
{r}anging}
\newabbreviation
{xml}{XML}
{e\itag
{x}tensible \itag
{m}arkup \itag
{l}anguage}
\newabbreviation
[category={other}]{tne}{TNE}
{\itag
{t}agging \itag
{n}ot \itag
{e}nabled}
\begin{document}
First use: \gls
{radar}, \gls
{xml}, \gls
{tne}.
Long form only: \glsxtrlong
{radar},
\glsxtrlong
{xml}, \glsxtrlong
{tne}.
\printglossaries
\end{document}
4.5. Abbreviation Styles[link]
\GlsXtrLoadResources
.
\newacronym
sets the category to
acronym so with \newacronym
you need to change the style with:
\setabbreviationstyle
[acronym]{ }
latin
category
which doesn’t have an associated abbreviation style, so it uses the style assigned to
the abbreviation category, not the acronym category.
The only reason that the “radar” abbreviation (defined with
\newacronym
) uses the style associated with the acronym
category is because the default definition of \newacronym
sets
category={acronym}.
\usepackage
[T1]{fontenc}
\usepackage
{glossaries-extra}
\setabbreviationstyle
{long-short-sc}
\newabbreviation
{html}{html}{hypertext markup language}
\setabbreviationstyle
[acronym]{footnote}
\newacronym
{radar}{radar}{radio detection and ranging}
\newacronym
[category={latin}]{ibid}{ibid}{ibidem}
\begin{document}
\gls
{html}, \gls
{radar} and \gls
{ibid}.
\printunsrtglossaries
\end{document}
4.5.1. Predefined Abbreviation Styles[link]
\gls
uses
\glsgenentryfmt
and is encapsulated with
\glsxtrregularfont
) and those that don’t treat the abbreviation
as a regular entry (so that \gls
uses \glsxtrgenabbrvfmt
and is encapsulated with \glsxtrabbreviationfont
). See
§5.5.5 for further details of those commands.
true
for the category assigned to each
abbreviation with that style. This means that on first use,
\gls
uses the value of the first field and on
subsequent use \gls
uses the value of the text field
(and analogously for the plural and case-changing versions).
false
. The first and text
fields (and their plural forms) are set, but they aren’t used by
commands like \gls
, which instead use formatting commands, such
as \glsxtrfullformat
and \glsxtrsubsequentfmt
, which are
defined by the style.
\gls
may not match the
text produced by \glsfirst
(and likewise for the plural
and case-changing versions).
\glsxtrshort
and
\glsxtrlong
. These may appear slightly differently to the way
the short or long form is displayed within \gls
, depending on the
style.
\textsc
, be careful about your
choice of fonts as some only have limited support. For example, you
may not be able to combine bold and small-caps. If you’re using
pdfLaTeX, I recommend that you at least use the fontenc
package with the T1 option or something similar.
\setacronymstyle
{ } Verses New Abbreviation
Styles \setabbreviationstyle
[ ]{ }Base Style Name
New Style Name
long-sc-short
long-short-sc
long-sm-short
long-short-sm
long-sp-short
long-short with
\renewcommand{
\glsxtrfullsep
}{\glsabspace
}short-long
short-long
sc-short-long
short-sc-long
sm-short-long
short-sm-long
long-short-desc
long-short-desc
long-sc-short-desc
long-short-sc-desc
long-sm-short-desc
long-short-sm-desc
long-sp-short-desc
long-short-desc with
\renewcommand{
\glsxtrfullsep
}{\glsabspace
}short-long-desc
short-long-desc
sc-short-long-desc
short-sc-long-desc
sm-short-long-desc
short-sm-long-desc
dua
long-noshort
dua-desc
long-noshort-desc
footnote
short-footnote
footnote-sc
short-sc-footnote
footnote-sm
short-sm-footnote
footnote-desc
short-footnote-desc
footnote-sc-desc
short-sc-footnote-desc
footnote-sm-desc
short-sm-footnote-desc
where is the name of the abbreviation style,
is either “SHRT FM” or (for the small caps
examples) “shrt fm”. The styles that require the
description or user1 key to be set will include that in
otherwise the optional argument of
\documentclass
{article}
\usepackage
[T1]{fontenc}
\usepackage
[colorlinks]{hyperref}
\usepackage
{glossaries-extra}
\setabbreviationstyle
{ }
\newabbreviation
[ ]{ex}{ }{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\newabbreviation
will be omitted.
The examples with a style that requires
\textsmaller
will load relsize.
The “hyphen” styles set the markwords and
markshortwords attributes.
Note that hyperref is loaded with the colorlinks
option, so the hyperlink text will be red.
-
]-
[post] [-
][-user
]
-
parts may
be omitted. These styles display followed by
in parentheses. If or starts
with “no” then that element is omitted from the
display style (no
parenthetical part) but is included in the inline style.
post
is present then is
placed after the link text using the post-link hook.
Note that this will use the singular form of by
default, even if \glspl
is used. The corresponding non-post
style will use the matching form for .
-
part is present and is one of
sc
, sm
or em
, then the field has
a font changing command applied to it.
-only
indicates that field is only present
according to whether or not the entry has been used.
-hyphen
indicates the style will substitute
inter-word spaces (that have been marked up with the
markwords or markshortwords attributes) will be
changed to spaces if the inserted material starts with a hyphen (but
not for the set of \glsxtrshort
and \glsxtrlong
commands).
-user
part is present, then the value of the field
given by \glsxtruserfield
(user1), if set, is inserted into the
parenthetical material.
\gls
) is moved to the post-link hook.
The long form is formatted according to \glslonghyphenfont
(or \glsfirstlonghyphenfont
on first use).
The short form is formatted according to \glsabbrvhyphenfont
(or \glsfirstabbrvhyphenfont
on first use).
-noreg
false
.
-
]-
[post
]footnote
post
is present then the footnote is
placed after the link text using the post-link hook.
The inline style does followed by the other field in
parentheses.
-
is present, has a
font-changing command applied to it.
\footnote
doesn’t work.
-desc
4.5.1.1. Regular Styles[link]
true
for all categories that have abbreviations
defined with any of these styles. This means that they are treated
like ordinary entries and are encapsulated with
\glsxtrregularfont
not \glsxtrabbreviationfont
. The
\gls
-like commands are formatted according to
\glsgenentryfmt
.
4.5.1.1.1. Short Styles[link]
\gls
-like
commands. The inline full form uses the same
parenthetical style as short-long (\glsxtrshortlongformat
).
Font variations are available with short-sc-nolong,
short-sm-nolong and short-em-nolong.
\setabbreviationstyle
{short-nolong}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glslongdefaultfont
for the
\glsxtrlong
set of commands.
\glsfirstabbrvdefaultfont
within the full form and with \glsabbrvdefaultfont
for
subsequent use and for the \glsxtrshort
set of commands.
\glsxtrshortnolongname
) and
the description is set to the unencapsulated long form.
\newabbreviation
.
Font variations are available with short-sc-nolong-desc,
short-sm-nolong-desc and short-em-nolong-desc.
\setabbreviationstyle
{short-nolong-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrshortdescname
), and the sort is set to
just the short form.
\glsxtrlongshortformat
).
Font variations are available with nolong-short-sc,
nolong-short-sm and nolong-short-em.
\setabbreviationstyle
{nolong-short}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-nolong}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-nolong-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{nolong-short-sc}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-nolong}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-nolong-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{nolong-short-sm}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-nolong}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-nolong-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{nolong-short-em}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
4.5.1.1.2. Long Styles[link]
\gls
-like commands
(\glsxtrlongformat
). The inline full form uses the same
parenthetical style as long-short
(\glsxtrlongshortformat
).
Font variations are available with long-noshort-sc-desc,
long-noshort-sm-desc and long-noshort-em-desc.
\setabbreviationstyle
{long-noshort-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsfirstlongdefaultfont
on
first use and \glslongdefaultfont
for subsequent use
and for the \glsxtrlong
set of commands.
\glsfirstabbrvdefaultfont
within the inline full form and with \glsabbrvdefaultfont
for the \glsxtrshort
set of commands.
\glsxtrlongnoshortdescname
) and
the description must be supplied.
\glsxtrlongnoshortname
) and the description is
set to the unencapsulated long form.
\setabbreviationstyle
{long-noshort}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-noshort-sc}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-noshort-sc-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-noshort-sm}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-noshort-sm-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-noshort-em}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-noshort-em-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
,
\glsfirstabbrvemfont
, \glslongemfont
and
\glsfirstlongemfont
(see §4.5.1.3.9).
This emphasizes both the long and short forms.
\setabbreviationstyle
{long-em-noshort-em}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
,
\glsfirstabbrvemfont
, \glslongemfont
and
\glsfirstlongemfont
(see §4.5.1.3.9).
This emphasizes both the long and short forms.
\setabbreviationstyle
{long-em-noshort-em-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
4.5.1.2. Non-Regular Styles[link]
false
if it has previously
been set. If it hasn’t already been set, it’s left unset.
Other attributes may also be set, depending on the style.
\glsgenentryfmt
as the display style (with the
\gls
-like commands). Instead they use \glsxtrgenabbrvfmt
. This
means that these styles won’t work if you provide your own custom
display style (using \defglsentryfmt
) that doesn’t check for
the regular attribute.
\glsfirst
, \glsfirstplural
,
\glstext
and \glsplural
(or their case-changing variants)
with these styles. There are also some styles that can be
problematic with \GLSname
.
4.5.1.2.1. Long (Short) Styles[link]
\gls
-like commands and after the short form on subsequent use.
The inline full form is the same as the display full form
(\glsxtrlongshortformat
).
Font variations are available with long-short-sc,
long-short-sm, long-short-em and
long-em-short-em.
\setabbreviationstyle
{long-short}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsfirstlongdefaultfont
within the full form and with \glslongdefaultfont
for the
\glsxtrlong
set of commands.
\glsfirstabbrvdefaultfont
within the full form and with \glsabbrvdefaultfont
for
subsequent use and for the \glsxtrshort
set of commands.
\glsxtrlongshortname
) and
the description is set to the unencapsulated long form.
\newabbreviation
.
Font variations are available with long-short-sc-desc,
long-short-sm-desc, long-short-em-desc and
long-em-short-em-desc.
\setabbreviationstyle
{long-short-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrlongshortdescname
and
\glsxtrlongshortdescsort
).
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-short-sc}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-short-sc-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-short-sm}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-short-sm-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-short-em}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{long-short-em-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
, \glsfirstlongemfont
and \glslongemfont
(see §4.5.1.3.9).
That is, both the long and short forms are emphasized.
\setabbreviationstyle
{long-em-short-em}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
, \glsfirstlongemfont
and \glslongemfont
(see §4.5.1.3.9).
That is, both the long and short forms are emphasized.
\setabbreviationstyle
{long-em-short-em-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
4.5.1.2.2. Long (Short, User) Styles[link]
\glsxtruserfield
, which will be placed in the parenthetical
content on first use (if set).
The inline full form is the same as the display full form.
\glsxtrusersuffix
,
\glsabbrvuserfont
, \glsfirstabbrvuserfont
,
\glslonguserfont
and \glsfirstlonguserfont
(except where
noted). See §4.5.1.3.1 and
§4.5.1.3.3 for style commands.
\glsuserdescription
, which can be redefined to include the
additional information, if required.
\setabbreviationstyle
{long-short-user}
\newabbreviation
[user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrlongshortuserdescname
.
\setabbreviationstyle
{long-short-user-desc}
\newabbreviation
[description={sample description},
user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\GLSname
with this style, you’ll have to
redefine \glsxtrlongshortuserdescname
so that the field name
doesn’t include the entry label. For example:
\renewcommand
{\glsxtrlongshortuserdescname
}{%
\protect
\glslonguserfont
{\the
\glslongtok
}%
\space
(\protect
\glsabbrvuserfont
{\the
\glsshorttok
})%
}
\glsxtrpostusershortformat
.
\setabbreviationstyle
{long-postshort-user}
\newabbreviation
[user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrlongshortuserdescname
.
\setabbreviationstyle
{long-postshort-user-desc}
\newabbreviation
[description={sample description},
user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\GLSname
with this style, you’ll have to
redefine \glsxtrshortlonguserdescname
so that the field name
doesn’t include the entry label, as for
long-short-user-desc.
\glsxtrscusersuffix
, \glsabbrvscuserfont
and
\glsfirstabbrvscuserfont
.
The name value is obtained from \glsxtrlongshortscusername
.
\setabbreviationstyle
{long-postshort-sc-user}
\newabbreviation
[user1={extra info}]{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrlongshortuserdescname
.
\setabbreviationstyle
{long-postshort-sc-user-desc}
\newabbreviation
[description={sample description},
user1={extra info}]{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\GLSname
with this style, you’ll have to
redefine \glsxtrlongshortscuserdescname
so that the field name
doesn’t include the entry label.
4.5.1.2.3. Short (Long) Styles[link]
\gls
-like commands.
The inline full form is the same as the display full form
(\glsxtrshortlongformat
).
Font variations are available with short-sc-long,
short-sm-long, short-em-long and
short-em-long-em.
\setabbreviationstyle
{short-long}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsfirstlongdefaultfont
within the full form and with \glslongdefaultfont
for the
\glsxtrlong
set of commands.
\glsfirstabbrvdefaultfont
within the full form and with \glsabbrvdefaultfont
for
subsequent use and for the \glsxtrshort
set of commands.
\glsxtrlongshortname
) and
the description is set to the unencapsulated long form.
\newabbreviation
.
Font variations are available with short-sc-long-desc,
short-sm-long-desc, short-em-long-desc and
short-em-long-em-desc.
\setabbreviationstyle
{short-long-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrshortlongdescname
), and the sort is set to
just the short form (\glsxtrshortlongdescsort
).
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-long}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-long-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-long}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-long-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-long}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-long-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
, \glsfirstlongemfont
and \glslongemfont
(see §4.5.1.3.9).
That is, both the long and short forms are emphasized.
\setabbreviationstyle
{short-em-long-em}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
, \glsfirstlongemfont
and \glslongemfont
(see §4.5.1.3.9).
That is, both the long and short forms are emphasized.
\setabbreviationstyle
{short-em-long-em-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
4.5.1.2.4. Short (Long, User) Styles[link]
\glsxtruserfield
, which will be placed in the parenthetical
content on first use (if set).
The inline full form is the same as the display full form.
\glsxtrusersuffix
,
\glsabbrvuserfont
, \glsfirstabbrvuserfont
,
\glslonguserfont
and \glsfirstlonguserfont
(except where
noted). See §4.5.1.3.1 and
§4.5.1.3.3 for style commands.
\glsuserdescription
, which can be redefined to include the
additional information, if required.
\setabbreviationstyle
{short-long-user}
\newabbreviation
[user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrshortlonguserdescname
and the sort value is obtained
from \glsxtrshortlongdescsort
.
\setabbreviationstyle
{short-long-user-desc}
\newabbreviation
[description={sample description},
user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\GLSname
with this style, you’ll have to
redefine \glsxtrshortlonguserdescname
so that the field name
doesn’t include the entry label. For example:
\renewcommand
{\glsxtrlongshortuserdescname
}{%
\protect
\glsabbrvuserfont
{\the
\glsshorttok
}%
\space
(\protect
\glslonguserfont
{\the
\glslongtok
})%
}
\glsuserdescription
, which can be redefined to include the
additional information, if required.
\setabbreviationstyle
{short-postlong-user}
\newabbreviation
[user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrshortlonguserdescname
. The sort value is the short form.
\setabbreviationstyle
{short-postlong-user-desc}
\newabbreviation
[description={sample description},
user1={extra info}]{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\GLSname
with this style, you’ll have to
redefine \glsxtrshortlonguserdescname
so that the field name
doesn’t include the entry label, as for short-long-user-desc.
4.5.1.2.5. Hyphen Styles[link]
\glsxtrshort
and \glsxtrlong
(and their plural
and case-changing variants) don’t perform the inter-word space
substitution. The inline full form is slightly different from
the display full form for the “post” styles.
\glslonghyphenfont
. The name is obtained from
\glsxtrlongshortname
, and the sort value is obtained from
\glsxtrlonghyphenshortsort
. The
inline full form is the same as the display full form.
\setabbreviationstyle
{long-hyphen-short-hyphen}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\setabbreviationstyle
{long-hyphen-postshort-hyphen}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrfull
) doesn’t show
the insert in the post-link hook, but instead places it at the
end of the link text. This is because only the
\gls
-like commands (not the \glstext
-like commands) set the
placeholder \glsinsert
to the supplied insert. If you want the
insert to show in the parenthetical part of the post-link hook for the
inline full form you need to redefine
\glsxtrfullsaveinsert
:
\renewcommand
*{\glsxtrfullsaveinsert
}[2]{%
\def
\glsinsert
{#2}}
\glsxtrlongshortdescname
, and the sort value is
obtained from \glsxtrlongshortdescsort
.
\setabbreviationstyle
{long-hyphen-short-hyphen-desc}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\setabbreviationstyle
{long-hyphen-postshort-hyphen-desc}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrfullsaveinsert
.
\glsxtrlongnoshortdescname
,
and the sort value is obtained from \glsxtrlonghyphennoshortdescsort
.
\setabbreviationstyle
{long-hyphen-noshort-desc-noreg}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrlongnoshortname
,
and the sort value is obtained from \glsxtrlonghyphennoshortsort
.
\setabbreviationstyle
{long-hyphen-noshort-noreg}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glslonghyphenfont
. The name is obtained from
\glsxtrshortlongname
and the sort value is obtained from
\glsxtrshorthyphenlongsort
.
\setabbreviationstyle
{short-hyphen-long-hyphen}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\setabbreviationstyle
{short-hyphen-postlong-hyphen}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrfullsaveinsert
(as described above, for the
long-hyphen-postshort-hyphen style).
\glsxtrshortlongdescname
, and the sort is obtained from
\glsxtrshortlongdescsort
.
\setabbreviationstyle
{short-hyphen-long-hyphen-desc}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\setabbreviationstyle
{short-hyphen-postlong-hyphen-desc}
\glssetcategoryattributes
{abbreviation}
{markwords,markshortwords}{true}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrfullsaveinsert
(as described above, for the
long-hyphen-postshort-hyphen style).
4.5.1.2.6. Only Styles[link]
\glsxtronlyname
and the sort value is
just the short form. The description is the long form encapsulated
with \glslongonlyfont
.
\setabbreviationstyle
{long-only-short-only}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtronlydescname
and
the sort is obtained from \glsxtronlydescsort
.
\setabbreviationstyle
{long-only-short-only-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsconlyname
,
and it uses \glsabbrvsconlyfont
, \glsfirstabbrvsconlyfont
and \glsxtrsconlysuffix
for the abbreviation fonts and plural
suffix.
\setabbreviationstyle
{long-only-short-sc-only}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsconlydescname
,
and the sort is obtained from \glsxtrsconlydescsort
.
\setabbreviationstyle
{long-only-short-sc-only-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
4.5.1.2.7. Footnote Styles[link]
\glsxtrshortformat
) with the long form as a footnote on
first use. On subsequent use only the short form is shown.
See §4.5.1.3.1 and §4.5.1.3.4
for style commands.
\glsxtrshortlongformat
).
Font variations are available with short-sc-footnote,
short-sm-footnote and short-em-footnote.
\gls
-like commands.
\setabbreviationstyle
{short-footnote}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsfirstlongfootnotefont
within the full form and with \glslongfootnotefont
for the
\glsxtrlong
set of commands.
\glsfirstabbrvdefaultfont
within the full form and with \glsabbrvdefaultfont
for
subsequent use and for the \glsxtrshort
set of commands.
\glsxtrfootnotename
) and
the description is set to the unencapsulated long form.
true
for the entry’s category.
\newabbreviation
.
\setabbreviationstyle
{short-footnote-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrfootnotedescname
), and the sort is set to
just the short form (\glsxtrfootnotedescsort
).
\setabbreviationstyle
{short-postfootnote}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\setabbreviationstyle
{short-postfootnote-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-footnote}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-footnote-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-postfootnote}
\newabbreviation
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrscsuffix
, \glsabbrvscfont
and
\glsfirstabbrvscfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sc-postfootnote-desc}
\newabbreviation
[description={sample description}]
{ex}{shrt fm}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-footnote}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-footnote-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-postfootnote}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtrsmsuffix
, \glsabbrvsmfont
and
\glsfirstabbrvsmfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-sm-postfootnote-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-footnote}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-footnote-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-postfootnote}
\newabbreviation
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
\glsxtremsuffix
, \glsabbrvemfont
and
\glsfirstabbrvemfont
(see §4.5.1.3.9).
\setabbreviationstyle
{short-em-postfootnote-desc}
\newabbreviation
[description={sample description}]
{ex}{SHRT FM}{long form}
\begin{document}
First: \gls
{ex}[-insert]. Next: \gls
{ex}[-insert].
Full: \glsxtrfull
{ex}[-insert].
First plural: \glspl
[prereset]{ex}[-insert].
First no insert: \gls
[prereset]{ex}.
\printunsrtglossaries
\end{document}
4.5.1.2.8. Short Styles[link]
false
.
4.5.1.2.9. Long Styles[link]
false
.
4.5.1.3. Formatting Commands and Hooks[link]
4.5.1.3.1. General[link]
\newcommand
*{\glsxtrparen
}[1]{%
\glsxtrgenentrytextfmt
{(}#1%
\glsxtrgenentrytextfmt
{)}}
\glsxtrparen
. This
is a space by default, but it includes the inner formatting.
The argument (the entry label) is ignored by default:
You can redefine this to use \newcommand
*{\glsxtrfullsep
}[1]{%
\glsxtrgenentrytextfmt
{ }}
\glsabspace
if you want to have a
non-breakable space if the short form is less than
\glsacspacemax
in width. (You can use \glsacspace
instead,
but note that \glsacspace
doesn’t incorporate the inner formatting.)
\glsabbrvdefaultfont
.
\glsxtrrevert
used by styles
that don’t have specific font markup. If you redefine
\glsabbrvdefaultfont
, you will need to redefine
\glsxtrdefaultrevert
as applicable.
\glslongdefaultfont
.
4.5.1.3.2. Parenthetical Styles[link]
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}
Note that this uses the original and values
supplied to \expandonce
\glsxtrorglong
\space
(\expandonce
\glsxtrorgshort
)
\newabbreviation
.
This essentially expands to ( ) but includes the
style font changing commands, the inner text formatting, and
accessibility support.
\glsxplongfont
{\the
\glslongtok
}{\glscategorylabel
}%
\protect
\glsxtrfullsep
{\the
\glslabeltok
}%
\protect
\glsxtrparen
{\glsxpabbrvfont
{\the
\glsshorttok
}
{\glscategorylabel
}}
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}
.
\expandonce
\glsxtrorgshort
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}%
\protect
\glsxtrfullsep
{\the
\glslabeltok
}%
\protect
\glsxtrparen
{\glsxplongfont
{\the
\glslongtok
}
{\glscategorylabel
}}
4.5.1.3.3. User Styles[link]
useri
, which corresponds to the user1
key.
\glsxtruserfield
within \glsxtruserparen
and
\GLSxtruserparen
. This simply does its argument by default.
\glsxtruserparen
and
\GLSxtruserparen
, and the case-change with the latter, will be
included in the argument of \glsxtruserfieldfmt
.
\renewcommand
{\glsxtruserparensep
}{; }
\renewcommand
{\glsxtruserfieldfmt
}[1]{\emph
{#1}}
\glsabbrvdefaultfont
.
\glsabbrvuserfont
.
\glsxtrabbrvpluralsuffix
.
\glsabbrvdefaultfont
.
\glslonguserfont
.
\glsabbrvscfont
, which in turn uses \textsc
to
apply a small caps style, so your document font needs to
support it.
\textsc
uses small capital glyphs for lowercase
characters. Uppercase characters show as normal capitals.
This means that you need to use lowercase characters in the
abbreviation.
\glsabbrvscuserfont
.
\glsabbrvscuserfont
. The default is
\glsxtrscrevert
. If you redefine \glsabbrvscuserfont
, you
will need to redefine \glsxtrscuserrevert
as applicable.
\glsxtrscsuffix
.
If you want to include the information contained in the field
identified by \newcommand
*{\glsuserdescription
}[2]{%
\glslonguserfont
{#1}}
\glsxtruserfield
, the second argument provides a
way of accessing that field without relying on the \glscurrententrylabel
placeholder. For example:
\renewcommand
*{\glsuserdescription
}[2]{%
\glslonguserfont
{#1}%
\ifglshasfield
{\glsxtruserfield
}{#2}%
{, \glscurrentfieldvalue
}%
{}%
}
\glsxtruserfield
has been set, this
essentially does:
otherwise it does:
\glsxtrfullsep
{ }\glsxtrparen
{ , }
It’s a little more complicated than this as the definition includes
the inner formatting around the comma and the field value
( ). The comma separator is given by
\glsxtrfullsep
{ }\glsxtrparen
{ }
\glsxtruserparensep
, and the field value is encapsulated with
\glsxtruserfieldfmt
(with the inner formatting inside).
\glsxtruserfield
is converted to all caps. Note that simply applying an
uppercase command to \glsxtruserparen
can fail as
it can cause the label to be converted to all caps, which
is the reason why a separate command to internally perform the
case-change is provided.
\protect
\glslonguserfont
{\the
\glslongtok
}%
\protect
\glsxtruserparen
{\protect
\glsabbrvuserfont
{\the
\glsshorttok
}}{\the
\glslabeltok
}
\protect
\glsabbrvscuserfont
{\the
\glsshorttok
}
\protect
\glslonguserfont
{\the
\glslongtok
}%
\protect
\glsxtruserparen
{\protect
\glsabbrvscuserfont
{\the
\glsshorttok
}}{\the
\glslabeltok
}
\protect
\glsabbrvuserfont
{\the
\glsshorttok
}%
\protect
\glsxtruserparen
{\protect
\glslonguserfont
{\the
\glslongpltok
}}%
{\the
\glslabeltok
}
\gls
or with \glsxtrfull
by styles like
long-short-user to format the long form followed by the
short form (with optional user information) in parentheses. The
default definition is:
\newcommand
*{\glsxtruserlongshortformat
}[4]{%
\glsxtrlongformat
{#1}{#2}{#3}%
\glsxtrusershortformat
{#1}{#4}%
}
\glspl
or with \glsxtrfullpl
by styles like
long-short-user to format the plural long form followed by the
plural short form (with optional user information) in parentheses. The
default definition is:
\newcommand
*{\glsxtruserlongshortplformat
}[4]{%
\glsxtrlongplformat
{#1}{#2}{#3}%
\glsxtrusershortplformat
{#1}{#4}%
}
\gls
or with \glsxtrfull
by styles like
short-long-user to format the short form followed by the
long form (with optional user information) in parentheses. The
default definition is:
\newcommand
*{\glsxtrusershortlongformat
}[4]{%
\glsxtrshortformat
{#1}{#2}{#3}%
\glsxtruserlongformat
{#1}{#4}%
}
\glspl
or with \glsxtrfullpl
by styles like
short-long-user to format the plural short form followed by the
plural long form (with optional user information) in parentheses. The
default definition is:
\newcommand
*{\glsxtrusershortlongplformat
}[4]{%
\glsxtrshortplformat
{#1}{#2}{#3}%
\glsxtruserlongplformat
{#1}{#4}%
}
\glsxtruserparen
) on the first use of \gls
or
\Gls
or with \glsxtrfull
or \Glsxtrfull
for styles like
long-short-user. The default definition is:
\newcommand
*{\glsxtrusershortformat
}[2]{%
\glsxtruserparen
{\glsxtrshortformat
{#1}{}{#2}}%
{#1}%
}
\glsxtrusershortformat
but for the first use of
\glspl
or with \glsxtrfull
for styles like
long-short-user. This has a similar definition
to the above but with \glsxtrshortplformat
.
\glsxtrusershortformat
but is used with the all caps
\GLS
or \GLSxtrfull
. This uses \GLSxtruserparen
instead of \glsxtruserparen
.
\glsxtrusershortplformat
but is used with the all caps
\GLSpl
or \GLSxtrfullpl
. This uses \GLSxtruserparen
instead of \glsxtruserparen
.
Note that this doesn’t check if the plural form was used. If you
require this, you will need to redefined this command to include
\newcommand
*{\glsxtrpostusershortformat
}[2]{%
\glsxtrifallcaps
{\GLSxtrusershortformat
{#1}{#2}}%
{\glsxtrusershortformat
{#1}{#2}}%
}
\glsifplural
:
\renewcommand
*{\glsxtrpostusershortformat
}[2]{%
\glsifplural
{%
\glsxtrifallcaps
{\GLSxtrusershortplformat
{#1}{#2}}%
{\glsxtrusershortplformat
{#1}{#2}}%
}%
{%
\glsxtrifallcaps
{\GLSxtrusershortformat
{#1}{#2}}%
{\glsxtrusershortformat
{#1}{#2}}%
}%
}
\glsxtruserparen
) on the first use of \gls
or
\Gls
or with \glsxtrfull
for styles like
short-long-user. The default definition is:
\newcommand
*{\glsxtruserlongformat
}[2]{%
\glsxtruserparen
{\glsxtrlongformat
{#1}{}{#2}}{#1}%
}
\glsxtruserlongformat
but all caps. This uses \GLSxtruserparen
instead of \glsxtruserparen
.
\glsxtruserlongformat
but for the first use of
\glspl
or with \glsxtrfull
for styles like
short-long-user. This has a similar definition
to \glsxtruserlongformat
but with \glsxtrlongplformat
.
\glsxtruserlongplformat
but all caps. This uses \GLSxtruserparen
instead of \glsxtruserparen
.
Note that, as with \newcommand
*{\glsxtrpostuserlongformat
}[2]{%
\glsxtrifallcaps
{\GLSxtruserlongformat
{#1}{#2}}%
{\glsxtruserlongformat
{#1}{#2}}%
}
\glsxtrpostusershortformat
, this doesn’t
check if the plural form was used. If you require this, you will
need to redefined this command to include \glsifplural
.
4.5.1.3.4. Footnote Styles[link]
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}%
\protect
\glsxtrfullsep
{\the
\glslabeltok
}%
\protect
\glsxtrparen
{\glsxplongfont
{\the
\glslongtok
}{\glscategorylabel
}}%
\the
.
\glsshorttok
\glslongdefaultfont
.
\glslongfootnotefont
.
\newcommand
*{\glsxtrabbrvfootnote
}[2]{\footnote
{#2}}
\gls
, \Gls
and \GLS
. The default definition is simply:
For example, if the footnote should start with an uppercase
letter then simply redefine this to use \newcommand
*{\glsxtrfootnotelongformat
}[2]{%
\glsxtrlongformat
{#1}{}{#2}%
}
\Glsxtrlongformat
instead:
\renewcommand
*{\glsxtrfootnotelongformat
}[2]{%
\Glsxtrlongformat
{#1}{}{#2}%
}
\glspl
, \Glspl
and \GLSpl
.
The default definition is simply:
\newcommand
*{\glsxtrfootnotelongplformat
}[2]{%
\glsxtrlongplformat
{#1}{}{#2}%
}
\glsxtrfootnotelongformat
. Note that
there’s no plural equivalent as the “postfootnote” styles don’t
check if the plural command (\glspl
etc) was used.
4.5.1.3.5. No-Long Styles[link]
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}%
\protect
\glsxtrfullsep
{\the
\glslabeltok
}%
\protect
\glsxtrparen
{\glsxplongfont
{\the
\glslongtok
}{\glscategorylabel
}}%
4.5.1.3.6. No-Short Styles[link]
\glsxplongfont
{\the
\glslongtok
}{\glscategorylabel
}
\glsxpabbrvfont
{\the
\glsshorttok
}{\glscategorylabel
}
4.5.1.3.7. Hyphen Styles[link]
\glsabbrvdefaultfont
.
\glsabbrvhyphenfont
.
\glslongdefaultfont
.
\glslonghyphenfont
.
\glsxtrabbrvpluralsuffix
.
\glsxtrorgshort
).
This command is irrelevant with the “unsrt” family of commands.
\glsxtrorgshort
).
This command is irrelevant with the “unsrt” family of commands.
\glsxtrorgshort
).
This command is irrelevant with the “unsrt” family of commands.
\glsxtrorglong
).
This command is irrelevant with the “unsrt” family of commands.
\glsxtrifhyphenstart
to test if the starts with a
hyphen. If it does, \glsxtrwordsep
is locally set to
\glsxtrwordsephyphen
to replace the inter-word spaces with
hyphens. The short form is placed in parentheses with
\glsxtrparen
, preceded by the \glsxtrfullsep
separator.
The is placed after both the long and the short form.
\glsxtrlonghyphenshort
with
as the argument as this
will interfere with the check to determine if starts
with a hyphen.
\MakeUppercase
{ }\glsxtrifhyphenstart
to test if the starts with a
hyphen. If it does, \glsxtrwordsep
is locally set to
\glsxtrwordsephyphen
to replace the inter-word spaces with
hyphens. The is placed after the long form.
\glsxtrlonghyphennoshort
with
as the argument as this
will interfere with the check to determine if starts
with a hyphen.
\MakeUppercase
{ }\glslabel
and \glsinsert
)
and uses \GLSxtrposthyphenshort
for all caps or
\glsxtrposthyphenshort
otherwise. Note that this doesn’t show
the plural by default. If you require the plural form, you need to
redefine this to add a check with \glsifplural
:
\renewcommand
*{\xpglsxtrposthyphenshort
}{%
\glsifplural
{%
\glsxtrifallcaps
{%
\expandafter
\GLSxtrposthyphenshortpl
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
{%
\expandafter
\glsxtrposthyphenshortpl
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
}%
{%
\glsxtrifallcaps
{%
\expandafter
\GLSxtrposthyphenshort
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
{%
\expandafter
\glsxtrposthyphenshort
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
}%
}
\glsxtrwordsep
is locally set to
\glsxtrwordsephyphen
to replace the inter-word spaces with
hyphens. The encapsulated with
\glsfirstlonghyphenfont
is then done (to complete the long
form, which has already been displayed with \glsxtrlonghyphen
in the link text). Then the short form followed by the
is placed in parentheses (with \glsxtrparen
preceded by \glsxtrfullsep
).
\glsxtrposthyphenshort
but plural.
\glslabel
and \glsinsert
)
and uses \GLSxtrposthyphensubsequent
for all caps or
\glsxtrposthyphensubsequent
otherwise.
\glsxtrlonghyphenshort
but the short and long forms are
swapped.
\glsxtrshorthyphenlong
with
as the argument as this
will interfere with the check to determine if starts
with a hyphen.
\MakeUppercase
{ }\glslabel
and \glsinsert
)
and uses \GLSxtrposthyphenlong
for all caps or
\glsxtrposthyphenlong
otherwise. Note that this doesn’t show
the plural by default. If you require the plural form, you need to
redefine this to add a check with \glsifplural
:
\renewcommand
*{\xpglsxtrposthyphenlong
}{%
\glsifplural
{%
\glsxtrifallcaps
{%
\expandafter
\GLSxtrposthyphenlongpl
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
{%
\expandafter
\glsxtrposthyphenlongpl
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
}%
{%
\glsxtrifallcaps
{%
\expandafter
\GLSxtrposthyphenlong
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
{%
\expandafter
\glsxtrposthyphenlong
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
}%
}
\glsxtrposthyphenshort
but shows the long form instead of
the short form.
\glsxtrposthyphenlong
but plural.
4.5.1.3.8. Only Styles[link]
\glsabbrvdefaultfont
.
\glsabbrvonlyfont
.
\glslongdefaultfont
.
\glslongonlyfont
.
\glsxtrabbrvpluralsuffix
.
\glsabbrvscfont
.
\glsabbrvsconlyfont
.
\glsabbrvsconlyfont
. The default is
\glsxtrscrevert
. If you redefine \glsabbrvsconlyfont
, you
will need to redefine \glsxtrsconlyrevert
as applicable.
\glsxtrscsuffix
.
\protect
\glsabbrvonlyfont
{\the
\glsshorttok
}
\protect
\glslongfont
{\the
\glslongtok
}
\the
.
\glslongtok
\protect
\glsabbrvsconlyfont
{\the
\glsshorttok
}
\glsxtronlydescname
.
\glsxtronlydescsort
.
4.5.1.3.9. Fonts[link]
\textsc
), “sm” (\textsmaller
)
or “em” (\emph
).
\textsc
to
apply a small caps style, so your document font needs to
support it.
\textsc
uses small capital glyphs for lowercase
characters. Uppercase characters show as normal capitals.
This means that you need to use lowercase characters in the
abbreviation.
\glsabbrvscfont
.
\glsabbrvscfont
. This defaults to
\glstextup
. If you redefine \glsabbrvscfont
, you
will need to redefine \glsxtrscrevert
as applicable.
\protect
\glstextup
\glsxtrabbrvpluralsuffix
\textsmaller
,
which is defined by the relsize package. You will need to
load that package if you want to use any of the “sm” styles.
\textsmaller
reduces the font size, so if you want to use it to
simulate small caps, you need to use uppercase characters
in the abbreviation.
\glsabbrvsmfont
.
\glsabbrvsmfont
. This defaults to
\textlarger
. If you redefine \glsabbrvsmfont
, you
will need to redefine \glsxtrsmrevert
as applicable.
\glsxtrabbrvpluralsuffix
.
\emph
.
\glsabbrvemfont
.
\glsabbrvemfont
. This defaults to
\textup
. If you redefine \glsabbrvemfont
, you
will need to redefine \glsxtremrevert
as applicable.
\glsxtrabbrvpluralsuffix
.
\emph
.
\glslongemfont
.
4.5.2. Advanced Style Commands[link]
\newabbreviationstyle
are applied.
\glsentryfmt
if the
current entry has the short field set. This ensures that the
\gls
-like commands use the appropriate formatting.
\glsxtrassignfieldfont
if the current entry has the
short field set. This ensures that the
\gls
-like commands use the appropriate formatting (where
possible).
\glsxtrshort
, \glsxtrlong
, \glsxtrfull
and their plural and case-changing variants.
\glossentryname
,
\glossentrynameother
, \glossentrydesc
,
\glossentrysymbol
, and their sentence-case variants.
\newabbreviationstyle
to inherit the setup code of a related
style.
\newabbreviationstyle
to inherit the formatting
of a related style.
\glsxtrpostabbrvfootnote
, otherwise they may lose
their definitions before the footnote text is typeset.
The second argument will be the expansion of
\newrobustcmd
*{\glsxtrpostabbrvfootnote
}[2]{%
\glsxtrabbrvfootnote
{#1}%
{#2\glsxtrpostfootnotelongformat
{#1}{\glsfirstlongfootnotefont
}}%
}
\glsxtrassignlinktextfmt
, to allow the inner formatting
to be picked up, if required.
\GlossariesExtraWarning
)
if a deprecated abbreviation style is used.
4.5.3. Defining New Abbreviation Styles[link]
\gls
) and the inline style
(\glsxtrfull
) are formatted. The relevant
commands for this argument are listed in
§4.5.3.2.
4.5.3.1. Style Initialisation Hooks[link]
\newabbreviationstyle
. They ensure
that all the fields are correctly initialised when the entry is
defined with the underlying \newglossaryentry
command. They may
also be used to set category attributes.
\renewcommand
*{\GlsXtrPostNewAbbreviation
}{}
\newabbreviation
, the following
steps are performed:
\newabbreviation
: \glskeylisttok
,
\glslabeltok
, \glsshorttok
and \glslongtok
.
\glsxtrorgkeylist
, \glsxtrorgshort
and \glsxtrorglong
are
defined to the options, short and long values supplied to
\newabbreviation
. (The \glskeylisttok
\glsshorttok
and \glslongtok
token registers may be changed before the entry is actually defined.
These commands may be used to obtain the original values.)
\ExtraCustomAbbreviationFields
is initialised to do
nothing.
\ExtraCustomAbbreviationFields
to set the
accessibility fields.
\glscategorylabel
is defined to abbreviation
.
\glscategorylabel
(which may have been changed when the options
were parsed in the previous step) or the fallback if no abbreviation
style is associated with that category. This performs both the
and provided when the style
was defined with \newabbreviationstyle
.
\glspluralsuffix
).
\glsexclapplyinnerfmtfield
).
\glsshorttok
is updated to reflect any changes.
\glsxtrnewabbrevpresetkeyhook
hook is performed.
\glskeylisttok
token is updated
to only include the remaining keys that haven’t yet been processed.
\glsshortpltok
and \glslongpltok
registers are
set.
\newabbreviationhook
performed.
\newglossaryentry
with the key value list:
type={
\glsxtrabbrvtype
},
category={abbreviation},
short={\the
\glsshorttok
},
shortplural={\the
\glsshortpltok
},
long={\the
\glslongtok
},
longplural={\the
\glslongpltok
},
name={\the
\glsshorttok
},
\CustomAbbreviationFields
,
\ExtraCustomAbbreviationFields
\the
\glskeylisttok
\GlsXtrPostNewAbbreviation
performed.
\newabbreviation
. These can be accessed
in the hooks using the following (but make sure they are fully
expanded):
\newabbreviation
with pre-processed options removed.
Use \the
to expand it.
\glskeylisttok
\newabbreviation
, can
be obtained with:
\the
to expand it.
\glslabeltok
\newabbreviation
). Use
\the
to expand it.
\glsshorttok
\newabbreviation
, can
be obtained with:
\newabbreviation
). Use
\the
to expand it.
\glsshortpltok
\newabbreviation
). Use
\the
to expand it.
\glslongtok
\newabbreviation
, can
be obtained with:
\newabbreviation
). Use
\the
to expand it.
\glslongpltok
\appto
) or prepend
(\preto
) additional information, if required, to this hook.
, including the last one.
={value}
.
={value}
\newabbreviation
). This can be used to set category attributes,
define the post-link hook, or mark the entry as having a complex
style (with \glsxtrsetcomplexstyle
).
Note that in the above, the commands within the definition of
\renewcommand
*{\GlsXtrPostNewAbbreviation
}{%
\glsxtrsetcomplexstyle
{\the
\glslabeltok
}{3}%
\glshasattribute
{\the
\glslabeltok
}{regular}%
{%
\glssetattribute
{\the
\glslabeltok
}{regular}{false}%
}%
{}%
}
\GlsXtrPostNewAbbreviation
are all expanded when that hook is
used. However, if this hook defines other commands or hooks that
will be used later, then make sure that the definitions of those
commands use the inner hook’s own placeholder commands.
\glslabel
to
reference the current label. Don’t use \glslabeltok
as that
will contain the label of the last abbreviation to be defined.
In the above, \renewcommand
*{\GlsXtrPostNewAbbreviation
}{%
\glsexclapplyinnerfmtfield
{\the
\glslabeltok
}{desc}%
\csdef
{glsxtrpostlink\glscategorylabel
}{%
\glsxtrifwasfirstuse
{%
\expandafter
\glsxtrposthyphenshort
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
{%
\expandafter
\glsxtrposthyphensubsequent
\expandafter
\glslabel
\expandafter
{\glsinsert
}%
}%
}%
\glshasattribute
{\the
\glslabeltok
}{regular}%
{%
\glssetattribute
{\the
\glslabeltok
}{regular}{false}%
}%
{}%
}
\glslabeltok
and \glscategorylabel
are used
in the parts that will be expanded at the end of
\newabbreviation
, but \glslabel
and \glsinsert
are
used in the definition of the post-link hook, which won’t be
expanded until the entry is referenced in the document with a
command such as \gls
. (The use of \expandafter
is included
to assist innertextformat.)
\GlsXtrPostNewAbbreviation
to indicate that the entry given by
has an abbreviation style that is
complex. The second argument should be numeric and
indicates why it doesn’t work with \glsfirst
, \Glsfirst
,