glossaries-extra.sty v1.32: an extension to the glossaries package
Nicola L.C. Talbot |
Dickimaw Books |
http://www.dickimaw-books.com/ |
2018-05-24
Abstract
The glossaries-extra package is an extension to the glossaries package, providing additional features. Some of the features provided by this package are only available with glossaries version 4.19 (or above). This document assumes familiarity with the glossaries package.
The file example-glossaries-xr.tex contains dummy entries with cross-references that may be used for creating minimal working examples for testing the glossaries-extra package. (The base glossaries package provides additional files, but this one needs glossaries-extra.) There are equivalent .bib files for use with bib2gls.
Additional resources:
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 new features.1.1 Future versions of glossaries will 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.
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 (see §2 Modifications to Existing Commands and Styles).
This is like:
This is like:
This is like:
However
This is like:
Since by the time glossaries-extra has been loaded, glossaries has already redefined memoir’s glossary-related commands.
Another noticeable change is that by default \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.
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 \printglossaries command instead of \printglossary. For example, consider the following:
The above document will only display the list of acronyms at the place where \printglossaries occurs. However it will also attempt to input the .gls file associated with the main glossary.
If you use makeglossaries, you’ll get the warning message:
(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:
This doesn’t occur with makeglossaries as it will create the .gls file containing the single command \null.
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:
(Note the need to set the acronym style using \setabbreviationstyle before \newacronym. See §3 Abbreviations for further details.)
If you haven’t already loaded glossaries, you can use any of the package options provided by glossaries when you load glossaries-extra and they will automatically be passed to glossaries (which glossaries-extra will load). If glossaries has already been loaded, then those options will be passed to \setupglossaries, but remember that not all of the glossaries package options may be used in that command.
The new and modified options provided by glossaries-extra are described below:
The glossaries-extra package extends this option to provide the additional values debug=showwrgloss and debug=all.
The debug=showwrgloss option implements debug=true and uses
to show a mark ⋅ just before the write operation performed by the indexing commands. If you use record=alsoindex there will be a mark for the write operation to the .aux file for bib2gls and a mark for the write operation to the associated glossary file for makeindex or xindy.
The debug=all option implements both debug=showtargets and debug=showwrgloss.
The value may also be one of the following keywords:
The default definition is
where the conditional is determined by the nopostdot package option. The postpunc option removes the conditional from the definition of \glspostdescription. The package options nopostdot and postdot will restore the original definition of \glspostdescription.
The glossaries-extra-stylemods package adjusts the predefined styles that had a hard-coded \space before the number list so that they use \glsxtrprelocation instead (which is defined to \space). You can therefore redefine this command in combination with postpunc to alter the separator before the number list. For example, to have a comma followed by \hfil:
Be careful with doing this as it will look odd if the number list is missing. (With bib2gls you can instead redefine \glsxtrprelocation to do nothing and set the location prefixes with loc-prefix which will only apply if the entry has a number list.)
If you want to define styles that can interface with the accessibility support provided by glossaries-accsupp use the \glsaccess⟨xxx⟩ type of commands instead of \glsentry⟨xxx⟩ (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⟨xxx⟩ commands will add the accessibility information. (See §11.2 Accessibility Support for further details.)
Note that the accsupp option can only be used as a package option (not through \glossariesextrasetup) since the glossaries-accsupp package must be loaded before glossaries-extra if it’s required.
Note that bib2gls can automatically find dependent entries when it parses the .bib source file. The record option automatically implements indexcrossrefs=false.
Note that the record=only option automatically implements autoseeindex=false.
For example, if an entry is defined as
then with autoseeindex=true, this is equivalent to
but with autoseeindex=false, this is equivalent to
Note that indexcrossrefs isn’t automatically implemented by the presence of the see key when autoseeindex is false.
It’s therefore possible 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 \makeglossaries. Since the appropriate file isn’t open, the information can’t be written to it. This will need the package option seenoindex=ignore (provided by glossaries) to prevent an error occurring.
The option may only be set in the preamble and can’t be used after \GlsXtrLoadResources. If the value is missing record=only is assumed. Permitted values:
The glossaries should be displayed using \printunsrtglossary (or \printunsrtglossaries).
The document build process is (assuming the file is called myDoc.tex):
Note that record=only will prevent the see from automatically implementing \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.
The record=only option will automatically set the glossaries package’s sort=none option if available. (That option value was only introduced to glossaries v4.30.)
The glossaries should be displayed using \printglossary (or \printglossaries). This option is expected to be used with bib2gls’s sort=none setting and so glossaries-extra-bib2gls is not automatically loaded.
The document build process is (assuming the file is called myDoc.tex):
With the recording on (record=only or record=alsoindex), any of the commands that would typically index the entry (such as \gls, \glstext or \glsadd) will add a \glsxtr@record entry to the .aux file. bib2gls can then read these lines 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 \glsxtr@record entry to the .aux file.) See §9 bib2gls: Managing Reference Databases for further details.
By default (with hyperref), the page numbers in number lists link back to the top of the relevant page (provided the format uses \glshypernumber). The indexcounter option is designed to link back to the place within the page where the indexing occurred. It does this by creating a new counter (called wrglossary) that’s incremented with \refstepcounter every time an entry is indexed (but not via cross-referencing commands, such as \glssee). A \label is placed immediately after the increment command allowing the back-referenced to be obtained with \pageref. The location, as seen by the indexing application, is the value of the wrglossary counter but this value is substituted with the page reference when number list is typeset. Since the counter is used by all entries and is incremented every time any indexing occurs, neither makeindex nor xindy can correctly collate the lists. For example, if the first term to be referenced is indexed three times on page 5 without any intervening terms then the actual locations obtained from wrglossary will be 1, 2 and 3, which xindy and makeindex will try to form into the range 1–3, but they should actually all simply appear as page 5, whereas it can actually end up with 5–5. Conversely, a range may not be formed where it would naturally occur if just the page counter was used.
Since bib2gls is designed specifically to work with glossaries-extra, bib2gls (v1.4+) will check for wrglossary locations. If the default --merge-wrglossary-records is on, then any records for the same page for a given entry will be merged. In the above example with three references on page 5, only a single record for page 5 for that entry will be added to the number list and it will link back to the first instance on that page. Whereas if you use the --no-merge-wrglossary-records switch, the number list will contain three instance of page 5, with each linking to the corresponding place on that page. In both cases, consecutive pages can form ranges, but it may look strange in the second case.
See the bib2gls documentation for the save-index-counter resource option for more details.
Remember that if \newglossaryentry wouldn’t be allowed in the document environment with the base glossaries package, then it still won’t be allowed with docdefs=true. If your glossaries occur at the end of the document, consider using docdef=restricted instead.
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).
The glossaries package allows \newglossaryentry within the document environment (when used with makeindex or xindy) but the user manual warns against this usage. By default the glossaries-extra package prohibits this, only allowing definitions within the preamble. If you are really determined to define entries in the document environment, despite all the associated drawbacks, you can restore this with docdef=true. Note that this doesn’t change the prohibitions that the glossaries package has in certain circumstances (for example, when using “option 1”). See the glossaries user manual for further details. A better option if document definitions are required is docdef=restricted. Only use docdef=true if document definitions are necessary and one or more of the glossaries occurs in the front matter.
This option affects commands that internally use \newglossaryentry, such as \newabbreviation, but not the “on-the-fly” commands described in §8 On-the-Fly Document Definitions.
which is equivalent to
If this command is already defined, it’s left unchanged. Otherwise it’s defined to “Abbreviations” if babel hasn’t been loaded or \acronymname if babel has been loaded. However, if you’re using babel it’s likely you will need to change this. (See §13 Multi-Lingual Support for further details.)
If the abbreviations option is used and the acronym option provided by the glossaries package hasn’t been used, then \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:
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.
which is equivalent to
which is equivalent to
Note that multiple invocations of the shortcuts option within the same option list will override each other.
After the glossaries-extra package has been loaded, you can set available options using
The abbreviations and docdef options may only be used in the preamble. Additionally, docdef can’t be used after \makenoidxglossaries.
The glossaries package provides \nopostdesc which may be used in the description to suppress the post-description hook. The glossaries-extra package provides another command
which has a similar function but only suppresses the post-description punctuation. It doesn’t suppress the use of \glsxtrpostdescription which allows the use of category-dependent post-description hooks. (Note that the punctuation, which is in the original base hook \glspostdescription, comes after the extended post-description hook \glsxtrpostdescription not before.) The post-description hook can counter-act the effect of \glsxtrnopostpunc using
These commands have no effect outside of the glossary (except with standalone entries that use \glsxtractivatenopost and \glspostdescription, see §10.3 Standalone Entry Items).
The glossaries package provides
to format items in a cross-reference list (identified with the see key or \glssee). This was originally defined to use \glsentryname{⟨label⟩} since it makes more sense for the cross-reference to match the way the term appears in the glossary. Unfortunately this caused a problem when the name field was sanitized, which used to be the default setting, so glossaries v3.0 changed the default definition of this command to use \glsentrytext instead. Since the name and text field are quite often the same, this change usually doesn’t have a noticeable effect. However, now that the name field is no longer sanitized (following the redesign of glossaries v4.0) it makes more sense to restore this command to its original behaviour, but to take account of abbreviations glossaries-extra redefines this as:
If you want to restore the glossaries v3.0+ definition just do:
The commands used by glossaries to automatically produce an error if an entry is undefined (such as \glsdoifexists) are changed to take the undefaction option into account.
The \newignoredglossary{⟨type⟩} command now (as from v1.11) has a starred version that doesn’t automatically switch off the hyperlinks. This starred version may be used with the targeturl attribute to create a link to an external URL. (See §5 Categories for further details.) As from v1.12 both the starred and unstarred version check that the glossary doesn’t already exist. (The glossaries package omits this check.)
You can now provide an ignored glossary with:
which will only define the glossary if it doesn’t already exist. This also has a starred version that doesn’t automatically switch off hyperlinks.
The individual glossary displaying commands \printglossary, \printnoidxglossary and \printunsrtglossary have two extra keys:
The \newglossaryentry command has three new keys:
The test file example-glossaries-xr.tex contains dummy entries with a mixture of see, alias and seealso keys for use with minimal working examples. There are also example-glossaries-*.bib files that correspond to each example-glossaries-*.tex file for testing bib2gls.
The \longnewglossaryentry command now has a starred version (as from v1.12) that doesn’t automatically insert
at the end of the description field.
The descriptionplural key is left unset unless explicitly set in ⟨options⟩.
The unstarred version no longer hard-codes the above code (which removes trailing space and suppresses the post-description hook) but instead uses:
This can be redefined to allow the post-description hook to work but retain the \unskip part if required. For example:
This will discarded unwanted trailing space at the end of the description but won’t suppress the post-description hook.
The unstarred version also alters the base glossaries package’s treatment of the descriptionplural key. Since a plural description doesn’t make much sense for multi-paragraph descriptions, the default behaviour with glossaries-extra’s \longnewglossaryentry is to simply leave the plural description unset unless explicitly set using the descriptionplural key. The glossaries.sty version of this command sets the description’s plural form to the same as the singular.2.1
Note that this modified unstarred version doesn’t append \glsxtrpostlongdescription to the description’s plural form.
The \newterm command (defined through the index package option) is modified so that the category defaults to index. The \newacronym command is modified to use the new abbreviation interface provided by glossaries-extra. (See §3 Abbreviations.)
The \makeglossaries command now has an optional argument.
If ⟨list⟩ is empty, \makeglossaries behaves as per its original definition in the glossaries package, otherwise ⟨list⟩ can be a comma-separated list of glossaries that need processing with an external indexing application.
This command is not permitted with the record=only package option. Without the optional argument, it’s permitted with record=alsoindex. With the optional argument, it’s only permitted with the default record=off.
It should then be possible to use \printglossary for those glossaries listed in ⟨list⟩ and \printnoidxglossary for the other glossaries. (See the accompanying file sample-mixedsort.tex for an example.)
You will need at least version 2.20 of makeglossaries or at least version 1.3 of the Lua alternative makeglossaries-lite (both distributed with glossaries v4.27) to allow for this use of \makeglossaries[⟨list⟩]. Alternatively, use the automake option.
As from version 1.31, there is a new command like \glsadd where the mandatory argument is a comma-separated list of labels:
This simply iterates over ⟨list⟩ and does \glsadd[⟨options⟩]{⟨label⟩} for each entry in the list.
The glossaries-extra package provides extra keys for commands like \gls and \glstext:
The default value is set up using
which is defined as:
This sets the conditional
which is used to determine where to perform the indexing.
This means you can set the wrgloss attribute to after to automatically use this as the default for entries with that category attribute. (Note that adding wrgloss to the default options in \GlsXtrSetDefaultGlsOpts will override \glsxtrinitwrgloss.)
will set hyperoutside=false for all entries that are assigned to the category mathrelation and
will use \mathrel instead of \glstextformat resulting in:
There is a new hook that’s used each time indexing information is written to the external glossary files:
where ⟨label⟩ is the entry’s label. This does nothing by default but may be redefined. (See, for example, the accompanying sample file sample-indexhook.tex, which uses this hook to determine which entries haven’t been indexed.)
There’s also a new hook (from v1.26) that’s used immediately before the options are set by the \gls-like and \glstext-like commands:
(The base package provides \glslinkpostsetkeys that’s used immediately after the options are set.)
As from version 1.30 there are also similar hooks for \glsadd:
and
For example, to default to using the equation counter in maths mode:
(This can be overridden with an explicit use of counter in the optional argument of \gls or \glsadd.) Alternatively, to enforce this (overriding the option argument):
As from version 1.14, there are two new keys for \glsadd: thevalue and theHvalue. These keys are designed for manually adding explicit locations rather than obtaining the value from the associated counter. As from version 1.19, these two keys are also available for commands like \gls and \glslink. The thevalue keys is intended primarily for adding locations in supplementary material that can’t be obtained from a counter.
The principle key thevalue is for the location value. The other key theHvalue can be used to extract a prefix value for the first argument of commands like \glsnoidxdisplayloc. It’s value must be in the format ⟨prefix⟩⟨location⟩. In general, there’s little need for this key as the prefix is typically associated with a counter that can be used to form hypertargets.
For example, makeindex will only accept locations in the form [⟨num⟩⟨sep⟩]*⟨num⟩ where ⟨num⟩ is an arabic number (0, 1, …), roman numeral (i, ii, … or I, II, …) or a character from a, …, z or A, …, Z, and [⟨num⟩⟨sep⟩]* indicates zero or more instances of a number followed by the recognised separator character (set with \glsSetCompositor). This means that makeindex won’t accept, for example,
This location value will be accepted by bib2gls, since it will allow any location and will only try forming ranges if the location matches any of its numerical patterns. In the case of xindy, you’ll need to add a rule that can match the value. If you’re using hyperref, you may need to use the format key to prevent a hyperlink if one can’t naturally be formed from the prefix, counter and location value.
For example, suppose the file suppl.tex contains:
This has an entry on page S.2. Suppose another document wants to include this location in the glossary. Then this can be done by setting thevalue to S.2. For example:
This location value will be accepted by makeindex as it’s in the form ⟨num⟩⟨sep⟩⟨num⟩.
If you want hyperlinks, things are more complicated. First you need to set the externallocation to the location of the PDF file. For example:
Next you need to add glsxtrsupphypernumber as the format:
Both documents will need to use the hyperref package. Remember that the counter used for the location also needs to match. If \theH⟨counter⟩ is defined in the other document and doesn’t match in the referencing document, then you need to use theHvalue to set the appropriate value. See the accompanying sample files sample-suppl-hyp.tex and sample-suppl-main-hyp.tex for an example that uses hyperref.
For example, if both sample-suppl-hyp.pdf and sample-suppl-main-hyp.pdf are in the same directory, then viewing sample-suppl-main-hyp.pdf in Evince will take you to the correct location in the linked document (when you click on the S.2 external link), but Okular will take you to the top of the first page of the linked document.
The value of the see key is now saved as a field. This isn’t the case with glossaries, where the see value is simply used to directly write a line to the corresponding glossary file and is then discarded. This is why the see key can’t be used before \makeglossaries (since the file hasn’t been opened yet). It’s also the reason why the see key doesn’t have any effect when used in entries that are defined in the document environment. Since the value isn’t saved, it’s not available when the .glsdefs file is created at the end of the document and so isn’t available at the start of the document environment on the next run.
This modification allows glossaries-extra to provide
which is used at the end of the document to automatically add any unused cross-references unless the package option indexcrossrefs was set to false.
As a by-product of this enhancement, the see key will now work for entries defined in the document environment, but it’s still best to define entries in the preamble, and the see key still can’t perform any indexing before the file has been opened by \makeglossaries. Note that glossaries v4.24 introduced the seenoindex package option, which can be used to suppress the error when the see key is used before \makeglossaries, so seenoindex=ignore will allow the see value to be stored even though it may not be possible to index it at that point.
As from version 1.06, you can display the cross-referenced information for a given entry using
This internally uses
where ⟨tag⟩ and ⟨xr list⟩ are obtained from the value of the entry’s see field (if non-empty). By default, this just does \glsseeformat[⟨tag⟩]{⟨xr list⟩}{}, which is how the cross-reference is displayed in the number list. Note that \glsxtrusesee does nothing if the see field hasn’t been set for the entry given by ⟨label⟩.
Suppose you want to suppress the number list using nonumberlist. This will automatically prevent the cross-references from being displayed. The seeautonumberlist package option will automatically enable the number list for entries that have the see key set, but this will also show the rest of the number list.
Another approach in this situation is to use the post description hook with \glsxtrusesee to append the cross-reference after the description. For example:
Now the cross-references can appear even though the number list has been suppressed.
As from v1.16, there’s a separate seealso key. Unlike see, this doesn’t have an optional part for the textual tag. The syntax seealso={⟨xr-labels⟩} works in much the same way as using see=[\seealsoname]{⟨xr-labels⟩} but the information is stored in a separate field. If you need a different tag, use the see key instead (or redefine \seealsoname or \glsxtruseseealsoformat, described below).
You can display the formatted list of cross-references stored in the seealso key using:
This works in much the same way as \glsxtrusesee but it internally uses
For example:
The actual unformatted comma-separated list ⟨xr-list⟩ stored in the seealso field can be accessed with:
This will just expand to the ⟨xr-labels⟩ provided in the value of the seealso key. There’s no corresponding command to access the see field. If you really need to access it, you can use commands like \glsxtrfielduse, but remember that it may start with [⟨tag⟩], so it can’t be automatically treated as a simple comma-separated list.
The base glossaries package provides \glsseelist, which requires a comma-separated list of labels as the argument. The argument isn’t fully expanded, so it’s not suitable to use, for example, \glsxtrseealsolabels{⟨label⟩} as the argument. For convenience, glossaries-extra provides
which fully expands its argument and passes it to \glsseelist.
The seealso key implements the automatic indexing using
which just does
Recall from the glossaries package that commands such as \gls display text at that point in the document (optionally with a hyperlink to the relevant line in the glossary). This text is referred to as the “link-text” regardless of whether or not it actually has a hyperlink. The actual text and the way it’s displayed depends on the command used (such as \gls) and the entry format.
The default entry format (\glsentryfmt) used in the link-text by commands like \gls, \glsxtrfull, \glsxtrshort and \glsxtrlong (but not commands like \glslink, \glsfirst and \glstext) is changed by glossaries-extra to test for regular entries, which are determined as follows:
This means that entries with a short form can be treated as regular entries rather than abbreviations if it’s more appropriate for the desired style.
As from version 1.04, \glsentryfmt now puts \glsgenentry in the argument of the new command
This just does its argument ⟨text⟩ by default. This means that if you want regular entries in a different font but don’t want that font to apply to abbreviations, then you can redefine \glsxtrregularfont. This is more precise than changing \glstextformat which is applied to all linking commands for all entries, unless overridden by the textformat attribute.
For example:
You can access the label through \glslabel. For example, you can query the category:
or query the category attribute, for example, provide a custom attribute called font:
As from version 1.21, it’s simpler to just do, for example:
without redefining \glsxtrregularfont.
As from version 1.30, there is also a command for abbreviations that encapsulates \glsxtrgenabbrvfmt:
This also just does its argument by default. Font changes made by abbreviation styles are within ⟨text⟩.
The \glspostlinkhook provided by the glossaries package to insert information after the link-text produced by commands like \gls and \glstext is redefined to
This command will discard a following full stop (period) if the discardperiod attribute is set to “true” for the current entry’s category. It will also do
if a full stop hasn’t be discarded and
if a full stop has been discarded.
It may be that you want to check some other setting (rather than a category attribute) to determine whether or not to discard a following full stop. In which case you can redefine:
You can access the field’s label using \glslabel. This command should do ⟨true⟩ if the post-link hook should check if a period follows and ⟨false⟩ otherwise. The default definition is simply:
which means that no additional checks are performed. (Only the recognised category attributes will be checked.)
By default \glsxtrpostlink just does \glsxtrpostlink⟨category⟩ if it exists, where ⟨category⟩ is the category label for the current entry. (For example, for the general category, \glsxtrpostlinkgeneral if it has been defined.)
You can define the post-link hook command using \newcommand, for example:
or, as from v1.31, you can use
This is simply a shortcut for:
The sentence-ending hook is slightly more complicated. If the command \glsxtrpostlink⟨category⟩ is defined the hook will do that and then insert a full stop with the space factor adjusted to match the end of sentence. If \glsxtrpostlink⟨category⟩ hasn’t been defined, the space factor is adjusted to match the end of sentence. This means that if you have, for example, an entry that ends with a full stop, a redundant following full stop will be discarded and the space factor adjusted (in case the entry is in uppercase) unless the entry is followed by additional material, in which case the following full stop is no longer redundant and needs to be reinserted.
There are some convenient commands you might want to use when customizing the post-link-text category hooks:
This will add the description in parentheses on first use.
For example, suppose you want to append the description in parentheses on first use for entries in the symbol category:
This will append the symbol (if defined) in parentheses on first use. (Does nothing if the symbol hasn’t been set.)
(New to v1.31.) On first use, this will append \space(⟨symbol⟩, ⟨description⟩) if the symbol is defined otherwise it just appends \space(⟨description⟩).
If you want to provide your own custom format be aware that you can’t use \ifglsused within the post-link-text hook as by this point the first use flag will have been unset. Instead you can use
This will do ⟨true⟩ if the last used entry was the first use for that entry, otherwise it will do ⟨false⟩. (Requires at least glossaries v4.19 to work properly.) This command is locally set by commands like \gls, so don’t rely on it outside of the post-link-text hook.
For example, if you want to place the description in a footnote after the link-text on first use for the general category:
The short-postfootnote abbreviation style uses the post-link-text hook to place the footnote after trailing punctuation characters.
You can set the default options used by \glslink, \gls etc with:
For example, if you mostly don’t want to index entries then you can do:
and then use, for example, \gls[noindex=false]{sample} when you actually want the location added to the number list. These defaults may be overridden by other settings (such as category attributes) in addition to any settings passed in the option argument of commands like \glslink and \gls.
Note that if you don’t want any indexing, just omit \makeglossaries and \printglossaries (or analogous commands). If you want to adjust the default for wrgloss, it’s better to do this by redefining \glsxtrinitwrgloss instead.
If you want to change the default value of format, you can instead use:
This has the advantage of also working for \glsadd. For example, if you want all locations in the back matter to appear in italic (unless explicitly overridden):
Commands like \gls have star (*) and plus (+) modifiers as a short cut for hyper=false and hyper=true. The glossaries-extra package provides a way to add a third modifier, if required, using
where ⟨char⟩ is the character used as the modifier and ⟨options⟩ is the default set of options (which may be overridden). Note that ⟨char⟩ must be a single character (not a UTF-8 character, unless you are using XƎLATEX or LuaLATEX).
Example:
This means that \gls!{sample} will be equivalent to \gls[noindex]{sample}. It’s not possible to mix modifiers. For example, if you want to do
you can use \gls*[noindex]{sample} or \gls![hyper=false]{sample} but you can’t combine the * and ! modifiers.
Location lists displayed with \printnoidxglossary internally use
This command is provided by glossaries, but is modified by glossaries-extra to check for the start and end range formation identifiers ( and ) which are discarded to obtain the actual control sequence name that forms the location formatting command.
If the range identifiers aren’t present, this just uses
otherwise it uses
for the start of a range (where the identifier has been stripped from ⟨format⟩) or
for the end of a range (where the identifier has been stripped from ⟨format⟩).
By default the start range command saves the format in
and does
\glsxtrdisplaysingleloc{⟨format⟩}{⟨location⟩}
The end command checks that the format matches the start of the range, does
(which does nothing by default), followed by
\glsxtrdisplaysingleloc{⟨format⟩}{⟨location⟩}
This means that the list
doesn’t display any differently from
but it does make it easier to define your own custom list handler that can accommodate the ranges.
If you are using bib2gls you may find it more convenient to use the record count commands described in §9 bib2gls: Managing Reference Databases instead.
The \glsenableentrycount command is modified to allow for the entrycount attribute. This means that you not only need to enable entry counting with \glsenableentrycount, but you also need to set the appropriate attribute (see §5 Categories).
For example, instead of just doing:
you now need to do:
This will enable the entry counting for entries in the abbreviation category, but any entries assigned to other categories will be unchanged.
Further information about entry counting, including the new per-unit feature, is described in §6.1 Entry Counting (First Use Flag).
There are two new commands provided with version 1.31+:
and
These behave like \glslocalreset and \glslocalunset but the argument is a comma-separated list of labels.
The internal command used by \glsunset is modified first to allow for the changing in entry counting, described above, but also to allow for buffering pending unsets when commands like \gls are used in a context where changing a boolean variable can cause things to go wrong. One example of this is using \gls in one of the commands provided with the package. For example:
This causes the confusing error:
The simplest workaround is to put \gls{html} inside the argument of \mbox. For example:
This can work provided it’s not the first use of this entry. It if is, then unsetting the first use flag causes a problem and results in the error:
The glossaries-extra package provides a way of temporarily switching off \glsunset so that it just makes a note of the entry’s label but doesn’t actually perform the change:
The unstarred version doesn’t check for duplicates, so the internal list may end up with multiple occurrences of the same label. The starred version only adds a label to the internal list if it’s not already in it. Note that this buffering only applies to the global \glsunset and does not affect the local \glslocalunset.
Later you can restore \glsunset and unset all buffered labels using:
The starred form \GlsXtrStopUnsetBuffering* uses \glslocalunset instead. For example:
Before you stop the unset buffering, you can iterate over the current buffer using
where ⟨cs⟩ is a control sequence that takes a single argument (which is the entry label). This is best used with the starred version \GlsXtrStartUnsetBuffering* to avoid duplicates.
There can still be a problem here as content within \mbox can’t break across a line so you may end up with an overfull line or excessive white space within the paragraph.
An alternative is to use \protect:
but the formatting (underlining in this example) won’t be applied. Another possibility is:
This moves \gls outside of \ul and uses textformat to locally change the formatting command used by \gls (which is normally given by \glstextformat or the textformat attribute) to a custom command \gul, which locally changes the regular font and the default abbreviation font to use \ul. It then uses
which (protected) fully expands ⟨text⟩ before applying ⟨cs⟩, which must be a control sequence that takes a single argument. This allows \ul to move much further inside and increases its chances of working. It can still break if ⟨text⟩ expands to something that \ul can’t deal with. For example, if an abbreviation style is used that contains complex formatting or if the field value contains problematic content.
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 \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.
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:
This last case is changed with glossaries-extra. With this extension package, the shortplural field defaults to the short field with \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. In most cases its redefined to use
which defaults to just \glspluralsuffix. Some of the abbreviation styles have their own command for the plural suffix, such as \glsxtrscsuffix, so if you want to completely strip all the plural suffixes used for abbreviations then you need to redefine \glsxtrabbrvpluralsuffix not \abbrvpluralsuffix, which changes with the style. Redefining \acrpluralsuffix will have no affect, since it’s not used by the new abbreviation mechanism.
If you require a mixture (for example, in a multilingual document), there are two attributes that affect the short plural suffix formation. The first is aposplural which uses the suffix
That is, an apostrophe followed by \abbrvpluralsuffix is appended. The second attribute is noshortplural which suppresses the suffix and simply sets shortplural to the same as short.
Complications arise when you use \gls in the value of the name field (or text or first fields, if set). This tends to occur with abbreviations that extend other abbreviations. For example, SHTML is an abbreviation for SSI enabled HTML, where SSI is an abbreviation for Server Side Includes and HTML is an abbreviation for Hypertext Markup Language.
Things can go wrong if we try the following with the glossaries package:
The main problems are:
which just doesn’t work. Grouping the \gls{ssi} doesn’t work either as this will effectively try to do
This will upper case the label ssi so the entry won’t be recognised. This problem will also occur if you use the all capitals version, such as \GLS.
This produces:
This section discusses server side includes (SSI), hypertext markup language (HTML) and SSI enabled HTML (SHTML).
So the first use of the shtml entry produces “SSI enabled HTML (SHTML)”.
Now let’s suppose the html entry is used before the shtml but the ssi entry is used after the shtml entry, for example:
This produces:
The sample files are either hypertext markup language (HTML) or server side includes (SSI) enabled HTML (SHTML), but let’s first discuss SSI.
So the first use of the shtml entry now produces “server side includes (SSI) enabled HTML (SHTML)”, which looks a bit strange.
Now let’s suppose the shtml entry is used before (or without) the other two entries:
This produces:
This article is an introduction to server side includes (SSI) enabled hypertext markup language (HTML) (SHTML).
So the first use of the shtml entry now produces “server side includes (SSI) enabled hypertext markup language (HTML) (SHTML)”, which is even more strange.
This is all aggravated by setting the style using the glossaries package’s \setacronymstyle. For example:
as this references the label through the use of \glslabel when displaying the long and short forms, but this value changes with each use of \gls, so instead of displaying “(SHTML)” at the end of the first use, it now displays “(HTML)”, since \glslabel has been changed to html by \gls{html}.
Another oddity occurs if you reset the html entry between uses of the shtml entry. For example:
The next use of shtml produces “Shypertext markup language (HTML)”, which is downright weird.
Even without this, the short form has nested formatting commands, which amount to \acronymfont{S\acronymfont{HTML}}. This may not be a problem for some styles, but if you use one of the “sm” styles (that use \textsmaller), this will produce an odd result.
For these reasons it’s better to use the simple expandable commands like \glsentrytext or \glsentryshort in the definition of other entries (although that doesn’t fix the first problem). Alternatively use something like:
with glossaries or:
with glossaries-extra. This fixes all the above listed problems (as long as you don’t use \glsdesc). Note that replacing \gls with \acrshort in the original example may fix the first use issue, but it doesn’t fix any of the other problems listed above.
If it’s simply that you want to use the abbreviation font, you can use \glsabbrvfont:
This will pick up the font style setting of the outer entry (shtml, in the above case). This isn’t a problem in the above example as all the abbreviations use the same style.
However if you’re really determined to use \gls in a field that may be included within some link-text, glossaries-extra patches internals used by the linking commands so that if \gls (or plural or case changing variants) occurs in the link-text it will behave as though you used \glstext[hyper=false,noindex] instead. Grouping is also added so that, for example, when \gls{shtml} is used for the first time the long form
is treated as
This overcomes problems 4, 5 and 6 listed above, but still doesn’t fix problems 1 and 2. Problem 3 usually won’t be an issue as most abbreviation styles set the sort key to the short form, so using these commands in the long form but not the short form will only affect entries with a style that sorts according to the long form (such as long-noshort-desc).
Additionally, any instance of the long form commands, such as \glsxtrlong or \acrlong will be temporarily redefined to just use
(or case-changing versions). Similarly the short form commands, such as \glsxtrshort or \acrshort will use \glsentryshort in the argument of either \glsabbrvfont (for \glsxtrshort) or \acronymfont (for \acrshort). So if the shtml entry had instead been defined as:then (using the long-short style) the first use will be like
whereas if the entry is defined as:
then the first use will be like:
Note that the first optional argument of \acrshort or \glsxtrshort is ignored in this context. (The final optional argument will be inserted, if present.) The abbreviation style that governs \glsabbrvfont will be set for \glsxtrshort. Note that \acrshort doesn’t set the abbreviation style.
Alternatively you can use:
where ⟨field⟩ is the field label and corresponds to a command in the form \gls⟨field⟩ (e.g. \glstext) or in the form \glsxtr⟨field⟩ (e.g. \glsxtrshort).
There’s a shortcut command for the most common fields:
which is equivalent to \glsxtrp{short}{⟨label⟩}, and
which is equivalent to \glsxtrp{text}{⟨label⟩}.
The \glsxtrp command behaves much like the \glsfmt⟨field⟩ commands described in §4 Entries in Sectioning Titles, Headers, Captions and Contents but the post-link hook is also suppressed and extra grouping is added. It automatically sets hyper to false and noindex to true. If you want to change this, you can use
For example:
will just switch off the hyperlinks but not the indexing. Be careful using this command or you can end up back to the original problem of nested links.
The hyper link is re-enabled within glossaries. This is done through the command:
which by default just does
You can redefine this if you want to adjust the setting when \glsxtrp is used in the glossary. For example:
For example,
is equivalent to
in the main body of the document or
inside the glossary. (Note the post-link hook is locally disabled.)
If \glsxtrp{short}{ssi} occurs in a sectioning mark, it’s equivalent to
(which recognises the headuc attribute.)
If hyperref has been loaded, then the bookmark will use \glsentry⟨field⟩ (\glsentryshort{ssi} in the above example).
There are similar commands
for first letter upper case and
for all upper case.
You can, with care, protect against issue 1 by inserting an empty group at the start if the long form starts with a command that breaks the first letter uppercasing commands like \Gls, but you still won’t be able to use the all caps commands, such as \GLS.
If you really need nested commands, the safest method is
but be aware that it may have some unexpected results occasionally.
Example document:
The glossaries-extra package provides a new way of dealing with abbreviations and redefines \newacronym to use \newabbreviation (see §3 Abbreviations). The simplest way to update a document that uses \newacronym from glossaries to glossaries-extra is do just add
before you define any entries. For example, the following document using just glossaries
can be easily adapted to use glossaries-extra:
Table 2.1 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. See §3.4 Predefined Abbreviation Styles for further details.
Old Style Name | New Style Name |
long-short |
|
long-short-desc |
|
The reason for introducing the new style of abbreviation commands provided by glossaries-extra is because the original acronym commands provided by glossaries are too restrictive to work with the internal modifications made by glossaries-extra. However, if you really want to restore the generic acronym function provided by glossaries you can use
(before any use of \newacronym).
\RestoreAcronyms should not be used in combination with the newer glossaries-extra abbreviations. Don’t combine old and new style entries with the same type. The original glossaries acronym mechanism doesn’t work well with the newer glossaries-extra commands.
In general, there’s rarely any need for \RestoreAcronyms. If you have a document that uses \newacronymstyle, then it’s best to either stick with just glossaries for that document or define an equivalent abbreviation style with \newabbreviationstyle. (See §3.5 Defining New Abbreviation Styles for further details.)
The space command \glsacspace used by the long-sp-short acronym style provided by glossaries is modified so that it uses
instead of the hard-coded 3em. This is a command not a length and so can be changed using \renewcommand.
Any of the new abbreviation styles that use \glsxtrfullsep (such as long-short) can easily be changed to use \glsacspace with
The first use acronym font command
is redefined to use the first use abbreviation font command \glsfirstabbrvfont. This will be reset if you use \RestoreAcronyms.
The subsequent use acronym font command
is redefined to use the subsequent use abbreviation font command \glsabbrvfont. This will be reset if you use \RestoreAcronyms.
As from v1.21, glossaries-extra has a new supplementary package glossary-bookindex which provides the glossary style bookindex. This is very similar to the mcolindexgroup style but is designed for indexes, so by default only the name and location list are displayed. You can either load this package explicitly and then set the style:
or use both the stylemods and style options:
The bookindex style only supports a maximum hierarchical level of 2 (top-level, level 1 and level 2).
The number of columns is given by
which defaults to 2.
This style uses the multicols environment. If the command
isn’t empty then it’s supplied as the optional argument following \begin{multicols} {⟨n⟩}. You can switch from multicols to multicols* by redefining
For example
Each top-level entry is displayed using
where the entry is identified by ⟨label⟩. This just does \glossentryname{⟨label⟩} by default. For example, if you want the symbol to be included:
Alternatively you can use the \glsxtrpostname⟨category⟩ hook.
Sub-entries are displayed using
which just defaults to \glsxtrbookindexname{⟨label⟩}.
The separator used before the location list for top-level entries is given by
where ⟨label⟩ is the entry’s label. This checks if the location field has been set. If it has, it does
otherwise it just does \glsxtrprelocation (which defaults to \space). If you’re not using bib2gls, the location field won’t be set.
The separator used before the location list for sub-entries is given by
which defaults to \glsxtrbookindexprelocation{⟨label⟩}.
The separator used between a top-level parent and child entry is given by
This defaults to \nopagebreak.
The separator used between a sub-level parent and child entry is given by
This defaults to \glsxtrbookindexparentchildsep.
The separator between top-level entries is given by
This comes after the entry given by ⟨label1⟩, if the entry has no children, or after the last descendent otherwise, so it always comes immediately before the entry given by ⟨label2⟩ unless the entry occurs at the start of a group. This does nothing by default.
The separator between two level 1 entries is given by
The separator between two level 2 entries is given by
At the end of each letter group, the following hooks are done in order:
where ⟨sub-sub-label⟩ is the label of the last level 2 entry, ⟨sub-label⟩ is the label of the last level 1 entry and ⟨label⟩ is the label of the last level 0 entry.
For example, the resource option seealso=omit instructs bib2gls to omit the seealso cross-reference from the location list. (The see cross-reference will still be added unless you also have see=omit.) The seealso cross-reference can instead be appended after the child entries using:
This uses \glstreesubitem and \glstreesubsubitem to indent the cross-reference according to the next level down, so the cross-reference for a top-level entry is aligned with the sub-entries, and a level 1 entry has its cross-reference aligned with sub-sub-entries. In the event that a level 2 entry has a cross-reference, this is indented a bit further (but it won’t be aligned with any deeper level as the bookindex style only supports a maximum of two sub-levels).
The bookindex style uses group headings. (If you use bib2gls remember to invoke it with the --group or -g switch.) The heading will use
If \pdfbookmark has been defined, this will use that command to bookmark the group title. If section=chapter is set (default if chapters are defined) then this uses level 1 otherwise it uses level 2. You can redefine this command if this isn’t appropriate. If \pdfbookmark hasn’t been defined, this command does nothin.
The group heading is formatted according to
which is defined as
where \glstreegroupheaderfmt is provided by the glossary-tree package, which is automatically loaded. Note that the entry names aren’t encapsulated with \glstreenamefmt.
The glossary-bookindex package provides some supplementary commands that aren’t used by default, but may be used when adjusting the style. These commands should only be used within one of the \print…glossary commands. (That is, they should only be used in glossary styles.)
This writes information to the .aux file that can be read on the next run to obtain the first and last entry on each page of the glossary.
You can display the first entry associated with the current page using:
and the last entry associated with the current page using:
These do nothing if there are no entries marked on the current page (or if the document build isn’t up to date).
The entry is formatted using:
for the first instance and
for the last.
These commands are designed for use in page headers or footers where the page number is stable. For example, \glsxtrbookindexname can be redefined to mark the current entry:
If you only want to mark the top-level entries, remember to redefine \glsxtrbookindexsubname as it defaults to \glsxtrbookindexname:
Then if you’re using fancyhdr you can set the page style to show the first and last entry for the current page with:
The glossaries-extra-stylemods package (more conveniently loaded through the glossaries-extra stylemods option) modifies some of the predefined styles that are provided with the glossaries package. These modifications are described in more detail in §2.10.3 The glossaries-extra-stylemods Package.
The glossaries package tries to determine the group title from its label by first checking if \⟨label⟩groupname exists. If it doesn’t exist, then the title is assumed to be the same as the label. For example, when typesetting the “A” letter group, glossaries first checks if \Agroupname exists. This could potentially cause conflict with another package that may have some other meaning for \Agroupname, so glossaries-extra first checks for the existence of the internal command \glsxtr@grouptitle@⟨label⟩ which shouldn’t clash with another package. You can set the group title using
For example:
This uses a global assignment. If you need to scope the change you can use
The commands \glossentryname and \glossentrydesc are modified to take into account the glossname, glossdesc and glossdescfont attributes (see §5 Categories). This means you can make simple case-changing modifications to the name and description without defining a new glossary style.
If you want to adapt a style to use another field instead of name, you can use
This behaves just like \glossentryname (that is, it obeys glossname, glossnamefont or \glsnamefont and uses the post-name hook) but it uses the given ⟨field⟩ instead of name. The ⟨field⟩ argument must be the internal field name (for example desc rather than description). See the key to field mappings table in the glossaries user manual.
There is a hook after \glossentryname and \Glossentryname:
By default this checks the indexname attribute. If the attribute exists for the category to which the label belongs, then the name is automatically indexed using
See §7 Auto-Indexing for further details.
As from version 1.04, the post-name hook \glsxtrpostnamehook will also use \glsxtrpostname⟨category⟩ if it exists. You can use \glscurrententrylabel to obtain the entry label with the definition of this command. For example, suppose you are using a glossary style the doesn’t display the symbol, you can insert the symbol after the name for a particular category, say, the “symbol” category:
For convenience, as from v1.31, you can use
This is simply a shortcut for:
As from version 1.25, the post-name hook also does
(before \glsxtrpostname⟨category⟩) to allow for additional non-category related code. This does nothing by default.
The post-description code used within the glossary is modified so that it also does
This occurs before the original \glspostdescription, so if the nopostdot=false option is used, it will be inserted before the terminating full stop.
This new command will do \glsxtrpostdesc⟨category⟩ if it exists, where ⟨category⟩ is the category label associated with the current entry. For example \glsxtrpostdescgeneral for entries with the category set to general or \glsxtrpostdescacronym for entries with the category set to acronym. For convenience, as from v1.31, you can use
This is simply a shortcut for:
Since both \glossentry and \subglossentry set
to the label for the current entry, you can use this within the definition of these post-description hooks if you need to reference the label.
For example, suppose you want to insert the plural form in brackets after the description in the glossary, but only for entries in the general category, then you could do:
This means you don’t have to define a custom glossary style, which you may find more complicated. (It also allows more flexibility if you decide to change the underlying glossary style.)
The number list is now placed inside the argument of
This is internally used by \glossaryentrynumbers. The nonumberlist option redefines \glossaryentrynumbers so that it doesn’t display the number list, but it still saves the number list in case it’s required.
If you want to, for example, change the font for the entire number list then redefine \GlsXtrFormatLocationList as appropriate. Don’t modify \glossaryentrynumbers.
Sometimes users like to insert “page” or “pages” in front of the number list. This is quite fiddly to do with the base glossaries package, but glossaries-extra provides a way of doing this. First you need to enable this option and specify the text to display using:
where ⟨page⟩ is the text to display if the number list only contains a single location and ⟨pages⟩ is the text to display otherwise. For example:
An extra run is required when using this command.
See the accompanying sample file sample-pages.tex.
Note that bib2gls can be instructed to insert a prefix at the start of non-empty location lists, which can be used as an alternative to \GlsXtrEnablePreLocationTag.
As from v1.02, glossaries-extra now includes the package glossaries-extra-stylemods that will redefine the predefined styles to include the post-description hook (for those that are missing it). You will need to make sure the styles have already been defined before loading glossaries-extra. For example:
Alternatively you can load glossary-⟨name⟩.sty at the same time by passing ⟨name⟩ as a package option to glossaries-extra-stylemods. For example:
Another option is to use the stylemods key when you load glossaries-extra. You can omit a value if you only want to use the predefined styles that are automatically loaded by glossaries (for example, the long3col style):
Or the value of stylemods may be a comma-separated list of the style package identifiers. For example:
Remember to group the value if it contains any commas:
Note that the inline style is dealt with slightly differently. The original definition provided by the glossary-inline package uses \glspostdescription at the end of the glossary (not after each entry description) within the definition of \glspostinline. The style modification changes this so that \glspostinline just does a full stop followed by space factor adjustment, and the description \glsinlinedescformat and sub-entry description formats \glsinlinesubdescformat are redefined to include \glsxtrpostdescription (not \glspostdescription). This means that the modified inline style isn’t affected by the nopostdot option, but the post-description category hook can still be used.
The tabular-like styles, such as long are adjusted so that the \ifglsnogroupskip conditional (set with nogroupskip) is moved outside of the definition of \glsgroupskip to avoid problems that cause an “Incomplete \iftrue” error with \printunsrtglossary and \printnoidxglossary. This means that if you want to change this conditional using \setupglossaries or using the nogroupskip option in \printglossary, \printnoidxglossary or \printunsrtglossary, you must also reset the glossary style.
As from version 1.21, the hard-coded \space before the number list in many of the predefined styles is replaced with
This just defaults to \space but may be redefined as required. For example:
(which defaults to \glsxtrprelocation) for top-level items and
(which defaults to \glslistprelocation) for child items.
As from v1.31, the description (including the post-description hook) is governed by:
for the list and altlist styles (but not the listdotted variations).
For just the list style and its letter group variations (not the altlist or listdotted variations) the number list for child entries is followed by
which defaults to a full stop.
The default value of \glslistdottedwidth is changed so that it’s set at the start of the document (if it hasn’t been changed in the preamble). This should take into account situations where \hsize isn’t set until the start of the document.
The glossary-tree package introduced two new commands in glossaries version 4.22, \glstreegroupheaderfmt and \glstreenavigationfmt, which are used to format the letter group headings and the navigation elements for the appropriate styles. These two new commands are defined in terms of \glstreenamefmt since that was the command originally used for the group headings and navigation. This now allows these different elements to be defined independently, but the most common redefinition is for \glstreenamefmt to remove the bold in the name. If the bold is still required for the group heading and navigation elements, then both other commands also need redefining. To simplify matters, if \glstreenamefmt has been defined, as from v1.31 glossaries-extra-stylemods defines:
which simply does \textbf{⟨text⟩} and redefines \glstreenamefmt, \glstreegroupheaderfmt and \glstreenavigationfmt all in terms of \glstreedefaultnamefmt. This means that if you want to change all three to use a particular style you only need to redefine \glstreedefaultnamefmt, but if you only want to redefine \glstreenamefmt without affecting the other two commands, then you now can.
The index-like and tree-like styles insert the pre-number list space with
(which defaults to \glsxtrprelocation) for top-level items and
(which defaults to \glstreeprelocation) for child items.
As from version 1.31, the glossaries-extra-stylemods package also provides:
which is used by the treenoname styles to display the pre-description separator, the description and the post-description hook. Similarly for the symbol:
The above are just used for top-level entries. Child entries don’t have the name or symbol displayed for the treenoname styles, so there’s only a command for the child description:
For the tree styles (but not the treenoname or alttree styles), the description is displayed using:
and the symbol with:
Again the above two commands are just for top-level entries. The child entries use:
for the description and
for the symbol.
As from version 1.05, the glossaries-extra-stylemods package provides some additional commands for use with the alttree style to make it easier to modify. These commands are only defined if the glossary-tree package has already been loaded, which is typically the case unless the notree option has been used when loading glossaries.
(New to version 1.21.) This is like \glssetwidest (provided by glossary-tree) but performs a global assignment.
This is like \glssetwidest but performs a protected expansion on ⟨name⟩. This has a localised effect. For a global setting, use
The following only set the value if ⟨name⟩ is wider than the current value (new to version 1.23). Local update:
Global update:
Locale update (expands ⟨name⟩):
Global update (expands ⟨name⟩):
The widest entry value can later be retrieved using
for the top-level entries and
for sub-entries, where ⟨level⟩ is the level number.
Note that if you are using bib2gls, you can use the resource option set-widest which will try to determine the widest name of all the selected entries. This isn’t guaranteed to work as it may depend on fonts or commands that bib2gls can’t replicate, but it should be suitable for names that just consist of text, and can be more efficient than iterating over all the defined entries using TEX.
The command \glsfindwidesttoplevelname provided by glossary-tree has a CamelCase synonym:
Similar commands are also provided:
This has an additional check that the entry has been used. Naturally this is only useful if the glossaries that use the alttree style occur at the end of the document. This command should be placed just before the start of the glossary. (Alternatively, place it at the end of the document and save the value in the auxiliary file for the next run.)
This is like the previous command but if doesn’t check the parent key. This is useful if all levels should have the same width for the name.
This is like the previous command but doesn’t check if the entry has been used.
This is like \glsFindWidestUsedTopLevelName but also sets the first two sub-levels as well. Any entry that has a great-grandparent is ignored.
This is like the previous command but doesn’t check if the entry has been used.
This is like \glsFindWidestUsedAnyName but also measures the symbol. The length of the widest symbol is stored in ⟨register⟩.
This is like the previous command but it doesn’t check if the entry has been used.
This is like \glsFindWidestUsedAnyNameSymbol but also measures the number list. This requires \glsentrynumberlist (see the glossaries user manual). The length of the widest symbol is stored in ⟨symbol register⟩ and the length of the widest number list is stored in ⟨location register⟩.
This is like the previous command but it doesn’t check if the entry has been used.
This is like \glsFindWidestUsedAnyNameSymbolLocation but doesn’t measure the symbol. The length of the widest number list is stored in ⟨register⟩.
This is like the previous command but doesn’t check if the entry has been used.
The layout of the symbol, description and number list is governed by
for top-level entries and
for sub-entries.
There is now a user level command that performs the initialisation for the alttree style:
The paragraph indent for subsequent paragraphs in multi-paragraph descriptions is provided by the length
For additional commands that are available with the alttree style, see the documented code (glossaries-extra-code.pdf). For examples, see the accompanying sample files sample-alttree.tex, sample-alttree-sym.tex and sample-alttree-marginpar.tex.
Abbreviations include acronyms (words formed from initial letters, such as “laser”), initialisms (initial letters of a phrase, such as “html”, that aren’t pronounced as words) and contractions (where parts of words are omitted, often replaced by an apostrophe, such as “don’t”). The “acronym” code provided by the glossaries package is misnamed as it’s more often than not used for initialisms instead. Acronyms tend not to be expanded on first use (although they may need to be described for readers unfamiliar with the term). They are therefore more like a regular term, which may or may not require a description in the glossary.
The glossaries-extra package corrects this misnomer, and provides better abbreviation handling, with
This sets the category key to abbreviation by default, but that value may be overridden in ⟨options⟩. The category may have attributes that modify the way abbreviations are defined. For example, the insertdots attribute will automatically insert full stops (periods) into ⟨short⟩ or the noshortplural attribute will set the default value of the shortplural key to just ⟨short⟩ (without appending the plural suffix). See §5 Categories for further details.
See §2.7 Nested Links regarding the pitfalls of using commands like \gls or \glsxtrshort within ⟨short⟩ or ⟨long⟩.
The \newacronym command provided by the glossaries package is redefined by glossaries-extra to use \newabbreviation with the category set to acronym (see also §2.8 Acronym Style Modifications) so
is
now
equivalent
to
\newabbreviation[type=\acronymtype,category=acronym,⟨options⟩]
{⟨label⟩}
{⟨short⟩}
{⟨long⟩}
The \newabbreviation command is superficially similar to the glossaries package’s \newacronym but you can apply different styles to different categories. The default style is short-nolong for entries in the acronym category and short-long for entries in the abbreviation category. (These aren’t the same as the acronym styles provided by the glossaries package, although they may produce similar results.)
The way the abbreviations are displayed by commands like \gls varies according to the abbreviation style. The styles are set according to the entry’s category so, unlike the base glossaries package, you can have different abbreviation styles within the same glossary.
There are two types of full forms. The display full form, which is used on first use by commands like \gls and the inline full form, which is used by commands like \glsxtrfull. For some of the abbreviation styles, such as long-short, the display and inline forms are the same. In the case of styles such as short-nolong or short-footnote, the display and inline full forms are different.
These formatting commands aren’t stored in the short, shortplural, long or longplural fields, which means they won’t be used within commands like \glsentryshort (but they are used within commands like \glsxtrshort and \glsfmtshort). Note that \glsxtrlong and the case-changing variants don’t use \glsfirstlongfont.
You can apply the formatting command used for the short form to some arbitrary text using
where ⟨category⟩ is the category label that identifies the abbreviation style. Similarly for the formatting command use by the long form:
If you would like to tag the initial letters in the long form such that those letters are underlined in the glossary but not in the main part of the document, you can use
before you define your abbreviations.
This command (robustly) defines ⟨cs⟩ (a control sequence) to accept a single argument, which is the letter (or letters) that needs to be tagged. The normal behaviour of this command within the document is to simply do its argument, but in the glossary it’s activated for those categories that have the tagging attribute set to “true”. For those cases it will use
This command defaults to \underline{⟨text⟩} but may be redefined as required.
The control sequence ⟨cs⟩ can’t already be defined when used with the unstarred version of \GlsXtrEnableInitialTagging for safety reasons. The starred version will overwrite any previous definition of ⟨cs⟩. As with redefining any commands, ensure that you don’t redefine something important. In fact, just forget the existence of the starred version and let’s pretend I didn’t mention it.
The first argument of \GlsXtrEnableInitialTagging is a comma-separated list of category names. The tagging attribute will automatically be set for those categories. You can later set this attribute for other categories (see §5 Categories) but this must be done before the glossary is displayed.
The accompanying sample file sample-mixtures.tex uses initial tagging for both the acronym and abbreviation categories:
This defines the command \itag which can be used in the definitions. For example:
The underlining of the tagged letters only occurs in the glossary and then only for entries with the tagging attribute set.
The abbreviation style must be set before abbreviations are defined using:
where ⟨style-name⟩ is the name of the style and ⟨category⟩ is the category label (abbreviation by default). New abbreviations will pick up the current style according to their given category. If there is no style set for the category, the fallback is the style for the abbreviation category. Some styles may automatically modify one or more of the attributes associated with the given category. For example, the long-noshort and short-nolong styles set the regular attribute to true.
Note that \setacronymstyle is disabled by glossaries-extra. Use
Abbreviations can be used with the standard glossaries commands, such as \gls, but don’t use the acronym commands like \acrshort (which use \acronymfont). The short form can be produced with:
(Use this instead of \acrshort.)
The long form can be produced with
(Use this instead of \acrlong.)
The inline full form can be produced with
(This this instead of \acrfull.)
As mentioned earlier, the inline full form may not necessarily match the format used on first use with \gls. For example, the short-nolong style only displays the short form on first use, but the full form will display the long form followed by the short form in parentheses.
The arguments ⟨options⟩, ⟨label⟩ and ⟨insert⟩ are the same as for commands such as \glstext. There are also analogous case-changing commands:
First letter upper case short form:
First letter upper case long form:
First letter upper case inline full form:
All upper case short form:
All upper case long form:
All upper case inline full form:
Plural forms are also available.
Short form plurals:
Long form plurals:
Full form plurals:
The abbreviation shortcut commands can be enabled using the package option shortcuts=abbreviation (or shortcuts=abbr) or shortcuts=ac. (You can use both settings at the same time.) The provided shortcut commands listed in table 3.1.
Shortcut | Shortcut | Equivalent Command |
(shortcuts=abbreviation) | (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 |
There are two types of abbreviation styles: those that treat the abbreviation as a regular entry (so that \gls uses \glsgenentryfmt) and those that don’t treat the abbreviation as a regular entry (so that \gls uses \glsxtrgenabbrvfmt).
The regular entry abbreviation styles set the regular attribute to “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). The short and long fields are set as appropriate and may be accessed through commands like \glsxtrshort.
The other abbreviation styles don’t modify the regular attribute. The first and text fields (and their plural forms) are set and can be accessed through commands like \glsfirst, but they aren’t used by commands like \gls, which instead use the short form (stored in the short key) and the display full format (through commands like \glsxtrfullformat that are defined by the style).
In both cases, the first use of \gls may not match the text produced by \glsfirst (and likewise for the plural and case-changing versions).
The sample file sample-abbr-styles.tex demonstrates all predefined styles described here.
The parenthetical styles, such as long-short, use
to set the parenthetical material. This just puts parentheses around the text: (⟨text⟩).
The basic abbreviation styles, such as long-short and short-long use
for the short form. This just does ⟨text⟩ by default. (That is, no font change is applied.) On first use,
is used instead. By default, this just does \glsabbrvdefaultfont. The long form is formatted according to
which again just does ⟨text⟩ (no font change). On first use,
is used instead. This just does \glslongdefaultfont. The plural suffix used for the short form is given by
which defaults to \glspluralsuffix.
The small-cap styles, such as long-short-sc and short-sc-long, use
which uses \textsc.3.1 On first use
is used instead. This uses \glsabbrvscfont by default. So redefine, \glsabbrvscfont to change first and subsequent uses or \glsfirstabbrvscfont to change just the first use.
The long form for the small-cap styles uses \glslongdefaultfont or \glsfirstlongdefaultfont, as with the basic style. The suffix is given by
This is defined as
The \glstextup command is provided by glossaries and is used to switch off the small caps font for the suffix. If you override the default short plural using the shortplural key when you define the abbreviation you will need to make the appropriate adjustment if necessary. (Remember that the default plural suffix behaviour can be modified through the use of the aposplural and noshortplural attributes. See §5 Categories for further details.)
The small styles, such as long-short-sm and short-sm-long, use
which uses \textsmaller. (This requires the relsizes package, which isn’t loaded by glossaries-extra, so must be loaded explicitly.) On first use
is used instead. This uses \glsabbrvsmfont by default.
The long form for the smaller styles uses \glslongdefaultfont or \glsfirstlongdefaultfont, as with the basic style. The suffix is given by
which defaults to just \glsxtrabbrvpluralsuffix.
The “short-em” (emphasize short) styles, such as long-short-em or short-em-long, use
On first use
is used instead. This uses \glsabbrvemfont by default. The suffix is given by
which defaults to just \glsxtrabbrvpluralsuffix. The long form is as for the basic style unless the style is a “long-em” style.
The “long-em” (emphasize long) styles, such as long-em-short-em or short-em-long-em, use
instead of \glsfirstlongdefaultfont{⟨long-form⟩} and
instead of \glslongdefaultfont{⟨long-form⟩}. The first form \glsfirstlongemfont is initialised to use \glslongemfont.
The user styles have similar commands:
for the short form,
for the first use short form,
for the long form,
for the first use long form, and
for the short plural suffix.
Similarly for the hyphen styles:
for the short form,
for the first use short form,
for the long form,
for the first use long form, and
for the short plural suffix.
Similarly for the “only” styles, such as long-only-short-only:
for the short form,
for the first use short form,
for the long form,
for the first use long form, and
for the short plural suffix.
Note that by default inserted material (provided in the final optional argument of commands like \gls), is placed outside the font command in the predefined styles. To move it inside, use:
This applies to all the predefined styles. For example:
This will make the long form and the inserted text emphasized, whereas the default (without \glsxtrinsertinsidetrue) would place the inserted text outside of the emphasized font.
Note that for some styles, such as the short-long, the inserted text would be placed inside the font command for the short form (rather than the long form in the above example).
Remember that \textsc renders lowercase letters as small capitals. Uppercase letters are rendered as normal uppercase letters, so if you specify the short form in uppercase, you won’t get small capitals unless you redefine \glsabbrvscfont to convert its argument to lowercase. For example:
If you want to easily switch between the “sc” and “sm” styles, you may find it easier to redefine this command to convert case:
Some of the styles use
as a separator between the long and short forms. This is defined as a space by default, but may be changed as required. For example:
or
The new naming scheme for abbreviation styles is as follows:
This is for the parenthetical styles. The -⟨modifier⟩ parts may be omitted. These styles display ⟨field1⟩ followed by ⟨field2⟩ in parentheses. If ⟨field1⟩ or ⟨field2⟩ starts with “no” then that element is omitted from the display style (no parenthetical part) but is included in the inline style.
If the -⟨modifier⟩ part is present, then the field has a font changing command applied to it. The special modifier -only indicates that field is only present according to whether or not the entry has been used.
If post is present then ⟨field2⟩ is placed after the link-text using the post-link hook.
If the -user part is present, then the user1 value, if provided, is inserted into the parenthetical material . (The field used for the inserted material may be changed.)
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 that style that doesn’t set the attribute.
There are a few “noshort” styles, such as long-hyphen-noshort-noreg, that have “-noreg” version without a regular version. This is because the style won’t work properly with the regular set, but the naming scheme is maintained for consistency with the other “noshort” styles.
The display style uses ⟨field1⟩ followed by a footnote with the other field in it. If post is present then the footnote is placed after the link-text using the post-link hook. The inline style does ⟨field1⟩ followed by the other field in parentheses.
If -⟨modifier1⟩ is present, ⟨field1⟩ has a font-changing command applied to it.
Examples:
Like ⟨style⟩ but the 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 deprecated style names generate a warning using:
where ⟨old-name⟩ is the deprecated name and ⟨new-name⟩ is the preferred name. You can suppress these warnings by redefining this command to do nothing.
The following abbreviation styles set the regular attribute to “true” for all categories that have abbreviations defined with any of these styles.
(Similarly for the other short⟨modifier⟩-nolong⟨modifier⟩ styles, unless indicated otherwise.) This command is expanded as the entry is defined, so any redefinition must be done before \newabbreviation (or \newacronym) for it to take effect. Make sure to \protect any formatting commands (or anything else that shouldn’t be expanded).
The description is set to the long form. The inline full form displays ⟨short⟩ (⟨long⟩). The long form on its own can be displayed through commands like \glsxtrlong.
(Similarly for the other short⟨modifier⟩-nolong⟨modifier⟩-desc styles, unless indicated otherwise.) This command is expanded when the entry is defined, so \protect fragile and formatting commands and only redefine this command before \newabbreviation (or \newacronym).
The description must be supplied by the user. You may prefer to use the short-nolong style with the post-description hook set to display the long form and override the description key. (See the sample file sample-acronym-desc.tex.)
The sort key are set to the long form. The name key is also set to the long form, but this is done by expanding
(Similarly for the other long⟨modifier⟩-noshort⟨modifier⟩-desc styles, unless indicated otherwise.) This command should only be redefined before abbreviations are defined, and any fragile or formatting commands within it need protecting.
The description must be provided by the user. The predefined glossary styles won’t display the short form. You can use the post-description hook to automatically append the short form to the description. The inline full form will display ⟨long⟩ (⟨short⟩).
(Similarly for other long⟨modifier⟩-noshort⟨modifier⟩ styles, unless indicated otherwise.) This command should only be redefined before abbreviations are defined, and fragile or formatting commands should be protected.
The following abbreviation styles will set the regular attribute to “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.
(Similarly for other long⟨modifier⟩-short⟨modifier⟩ styles, unless indicated otherwise.) Any redefinition of this command must come before the abbreviations are defined as it expands on definition. Make sure you protect any commands that shouldn’t be expanded. The long form can be referenced with \the\glslongtok and the short form can be referenced with \the\glsshorttok.
The description is set to the long form. The long and short forms are separated by \glsxtrfullsep. If you want to insert material within the parentheses (such as a translation), try the long-short-user style.
Any redefinition of this command must come before the abbreviations are defined as it expands on definition. Make sure you protect any commands that shouldn’t be expanded. The long form can be referenced with \the\glslongtok and the short form can be referenced with \the\glsshorttok.
Any redefinition of this command must come before the abbreviations are defined as it expands on definition. Make sure you protect any commands that shouldn’t be expanded. The long form can be referenced with \the\glslongtok and the short form can be referenced with \the\glsshorttok.
(which defaults to useri) using \ifglshasfield (provided by glossaries). If the field hasn’t been set, the style behaves like the long-short style and produces ⟨long⟩ (⟨short⟩) but if the field has been set, the contents of that field are inserted within the parentheses in the form ⟨long⟩ (⟨short⟩, ⟨field-value⟩). The format is governed by
where ⟨text⟩ is the short form (for the long-short-user style) or the long form (for the short-long-user style). This command first inserts a space using \glsxtrfullsep and then the parenthetical content (using \glsxtrparen). The description is set to
The default definition ignores the ⟨label⟩ and encapsulates ⟨long⟩ with \glslonguserfont.
The name is obtained by expanding \glsxtrlongshortname (see above). The ⟨text⟩ argument includes the font formatting command, \glsfirstabbrvfont {⟨short⟩} in the case of the long-short-user style and \glsfirstlongfont{⟨long⟩} in the case of the short-long-user style.
For example:
On first use, \gls{tug} will appear as:
TEX User Group (TUG)
whereas \gls{dante} will appear as:
Deutschsprachige Anwendervereinigung TEX e.V (DANTE, German Speaking TEX User Group)
The short form is formatted according to
and the plural suffix is given by
These may be redefined as appropriate. For example, if you want a smallcaps style, you can just set these commands to those used by the long-short-sc style:
For example:
The description must be supplied by the user. The long and short forms are separated by \glsxtrfullsep. The name field is obtained from
(Similarly for other long⟨modifier⟩-short⟨modifier⟩-desc styles, unless indicated otherwise.) Any redefinition of this command must come before the abbreviations are defined as it expands on definition. Make sure you protect any commands that shouldn’t be expanded. The long form can be referenced with \the\glslongtok and the short form can be referenced with \the\glsshorttok.
Again, this should only be redefined before \newabbreviation (or \newacronym), and fragile and formatting commands need protecting.
The description key must be supplied in the optional argument of \newabbreviation (or \newacronym). The sort key is set to ⟨long⟩ (⟨short⟩) as per the long-short-desc style.
The name field is obtained from
(Similarly for other short⟨modifier⟩-long⟨modifier⟩ styles, unless indicated otherwise.) Any redefinition of this command must come before the abbreviations are defined as it expands on definition. Make sure you protect any commands that shouldn’t be expanded. The long form can be referenced with \the\glslongtok and the short form can be referenced with \the\glsshorttok.
Again, this should only be redefined before \newabbreviation (or \newacronym) and commands that should be expanded need to be protected. The description is set to \glsuserdescription{⟨long⟩}{⟨label⟩}.
(Similarly for other short⟨modifier⟩-long⟨modifier⟩-desc styles, unless indicated otherwise.) Any redefinition of this command must come before the abbreviations are defined as it expands on definition. Make sure you protect any commands that shouldn’t be expanded. The long form can be referenced with \the\glslongtok and the short form can be referenced with \the\glsshorttok.
Again, this should only be redefined before \newabbreviation (or \newacronym), and fragile and formatting commands need protecting.
The description key must be supplied in the optional argument of \newabbreviation (or \newacronym).
The inline full form uses the ⟨short⟩ (⟨long⟩) style. The name is set to the short form. The description is set to the long form. The name key is obtained by expanding
(Similarly for other short⟨modifier⟩-⟨modifier⟩footnote styles, unless indicated otherwise.) Again, this command should only be redefined before \newabbreviation (or \newacronym), and fragile or formatting commands should be protected from expansion.
As from version 1.05, all the footnote styles use:
to format the long form on first use or for the full form and
to format the long form elsewhere (for example, when used with \glsxtrlong).
As from version 1.07, all the footnote styles use:
By default, this just does \footnote{⟨long⟩} (the first argument is ignored). For example, to make the footnote text link to the relevant place in the glossary:
or to include the short form with a hyperlink:
Note that I haven’t used commands like \glsxtrshort to avoid interference (see §2.3 Entry Display Style Modifications and §2.7 Nested Links).
The inline full form uses the ⟨short⟩ (⟨long⟩) style. The name is set to the short form. The description is set to the long form. Note that this style will change \glsxtrfull (and it’s variants) so that it fakes non-first use. (Otherwise the footnote would appear after the inline form.)
where ⟨insert⟩ is the inserted material provided in the final optional argument of commands like \insert. If ⟨insert⟩ start with a hyphen, then this locally redefines \glsxtrwordsep to a hyphen, which means that if the markwords attribute is set then the long form will become hyphenated. (If this attribute isn’t set, there’s no alteration to the way the long form is displayed.) The name key is obtained from \glsxtrlongshortname.
Unlike the other ⟨long⟩ (⟨short⟩) type of styles, such as long-short, this style also repeats the insertion in the parenthetical part, so that the first use form is:
\glsfirstlonghyphenfont{⟨long⟩}⟨insert⟩ (\glsfirstabbrvhyphenfont{⟨short⟩}⟨insert⟩)
The space before the parenthetical material is actually given by \glsxtrfullsep{⟨label⟩} which defaults to a space. The ⟨insert⟩ may be moved into the formatting commands according to the conditional \ifglsxtrinsertinside.
For example, if ip is defined using:
then
will do
Internet-Protocol-Adressen (IP-Adressen)
on first use, whereas
will do
Internet Protocol Address (IP Address)
on first use.
will do
Internet Protocol-Adressen
If the markwords attribute hadn’t been set, then the first use of
would do
Internet Protocol-Adressen (IP-Adressen)
instead.
If you want the short version in small-caps, you can just redefine \glsabbrvhyphenfont and \glsxtrhyphensuffix to use the small-caps versions. For example:
Similarly for other font-changing variations.
New to version 1.17. This is similar to long-hyphen-short-hyphen but the user supplies the description. The name is obtained from \glsxtrlongshortdescname.
New to version 1.17. This is similar to long-hyphen-short-hyphen but the
inserted and parenthetical material are moved to the post-link hook. On first
use, \gls{⟨label⟩}[⟨insert⟩] will do
\glsxtrlonghyphen{⟨long⟩}{⟨label⟩}{⟨insert⟩}\glsxtrposthyphenshort
{⟨label⟩}⟨insert⟩
is in the post-link hook. This uses the format:
⟨insert⟩ (\glsfirstabbrvhyphenfont{⟨short⟩}⟨isnert⟩)
The part in the link-text on first use:
checks if ⟨insert⟩ starts with a hyphen. If it does, then \glsxtrwordsep is locally redefined to a hyphen. This command only uses ⟨insert⟩ to test if it starts with a hyphen. The actual insertion code isn’t typeset until the post-link hook and it’s also localised, which means that you can use commands like \gls in ⟨insert⟩ for this style without causing nested hyperlinks, but only for commands like \gls.
The inline full display format used by commands like \glsxtrfull behaves differently to the first use of \gls with this style. It’s better to use \glsreset{⟨label⟩}\gls{⟨label⟩} if you want to ensure the full format.
New to version 1.17. This is similar to long-hyphen-postshort-hyphen but the user supplies the description. The name is obtained from \glsxtrlongshortdescname.
which behaves in an analogous way to \glsxtrlonghyphenshort. The name is obtained from \glsxtrshortlongname.
New to version 1.17. This is similar to short-hyphen-long-hyphen but the user supplies the description. The name is obtained from \glsxtrshortlongdescname.
is in the post-link hook. These commands behave in an analogous manner to those used with long-hyphen-postshort-hyphen. The name is obtained from \glsxtrshortlongname.
The inline full display format used by commands like \glsxtrfull behaves differently to the first use of \gls with this style. It’s better to use \glsreset{⟨label⟩}\gls{⟨label⟩} if you want to ensure the full format.
New to version 1.17. This is similar to short-hyphen-postlong-hyphen but the user supplies the description. The name is obtained from \glsxtrshortlongdescname.
New abbreviation styles may be defined using:
where ⟨name⟩ is the name of the new style (as used in the mandatory argument of \setabbreviationstyle). This is similar but not identical to the glossaries package’s \newacronymstyle command.
The ⟨setup⟩ argument deals with the way the entry is defined and may set attributes for the given abbreviation category. This argument should redefine
to set the entry fields including the name (defaults to the short form if omitted), sort, first, firstplural. Other fields may also be set, such as text, plural and description.
For example, the long-short style has the following in ⟨setup⟩:
Note that the first and firstplural are set even though they’re not used by \gls.
The basic styles, such as long-short, use commands like \glsabbrvfont (which are redefined whenever the style formatting is set) within \CustomAbbreviationFields. Other styles, such as long-em-short-em directly use their own custom commands, such as \glsabbrvemfont. With these styles, commands like \glsabbrvfont still need to be defined as appropriate in the ⟨fmts⟩ argument even if they’re not used within \CustomAbbreviationFields.
The ⟨setup⟩ argument may also redefine
which can be used to assign attributes. (This will automatically be initialised to do nothing.)
For example, the short-footnote includes the following in ⟨setup⟩:
This sets the nohyperfirst attribute to “true”. It also unsets the regular attribute if it has previously been set. Note that the nohyperfirst attribute doesn’t get unset by other styles, so take care not to switch styles for the same category.
You can access the short, long, short plural and long plural values through the following token registers.
Short value (defined by glossaries):
Short plural value (defined by glossaries-extra):
(This may be the default value or, if provided, the value provided by the user through the shortplural key in the optional argument of \newabbreviation.)
Long value (defined by glossaries):
Long plural value (defined by glossaries-extra):
(This may be the default value or, if provided, the value provided by the user through the longplural key in the optional argument of \newabbreviation.)
The short or long values may be modified by attributes (such as markwords). The above registers reflect the modification. If you want to access the original (unmodified) short or long form (as provided in the final two arguments of \newabbreviation), then use the commands:
for the short form and
for the long form. (These may be useful for the sort key to avoid any formatting that may be added by the attribute setting.)
There are two other registers available that are defined by glossaries:
which contains the entry’s label and
which contains the values provided in the optional argument of \newabbreviation.
Remember put \the in front of the register command as in the examples above. The category label can be access through the command (not a register):
This may be used inside the definition of \GlsXtrPostNewAbbreviation.
If you want to base a style on an existing style, you can use
where ⟨name⟩ is the name of the existing style. For example, the long-noshort-sc-desc style simply does
within ⟨setup⟩.
The ⟨fmts⟩ argument deals with the way the entry is displayed in the document. This argument should redefine the following commands.
The default suffix for the plural short form (if not overridden by the shortplural key):
(Note that this isn’t used for the plural long form, which just uses the regular \glspluralsuffix.)
The font used for the short form on first use or in the full forms:
The font used for the short form on subsequent use or through commands like \glsxtrshort:
The font used for the long form on first use or in the full forms:
The font used for the long form in commands like \glsxtrlong use:
Display full form singular no case-change (used by \gls on first use for abbreviations without the regular attribute set):
Display full form singular first letter converted to upper case (used by \Gls on first use for abbreviations without the regular attribute set):
Display full form plural no case-change (used by \glspl on first use for abbreviations without the regular attribute set):
Display full form plural first letter converted to upper case (used by \Glspl on first use for abbreviations without the regular attribute set):
In addition ⟨fmts⟩ may also redefine the following commands that govern the inline full formats. If the style doesn’t redefine them, they will default to the same as the display full forms.
Inline singular no case-change (used by \glsentryfull, \glsxtrfull and \GLSxtrfull):
Inline singular first letter converted to upper case (used by \Glsentryfull and \Glsxtrfull):
Inline plural no case-change (used by \glsentryfullpl, \glsxtrfullpl and \GLSxtrfullpl):
Inline plural first letter converted to upper case (used by \Glsentryfullpl and \Glsxtrfullpl):
(New to version 1.17.) You can also modify the way the subsequent use is formatted by redefining the following four commands, but these won’t be used for abbreviations with the regular attribute set. If the style doesn’t redefine these commands, the default values are used.
Singular with no case-change:
Singular with first letter upper case:
Plural with no case-change:
Plural with first letter upper case:
If you want to provide support for glossaries-accsupp use the following \glsaccess⟨xxx⟩ commands (§11.2 Accessibility Support) within the definitions of \glsxtrfullformat etc instead of the analogous \glsentry⟨xxx⟩ commands. (If you don’t use glossaries-accsupp, they will just do the corresponding \glsentry⟨xxx⟩ command.)
For example, the short-long style has the following in ⟨fmts⟩:
Since the inline full commands aren’t redefined, they default to the same as the display versions.
If you want to base a style on an existing style, you can use
within ⟨fmts⟩, where ⟨name⟩ is the name of the existing style. For example, the long-short-desc style has the following in ⟨fmts⟩:
Here’s an example of an abbreviation style that’s based on long-short that displays the short form within \textsf:
Note that this wouldn’t work if it was instead based on one of the modified versions such as short-sc-long as they explicitly use their own formatting commands, such as \glsabbrvemfont. The base styles, such as short-long, use the more generic \glsabbrvfont etc which makes them easier to adapt than the modified styles.
For further details, see the “Abbreviations” section in the documented code (glossaries-extra-code.pdf).
The glossaries user manual cautions against using commands like \gls in chapter or section titles. The principle problems are:
Similar problems can also occur with captions (except for the page header and bookmark issues).
To get around all these problems, the glossaries user manual recommends using the expandable non-hyperlink commands, such as \glsentrytext (for regular entries) or \glsentryshort (for abbreviations). This is the simplest solution, but doesn’t allow for special formatting that’s applied to the entry through commands like \glstext or \glsxtrshort. This means that if, for example, you are using one of the abbreviation styles that uses \textsc then the short form displayed with \glsentryshort won’t use small caps. If you only have one abbreviation style in use, you can explicitly enclose \glsentryshort{⟨label⟩} in the argument of \glsabbrvfont, like this:
Or, if you are using hyperref:
Since this is a bit cumbersome, you might want to define a new command to do this for you. However, if you have mixed styles this won’t work as commands like \gls and \glsxtrshort redefine \glsabbrvfont to match the entry’s style before displaying it. In this case, the above example doesn’t take into account the shifting definitions of \glsabbrvfont and will use whatever happens to be the last abbreviation style in use. More complicated solutions interfere with the upper casing used by the standard page styles that display the chapter or section title in the page header using \MakeUppercase.
The glossaries-extra package tries to resolve this by modifying \markright and \markboth and \@starttoc. If you don’t like this change, you can restore their former definitions using
If you only want to restore \@starttoc you can use:
If you restore the header or table of contents commands, you’ll have to use the glossaries manual’s recommendations of either simply using \glsentryshort (as above) or use the sectioning command’s option argument to provide an alternative for the table of contents and page header. For example:
Alternatively, you need to find a way to insert \glsxtrmarkhook and \@glsxtrinmark at the start of the header or table of contents either scoped or afterwards cancelled with \@glsxtrnotinmark and \glsxtrrestoremarkhook.
If you don’t revert the mark commands back with \glsxtrRevertMarks, you can use the commands described below in the argument of sectioning commands. You can still use them even if the mark commands have been reverted, but only where they don’t conflict with the page style.
The commands listed below all use \texorpdfstring if hyperref has been loaded so that the expandable non-formatted version is added to the PDF bookmarks. Note that since the commands that convert the first letter to upper case aren’t expandable, the non-case-changing version is used for the bookmarks.
These commands essentially behave as though you have used \glsxtrshort (or equivalent) with the options noindex and hyper=false. The text produced won’t be converted to upper case in the page headings by default. If you want the text converted to upper case you need to set the headuc attribute to “true” for the appropriate category.
Display the short form:
Display the plural short form:
First letter upper case singular short form:
(No case-change applied to PDF bookmarks.)
First letter upper case plural short form:
(No case-change applied to PDF bookmarks.)
Display the long form:
Display the plural long form:
First letter upper case singular long form:
(No case-change applied to PDF bookmarks.)
First letter upper case plural long form:
(No case-change applied to PDF bookmarks.)
There are similar commands for the full form, but note that these use the inline full form, which may be different from the full form used by \gls.
Display the full form:
Display the plural full form:
First letter upper case singular full form:
(No case-change applied to PDF bookmarks.)
First letter upper case plural full form:
(No case-change applied to PDF bookmarks.)
There are also equivalent commands for the value of the text field:
First letter converted to upper case:
(No case-change applied to PDF bookmarks.)
The plural equivalents:
and
Likewise for the value of the name field:
First letter converted to upper case:
(No case-change applied to PDF bookmarks.)
Similarly for the value of the first field:
First letter converted to upper case:
(No case-change applied to PDF bookmarks.)
The plural equivalents:
and
Each entry defined by \newglossaryentry (or commands that internally use it such as \newabbreviation) is assigned a category through the category key. You may add any category that you like, but since the category is a label used in the creation of some control sequences, avoid problematic characters within the category label. (So take care if you have babel shorthands on that make some characters active.)
The use of categories can give you more control over the way entries are displayed in the text or glossary. Note that an entry’s category is independent of the glossary type. Be careful not to confuse category with type.
The default category assumed by \newglossaryentry is labelled general. Abbreviations defined with \newabbreviation have the category set to abbreviation by default. Abbreviations defined with \newacronym have the category set to acronym by default.
Additionally, if you have enabled \newterm with the index package option that command will set the category to index by default. If you have enabled \glsxtrnewsymbol with the symbols package option, that command will set the category to symbol. If you have enabled \glsxtrnewnumber with the numbers package option, that command will set the category to number.
You can obtain the category label for a given entry using
This is equivalent to commands like \glsentryname and so may be used in an expandable context. No error is generated if the entry doesn’t exist.
You can test the category for a given entry using
This is equivalent to
so any restrictions that apply to \ifglsfieldeq also apply to \glsifcategory.Each category may have a set of attributes. For example, the general and acronym categories have the attribute regular set to “true” to indicate that all entries with either of those categories are regular entries (as opposed to abbreviations). This attribute is accessed by \glsentryfmt to determine whether to use \glsgenentryfmt or \glsxtrgenabbrvfmt.
Other attributes recognised by glossaries-extra are:
to do nothing.
Note that this can cause a problem if you access a field that doesn’t end with a full stop. For example:
Here the short and long fields end with a full stop, but the user1 field doesn’t. The simplest solution in this situation is to put the sentence terminator in the final optional argument. For example:
This will bring the punctuation character inside the link-text and it won’t be discarded.
and each word is encapsulated with
For example:
is essentially the same as
The “hyphen” styles, such as long-hyphen-short-hyphen, take advantage of this markup. If the inserted material (provided in the final argument of commands like \gls) starts with a hyphen then \glsxtrwordsep is locally redefined to a hyphen. (The default value is a space). Note that this only applies to commands like \gls and not like \glsxtrlong. You can provide your own localised switch, if required. For example:
This setting will also adjust the long plural. This attribute is only applicable to entries defined using \newabbreviation (or \newacronym if it’s using \newabbreviation.)
This setting will only adjust the short plural if the shortplural key isn’t used. This setting will take precedence over insertdots.
This attribute is best used with the discardperiod attribute set to “true”.
This setting will be overridden by an explicit use of the shortaccess key in the optional argument of \newabbreviation (or \newacronym). This attribute is only applicable to entries defined using \newabbreviation (or \newacronym if it’s using \newabbreviation.)
With glossaries, commands like \cgls use \cglsformat only if the previous usage count for that entry was equal to 1. With glossaries-extra the test is now for entries that have the entrycount attribute set and where the previous usage count for that entry is less than or equal to the value of that attribute.
For example:
(Note that the argument to \glsxtrfieldtitlecasecs will be a control sequence whose replacement text is the entry’s description, which is why \xcapitalisefmtwords is needed instead of \capitalisefmtwords.)
Any other values of this attribute are ignored. Remember that there are design limitations for both the first letter uppercasing and the title casing commands. See the mfirstuc user manual for further details.
Note that this overrides \glsnamefont which will only be used if this attribute hasn’t been set.
Remember that glossary styles may additionally apply a font change, such as the list styles which put the name in the optional argument of \item.
(See also the accompanying sample file sample-external.tex.) If the URL contains awkward characters (such as % or ~) remember that the base glossaries package provides commands like \glspercentchar and \glstildechar that expand to literal characters.
If you want to a named anchor within the target URL (notionally adding #⟨name⟩ to the URL), then you also need to set targetname to the anchor ⟨name⟩. You may use \glslabel within ⟨name⟩ which is set by commands like \gls to the entry’s label.
All the predefined glossary styles start each entry listing with \glstarget which sets the anchor to \glolinkprefix\glslabel, so if you want entries to link to glossaries in the URL given by targeturl, you can just do:
(If the target document changed \glolinkprefix then you will need to adjust the above as appropriate.)
If the anchor is in the form ⟨name1⟩.⟨name2⟩ then use targetname for the ⟨name2⟩ part and targetcategory for the ⟨name1⟩ part.
For example:
will cause all link text for general entries to link to master-doc.pdf#page.7 (page 7 of that PDF).
If you want a mixture in your document of entries that link to an internal glossary and entries that link to an external URL then you can use the starred form of \newignoredglossary for the external list. For example:
An attribute can be set using:
where ⟨category-label⟩ is the category label, ⟨attribute-label⟩ is the attribute label and ⟨value⟩ is the new value for the attribute.
There is a shortcut version to set the regular attribute to “true”:
If you need to lookup the category label for a particular entry, you can use the shortcut command:
This uses \glssetcategoryattribute with \glscategory to set the attribute. Note that this will affect all other entries that share this entry’s category.
You can fetch the value of an attribute for a particular category using:
Again there is a shortcut if you need to lookup the category label for a given entry:
You can test if an attribute has been assigned to a given category using:
This uses etoolbox’s \ifcsvoid and does ⟨true code⟩ if the attribute has been set and isn’t blank and isn’t \relax. The shortcut if you need to lookup the category label from an entry is:
You can test the value of an attribute for a particular category using:
This tests if the attribute (given by ⟨attribute-label⟩) for the category (given by ⟨category-label⟩) is set and equal to ⟨value⟩. If true, ⟨true-part⟩ is done. If the attribute isn’t set or is set but isn’t equal to ⟨value⟩, ⟨false part⟩ is done.
For example:
This does “NO HYPER” if the general category has the nohyper attribute set to true otherwise if does “HYPER”.
With boolean-style attributes like nohyper, make sure you always test for true not false in case the attribute hasn’t been set.
Again there’s a shortcut if you need to lookup the category label from a particular entry:
There’s also a shortcut to determine if a particular category has the regular attribute set to “true”:
Alternatively, if you need to lookup the category for a particular entry:
Note that if the regular attribute hasn’t be set, the above do ⟨false-part⟩. There are also reverse commands that test if the regular attribute has been set to “false”:
or for a particular entry:
Again, if the regular attribute hasn’t been set, the above do ⟨false-part⟩, so these reverse commands aren’t logically opposite in the strict sense.
You can iterate through all entries with a given category using:
This iterates through all entries in the glossaries identified by the comma-separated list ⟨glossary-labels⟩ that have the category given by ⟨category-label⟩ and performs ⟨body⟩ for each match. Within ⟨body⟩, you can use ⟨glossary-cs⟩ and ⟨label-cs⟩ (which much be control sequences) to access the current glossary and entry label. If ⟨glossary-labels⟩ is omitted, all glossaries are assumed.
Similarly, you can iterate through all entries that have a category with a given attribute using:
This will do ⟨body⟩ for each entry that has a category with the attribute ⟨attribute-label⟩ set to ⟨attribute-value⟩. The remaining arguments are as the previous command.
You can change the category for a particular entry using the standard glossary field changing commands, such as \glsfielddef. Alternatively, you can use
This will change the category to ⟨category-label⟩ for each entry listed in the comma-separated list ⟨entry-labels⟩. This command uses \glsfieldxdef so it will expand ⟨category-label⟩ and make the change global.
You can also change the category for all entries with a glossary or glossaries using:
where ⟨glossary-labels⟩ is a comma-separated list of glossary labels.
There are three basic ways of counting entry references:
This method is extended by glossaries-extra and is described in §6.1 Entry Counting (First Use Flag).
As mentioned in §2.4 Entry Counting Modifications, glossaries-extra modifies the \glsenableentrycount command to allow for the entrycount attribute. This means that you not only need to enable entry counting with \glsenableentrycount, but you also need to set the appropriate attribute (see §5 Categories).
With glossaries-extra, you may use \cgls instead of \gls even if you haven’t enabled entry counting. You will only get a warning if you use \glsenableentrycount without setting the entrycount attribute. (With glossaries, commands like \cgls will generate a warning if \glsenableentrycount hasn’t been used.) The abbreviation shortcut \ab uses \cgls (see §3.3 Shortcut Commands). The acronym shortcut \ac uses \cgls if it’s been defined with shortcuts=ac (or shortcuts=all) but uses \gls if it’s been defined with shortcuts=acronyms (or shortcuts=acro).
All upper case versions (not provided by glossaries) are also available:
and
These are analogous to \cgls and \cglspl but they use
and
which convert the analogous \cglsformat and \cglsplformat to upper case.
Just using glossaries:
If you switch to glossaries-extra you must set the entrycount attribute:
When activated with \glsenableentrycount, commands such as \cgls now use
to determine if the entry trips the entry count trigger. The ⟨trigger code⟩ uses commands like \cglsformat and unsets the first use flag. The ⟨normal code⟩ is the code that would ordinarily be performed by whatever the equivalent command is (for example, \cgls will use \cglsformat in ⟨trigger code⟩ but the usual \gls behaviour in ⟨normal code⟩).
The default definition is:
This means that if an entry is assigned to a category that has the entrycount attribute then the ⟨trigger code⟩ will be used if the previous count value (the number of times the entry was used on the last run) is greater than the value of the attribute.
For example, to trigger normal use if the previous count value is greater than four:
There is a convenient command provided to enable entry counting, set the entrycount attribute and redefine \gls, etc to use \cgls etc:
The first argument ⟨categories⟩ is a comma-separated list of categories. For each category, the entrycount attribute is set to ⟨value⟩. In addition, this does:
This makes it easier to enable entry-counting on existing documents.
If you use \GlsXtrEnableEntryCounting more than once, subsequent uses will just set the entrycount attribute for each listed category.
The above example document can then become:
The standard entry-counting function describe above counts the number of times an entry has been marked as used throughout the document. (The reset commands will reset the total back to zero.) If you prefer to count per sectional-unit, you can use
where ⟨categories⟩ is a comma-separated list of categories to which this feature should be applied, ⟨value⟩ is the trigger value and ⟨counter-name⟩ is the name of the counter used by the sectional unit.
Note that you can’t use both the document-wide counting and the per-unit counting in the same document.
The counter value is used as part of a label, which means that \the⟨counter-name⟩ needs to be expandable. Since hyperref also has a similar requirement and provides \theH⟨counter-name⟩ as an expandable alternative, glossaries-extra will use \theH⟨counter-name⟩ if it exists otherwise it will use \the⟨counter-name⟩.
The per-unit counting function uses two attributes: entrycount (as before) and unitcount (the name of the counter).
Both the original document-wide counting mechanism and the per-unit counting mechanism provide a command that can be used to access the current count value for this run:
and the final value from the previous run:
In the case of the per-unit counting, this is the final value for the current unit. In both commands ⟨label⟩ is the entry’s label.
The per-unit counting mechanism additionally provides:
which gives the sum of all the per-unit totals from the previous run for the entry given by ⟨label⟩, and
which gives the maximum per-unit total from the previous run.
The above two commands are unavailable for the document-wide counting.
Example of per-unit counting, where the unit is the chapter:
In this document, the css entry is used three times in the first chapter. This is more than the trigger value of 2, so \gls{css} is expanded on first use with the short form used on subsequent use, and the css entries in that chapter are added to the glossary. In the second chapter, the css entry is only used once, which trips the suppression trigger, so in that chapter, the long form is used and \gls{css} doesn’t get a line added to the glossary file.
The html is used a total of three times, but the expansion and indexing suppression trigger is tripped in both chapters because the per-unit total (1 for the first chapter and 2 for the second chapter) is less than or equal to the trigger value.
The sample entry has only been used once, but it doesn’t trip the indexing suppression because it’s in the general category, which hasn’t been listed in \GlsXtrEnableEntryUnitCounting.
The per-unit entry counting can be used for other purposes. In the following example document the trigger value is set to zero, which means the index suppression won’t be triggered, but the unit entry count is used to automatically suppress the hyperlink for commands like \gls by modifying the hook
which is used at the end of the macro the determines whether or not to suppress the hyperlink.
This only produces a hyperlink for the first instance of \gls{sample} on each page.
The earlier warning about using the page counter still applies. If the first instance of \gls occurs at the top of the page within a paragraph that started on the previous page, then the count will continue from the previous page.
As from version 1.26, an alternative method of entry counting is to count the number of times the \gls-like or \glstext-like commands are used. (The “link” in this method’s name refers to the use of the internal command \@gls@link not to \hyperlink although \@gls@link may use \hyperlink when displaying the link-text.)
To enable link counting use the preamble-only command:
where ⟨categories⟩ is a list of category labels. The optional argument ⟨master counter⟩ may be used to identify a master counter (which must be defined). If present, the associated link counter will be reset when the master counter is incremented. This command automatically sets the linkcount attribute for the given categories. If the optional argument is present, it also sets the linkcountmaster attribute.
When enabled, commands like \gls and \glstext increment the associated counter using
This just does \stepcounter{⟨counter name⟩} by default but if you need \refstepcounter instead, just redefine this command:
You can access the internal count register using
where ⟨label⟩ is the entry’s label. This will expand to 0 if the counter hasn’t been defined.
It’s also possible to access the display value (\the⟨counter⟩) using
(This will expand to 0 if the counter hasn’t been defined.)
You can test if the counter has been defined using:
where ⟨label⟩ is the entry’s label.
The counter name can be obtained using
This simply expands to the counter name associated with the entry given by ⟨label⟩ without any check for existence. For example, to change the display command (\the⟨counter⟩) using etoolbox:
This is useful if you just want to change the display for specific entries but isn’t convenient if you want to change the display for all entries. Instead, it’s simpler to redefine \GlsXtrTheLinkCounter. For example:
In both cases, the redefinition should be implemented after \GlsXtrEnableLinkCounting.
Here’s an example document that uses link counting to disable the hyperlink after the first reference. This redefines \glslinkpresetkeys (which is used by both \gls and \glstext) instead of \glslinkcheckfirsthyperhook (which is used by \gls but not by \glstext).
The use of \glslinkpresetkeys means that the options can override this. For example
will override the hyper=false setting in \glslinkpresetkeys. If \glslinkpostsetkeys is used instead, the hyper=false setting will override the setting provided in the optional argument.
The abbreviation category doesn’t have the linkcount attribute set (since it’s not listed in the argument of \GlsXtrEnableLinkCounting). This means that \GlsXtrLinkCounterValue always expands to 0 for the abbreviation (ex), so the inequality test
will always be false. This means that the abbreviation won’t have hyper=false applied. If the test is changed to
Then the abbreviation will always have hyper=false applied.
To reset the counter every section use the optional argument to set the master counter:
It’s possible that you may also want a normal index as well as the glossary, and you may want entries to automatically be added to the index (as in this document). There are two attributes that govern this: indexname and dualindex.
The \glsxtrpostnamehook macro, used at the end of \glossentryname and \Glossentryname, checks the indexname attribute for the category associated with that entry. Since \glossentryname is used in the default glossary styles, this makes a convenient way of automatically indexing each entry name at its location in the glossary without fiddling around with the value of the name key.
The internal macro used by the glossaries package to write the information to the external glossary file is modified to check for the dualindex attribute.
In both cases, the indexing is done through
This uses the standard \index command with the sort value taken from the entry’s sort key and the actual value set to \glsentryname{⟨label⟩}. As from v1.16, there are user-level commands available to change the sort and actual value used by the automated index.
The actual value is given by
where ⟨label⟩ is the entry’s label. The default definition is:
Note the use of \string to prevent \glsentryname from being expanded as it’s written to the index file.
The sort value is assigned using:
where ⟨label⟩ is the entry label and ⟨cs⟩ is the command which needs to be set to the sort value. The default definition is:
After this macro is called, ⟨cs⟩ is then processed to escape any of makeindex’s special characters. Note that this escaping is only performed on the sort not on the actual value.
The command used to perform the actual indexing is:
This just does \index{⟨text⟩} by default.
For example, to index the value of the first key, instead of the name key:
and if the sort value also needs to be set to the long field, if present, otherwise the sort field:
If the value of the attribute given by ⟨attribute-label⟩ is “true”, no encap will be added, otherwise the encap will be the attribute value. For example:
will set the encap to textbf which will display the relevant page number in bold whereas
won’t apply any formatting to the page number in the index.
By default the format key won’t be used with the dualindex attribute. You can allow the format key to override the attribute value by using the preamble-only command:
If you use this command and hyperref has been loaded, then the theindex environment will be modified to redefine \glshypernumber to allow formats that use that command.
The \glsxtrdoautoindexname command will attempt to escape any of \makeindex’s special characters, but there may be special cases where it fails, so take care. This assumes the default makeindex actual, level, quote and encap values (unless any of the commands \actualchar, \levelchar, \quotechar or \encapchar have been defined before glossaries-extra is loaded).
If this isn’t the case, you can use the following preamble-only commands to set the correct characters.
Set the actual character to ⟨char⟩.
Set the level character to ⟨char⟩.
Set the escape (quote) character to ⟨char⟩.
Set the encap character to ⟨char⟩.
The glossaries package advises against defining entries in the document environment. As mentioned in §1.2 New or Modified Package Options above, this ability is disabled by default with glossaries-extra but can be enabled using the docdefs package options.
Although this can be problematic, the glossaries-extra package provides a way of defining and using entries within the document environment without the tricks used with the docdefs option. There are limitations with this approach, so take care with it. This function is disabled by default, but can be enabled using the preamble-only command:
When used, this defines the commands described below.
If an entry with the label ⟨label⟩ has already been defined, this just does \gls [⟨gls-options⟩]{⟨label⟩}. If ⟨label⟩ hasn’t been defined, this will define the entry using:
The second optional argument ⟨dfn-options⟩ should be empty if the entry has already been defined, since it’s too late for them. If it’s not empty, a warning will be generated with
For example, this warning will be generated on the second instance of \glsxtr below:
If you are considering doing something like:
then don’t bother. It’s simpler and less problematic to just define the entries in the preamble with \newglossaryentry and then use \gls in the document.
There are plural and case-changing alternatives to \glsxtr:
This is like \glsxtr but uses \glspl instead of \gls.
This is like \glsxtr but uses \Gls instead of \gls.
This is like \glsxtr but uses \Glspl instead of \gls.
If you use UTF-8 and don’t want the inconvenient of needing to use an ASCII-only label, then it’s better to use XƎLATEX or LuaLATEX instead of LATEX (or pdfLATEX). If you really desperately want to use UTF-8 entry labels without switching to XƎLATEX or LuaLATEX then there is a starred version of \GlsXtrEnableOnTheFly that allows you to use UTF-8 characters in ⟨label⟩, but it’s experimental and may not work in some cases.
There is a new command line application called bib2gls, which works in much the same way as a combination of bibtex and makeindex/xindy. Instead of storing all your entry definitions in a .tex and loading them using \input or \loadglsentries, the entries can instead be stored in a .bib file and bib2gls can selectively write the appropriate commands to a .glstex file which is loaded using \glsxtrresourcefile (or \GlsXtrLoadResources).
This means that you can use a reference managing system, such as JabRef, to maintain the database and it reduces the TEX overhead by only defining the entries that are actually required in the document. If you currently have a .tex file that contains hundreds of definitions, but you only use a dozen or so in your document, then the build time is needlessly slowed by the unrequired definitions that occur when the file is input. (You can convert an existing .tex file containing glossary definitions to a .bib file using convertgls2bib, supplied with bib2gls.)
There are some new commands and options added to glossaries-extra to help assist the integration of bib2gls into the document build process.
This chapter just provides a general overview of bib2gls. The full details and some sample documents are provided in the bib2gls manual.
An example of the contents of .bib file that stores glossary entries that can be extracted with bib2gls:
The follow provides some abbreviations:
Here are some symbols:
To ensure that bib2gls can find out which entries have been used in the document, you need the record package option:
If this option’s value is omitted (as above), the normal indexing will be switched off, since bib2gls can also sort the entries and collate the locations.
If you still want to use an indexing application (for example, you need a custom xindy rule), then just use record=alsoindex and continue to use \makeglossaries and \printglossary (or \printglossaries), but you also need to instruct bib2gls to omit sorting to save time and to prevent the sort key from being set.
The .glstex file created by bib2gls is loaded using:
(Don’t include the file extension in ⟨filename⟩.) There’s a shortcut version (recommended over the above) that sets ⟨filename⟩ to use \jobname:
On the first use, this command is a shortcut for
which is incremented at the end of \GlsXtrLoadResources. Any advisory notes regarding \glsxtrresourcefile also apply to \GlsXtrLoadResources.
The \glsxtrresourcefile command writes the line
Since the .glstex file won’t exist on the first LATEX run, the record package option additionally switches on undefaction=warn. Any use of commands like \gls or \glstext will produce ?? in the document, since the entries are undefined at this point. Once bib2gls has created the .glstex file the references should be resolved. This may cause a shift in the locations if the actual text produced once the entry is defined is significantly larger than the placeholder ?? (as this can alter the page breaking).
Note that as from v1.12, \glsxtrresourcefile temporarily switches the category code of @ to 11 (letter) while it reads the file to allow for any internal commands stored in the location field.
The default behaviour is for bib2gls to select all entries that have a record in the .aux file, and any dependent entries (including parent and cross-references). The glsignore format (for example, \gls[format=glsignore]{duck}) is recognised by bib2gls as a special ignored record. This means that it will match the selection criteria but the record won’t be added to the location list. This means that you won’t get spurious commas in the location list (as can happen with the other indexing methods), so you can do, for example,
at the start of the front matter and
at the start of the main matter to prevent any records in the front matter from occurring in the location lists.
If you want to add all entries to the glossary, you need to tell bib2gls this in the options list. For example:
This will add all entries, regardless of whether or not they have any records in the .aux file. Those that don’t have any records will have an empty location list. See the bib2gls user manual for more details of this option.
There are many sorting options provided by bib2gls. The default is to sort according to the system locale. If the document has a language setting, you can use sort=doc to instruct bib2gls to sort according to that. (The language tag obtained from tracklang’s interface is written to the .aux file.) For a multilingual document you need to explicitly set the locale using a well-formed language tag. For example:
The locale-sensitive sort methods usually ignore most punctuation so for lists of symbols you may find it more appropriate to use one of the letter-base sort methods that sort according to the Unicode value of each character. Alternatively you can provide a custom rule. See the bib2gls manual for full details of all the available sort methods.
Since the .glstex file only defines those references required within the document (selected according to the selection option) and the definitions have been written in the order corresponding to bib2gls’s sorted list, the glossaries can simply be displayed using \printunsrtglossary (or \printunsrtglossaries), described in §10.2 Display All Entries Without Sorting or Indexing.
Suppose the .bib examples shown above have been stored in the files terms.bib, abbrvs.bib and symbols.bib which may either be in the current directory or on TEX’s path. Then the document might look like:
The document build process (assuming the document is called mydoc) is:
This creates a single glossary containing the entries: bird, duck, goose, html, M, shtml and ssi (in that order). The bird, shtml and M entries were added because bib2gls detected (from the .aux file) that they had been used in the document. The other entries were added because bib2gls detected (from the .bib files) that they are referenced by the used entries. In the case of duck and goose, they are in the see field for bird. In the case of ssi and html, they are referenced in the description field of shtml. These cross-referenced entries won’t have a location list when the glossary is first displayed, but depending on how they are referenced, they may pick up a location list on the next document build.
The entries can be separated into different glossaries with different sort methods:
Or you can have multiple instance of \GlsXtrLoadResources with the same type, which will produce a glossary with ordered sub-blocks. For example:
This will result in a glossary where the first group has the title “Abbreviations”, the second group has the title “Symbols” and then follow the usual letter groups. Note that for this example to work, you must run bib2gls with the --group (or -g) switch. For example, if the document is called myDoc.tex:
The value of the group field must always be a label. You can set the corresponding title with \glsxtrsetgrouptitle (see §2.10 Glossary Style Modifications). If no title is set then the label is used as the group title.
You can provide your own custom sort rule. For example, if you are using XƎLATEX or LuaLATEX:
The package option record=only (or simply record) automatically loads the supplementary package glossaries-extra-bib2gls, which provides some commands that are specific to bib2gls. The package isn’t loaded by record=alsoindex as that option is intended for sorting with makeindex or xindy and it is expected that the sorting will be switched off (with the resource option sort=none).
If glossaries-extra-bib2gls is loaded via the record package option then the check for associated language resource files (see §13 Multi-Lingual Support) will also search for the existence of glossariesxtr-⟨script⟩.ldf for each document dialect (where ⟨script⟩ is the four letter script identifier, such as Latn).
This is just defined as \string\u, which is required when you need to indicate a Unicode character in the form \u⟨hex⟩ in some of the resource options (as illustrated above).
This is just defined as \string\$ and is used for the captured group reference in a replacement part of a regular expression substitution (requires at least bib2gls version 1.5). For example:
This only removes a full stop that follows any of the characters a,…,z or A,…,Z.
If you use the save-child-count resource option, you can test if the childcount field is non-zero using:
This internally uses \GlsXtrIfFieldNonZero and will do ⟨false⟩ if the field isn’t set. Within ⟨true⟩ and ⟨false⟩ you can use \glscurrentfieldvalue to access the value. (It will be 0 in ⟨false⟩ if the field isn’t set.)
This command is intended for use in @preamble. It’s simply defined to \providecommand in glossaries-extra-bib2gls but bib2gls’s interpreter treats it as \renewcommand. This means that you can override bib2gls’s internal definition of a command without overriding the command definition in the document (if it’s already defined before the resource file is input). For example
This will force bib2gls to treat \int as the word “integral” to assist sorting but if this preamble code is written to the .glstex file (as it is by default) then it won’t override the current definition (provided by the kernel or redefined by a package).
If the \hyperref command has been defined (that is, hyperref has been loaded before glossaries-extra) then this command checks for the existence of the indexcounter field. If this field is set for the entry given by ⟨label⟩, this command does \hyperref[wrglossary.⟨value⟩]{⟨text⟩}, where ⟨value⟩ is the value of the indexcounter field. If the field isn’t set or if \hyperref hasn’t been defined, this just does ⟨text⟩. This command is provided for use with the indexcounter package option combined with bib2gls’s save-index-counter resource option. See the bib2gls manual for further details (at least version 1.4).
A convenient shortcut for use in the entry-type-aliases setting. This provides aliases for BibTEX’s standard entry types to bib2gls’s @bibtexentry entry type (requires at least bib2gls version 1.4).
Defines storage keys for BibTEX’s standard fields. Note that BibTEX’s type field clashes with the glossaries package’s type key, so this command provides the key bibtextype instead. You can alias it with field-aliases=type=bibtextype in the resource options. Each storage key is provided with a convenient command to access the value in the form \glsxtrbib⟨field⟩. For example, \glsxtrbibaddress. The bibtextype field can be accessed with \glsxtrbibtype. Each of these commands takes the entry label as the sole argument.
The glossaries-extra-bib2gls package also provides definitions of the missing mathematical Greek commands: \Alpha, \Beta, \Epsilon, \Zeta, \Eta, \Iota, \Kappa, \Mu, \Nu, \Omicron, \Rho, \Tau, \Chi, \Digamma, \omicron. These are all defined with \providecommand, so they won’t override any definitions provided by any package loaded before glossaries-extra. Since bib2gls’s interpreter recognises these commands, using them instead of explicitly using the Latin characters with the same shape helps to keep the Greek symbols together when sorting. Similarly, if upgreek has been loaded, the missing upright Greek commands are also provided.
The remaining commands provide common rule blocks for use in the sort-rule resource option. If you want a rule for a specific locale, you can provide similar commands in a file called glossariesxtr-⟨tag⟩.ldf, where ⟨tag⟩ identifies the dialect, locale, region or root language. See the description of \IfTrackedLanguageFileExists in the tracklang documentation for further details. If this file is on TEX’s path and the tracklang package (automatically loaded by glossaries) detects that the document has requested that language or locale, then the file will automatically be loaded. For example, if you want to provide a rule block for Welsh, then create a file called glossariesxtr-welsh.ldf that contains:
(The use of \string is in case the < character has been made active.) You can provide more than one rule-block per local, to allow for loanwords or foreign words. For example, you could provide \glsxtrWelshIRules, \glsxtrWelshIIRules etc.
If the rules are for a particular script (independent of language or region) then they can be provided in a file given by glossariesxtr-⟨script⟩.ldf instead. For example, the file glossariesxtr-Cyrl.ldf could contain:
(Remember that the required document language scripts need to be tracked through the tracklang package, in order for these files to be automatically loaded. This essentially means ensuring you load the appropriate language package before tracklang is loaded by the base glossaries package or any other package that uses it. See the tracklang documentation for further details.)
Alternatively, if the rules are specific to a subject rather than a region or language, then you can provide a supplementary package. For example, if you have a package called, say, mapsymbols that provides map symbols, then the file mapsymbols.sty might contain:
and the supplementary file mapsymbols.bib can provide the appropriate definitions for bib2gls:
Now both the preamble and rule block can be used in the resource set:
The following commands are provided by glossaries-extra-bib2gls. They should be separated by the rule separator characters ; (semi-colon) or , (comma) or & (ampersand) or < (less than). See Java’s RuleBasedCollator documentation for details of the rule syntax.
For example, the following will place the mathematical Greek symbols (\alpha, \Alpha, \beta, \Beta etc) in a block before Latin characters:
These are control characters that are usually placed at the start of a rule in the ignored section. They typically won’t occur in any sort values, but if they do they should normally be ignored.
These are space characters. They typically come after the control characters with the two blocks separated by a ; (semi-colon).
These are non-printable characters (BOM, tabs, line feed and carriage return). They typically come after the spaces separated by a ; (semi-colon). These characters aren’t checked for by bib2gls when it determines whether or not to use the interpreter, so a TAB or newline character may end up in the sort value if it wasn’t interpreted.
These are combining diacritic marks which typically follow the space and non-printable blocks (separated by a semi-colon). This command is defined in terms of sub-block commands:
If you prefer, you can use the sub-blocks directly in your required ordered.
This contains the combining diacritics: acute, grave, breve, circumflex, caron, ring, vertical line above, diaeresis (umlaut), double acute, tilde, dot above, combining macron.
This contains the combining diacritics: short solidus overlay, cedilla, ogonek, dot below, low line, overline, hook above, double vertical line above, double grave accent, candrabindu, inverted breve, turned comma above, comma above, reversed comma above, comma above right, grave accent below, acute accent below.
This contains the combining diacritics: left tack below, right tack below, left angle above, horn, left half ring below, up tack below, down tack below, plus sign below, minus sign below, palatalized hook below, retroflex hook below, diaresis below, ring below, comma below, vertical line below, bridge below, inverted double arch below, caron below, circumflex accent below, breve below, inverted breve below, tilde below, macron below, double low line, tilde overlay, short stroke overlay, long stroke overlay, long solidus overlay, right half ring below, inverted bridge below, square below, seagull below, x above, vertical tilde, double overline, Greek perispomeni, Greek dialytika tonos, Greek ypogegrammeni, double tilde, double inverted breve, Cyrillic titlo, Cyrillic palatalization, Cyrillic dasia pneumata, Cyrillic psili pneumata.
This contains the combining diacritics: left harpoon above, right harpoon above, long vertical line overlay, short vertical line overlay, anticlockwise arrow above, clockwise arrow above, left arrow above, right arrow above, ring overlay, clockwise ring overlay, anticlockwise ring overlay, three dots above, four dots above, enclosing circle, enclosing square, enclosing diamond, enclosing circle backslash, left right arrow above.
This contains hyphens (including the minus sign 0x2212). This rule block typically comes after the diacritic rules separated by a comma.
This contains punctuation characters. This rule block typically comes after the hyphen rules separated by a less than (<). As with the combining diacritics, this command is defined in terms of sub-blocks which may be used directly instead if a different order is required:
This is the first punctuation sub-block containing: underscore, macron, comma, semi-colon, colon, exclamation mark, inverted exclamation mark, question mark, inverted question mark, solidus, full stop, acute accent, grave accent, circumflex accent, diaersis, tilde, middle dot, cedilla, straight apostrophe, straight double quote, left guillemet, right guillemet, left parenthesis, right parenthesis, left square bracket, right square bracket, left curly bracket, right curly bracket, section sign, pilcrow sign, copyright sign, registered sign, at sign.
This sub-block contains some currency symbols: currency sign, Thai currency symbol baht, cent sign, colon sign, cruzeiro sign, dollar sign, dong sign, euro sign, French franc sign, lira sign, mill sign, naira sign, peseta sign, pound sign, rupee sign, new sheqel sign, won sign, yen sign.
This sub-block contains some other punctuation symbols: asterisk, backslash, ampersand, hash sign, percent sign, plus sign, plus-minus sign, division sign, multiplication sign, less-than sign, equals sign, greater-than sign, not sign, vertical bar (pipe), broken bar, degree sign, micron sign.
This rule block contains the Basic Latin digits (0, …, 9) and the subscript and superscript digits (0 0 etc) made equivalent to the corresponding Basic Latin digit. The digit block typically comes after the punctuation rules separated by a less than (<).
This rule block contains just the Basic Latin digits (0, …, 9).
This rule block contains just the subscript digits (0 … 9).
This rule block contains just the superscript digits (0 … 9).
This rule block contains vulgar fraction characters. The digit block typically comes after the digit rules separated by a less than (<).
There are a number of Latin rule blocks. Some of these included extended characters or ligatures (such as ß or œ) but they don’t include accented characters. If you require a Latin rule block that includes accented characters, digraphs, trigraphs or other extended characters, then it’s best to provide similar commands in a glossariesxtr-⟨tag⟩.ldf file for the particular language or region.
This is just the basic (non-extended) Latin alphabet with the superscript and subscript Latin letters (a a etc) treated as the equivalent basic Latin letter. (If you don’t want the subscripts and superscripts included you can redefine \glsxtrLatinA etc to omit them.)
This is like \glsxtrGeneralLatinIrules but it includes eth (Ð) between ‘D’ and ‘E’ and eszett (ß) treated as ‘ss’.
This is like \glsxtrGeneralLatinIrules but it includes eth (Ð) between ‘D’ and ‘E’ and eszett (ß) treated as ‘sz’.
This is like \glsxtrGeneralLatinIrules but it includes eth (Ð) between ‘D’ and ‘E’, ae-ligature (æ) is treated as ‘ae’, oe-ligature (œ) is treated as ‘oe’, eszett (ß) treated as ‘ss’ and thorn (þ) is treated as ‘th’.
This is like \glsxtrGeneralLatinIrules but it includes eth (Ð) between ‘D’ and ‘E’, eszett (ß) treated as ‘ss’ and thorn (þ) treated as ‘th’.
This is like \glsxtrGeneralLatinIrules but it includes eth (Ð) between ‘D’ and ‘E’, eszett (ß) treated as ‘sz’ and thorn (þ) treated as ‘th’.
This is like \glsxtrGeneralLatinIrules but it includes ae-ligature (æ) between ‘A’ and ‘B’, eth (Ð) between ‘D’ and ‘E’, insular G (Ᵹ) instead of ‘G’, oe-ligature between ‘O’ and ‘P’, long s (ſ) equivalent to ‘s’, thorn (þ) between ‘T’ and ‘U’ and wynn (Ƿ) instead of W.
This is like \glsxtrGeneralLatinIrules but ae-ligature (æ) is treated as ‘ae’, oe-ligature (œ) is treated as ‘oe’, eszett (ß) treated as ‘ss’, thorn (þ) is treated as ‘th’, Ø is treated as ‘O’ and ‘Ł’ is treated as ‘L’.
A mini-rule that just covers ‘A’ but includes the sub- and superscript A.
A mini-rule that just covers ‘E’ but includes the subscript E.
A mini-rule that just covers ‘H’ but includes the subscript H.
A mini-rule that just covers ‘K’ but includes the subscript K.
A mini-rule that just covers ‘I’ but includes the superscript I.
A mini-rule that just covers ‘L’ but includes the subscript L.
A mini-rule that just covers ‘M’ but includes the subscript M.
A mini-rule that just covers ‘N’ but includes the sub- and superscript N.
A mini-rule that just covers ‘O’ but includes the sub- and superscript O.
A mini-rule that just covers ‘P’ but includes the subscript P.
A mini-rule that just covers ‘S’ but includes the subscript S.
A mini-rule that just covers ‘T’ but includes the subscript T.
A mini-rule that just covers ‘X’ but includes the subscript X.
A mini-rule that just covers eszett (ß) and makes long s (ſ) followed by short ‘s’ equivalent to ‘ß’. (This is used in the above blocks that treat ‘ß’ as ‘ss’.)
A mini-rule that just covers eszett (ß) and makes long s (ſ) followed by ‘z’ equivalent to ‘ß’. (This is used in the above blocks that treat ‘ß’ as ‘sz’.)
A mini-rule for eth (Ð) so you don’t need to remember the Unicode values.
A mini-rule for thorn (þ) so you don’t need to remember the Unicode values.
A mini-rule for ae-ligature (æ) so you don’t need to remember the Unicode values.
A mini-rule for oe-ligature (œ) so you don’t need to remember the Unicode values.
A mini-rule for ‘Ø’ so you don’t need to remember the Unicode values.
A mini-rule for ‘Ł’ so you don’t need to remember the Unicode values.
A mini-rule for wynn (Ƿ) so you don’t need to remember the Unicode values.
A mini-rule for insular G (Ᵹ) so you don’t need to remember the Unicode values.
A mini-rule that just covers schwa (Ə) but includes the subscript schwa. (Not used in any of the provided Latin rule blocks described above.)
A mini-rule for ‘Å’ so you don’t need to remember the Unicode values. (Not used in any of the provided Latin rule blocks described above.)
A rule block for mathematical Greek (\alpha, \beta etc) and upright Greek (\upalpha, etc, from the upgreek package) characters that includes digamma (\digamma and \Digamma) between epsilon and zeta. The upright and italic versions are gathered together into the same letter group.
As \glsxtrMathGreekIrules but doesn’t include digamma.
A rule block for upright Greek (\upalpha, etc, from the upgreek package) characters that includes digamma (\digamma and \Digamma) between epsilon and zeta.
A rule block for upright Greek (\upalpha, etc, from the upgreek package) that doesn’t include digamma.
A rule block for mathematical Greek (\alpha, \Alpha, etc) characters that includes digamma (\diagamma and \Digamma) between epsilon and zeta. Note that even though the upper case \Delta etc are actually rendered upright by LATEX, bib2gls’s interpreter treats them as italic to help keep them close to the lower case versions.
A rule block for mathematical Greek (\alpha, \Alpha, etc) characters that doesn’t include digamma.
A rule block for upper case mathematical Greek (\Alpha, \Beta, etc) characters that includes digamma (\Digamma) between epsilon and zeta.
A rule block for upper case mathematical Greek (\Alpha, \Beta, etc) characters that doesn’t include digamma.
A rule block for lower case mathematical Greek (\alpha, \beta, etc) characters that includes digamma (\digamma) between epsilon and zeta.
A rule block for lower case mathematical Greek (\alpha, \beta, etc) characters that doesn’t include digamma.
Additionally, there are commands in the form \glsxtrUpAlpha, \glsxtrUpBeta etc and \glsxtrMathItalicAlpha, \glsxtrMathItalicBeta etc that just cover the upper and lower case forms of a special Greek character (\Upalpha, \upalpha etc and \Alpha, \alpha etc) as well as the following:
The partial derivative symbol (∂).
The nabla symbol (∇).
These commands are provided by glossaries-extra for use with bib2gls.
The information provided with \GlsXtrLoadResources is written to the .aux file using
may be used to temporarily redefine commands before the information is written to the file. This does nothing by default, but may be redefined to allow the use of short commands for convenience. For example, with:
you can just use, for example, \u E6 instead of \string\uE6 in the custom rule. This redefinition of \u is scoped so its original definition is restored after the write operation.
It’s possible to specify label prefixes. For example, modifying the earlier example:
If you do something like this, you may find it more convenient to define custom commands that set the prefix. For example:
The problem with this is that the custom command \sym doesn’t allow for modifiers (such as \gls* or \gls+). Instead you can use:
which defines the command ⟨cs⟩ that behaves like
or (to default to no hyperlinks)
now you can use \sym+{M} to behave like \gls+{sym.M}.
If you also want the plural and first letter upper case versions you can use
For example:
For the all caps versions:
For example:
There’s an analogous command for \rgls:
and for \rgls, \rglspl, \rGls and \rGlspl:
and for the all caps:
As from version 1.1 of bib2gls, you can save the total record count for each entry by invoking bib2gls with the --record-count or --record-count-unit switches. These options will ensure that when each entry is written to the .glstex file bib2gls will additionally set the following internal fields for that entry:
If --record-count-unit is used then additionally:
Only use the unit counting option if the locations don’t contain any special characters. If you really need it with locations that may contain formatting commands, then you can try redefining:
so that it detokenizes ⟨location⟩ but take care when using \GlsXtrLocationRecordCount with commands like \thepage as they can end up becoming detokenized too early.
Note that the record count includes locations that bib2gls discards, such as ignored records, duplicates and partial duplicates. It doesn’t include cross-reference records. For example, if \gls{bird} is used twice on page 1, once on page 2 and fours times on page 3, and \gls[counter=section]{bird} is used once in section 3, then the total record count (stored in the recordcount field) is 2 + 1 + 4 + 1 = 8, the total for the page counter (stored in the recordcount.page field) is 2 + 1 + 4 = 7, and the total for the section counter (stored in the recordcount.section field) is 1.
With the unit counting on as well, the field recordcount.page.1 is set to 2, recordcount.page.2 is set to 1, recordcount.page.3 is set to 4 and recordcount.section.3 is set to 1.
You can access these fields using the following commands which will expand to the field value if set or to 0 if unset:
This expands to the total record count for the entry given by ⟨label⟩.
expands to 8.
This expands to the counter total for the entry given by ⟨label⟩ where ⟨counter⟩ is the counter name. For example:
expands to 7 and
expands to 1.
This expands to the total for the given location. For example
expands to 4. Be careful about using \thepage in the ⟨location⟩ part. Remember that due to TEX’s asynchronous output routine, \thepage may not be correct.
There are commands analogous to the entry counting commands like \cgls and \cglsformat that are triggered by the record count. These are listed below.
These commands check the recordcount attribute which, if set, should be a number. For example:
For convenience, you can use
to set the recordcount attribute to ⟨n⟩ for all the categories listed in ⟨category list⟩.
The \rgls-like commands use
to determine whether the \rgls-like command should behave like its \gls counterpart (⟨normal⟩) or whether it should instead use ⟨trigger code⟩.
This command checks if the recordcount attribute is set. If not is just does ⟨normal⟩, otherwise it tests if
is greater than the value given in the recordcount attribute for that entry’s category. If true, this does ⟨normal⟩ otherwise it does ⟨trigger code⟩. The default definition of the trigger value command is:
The ⟨trigger code⟩ part writes a record with the format set to glstriggerrecordformat (which bib2gls v1.1+ recognises as a special type of ignored location format) and does ⟨trigger format⟩. Then it unsets the first use flag. Note that it doesn’t implement the post-link hook. This ensures that the record count is correct on the next run.
The ⟨trigger format⟩ depends on the \rgls-like command used and will be one of the following:
These all behave much like their \cglsformat counterparts. If the entry’s regular attribute is set or if the entry doesn’t have a long form, the first or first plural is used, otherwise the long or long plural form is used.
You can use
to redefine \gls, \glspl, \Gls, \Glspl, \GLS, \GLSpl to \rgls, \rglspl, \rGls, \rGlspl, \rGLS, \rGLSpl, respectively, for convenience.
If you don’t want the entries that use ⟨trigger code⟩ to appear in the glossary, you need to use the resource option trigger-type to assign them to another glossary. For example:
In the above, stc and upa both only have one record, so they are assigned to the ignored glossary instead of the main one.
The glossaries package provides \glsrefentry entry to cross-reference entries when used with the entrycounter or subentrycounter options. The glossaries-extra package provides a supplementary command
that works in the same way except that it uses \pageref instead of \ref.
You can copy an entry to another glossary using
This appends ⟨entry-label⟩ to the end of the internal list for the glossary given by ⟨glossary-type⟩. Be careful if you use the hyperref package as this may cause duplicate hypertargets. You will need to change \glolinkprefix to another value or disable hyperlinks when you display the duplicate. Alternatively, use the new target key to switch off the targets:
The glossaries package allows you to set preamble code for a given glossary type using \setglossarypreamble. This overrides any previous setting. With glossaries-extra (as from v1.12) you can instead append to the preamble using
or prepend using
A field may now be used to store the name of a text-block command that takes a single argument. The field is given by
The default value is useri. Note that the value must be the control sequence name without the initial backslash.
For example:
There are two commands provided that allow you to apply the command to an argument:
This effectively does
The default ⟨default-options⟩ are given by
This is defined as noindex but may be redefined as appropriate. Note that the replacement text of \GlsXtrFmtDefaultOptions is prepended to the optional argument of \glslink.
As from version 1.23, there’s also a starred version of this command that has a final optional argument:
Both the starred and unstarred versions use:
within the link text. In the case of the unstarred version ⟨insert⟩ will be empty. It will also be empty if the final option argument is missing from the starred form. If the entry given by ⟨label⟩ is undefined \glsxtrfmt and \glsxtrfmt* will issue an error (or warning if undefaction=warn). There won’t be a warning or error if the entry is defined by the given field is missing. In either case, (the entry is undefined or the field is missing) ⟨cs name⟩ will be @firstofone otherwise it will be the field value. The default definition is:
which puts ⟨text⟩ inside the argument of the control sequence and ⟨insert⟩ outside it (but it will still be inside the link text).
For example:
If the default options are set to noindex then \glsxtrfmt won’t index, but will create a hyperlink (if hyperref has been loaded). This can be changed so that it also suppresses the hyperlink:
Note that \glsxtrfmt won’t work with PDF bookmarks. Instead you can use
This uses \texorpdfstring and will simply expand to ⟨text⟩ within the PDF bookmarks, but in the document it will do ⟨cs⟩{⟨text⟩} if a control sequence name has been provided or just ⟨text⟩ otherwise.
The glossaries package provides \glsaddstoragekey to add new keys. This command will cause an error if the key has already been defined. The glossaries-extra package provides a supplementary command that will only define the key if it doesn’t already exist:
If the key has already been defined, it will still provide the command given in the third argument ⟨cs⟩ (if it hasn’t already been defined). Unlike \glsaddstoragekey, ⟨cs⟩ may be left empty if you’re happy to just use \glsfieldfetch to fetch the value of this new key.
You can test if a key has been provided with:
This tests if ⟨key⟩ is available for use in the ⟨key⟩= list in the second argument of \newglossaryentry (or the optional argument of commands like \newabbreviation). The corresponding field may not have been set for any of the entries if no default was provided.
There are now commands provided to set individual fields. Note that these only change the specified field, not any related values. For example, changing the value of the text field won’t update the plural field. There are also some fields that should really only be set when entries are defined (such as the parent field). Unexpected results may occur if they are subsequently changed.
Sets the field given by ⟨field⟩ to ⟨value⟩ for the entry given by ⟨label⟩. No expansion is performed. It’s not necessary for the field to have been defined as a key. You can access the value later with \glsxtrusefield. Note that \glsxtrifkeydefined only tests if a key has been defined for use with commands like \newglossaryentry. If a field without a corresponding key is assigned a value, the key remains undefined. This command is robust.
\GlsXtrSetField uses
where ⟨label⟩ is the entry label and ⟨code⟩ is the assignment code.
This command just uses \glsdoifexists{⟨label⟩}{⟨code⟩} (ignoring the ⟨field⟩ argument), so by default it causes an error if the entry doesn’t exist. This can be changed to a warning with undefaction=warn. You can redefine \glsxtrsetfieldifexists to simply do ⟨code⟩ if you want to skip the existence check. Alternatively you can instead use
This simply uses etoolbox’s \csdef without any checks. This command isn’t robust. There is also a version that uses \protected@csedef instead:10.1
As \GlsXtrSetField but globally.
As \GlsXtrSetField but uses protected expansion.
As \gGlsXtrSetField but uses protected expansion.
Sets the field given by ⟨field⟩ to the replacement text of ⟨cs⟩ for the entry given by ⟨label⟩ (using \let).
As \GlsXtrLetField but the control sequence name is supplied instead.
Sets the field given by ⟨field-1⟩ for the entry given by ⟨label-1⟩ to the field given by ⟨field-2⟩ for the entry given by ⟨label-2⟩. There’s no check for the existence of ⟨label-2⟩, but \glsxtrsetfieldifexists{⟨label-1⟩}{⟨field-1⟩}{⟨code⟩} is still used, as for \GlsXtrSetField.
The glossaries package provides \ifglshasfield to determine if a field has been set. The glossaries-extra package provides a simpler version:
(New to v1.19.) Note that in this case the ⟨field⟩ must be the internal field label (for example, useri rather than user1). Unlike \ifglshasfield, this version doesn’t complain if the entry (given by ⟨label⟩) or the field don’t exist and will simply do ⟨false⟩. If the field does exist for the given entry and it’s not empty, the ⟨true⟩ part is done otherwise it does ⟨false⟩. Within ⟨true⟩ you may use
to access the field value. This command includes grouping which scopes the ⟨true⟩ and ⟨false⟩ parts. The starred version
omits the implicit grouping.
There is also a version that simply uses \ifcsundef. It doesn’t save the field value, but can be used if you only need to check if the field is defined without accessing it:
You can test if a field value equals a string using
If the entry exists and has the given field set to the given text then this does ⟨true⟩ otherwise it does ⟨false⟩. This is just a shortcut that uses:
This in turn is just a shortcut that uses \glsxtrifhasfield to test if the field exists and then compares the replacement text of \glscurrentfieldvalue with ⟨text⟩ using etoolbox’s \ifdefstring. The ⟨comparison⟩ argument must be one of = (equality), < (less than) or > (greater than).
As from version 1.31, there’s a similar command:
This is like \GlsXtrIfFieldEqStr but first (protected) fully expands ⟨text⟩ (but not the field value). If you want to compare the (protected) full expansion of both the field value and ⟨text⟩ use:
As from v1.31, if a field represents a numeric (integer) value, you can use the following two numeric tests. If the field is set, it must expand to an integer. You may use \glscurrentfieldvalue within ⟨true⟩ or ⟨false⟩ to access the actual value. Both ⟨true⟩ and ⟨false⟩ are scoped. If the field is undefined or empty, the value is assumed to be 0, and \glscurrentfieldvalue is set accordingly.
To test if the value is non-zero:
Alternatively, you can test if the field expands to a specific number using:
This does ⟨true⟩ if the field value equals ⟨n⟩ (using \ifnum for the comparison) otherwise it does ⟨false⟩.
The glossaries package provides \glsfieldfetch which can be used to fetch the value of the given field and store it in a control sequence. The glossaries-extra package provides another way of accessing the field value:
This works in the same way as commands like \glsentrytext but the field label is specified in the first argument. Note that the ⟨field-label⟩ corresponds to the internal field tag, which isn’t always the same as the key name. See Table 4.1 of the glossaries manual. No error occurs if the entry or field haven’t been defined. This command is not robust.
There is also a version that converts the first letter to uppercase (analogous to \Glsentrytext):
If you want to use a field to store a list that can be used as an etoolbox internal list, you can use the following command that adds an item to the field using etoolbox’s \listcsadd:
where ⟨label⟩ is the entry’s label, ⟨field⟩ is the entry’s field and ⟨item⟩ is the item to add. There are analogous commands that use \listgadd, \listeadd and \listxadd:
You can then iterate over the list using:
or
that internally use \dolistcsloop and \forlistloop, respectively.
There are also commands that use \ifinlistcs:
and \xifinlistcs
See the etoolbox’s user manual for further details of these commands, in particular the limitations of \ifinlist.
If the field has a comma-separated list value instead, you can iterate over it using:
where again ⟨handler⟩ is a control sequence that takes a single argument. Unlike the etoolbox loops, this doesn’t ignore empty elements nor does it discard leading / trailing spaces. Internally it uses \@for (modified by xfor which is automatically loaded by glossaries). The xfor package modifies the behaviour of \@for to allow the loop to be broken prematurely using \@endfortrue. The \glsxtrforcsvfield command locally defines a user level command:
which is just a synonym for \@endfortrue.
The loop is performed within the true part of \glsxtrifhasfield so scoping is automatically applied.
As from version 1.32, if the field given by
(which defaults to userii) contains a locale tag, then
can be used to encapsulate ⟨text⟩ in \foreignlanguage{⟨dialect⟩}{⟨text⟩} where ⟨dialect⟩ is obtained from the locale tag through tracklang’s \GetTrackedDialectFromLanguageTag command. You need at least tracklang v1.3.6 for this to work properly. The ⟨dialect⟩ must be one that’s tracked (which typically means that babel or polyglossia has been loaded with the appropriate setting for that language). If \foreignlanguage hasn’t been defined, this just does ⟨text⟩. For example:
When using the record option, in addition to recording the usual location, you can also record the current value of another counter at the same time using the preamble-only command:
For example:
Each time an entry is referenced with commands like \gls or \glstext, the .aux file will not only contain the \glsxtr@record command but also
Note that there’s no key corresponding to this new record.section field, but its value can be accessed with \glsxtrfielduse or the list can be iterated over with \glsxtrfielddolistloop etc.
This behaves like \printnoidxglossary but never sorts the entries and always lists all the defined entries for the given glossary (and doesn’t require \makenoidxglossaries). If you want to use one of the tabular-like styles with \printunsrtglossary, make sure you load glossaries-extra-stylemods which modifies the definition of \glsgroupskip to avoid the “Incomplete \iftrue” error that may otherwise occur.
There’s also a starred form
which is equivalent to
This means you now have the option to simply list all entries on the first LATEX run without the need for a post-processor, however there will be no number list in this case, as that has to be set by a post-processor such as bib2gls (see §9 bib2gls: Managing Reference Databases).
There’s a difference in behaviour depending on whether or not the group key is defined. If not defined (default), the group label will be formed from the first letter of the name field. The corresponding group title will be obtained as discussed in §2.10 Glossary Style Modifications. This can lead to an odd effect if you are using a style that separates letter groups when the ordering isn’t alphabetical.
If the group key is defined (which it is with the record option) then the group label will be obtained from the value of that field. If the field is empty, no grouping is performed, even if the style supports it. (That is, there won’t be a header or a vertical separation.) If the group field is non-empty, then the corresponding title is obtained as described earlier.
If you want to use a different field, you can redefine
to the relevant internal field label, but the group key must still be defined (through the record option or with commands like \glsaddstoragekey) to ensure that \printunsrtglossary uses \glsxtrgroupfield. (This method is used by bib2gls for secondary entries, which have the group label stored in the secondarygroup internal field.)
If you have any entries with the see key set, you will need the glossaries package option seenoindex=ignore or seenoindex=warn to prevent an error occurring from the automated \glssee normally triggered by this key. The record=only package option will automatically deal with this.
For example:
In the above, zebra will be listed before ant as it was defined first.
If you allow document definitions with the docdefs option, the document will require a second LATEX run if the entries are defined after \printunsrtglossary.
The optional argument is as for \printnoidxglossary (except for the sort key, which isn’t available).
All glossaries may be displayed in the order of their definition using:
which is analogous to \printnoidxglossaries. This just iterates over all defined glossaries (that aren’t on the ignored list) and does \printunsrtglossary[type=⟨type⟩].
To avoid complications caused by tabular-like glossary styles, \printunsrtglossary iterates over all entries in the selected glossary and appends the appropriate code to an internal command. Once the construction of this command is complete, then it’s performed to display the glossary. This puts the loop outside the style code. For convenience, there’s a hook used within the loop:
This hook should not display any content, but may be used to perform calculations. For example, to calculate widths. Within this hook you can use:
to skip the current entry. This will prevent the entry from being added to the internal command.
There’s another hook immediately before the internal command containing the glossary code is performed:
The internal command uses
to display each item in the list, where ⟨label⟩ is the current label.
By default the handler just does
which determines whether to use \glossentry or \subglossentry and checks the location and loclist fields for the number list.
You can redefine the handler if required. For example, you may want to filter entries according to the category label. You can test if a label is contained in a comma-separated list of labels using:
The ⟨label⟩ and ⟨label list⟩ will be fully expanded.
For example, if the preamble includes:
then you can print the glossary but first redefine the handler to only select entries that include the current section number in the record.section field:
Alternatively you can use the starred form of \printunsrtglossary which will localise the change:
If you are using the hyperref package and want to display the same glossary more than once, you can also add a temporary redefinition of \glolinkprefix to avoid duplicate hypertarget names. For example:
Note that this will cause a problem if your descriptions contain commands like \gls that need to link an entry that doesn’t appear in the summary. In this case, it’s a better approach to use:
If it’s a short summary at the start of a section, you might also want to suppress the glossary header and add some vertical space afterwards:
There’s a shortcut command that essentially does this:
The above example can simply be replaced with:
This shortcut command is actually defined to use \printunsrtglossary* with
so if you want to just make some minor modifications you can do
which will start the list with a subsection header with the title “Summary” (overriding the glossary’s title).
Note that this shortcut command is only available with the record (or record=alsoindex) package option.
This temporary change in the hypertarget prefix means you need to explicitly use \hyperlink to create a link to it as commands like \gls will try to link to the target created with the default definition of \gloslinkprefix. This isn’t a problem if you want a primary glossary of all terms produced using just \printunsrtglossary (in the front or back matter) which can be the target for all glossary references and then just use \printunsrtglossaryunit for a quick summary at the start of a section etc.
It may be that you don’t want a list but would rather display entry details throughout the document. You can simply do \glsentryname followed by \glsentrydesc. (Remember that if you don’t want a sorted list, use sort=none to skip the construction of the sort field.) For example, in the preamble provide a custom command:
define your entries
and then later in the text:
However, if may be that you want to use hyperref and have commands like \gls link back to the place where the term is described. Instead of using \glsentryname use
where ⟨label⟩ is the entry’s label.
This is designed to behave much like the way the name is displayed in the glossary. It performs the following:
which defaults to the value of the type field for the current entry.
otherwise it does (as from v1.31)
This reflects the behaviour of the predefined hierarchical styles. A bug in pre-version 1.31 used \glsentryitem for all child levels, which doesn’t match the hierarchical glossary styles. If you want to restore this behaviour, just do:
If you have used \nopostdesc or \glsxtrnopostpunc in any of your description fields, you can use
to make these commands behave as they normally do within a glossary. This needs to be placed before
It’s also possible to select a different field (rather than using name):
The ⟨field⟩ must be given using its internal field label which may not be the same as the key used to set the field. See the key to field mappings table in the glossaries user manual. The ⟨header⟩ argument is the code to pass to the third argument of \glsxtrtitleorpdforheading. It may be left empty in which case the default is determined as follows:
The \glsxtrglossentryother command internally uses \glossentrynameother{⟨label⟩} {⟨field⟩} instead of \glossentryname{⟨label⟩}. If you are using the glossaries-accsupp package (through the accsupp option) then accessibility support will be provided if there’s a corresponding command
This means that my custom command can be changed to:
If I want numbered definitions, then I can use the package options entrycounter or subentrycounter and remove the colon:
The counter label uses a dot after the number by default but this can be changed to a colon:
It’s now possible to not only use \gls to link back to the definition but also use \glsrefentry to reference the counter and \glsxtrpageref to reference the page number.
If I want the description to behave more like it does in a glossary in need to make the following modification:
(Note the grouping to localise \glsxtractivatenopost.)
You can also use \glsxtrglossentry within section headings. For example:
This will use \glsentryname in PDF bookmarks (if \texorpdfstring is defined) and will use \glsxtrheadname in page headers and table of contents. (If you’re using a page style or table of contents that doesn’t use \markright or \markbook or \@starttoc then you need to insert \glsxtrmarkhook and \@glsxtrinmark at the start of the header or table of contents either scoped or afterwards cancelled with \@glsxtrnotinmark and \glsxtrrestoremarkhook.)
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 ⟨entry-1⟩ is made an alias of ⟨entry-2⟩ then:
Note that with record=only, the location list for aliased entries is controlled with bib2gls’s settings.
The index suppression trigger is performed by
This is performed after the default options provided by \GlsXtrSetDefaultGlsOpts have been set. With record=only, \glsxtrsetaliasnoindex will default to do nothing.
Within the definition of \glsxtrsetaliasnoindex you can use
to index ⟨entry-2⟩.
The index suppression command can be redefined to index the main term instead. For example:
The value of the alias field can be accessed using
The glossaries bundle provides additional support packages glossaries-prefix (for prefixing) and glossaries-accsupp (for accessibility support). These packages aren’t automatically loaded.
If prefixing is required, you can simply load glossaries-prefix after glossaries-extra. For example:
The glossaries-accsupp package needs to be loaded before glossaries-extra or through the accsupp package option:
If you don’t load glossaries-accsupp or you load glossaries-accsupp after glossaries-extra the new \glsaccess⟨xxx⟩ commands described below will simply be equivalent to the corresponding \glsentry⟨xxx⟩ commands.
The following \glsaccess⟨xxx⟩ commands add accessibility information wrapped around the corresponding \glsentry⟨xxx⟩ commands. There is no check for existence of the entry nor do any of these commands add formatting, hyperlinks or indexing information.
This displays the value of the name field for the entry identified by ⟨label⟩.
If the glossaries-accsupp package isn’t loaded, this is simply defined as:
otherwise it’s defined as:
(\glsnameaccessdisplay is defined by the glossaries-accsupp package.) The first letter upper case version is:
Without the glossaries-accsupp package this is just defined as:
With the glossaries-accsupp package this is defined as:
The following commands are all defined in an analogous manner.
This displays the value of the text field.
This displays the value of the text field with the first letter converted to upper case.
This displays the value of the plural field.
This displays the value of the plural field with the first letter converted to upper case.
This displays the value of the first field.
This displays the value of the first field with the first letter converted to upper case.
This displays the value of the firstplural field.
This displays the value of the firstplural field with the first letter converted to upper case.
This displays the value of the symbol field.
This displays the value of the symbol field with the first letter converted to upper case.
This displays the value of the symbolplural field.
This displays the value of the symbolplural field with the first letter converted to upper case.
This displays the value of the desc field.
This displays the value of the desc field with the first letter converted to upper case.
This displays the value of the descplural field.
This displays the value of the descplural field with the first letter converted to upper case.
This displays the value of the short field.
This displays the value of the short field with the first letter converted to upper case.
This displays the value of the shortplural field.
This displays the value of the shortplural field with the first letter converted to upper case.
This displays the value of the long field.
This displays the value of the long field with the first letter converted to upper case.
This displays the value of the longplural field.
This displays the value of the longplural field with the first letter converted to upper case.
The following sample files are provided with this package:
There’s only one command provided by glossaries-extra that you’re likely to want to change in your document and that’s \abbreviationsname (§1.2 New or Modified Package Options) if you use the abbreviations package option to automatically create the glossary labelled abbreviations. If this command doesn’t already exist, it will be defined to “Abbreviations” if babel hasn’t been loaded, otherwise it will be defined as \acronymname (provided by glossaries).
You can redefine it in the usual way. For example:
Or using babel or polyglossia captions hook:
Alternatively you can use the title key when you print the list of abbreviations. For example:
or
The other fixed text commands are the diagnostic messages, which shouldn’t appear in the final draft of your document.
The glossaries-extra package has the facility to load language modules (whose filename is in the form glossariesxtr-⟨language⟩.ldf) if they exist, but won’t warn if they don’t. If glossaries-extra-bib2gls is loaded via the record package option then the check for language resource files will additionally search for an associated language script file given by glossariesxtr-⟨script⟩.ldf where ⟨script⟩ is the four letter script identifier, such as Latn, associated with the given dialect. There’s no warning if the associated file isn’t found. The script file is loaded after the dialect file.
If you want to write your own language module, you just need to create a file called glossariesxtr-⟨lang⟩.ldf, where ⟨lang⟩ identifies the language or dialect (see the tracklang package). For example, glossariesxtr-french.ldf.
The simplest code for this file is:
You can adapt this for other languages by replacing all instances of the language identifier french and the translated text Abr\’eviations as appropriate. You can also use the .ldf file to provide rule blocks for a particular language for use with bib2gls’s custom sort rule. See §9.3 The glossaries-extra-bib2gls package for further details.
This .ldf file then needs to be put somewhere on TEX’s path so that it can be found by glossaries-extra. You might also want to consider uploading it to CTAN so that it can be useful to others. (Please don’t send it to me. I already have more packages than I am able to maintain.)
If you additionally want to provide translations for the diagnostic messages used when a glossary is missing, you need to redefine the following commands:
This produces the following text in English:
This document is incomplete. The external file associated with the glossary ‘⟨label⟩’ (which should be called ⟨file⟩) hasn’t been created.
This produces the following text in English:
This has probably happened because there are no entries defined in this glossary.
This produces the following text in English:
If you don’t want this glossary, add nomain to your package option list when you load glossaries-extra.sty. For example:
This produces the following text in English:
Did you forget to use type=⟨label⟩ when you defined your entries? If you tried to load entries into this glossary with \loadglsentries did you remember to use [⟨label⟩] as the optional argument? If you did, check that the definitions in the file you loaded all had the type set to \glsdefaulttype.
This produces the following text in English:
Check the contents of the file ⟨file⟩. If it’s empty, that means you haven’t indexed any of your entries in this glossary (using commands like \gls or \glsadd) so this list can’t be generated. If the file isn’t empty, the document build process hasn’t been completed.
This produces the following text in English:
You need to either replace \makenoidxglossaries with \makeglossaries or replace \printglossary (or \printglossaries) with \printnoidxglossary (or \printnoidxglossaries) and then rebuild this document.
This produces the following text in English:
The file ⟨file⟩ doesn’t exist. This most likely means you haven’t used \makeglossaries or you have used \nofiles. If this is just a draft version of the document, you can suppress this message using the nomissingglstext package option.
This produces the following text in English:
This message will be removed once the problem has been fixed.
This is advice on how to generate the glossary files. See the documented code (glossaries-extra-code.pdf) for further details.
This is the message produced when the automake option is used, but the document needs a rerun or the shell escape setting doesn’t permit the execution of the external application. This command also generates a warning in the transcript file. See the documented code for further details.
A
B
babel package 301, 302, 303, 304, 305, 306, 307, 308, 309
bib2gls 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389
bib2gls 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469
C
categories:
abbreviation 470, 471, 472, 473, 474
acronym 475, 476, 477, 478, 479
general 480, 481, 482, 483, 484, 485, 486, 487
index 488, 489
number 490
symbol 491, 492
category attributes:
accessaposplural 493, 494, 495
accessinsertdots 496
accessnoshortplural 497
aposplural 498, 499, 500, 501, 502, 503, 504, 505
discardperiod 506, 507, 508, 509, 510
dualindex 511, 512, 513, 514, 515, 516, 517
entrycount 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528
externallocation 529
firstshortaccess 530
glossdesc 531, 532, 533
glossdescfont 534, 535
glossname 536, 537, 538
glossnamefont 539, 540, 541
headuc 542, 543, 544, 545
hyperoutside 546, 547
indexname 548, 549, 550, 551, 552
indexonlyfirst 553, 554, 555
insertdots 556, 557, 558, 559
linkcount 560, 561, 562
linkcountmaster 563, 564
markshortwords 565, 566
markwords 567, 568, 569, 570, 571, 572
nameshortaccess 573
nohyper 574, 575, 576
nohyperfirst 577, 578, 579, 580, 581
noshortplural 582, 583, 584, 585, 586, 587
pluraldiscardperiod 588, 589
recordcount 590, 591, 592, 593
regular 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625
retainfirstuseperiod 626
tagging 627, 628, 629, 630
targetcategory 631
targetname 632, 633
targeturl 634, 635, 636, 637, 638
textformat 639, 640, 641, 642, 643
textshortaccess 644
unitcount 645
wrgloss 646, 647
\cGLS 648
\cGLSformat 649
\cGLSpl 650
\cGLSplformat 651
convertgls2bib 652
\csGlsXtrLetField 653
\CustomAbbreviationFields 654
D
datatool-base package 655
E
\eglssetwidest 656
\eglsupdatewidest 657
\eGlsXtrSetField 658
entry location 659, 660, 661
entrycounter package 662
equation (counter) 663, 664
etoolbox package 665, 666, 667, 668, 669, 670, 671, 672, 673
F
fancyhdr package 674
first use 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727
first use flag 728, 729, 730, 731, 732, 733
first use text 734, 735
fontenc package 736
G
\gglssetwidest 737
\gglsupdatewidest 738
\gGlsXtrSetField 739
glossaries package 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754
glossaries-accsupp package 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771
glossaries-extra package 772, 773, 774
glossaries-extra-bib2gls package 775, 776, 777, 778, 779, 780, 781, 782, 783
glossaries-extra-stylemods package 784, 785, 786, 787, 788, 789, 790, 791
glossaries-prefix package 792, 793, 794
\glossariesextrasetup 795
glossary styles:
altlist 796, 797
alttree 798, 799, 800, 801, 802, 803, 804, 805
bookindex 806, 807, 808, 809
index 810
inline 811, 812
list 813, 814, 815
listdotted 816, 817
long 818
long3col 819
mcolindexgroup 820
tree 821, 822
treenoname 823, 824, 825
glossary-bookindex package 826, 827
glossary-inline package 828
glossary-tree package 829, 830, 831, 832, 833
\glossentrynameother 834
\glossxtrsetpopts 835
\glsabbrvdefaultfont 836, 837
\glsabbrvemfont 838
\glsabbrvfont 839
\glsabbrvhyphenfont 840
\glsabbrvonlyfont 841
\glsabbrvscfont 842
\glsabbrvsmfont 843
\glsabbrvuserfont 844, 845
\Glsaccessdesc 846
\glsaccessdesc 847
\Glsaccessdescplural 848
\glsaccessdescplural 849
\Glsaccessfirst 850
\glsaccessfirst 851
\Glsaccessfirstplural 852
\glsaccessfirstplural 853
\Glsaccesslong 854
\glsaccesslong 855
\Glsaccesslongpl 856
\glsaccesslongpl 857
\Glsaccessname 858
\glsaccessname 859
\Glsaccessplural 860
\glsaccessplural 861
\Glsaccessshort 862
\glsaccessshort 863
\Glsaccessshortpl 864
\glsaccessshortpl 865
\Glsaccesssymbol 866
\glsaccesssymbol 867
\Glsaccesssymbolplural 868
\glsaccesssymbolplural 869
\Glsaccesstext 870
\glsaccesstext 871
\glsacspace 872
\glsacspacemax 873
\glsadd options
format 874
theHvalue 875, 876
thevalue 877, 878, 879, 880, 881
\glsaddeach 882
\glsaddpostsetkeys 883
\glsaddpresetkeys 884
\glscapturedgroup 885
\glscategory 886
\glscategorylabel 887
\glscurrententrylabel 888
\glscurrentfieldvalue 889
\glsdefpostdesc 890
\glsdefpostlink 891
\glsdefpostname 892
\glsentrycurrcount 893
\glsentryprevcount 894
\glsentryprevmaxcount 895
\glsentryprevtotalcount 896
\glsextrapostnamehook 897
\glsFindWidestAnyName 898
\glsFindWidestAnyNameLocation 899
\glsFindWidestAnyNameSymbol 900
\glsFindWidestAnyNameSymbolLocation 901
\glsFindWidestLevelTwo 902
\glsFindWidestTopLevelName 903
\glsFindWidestUsedAnyName 904
\glsFindWidestUsedAnyNameLocation 905
\glsFindWidestUsedAnyNameSymbol 906
\glsFindWidestUsedAnyNameSymbolLocation 907
\glsFindWidestUsedLevelTwo 908
\glsFindWidestUsedTopLevelName 909
\glsfirstabbrvdefaultfont 910
\glsfirstabbrvemfont 911
\glsfirstabbrvfont 912
\glsfirstabbrvhyphenfont 913
\glsfirstabbrvonlyfont 914
\glsfirstabbrvsmfont 915
\glsfirstabbrvuserfont 916
\glsfirstlongdefaultfont 917
\glsfirstlongemfont 918
\glsfirstlongfont 919
\glsfirstlongfootnotefont 920
\glsfirstlonghyphenfont 921
\glsfirstlongonlyfont 922
\glsfirstlonguserfont 923
\Glsfmtfirst 924
\glsfmtfirst 925
\Glsfmtfirstpl 926
\glsfmtfirstpl 927
\Glsfmtfull 928
\glsfmtfull 929
\Glsfmtfullpl 930
\glsfmtfullpl 931
\Glsfmtlong 932
\glsfmtlong 933
\Glsfmtlongpl 934
\glsfmtlongpl 935
\Glsfmtname 936
\glsfmtname 937
\Glsfmtplural 938
\glsfmtplural 939
\Glsfmtshort 940
\glsfmtshort 941
\Glsfmtshortpl 942
\glsfmtshortpl 943
\Glsfmttext 944
\glsfmttext 945
\glsforeachwithattribute 946
\glsgetattribute 947
\glsgetcategoryattribute 948
\glsgetwidestname 949
\glsgetwidestsubname 950
\glshasattribute 951
\glshascategoryattribute 952
\glshex 953
\glsifattribute 954
\glsifcategory 955
\glsifcategoryattribute 956
\glsifnotregular 957
\glsifnotregularcategory 958
\glsifregular 959
\glsifregularcategory 960
\glskeylisttok 961
\glslabeltok 962
\glslink options
format 963, 964, 965, 966
hyper 967, 968, 969
hyper=false 970
hyperoutside 971, 972
noindex 973, 974, 975, 976, 977, 978, 979
prefix 980, 981
textformat 982, 983
theHvalue 984
thevalue 985
wrgloss 986, 987, 988, 989
\glslinkcheckfirsthyperhook 990
\glslinkpresetkeys 991
\glslistchildpostlocation 992
\glslistchildprelocation 993
\glslistdesc 994
\glslistprelocation 995
\glslocalreseteach 996
\glslocalunseteach 997
\glslongdefaultfont 998
\glslongemfont 999
\glslongfont 1000
\glslongfootnotefont 1001
\glslonghyphenfont 1002
\glslongonlyfont 1003
\glslongpltok 1004
\glslongtok 1005
\glslonguserfont 1006
\glsnoidxdisplayloc 1007
\glsps 1008
\glspt 1009
\glsseeitemformat 1010
\glssetattribute 1011
\glssetcategoryattribute 1012
\glssetregularcategory 1013
\glsshortpltok 1014
\glsshorttok 1015
\glstreechilddesc 1016
\glstreechildprelocation 1017
\glstreechildsymbol 1018
\glstreedefaultnamefmt 1019
\glstreedesc 1020
\glstreenonamechilddesc 1021
\glstreenonamedesc 1022
\glstreenonamesymbol 1023
\glstreeprelocation 1024
\glstreesymbol 1025
\glsupdatewidest 1026
\glsuseabbrvfont 1027
\glsuselongfont 1028
\glsuserdescription 1029
\Glsxtr 1030
\glsxtr 1031
\glsxtrabbreviationfont 1032
\glsxtrabbrvfootnote 1033
\glsxtrabbrvpluralsuffix 1034, 1035
\glsxtractivatenopost 1036
\glsxtraddallcrossrefs 1037
\glsxtralias 1038
\glsxtrAltTreeIndent 1039
\glsxtralttreeInit 1040
\glsxtralttreeSubSymbolDescLocation 1041
\glsxtralttreeSymbolDescLocation 1042
\glsxtrautoindex 1043
\glsxtrautoindexassignsort 1044
\glsxtrautoindexentry 1045
\glsxtrBasicDigitrules 1046
\GlsXtrBibTeXEntryAliases 1047
\glsxtrbookindexatendgroup 1048
\glsxtrbookindexbetween 1049
\glsxtrbookindexbookmark 1050
\glsxtrbookindexcols 1051
\glsxtrbookindexcolspread 1052
\glsxtrbookindexfirstmark 1053
\glsxtrbookindexfirstmarkfmt 1054
\glsxtrbookindexformatheader 1055
\glsxtrbookindexlastmark 1056
\glsxtrbookindexlastmarkfmt 1057
\glsxtrbookindexmarkentry 1058
\glsxtrbookindexmulticolsenv 1059
\glsxtrbookindexname 1060
\glsxtrbookindexparentchildsep 1061
\glsxtrbookindexparentsubchildsep 1062
\glsxtrbookindexprelocation 1063
\glsxtrbookindexsubatendgroup 1064
\glsxtrbookindexsubbetween 1065
\glsxtrbookindexsubname 1066
\glsxtrbookindexsubprelocation 1067
\glsxtrbookindexsubsubatendgroup 1068
\glsxtrbookindexsubsubbetween 1069
\glsxtrchecknohyperfirst 1070
\glsxtrcombiningdiacriticIIIrules 1071
\glsxtrcombiningdiacriticIIrules 1072
\glsxtrcombiningdiacriticIrules 1073
\glsxtrcombiningdiacriticIVrules 1074
\glsxtrcombiningdiacriticrules 1075
\glsxtrcontrolrules 1076
\glsxtrcopytoglossary 1077
\glsxtrcurrencyrules 1078
\glsxtrdeffield 1079
\glsxtrdetoklocation 1080
\glsxtrdigitrules 1081
\glsxtrdisplayendloc 1082
\glsxtrdisplayendlochook 1083
\glsxtrdisplaysingleloc 1084
\glsxtrdisplaystartloc 1085
\glsxtrdoautoindexname 1086
\glsxtrdowrglossaryhook 1087
\glsxtredeffield 1088
\glsxtremsuffix 1089
\GlsXtrEnableEntryCounting 1090
\GlsXtrEnableEntryUnitCounting 1091
\GlsXtrEnableIndexFormatOverride 1092
\GlsXtrEnableInitialTagging 1093
\GlsXtrEnableLinkCounting 1094
\GlsXtrEnableOnTheFly 1095
\GlsXtrEnablePreLocationTag 1096
\glsxtrenablerecordcount 1097
\glsxtrendfor 1098
\glsxtrentryfmt 1099
\GlsXtrExpandedFmt 1100
\glsxtrfielddolistloop 1101
\glsxtrfieldforlistloop 1102
\glsxtrfieldifinlist 1103
\glsxtrfieldlistadd 1104
\glsxtrfieldlisteadd 1105
\glsxtrfieldlistgadd 1106
\glsxtrfieldlistxadd 1107
\glsxtrfieldtitlecasecs 1108
\glsxtrfieldxifinlist 1109
\glsxtrfmt 1110
\glsxtrfmt* 1111
\GlsXtrFmtDefaultOptions 1112
\glsxtrfmtdisplay 1113
\GlsXtrFmtField 1114
\glsxtrfootnotename 1115
\glsxtrforcsvfield 1116
\GlsXtrForeignText 1117
\GlsXtrForeignTextField 1118
\GlsXtrFormatLocationList 1119
\GlsXtrForUnsetBufferedList 1120
\glsxtrfractionrules 1121
\GLSxtrfull 1122
\Glsxtrfull 1123
\glsxtrfull 1124
\Glsxtrfullformat 1125
\glsxtrfullformat 1126
\GLSxtrfullpl 1127
\Glsxtrfullpl 1128
\glsxtrfullpl 1129
\Glsxtrfullplformat 1130
\glsxtrfullplformat 1131
\glsxtrfullsep 1132
\glsxtrGeneralLatinIIIrules 1133
\glsxtrGeneralLatinIIrules 1134
\glsxtrGeneralLatinIrules 1135
\glsxtrGeneralLatinIVrules 1136
\glsxtrGeneralLatinVIIIrules 1137
\glsxtrGeneralLatinVIIrules 1138
\glsxtrGeneralLatinVIrules 1139
\glsxtrGeneralLatinVrules 1140
\glsxtrgeneralpuncIIrules 1141
\glsxtrgeneralpuncIrules 1142
\glsxtrgeneralpuncrules 1143
\glsxtrglossentry 1144
\glsxtrglossentryother 1145
\glsxtrgroupfield 1146
\glsxtrhyphenrules 1147
\glsxtrhyphensuffix 1148
\glsxtrifcounttrigger 1149
\glsxtrifcustomdiscardperiod 1150
\GlsXtrIfFieldCmpStr 1151
\GlsXtrIfFieldEqNum 1152
\GlsXtrIfFieldEqStr 1153
\GlsXtrIfFieldEqXpStr 1154
\GlsXtrIfFieldNonZero 1155
\GlsXtrIfFieldUndef 1156
\glsxtrifhasfield 1157
\glsxtrifhasfield* 1158
\GlsXtrIfHasNonZeroChildCount 1159
\glsxtrifkeydefined 1160
\glsxtriflabelinlist 1161
\GlsXtrIfLinkCounterDef 1162
\glsxtrifrecordtrigger 1163
\glsxtrifwasfirstuse 1164
\GlsXtrIfXpFieldEqXpStr 1165
\glsxtrinclinkcounter 1166
\glsxtrindexaliased 1167
\GlsXtrIndexCounterLink 1168
\glsxtrindexseealso 1169
\glsxtrinitwrgloss 1170
\Glsxtrinlinefullformat 1171
\glsxtrinlinefullformat 1172
\Glsxtrinlinefullplformat 1173
\glsxtrinlinefullplformat 1174
\glsxtrinsertinsidetrue 1175
\glsxtrLatinA 1176
\glsxtrLatinAA 1177
\glsxtrLatinAELigature 1178
\glsxtrLatinE 1179
\glsxtrLatinEszettSs 1180
\glsxtrLatinEszettSz 1181
\glsxtrLatinEth 1182
\glsxtrLatinH 1183
\glsxtrLatinI 1184
\glsxtrLatinInsularG 1185
\glsxtrLatinK 1186
\glsxtrLatinL 1187
\glsxtrLatinLslash 1188
\glsxtrLatinM 1189
\glsxtrLatinN 1190
\glsxtrLatinO 1191
\glsxtrLatinOELigature 1192
\glsxtrLatinOslash 1193
\glsxtrLatinP 1194
\glsxtrLatinS 1195
\glsxtrLatinSchwa 1196
\glsxtrLatinT 1197
\glsxtrLatinThorn 1198
\glsxtrLatinWynn 1199
\glsxtrLatinX 1200
\GlsXtrLetField 1201
\GlsXtrLetFieldToField 1202
\GlsXtrLinkCounterName 1203
\GlsXtrLinkCounterValue 1204
\GlsXtrLoadResources 1205
\glsxtrlocalsetgrouptitle 1206
\GlsXtrLocationRecordCount 1207
\glsxtrlocrangefmt 1208
\Glsxtrlong 1209, 1210
\glsxtrlong 1211
\glsxtrlonghyphen 1212
\glsxtrlonghyphenshort 1213
\glsxtrlongnoshortdescname 1214
\glsxtrlongnoshortname 1215
\GLSxtrlongpl 1216
\Glsxtrlongpl 1217
\glsxtrlongpl 1218
\glsxtrlongshortdescname 1219
\glsxtrlongshortdescsort 1220
\glsxtrlongshortname 1221
\glsxtrlongshortuserdescname 1222
\glsxtrMathGreekIIrules 1223
\glsxtrMathGreekIrules 1224
\glsxtrMathItalicGreekIIrules 1225
\glsxtrMathItalicGreekIrules 1226
\glsxtrMathItalicLowerGreekIIrules 1227
\glsxtrMathItalicLowerGreekIrules 1228
\glsxtrMathItalicNabla 1229
\glsxtrMathItalicPartial 1230
\glsxtrMathItalicUpperGreekIIrules 1231
\glsxtrMathItalicUpperGreekIrules 1232
\glsxtrMathUpGreekIIrules 1233
\glsxtrMathUpGreekIrules 1234
\glsxtrnewgls 1235
\glsxtrnewGLSlike 1236
\glsxtrnewglslike 1237
\glsxtrnewnumber 1238
\glsxtrnewrgls 1239
\glsxtrnewrGLSlike 1240
\glsxtrnewrglslike 1241
\glsxtrnewsymbol 1242
\GlsXtrNoGlsWarningAutoMake 1243
\GlsXtrNoGlsWarningBuildInfo 1244
\GlsXtrNoGlsWarningCheckFile 1245
\GlsXtrNoGlsWarningEmptyMain 1246
\GlsXtrNoGlsWarningEmptyNotMain 1247
\GlsXtrNoGlsWarningEmptyStart 1248
\GlsXtrNoGlsWarningHead 1249
\GlsXtrNoGlsWarningMisMatch 1250
\GlsXtrNoGlsWarningNoOut 1251
\GlsXtrNoGlsWarningTail 1252
\glsxtrnonprintablerules 1253
\glsxtrnopostpunc 1254
\glsxtronlydescname 1255
\glsxtronlyname 1256
\glsxtronlysuffix 1257
\glsxtrorglong 1258
\glsxtrorgshort 1259
\Glsxtrp 1260, 1261
\glsxtrp 1262
\glsxtrpageref 1263
\glsxtrparen 1264
\Glsxtrpl 1265
\glsxtrpl 1266
\glsxtrpostdescription 1267
\glsxtrposthyphenlong 1268
\glsxtrposthyphenshort 1269
\glsxtrpostlink 1270
\glsxtrpostlinkAddDescOnFirstUse 1271
\glsxtrpostlinkAddSymbolDescOnFirstUse 1272
\glsxtrpostlinkAddSymbolOnFirstUse 1273
\glsxtrpostlinkendsentence 1274
\glsxtrpostlinkhook 1275
\glsxtrpostlongdescription 1276
\glsxtrpostnamehook 1277
\GlsXtrPostNewAbbreviation 1278
\glsxtrprelocation 1279
\GlsXtrProvideBibTeXFields 1280
\glsxtrprovidecommand 1281
\glsxtrprovidestoragekey 1282
\GlsXtrRecordCount 1283
\GlsXtrRecordCounter 1284
\glsxtrrecordtriggervalue 1285
\glsxtrregularfont 1286
\glsxtrresourcefile 1287
\glsxtrresourceinit 1288
\glsxtrrestorepostpunc 1289
\glsxtrRevertMarks 1290
\glsxtrRevertTocMarks 1291
\glsxtrscsuffix 1292
\glsxtrseealsolabels 1293
\glsxtrseelist 1294
\GlsXtrSetActualChar 1295
\glsxtrsetaliasnoindex 1296
\GlsXtrSetAltModifier 1297
\glsxtrsetcategory 1298
\glsxtrsetcategoryforall 1299
\GlsXtrSetDefaultGlsOpts 1300
\GlsXtrSetEncapChar 1301
\GlsXtrSetEscChar 1302
\GlsXtrSetField 1303
\glsxtrsetfieldifexists 1304
\glsxtrsetgrouptitle 1305
\GlsXtrSetLevelChar 1306
\glsxtrsetpopts 1307
\GlsXtrSetRecordCountAttribute 1308
\Glsxtrshort 1309, 1310
\glsxtrshort 1311
\glsxtrshortdescname 1312
\glsxtrshorthyphenlong 1313
\glsxtrshortlongdescname 1314
\glsxtrshortlongname 1315, 1316
\glsxtrshortlonguserdescname 1317
\glsxtrshortnolongname 1318
\GLSxtrshortpl 1319
\Glsxtrshortpl 1320
\glsxtrshortpl 1321
\glsxtrsmsuffix 1322
\glsxtrspacerules 1323
\GlsXtrStandaloneGlossaryType 1324
\GlsXtrStartUnsetBuffering 1325
\GlsXtrStopUnsetBuffering 1326
\glsxtrSubScriptDigitrules 1327
\Glsxtrsubsequentfmt 1328
\glsxtrsubsequentfmt 1329
\Glsxtrsubsequentplfmt 1330
\glsxtrsubsequentplfmt 1331
\glsxtrSuperScriptDigitrules 1332
\glsxtrtagfont 1333
\GlsXtrTheLinkCounter 1334
\GlsXtrTotalRecordCount 1335
\glsxtrunsrtdo 1336
\GlsXtrUseAbbrStyleFmts 1337
\GlsXtrUseAbbrStyleSetup 1338
\Glsxtrusefield 1339
\glsxtrusefield 1340
\glsxtruserfield 1341
\glsxtruserparen 1342
\glsxtrusersuffix 1343, 1344
\glsxtrusesee 1345
\glsxtruseseealso 1346
\glsxtruseseeformat 1347, 1348
\GlsXtrWarnDeprecatedAbbrStyle 1349
\GlsXtrWarning 1350
\glsxtrword 1351
\glsxtrwordsep 1352
\glsxtrwrglossmark 1353
H
hyperref package 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376
I
\ifglsxtrinitwrglossbefore 1377
inputenc package 1378
L
link-text 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398
location list 1399, 1400, 1401, 1402, 1403
\longnewglossaryentry 1404
M
makeglossaries 1405, 1406, 1407, 1408, 1409
\makeglossaries 1410
makeglossaries-lite 1411, 1412
makeglossaries-lite 1413, 1414
makeindex 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431
makeindex 1432, 1433, 1434, 1435
memoir class 1436
mfirstuc package 1437, 1438, 1439
N
\newabbreviation 1440
\newabbreviationstyle 1441
\newacronym 1442
\newglossaryentry options
access 1443, 1444
alias 1445, 1446, 1447, 1448, 1449, 1450
category 1451, 1452, 1453, 1454, 1455, 1456
counter 1457
desc 1458, 1459
descplural 1460, 1461
description 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483
descriptionplural 1484, 1485, 1486, 1487
first 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500
firstaccess 1501
firstplural 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511
group 1512, 1513, 1514, 1515, 1516
location 1517, 1518
loclist 1519
long 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528
longplural 1529, 1530, 1531, 1532, 1533, 1534
name 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586
nameshortaccess 1587, 1588
parent 1589, 1590, 1591
plural 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604
prefix 1605
see 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632
seealso 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642
short 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657
shortaccess 1658, 1659, 1660, 1661, 1662, 1663
shortplural 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678
shortpluralaccess 1679, 1680, 1681, 1682
sort 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700
symbol 1701, 1702, 1703, 1704
symbolplural 1705, 1706
text 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719
textaccess 1720
type 1721, 1722, 1723, 1724
user1 1725, 1726, 1727
number list 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761
P
package options:
abbreviations 1762, 1763, 1764, 1765, 1766
accsupp 1767, 1768, 1769, 1770, 1771
acronym 1772
acronymlists 1773
automake 1774, 1775
autoseeindex 1776, 1777
false 1778, 1779
counter
wrglossary 1780
debug 1781
all 1782, 1783
showtargets 1784, 1785
showwrgloss 1786, 1787, 1788
true 1789
docdef 1790, 1791, 1792, 1793
restricted 1794, 1795
true 1796, 1797
docdefs 1798, 1799, 1800
true 1801
entrycounter 1802, 1803
hyperfirst
false 1804
index 1805, 1806
indexcounter 1807, 1808, 1809
indexcrossrefs 1810, 1811, 1812, 1813
false 1814
indexonlyfirst 1815, 1816, 1817, 1818
nogroupskip 1819
nomain 1820
nomissingglstext 1821
nonumberlist 1822, 1823, 1824, 1825
nopostdot 1826, 1827, 1828, 1829
false 1830, 1831, 1832
true 1833
noredefwarn
false 1834
true 1835
notree 1836
numbers 1837, 1838, 1839
postdot 1840, 1841, 1842
postpunc 1843, 1844, 1845
comma 1846
dot 1847
none 1848
record 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859
alsoindex 1860, 1861, 1862, 1863, 1864, 1865, 1866
off 1867, 1868
only 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878
section
chapter 1879
seeautonumberlist 1880
seenoindex 1881
ignore 1882, 1883
warn 1884
shortcuts 1885, 1886
abbr 1887, 1888
abbreviation 1889, 1890
abbreviations 1891, 1892
ac 1893, 1894, 1895, 1896, 1897, 1898
acro 1899, 1900
acronyms 1901, 1902
all 1903, 1904
false 1905
none 1906
other 1907, 1908
true 1909
sort
none 1910, 1911
stylemods 1912, 1913, 1914, 1915, 1916
all 1917
default 1918
subentrycounter 1919, 1920
symbols 1921, 1922, 1923
toc
false 1924
true 1925
translate
babel 1926
true 1927
undefaction 1928, 1929
error 1930, 1931
warn 1932, 1933, 1934, 1935, 1936, 1937
xindy 1938
page (counter) 1939, 1940, 1941, 1942
polyglossia package 1943, 1944
\pretoglossarypreamble 1945
\printabbreviations 1946
\printglossary options
nogroupskip 1947
prefix 1948
target 1949, 1950
targetnameprefix 1951
title 1952
\printnoidxglossary options
sort 1953
\printunsrtglossaries 1954
\printunsrtglossary 1955
\printunsrtglossary* 1956
\printunsrtglossaryentryprocesshook 1957
\printunsrtglossaryhandler 1958
\printunsrtglossarypredoglossary 1959
\printunsrtglossaryskipentry 1960
\printunsrtglossaryunit 1961
\printunsrtglossaryunitsetup 1962
\provideignoredglossary 1963
R
relsizes package 1964
\RestoreAcronyms 1965
\rGLS 1966
\rGls 1967
\rgls 1968
\rGLSformat 1969
\rGlsformat 1970
\rglsformat 1971
\rGLSpl 1972
\rGlspl 1973
\rglspl 1974
\rGLSplformat 1975
\rGlsplformat 1976
\rglsplformat 1977
S
\setabbreviationstyle 1978
slantsc package 1979
soul package 1980, 1981
style package 1982
subentrycounter package 1983
T
textcase package 1984
tracklang package 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994
translator package 1995
U
upgreek package 1996, 1997, 1998, 1999
W
wrglossary (counter) 2000, 2001, 2002, 2003, 2004
X
xfor package 2005, 2006, 2007
\xglssetwidest 2008
\xglsupdatewidest 2009
\xGlsXtrSetField 2010
xindy 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025
xindy 2026
xkeyval package 2027
1.14.21 was originally intended as the last release of glossaries to incorporate new features, but a few new minor features slipped in with some bug fixes in v4.21.
2.1The descriptionplural key is a throwback to the base package’s original acronym mechanism before the introduction of the long and short keys, where the long form was stored in the description field and the short form was stored in the symbol field.
3.1For compatibility with earlier versions, \glsabbrvscfont is defined to \glsxtrscfont, which is defined to use \textsc. Direct use of \glsxtrscfont is now deprecated. Likewise for similar commands.
9.1Version 1.11 only allowed one use of \GlsXtrLoadResources per document.
9.2v1.08 assumed ⟨filename⟩.tex but that’s potentially dangerous if, for example, ⟨filename⟩ happens to be the same as \jobname. The .glstex extension was enforced by version 1.11.
10.1Pre version 1.28 used \csedef.