% This document takes a while to compile from scratch. See
% notes below.
%
% arara: lualatex if missing("glstex")
% arara: bib2gls: { group: on, packages: [ mfirstuc-english ] } if missing("glstex")
% arara: lualatex: { shell: yes }
% arara: bib2gls: { group: on, packages: [ mfirstuc-english ] }
% arara: lualatex
% arara: lualatex if found("log", "Rerun to get")
%
% This manual creates example documents on the fly in the 
% directory created by the following line:
\directlua{os.execute("mkdir -p glossaries-user-examples")}
% If the above doesn't work, you'll have to create the directory
% manually.

% If the shell escape is enabled the example documents will be
% automatically built with arara. If you already have the example .tex and
% .pdf files in the above directory, the shell escape isn't
% required. You'll need to run pdfcrop on the example pdf files if
% you don't have the *-crop.pdf files. If you only have the .tex
% files in the examples directory, then you need to run arara on
% each .tex file (which will call pdfcrop where applicable).
%
% This document requires glossaries-extra v1.49+, bib2gls v3.0+
% and nlctuserguide.sty. Some of the example documents require
% glossaries v4.50+ and mfirstuc v2.08+.

\documentclass[titlepage=false,oneside,toc=listof,
 fontsize=12pt,captions=tableheading]{scrbook}

\usepackage{relsize}
\usepackage{placeins}
\usepackage{bookmark}
\usepackage{mfirstuc-english}
\usepackage[
   deephierarchy,
   numberedsection,
   abbreviations,
   tikzsymbols,
   indexmarks,
   novref,
   %debug=showwrgloss,
   %showtargets=annoteleft
 ]{nlctuserguide}

\hypersetup{pdfauthor={Nicola Talbot},
 pdftitle={glossaries manual},
 bookmarksdepth=5}

\tcbuselibrary{hooks}
\tcbset{floatplacement=htbp}

\GetTitleStringSetup{expand}

\RedeclareSectionCommand[tocnumwidth=35pt]{section}

\renewcommand*{\thispackagename}{glossaries}
\renewcommand{\cmdnotefmt}[1]{}

\appto\terminaldesc{. See also
\qt{\dickimawhref{latex/buildglossaries}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}}}

\renewcommand{\optionlistprefix}{idx.opt.}
\renewcommand{\glsxtrtaggedlistsep}{~}
\newcommand{\idxoptiondef}[1]{%
  \protect\glsxtrtitleorpdforheading
   {\texidxoptiondef{#1}}% document text
   {\glsentryname{idx.opt.#1}}% PDF bookmark
   {\glsentryname{idx.opt.#1}}% page header
} 
\newrobustcmd{\texidxoptiondef}[1]{%
  \glsentryname{idx.opt.#1}%
} 
\newcommand{\maintexidxoptiondef}[1]{%
 \inlineidxdef{opt.#1}%
} 
\newcommand{\toctexidxoptiondef}[1]{%
 \inlineidxdef{opt.#1}%
} 
\glsxtrnewgls{idx.opt.}{\optionnum}

\MFUblocker{\csfmt}

\newcommand{\combase}{\comment{\glslink{pkg.glossaries-extra}{glossaries.sty}}}
\newcommand{\comxr}{\comment{\glslink{pkg.glossaries-extra}{glossaries-extra.sty}}}
\newcommand{\comxronly}{\comment{\glslink{pkg.glossaries-extra}{glossaries-extra.sty} only}}
\newcommand{\comxrkey}{\comment{\glslink{pkg.glossaries-extra}{glossaries-extra.sty} key}}
\newcommand{\comxropt}[1]{\comment{requires \glslink{pkg.glossaries-extra}{glossaries-extra.sty} '\opt{#1}' option}}

\newcommand{\location}{\idxc{entrylocation}{location}}
\newcommand{\locations}{\idxc{entrylocation}{locations}}

\newcommand{\encap}[2][]{{\let\csfmt\csfmtcolourfont\gls[#1]{#2}}}
\newcommand{\inlineencapdef}[1]{{\let\csfmt\csfmtcolourfont\inlineglsdef[]{#1}}}

\newcommand{\indexed}{\idxc{indexing}{indexed}}
\newcommand{\recorded}{\idxc{indexing}{recorded}}
\newcommand{\record}{\idxc{indexing}{record}}
\newcommand{\records}{\idxc{indexing}{records}}
\newcommand{\sanitized}{\idxc{sanitize}{sanitized}}
\newcommand{\sanitization}{\idxc{sanitize}{sanitization}}
\newcommand{\casechanging}{\idxc{casechange}{case-changing}}
\newcommand{\atentry}[1]{\texorpdfstring{\code{@#1}}{@#1}}
\newcommand{\thecounter}[1]{\glslink{thecounter}{\csfmt{the\-#1}}}
\newcommand{\theHcounter}[1]{\glslink{theHcounter}{\csfmt{the\-H\-#1}}}
\newcommand{\thecountername}{\glslink{thecounter}{\csfmt{the\-\meta{counter-name}}}}
\newcommand{\theHcountername}{\glslink{theHcounter}{\csfmt{the\-\meta{counter-name}}}}
\newcommand{\recordcounterfield}[1]{%
 \glslink{opt.glosfield.recordcount.counter}{\csoptfmt{record\-count\dfullstop#1}}}
\newcommand{\recordcounterlocationfield}[2]{%
 \glslink{opt.glosfield.recordcount.counter.location}{\csoptfmt{record\-count\dfullstop#1\dfullstop#2}}}
\newcommand{\captionslanguage}[1]{\glslink{captionslanguage}{\csfmt{captions\-#1}}}
\newcommand{\glsxtrcounterlocfmt}[1]{\glslink{glsxtrcounterlocfmt}{\xtrcsfmt{gls\-xtr\-#1\-loc\-fmt}}}
\newcommand{\glsXcounterXformat}[2]{\glslink{glsXcounterXformat}{\csfmt{gls\-X\-#1\-X\-#2}}}
\newcommand{\glsfieldlabelaccsupp}[1]{\glslink{glsfield-labelaccsupp}{\csfmt{gls\-#1\-acc\-supp}}}
\newcommand{\glsxtrcategoryfieldaccsupp}[1]{\glslink{glsxtrcategoryfieldaccsupp}{\csfmt{glsxtr\-#1\-acc\-supp}}}
\newcommand{\glsxtrcategoryaccsupp}[1]{\glslink{glsxtrcategoryaccsupp}{\csfmt{glsxtr\-#1\-acc\-supp}}}

\MFUhyphentrue
\setabbreviationstyle[termacronym]{short-sm-desc}
\setabbreviationstyle[acronym]{short-sm-nolong}

\glsxtrnewgls{opt.printgloss.}{\printglossopt}
\newcommand{\printglossoptval}[2]{\optval{printgloss.#1}{#2}}
\newcommand{\printglossoptvalm}[2]{\optval{printgloss.#1}{\marg{#2}}}
\newcommand{\printglossopteqvalref}[2]{\opteqvalref{printgloss.#1}{#2}}

\glsxtrnewgls{opt.style-options.}{\glostyleopt}
\newcommand{\glostyleoptval}[2]{\optval{style-options.#1}{#2}}
\newcommand{\glostyleoptvalm}[2]{\optval{style-options.#1}{\marg{#2}}}

\glsxtrnewgls{opt.style-options.tree*.}{\treestaropt}
\newcommand{\treestaroptval}[2]{\optval{style-options.tree*.#1}{#2}}
\newcommand{\treestaroptvalm}[2]{\optval{style-options.tree*.#1}{\marg{#2}}}
\newcommand{\treestaroptdef}[1]{\optiondef{style-options.tree*.#1}}
\newcommand{\treestaroptvaldef}[2]{\optionvaldef{style-options.tree*.#1}{#2}}

\glsxtrnewgls{opt.style-options.mcoltree*.}{\mcoltreestaropt}
\newcommand{\mcoltreestaroptval}[2]{\optval{style-options.mcoltree*.#1}{#2}}
\newcommand{\mcoltreestaroptvalm}[2]{\optval{style-options.mcoltree*.#1}{\marg{#2}}}
\newcommand{\mcoltreestaroptdef}[1]{\optiondef{style-options.mcoltree*.#1}}

\newcommand{\styoptxdyval}[2]{\optval{xindy.#1}{#2}}
\newcommand{\styoptxdyvalm}[2]{\styoptxdyval{#1}{\marg{#2}}}

\glsxtrnewgls{opt.glsopt.}{\glsopt}
\newcommand{\glsoptval}[2]{\optval{glsopt.#1}{#2}}
\newcommand{\glsoptvalm}[2]{\optvalm{glsopt.#1}{#2}}

\glsxtrnewgls{opt.gloskey.}{\gloskey}
\newcommand{\gloskeyval}[2]{\optval{gloskey.#1}{\marg{#2}}}
\newcommand{\gloskeyfmttext}[1]{\glsfmttext{opt.gloskey.#1}}

\glsxtrnewgls{opt.glosfield.}{\glosfield}
\newcommand{\glosfielddisp}[3][]{\glsdisp[#1]{opt.glosfield.#2}{\csoptfmt{#3}}}

\newcommand{\glosfielddef}[1]{\inlineglsdef[optdef]{opt.glosfield.#1}}
\newcommand{\glostypedef}[1]{\inlineglsdef[optdef]{opt.glostype.#1}}
\newcommand{\glsoptdef}[1]{\inlineglsdef[optdef]{opt.glsopt.#1}}

\newcommand{\inlineglostyledef}[1]{\inlineglsdef[optdef]{opt.glostyle.#1}}
\newcommand{\glostyledef}[1]{\optiondef{glostyle.#1}}

\newcommand{\printglossoptdef}[1]{\optiondef{printgloss.#1}}

\defsemanticcmd[style2]{\glostypefmt}{\texttt}{}
\glsxtrnewgls{opt.glostype.}{\glostype}

\glsxtrnewgls{opt.cat.}{\cat}
\glsxtrnewgls{opt.catattr.}{\catattr}
\glsxtrnewgls{opt.resource.}{\resourceopt}
\newcommand{\resourceoptval}[2]{\optval{resource.#1}{#2}}
\newcommand{\resourceoptvalm}[2]{\optval{resource.#1}{\marg{#2}}}

\glsxtrnewgls{switch.mkidx.}{\mkidxopt}
\glsxtrnewgls{switch.xdy.}{\xdyopt}
\glsxtrnewgls{switch.mkgls.}{\mkglsopt}
\glsxtrnewgls{switch.mkglslite.}{\mkglsliteopt}
\glsxtrnewgls{switch.b2g.}{\bibglsopt}

\glsxtrnewgls{opt.glostyle.}{\glostyle}
\glsxtrnewgls{opt.abbrstyle.}{\abbrstyle}
\glsxtrnewgls{opt.acrstyle.}{\acrstyle}

\defsemanticcmd[style1]{\fieldfmt}{\texttt}{}
\defsemanticcmd[style6]{\entryfmt}{\texttt}{}
\newcommand*{\atentryfmt}[1]{\entryfmt{@#1}}

\newcommand*{\acrstyledef}[1]{\optiondef{acrstyle.#1}}
\defsemanticcmd[style3]{\acrstylefmt}{\textsf}{}
\defsemanticcmd{\glostylefmt}{\textsf}{}

\defsemanticcmd[style5]{\glostyleoptfmt}{\texttt}{}

\defsemanticcmd[style6]{\catfmt}{\textsf}{}
\defsemanticcmd[style6]{\catattrfmt}{\textsf}{}
\defsemanticcmd[style6]{\xtrfmt}{}{}
\defsemanticcmd[style6]{\xtrcsfmt}{\texttt}{\codebackslash}
\defsemanticcmd[style6]{\xtrcsoptfmt}{\optfmt}{}
\defsemanticcmd[style6]{\xtrstyoptfmt}{\optfmt}{}
\defsemanticcmd[style6]{\xtroptfmt}{\optfmt}{}
\defsemanticcmd[style6]{\xtrctrfmt}{\ctrfmt}{}
\defsemanticcmd[style6]{\abbrstylefmt}{\textsf}{}
\defsemanticcmd[style6]{\xtrglostylefmt}{\textsf}{}

\newcommand{\xtrcmd}[1]{\xtrfmt{\cmd{#1}}}

\newcommand{\hierarchical}{\glslink{hierarchicallevel}{hierarchical}}
\newcommand{\toplevel}{\glslink{hierarchicallevel}{top level (level~0)}}
\newcommand{\hierlevel}[1]{\glslink{hierarchicallevel}{level~#1}}

\newcommand{\samplefile}[1]{\file{sample#1.tex}}

\renewcommand{\nlctuserguidecustomentryaliases}{%
   glossarystyle=index,
   abbreviationstyle=index,
   acronymstyle=index,
}

\appto{\nlctexampledisablecmds}{%
 \letcs{\opt}{@firstofone}%
 \letcs{\glostype}{@firstofone}%
 \letcs{\cat}{@firstofone}%
 \letcs{\catattr}{@firstofone}%
 \letcs{\resourceopt}{@firstofone}%
 \letcs{\acrstyle}{@firstofone}%
 \letcs{\abbrstyle}{@firstofone}%
 \letcs{\glostyle}{@firstofone}%
 \letcs{\glsopt}{@firstofone}%
 \letcs{\mglsopt}{@firstofone}%
 \letcs{\gloskey}{@firstofone}%
 \letcs{\glosfield}{@firstofone}%
 \letcs{\printglossopt}{@firstofone}%
 \letcs{\treestaropt}{@firstofone}%
 \letcs{\mcoltreestaropt}{@firstofone}%
 \let\resourceoptval\keyeqvalue
 \let\resourceoptvalm\keyeqvaluem
 \let\optval\keyeqvalue
 \let\opteqvalref\keyeqvalue
 \let\gloskeyval\keyeqvaluem
 \let\glsoptval\keyeqvaluem
 \let\mglsoptval\keyeqvaluem
 \let\printglossoptval\keyeqvalue
 \let\printglossoptvalm\keyeqvaluem
 \let\glostyleoptvalm\keyeqvaluem
 \let\treestaroptval\keyeqvalue
 \let\treestaroptvalm\keyeqvaluem
 \let\mcoltreestaroptval\keyeqvalue
 \let\mcoltreestaroptvalm\keyeqvaluem
}

\newcommand{\summaryentryglossarystyle}[1]{%
 {%
   \renewcommand*{\glostylefmt}[1]{\texttt{##1}}%
   \genericsummaryentryoption{#1}%
 }%
}

\newcommand{\summaryentryacronymstyle}[1]{%
 {%
   \renewcommand*{\acrstylefmt}[1]{\texttt{##1}}%
   \genericsummaryentryoption{#1}%
 }%
}

\renewcommand{\nlctuserguideletterrules}{%
 \glsxtrGeneralLatinAtoGrules
 \string<glo,Glo,GLO\string<gls,Gls,GLS\string<glsxtr,Glsxtr,GlsXtr,GLSxtr,GLSXTR
 \glsxtrGeneralLatinHtoMrules
 \glsxtrGeneralLatinNtoZrules
}

\nlctuserguidegls[selection=all,max-loc-diff=3]
{
  \def\gxtrcmd#1#2{\glsbibwriteentry{command}{#1}{\field{name}{\xtrcsfmt{#1}}#2}}%
  \def\gxtrcmds#1#2{\glsbibwriteentry{command}{#1}{\field{name}{\xtrcsfmt{#1}}\field{modifiers}{*}#2}}%
  \def\gxtrcmdsp#1#2{\glsbibwriteentry{command}{#1}{\field{name}{\xtrcsfmt{#1}}\field{modifiers}{*,+}#2}}%
  \def\gxtrcmdmeta#1#2#3#4{\glsbibwriteentry{command}{#1#2#3}{\field{name}{\xtrcsfmt{#1\meta{#2}#3}}#4}}%
  \def\gxtrcmdmetameta#1#2#3#4#5#6{\glsbibwriteentry{command}{#1#2#3#4#5}{\field{name}{\xtrcsfmt{#1\meta{#2}#3\meta{#4}#5}}#6}}%
  \def\gxtrstyopt#1#2{\glsbibwriteentry{packageoption}{opt.#1}{\field{name}{\xtrstyoptfmt{#1}}#2}}%
  \def\gxtroptval#1#2#3{\glsbibwriteentry{optionvalue}{optval.#1.#2}{\field{name}{\xtroptfmt{#2}}\field{parent}{opt.#1}#3}}%
  \def\gxtrctr#1#2{\glsbibwriteentry{counter}{ctr.#1}{\field{name}{\xtrctrfmt{#1}}#2}}%
  \def\gprintglossopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.printgloss.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.printglossopt}#2}}%
  \def\gxtrprintglossopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.printgloss.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.printglossopt}#2}}%
  \def\gglsopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.glsopt.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.glsopt}#2}}%
  \def\gxtrglsopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.glsopt.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.glsopt}#2}}%
  \def\ggloskey#1#2{%
   \glsbibwriteentry{commandoption}{opt.gloskey.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.gloskey}#2}}%
  \def\gxtrgloskey#1#2{%
   \glsbibwriteentry{commandoption}{opt.gloskey.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.gloskey}#2}}%
  \def\gglosfield#1#2{%
   \glsbibwriteentry{commandoption}{opt.glosfield.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.glosfield}#2}}%
  \def\gxtrglosfield#1#2{%
   \glsbibwriteentry{commandoption}{opt.glosfield.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.glosfield}#2}}%
  \def\gglostype#1#2{%
   \glsbibwriteentry{optionvalue}{opt.glostype.#1}{%
    \field{name}{\glostypefmt{#1}}\parent{glossary}#2}}%
  \def\gcat#1#2{%
   \glsbibwriteentry{optionvalue}{opt.cat.#1}{%
    \field{name}{\catfmt{#1}}\parent{idx.category}#2}}%
  \def\gcatattr#1#2{%
   \glsbibwriteentry{optionvalue}{opt.catattr.#1}{%
    \field{name}{\csoptfmt{#1}}\parent{idx.categoryattribute}#2}}%
  \def\gtreestaropt#1#2{\glsbibwriteentry{option}{opt.style-options.tree*.#1}%
    {\field{name}{\glostyleoptfmt{#1}}\parent{opt.style-options.tree*}#2}}%
  \def\gtreestaroptval#1#2#3{%
   \glsbibwriteentry{optionvalue}{optval.style-options.tree*.#1.#2}%
   {\field{name}{\glostyleoptfmt{#2}}\field{parent}{opt.style-options.tree*.#1}#3}}
  \def\gmcoltreestaropt#1#2{\glsbibwriteentry{option}{opt.style-options.mcoltree*.#1}%
    {\field{name}{\glostyleoptfmt{#1}}\parent{opt.style-options.mcoltree*}#2}}%
  \def\gglosty#1#2{\glsbibwriteentry{glossarystyle}{opt.glostyle.#1}%
    {\field{name}{\glostylefmt{#1}}\parent{idx.glossarystyle}#2}}%
  \def\gxtrglosty#1#2{\glsbibwriteentry{glossarystyle}{opt.glostyle.#1}%
    {\field{name}{\xtrglostylefmt{#1}}\parent{idx.glossarystyle}#2}}%
  \def\gabbrsty#1#2{\glsbibwriteentry{abbreviationstyle}{opt.abbrstyle.#1}%
    {\field{name}{\abbrstylefmt{#1}}\parent{idx.abbrvstyle}#2}}%
  \def\gabbrstyalias#1#2{\gabbrsty{#1}{\field{alias}{opt.abbrstyle.#2}}}%
  \def\gdepabbrsty#1#2{\gabbrsty{#1}{\deprecated\field{alias}{opt.abbrstyle.#2}}}%
  \def\gacrsty#1#2{\glsbibwriteentry{acronymstyle}{opt.acrstyle.#1}%
    {\field{name}{\acrstylefmt{#1}}\parent{idx.acronymstyle}#2}}%
  \def\gresourceopt#1#2{%
   \glsbibwriteentry{commandoption}{opt.resource.#1}{%
    \field{name}{\xtrcsoptfmt{#1}}\parent{idx.resourceopt}#2}}%
  \def\gbibglsswitch#1#2{\glsbibwriteentry{switch}{switch.b2g.#1}{\field{name}{\shortargfmt{#1}}\inapp{bib2gls}#2}}%
  \def\gmkidxswitch#1#2{\glsbibwriteentry{switch}{switch.mkidx.#1}{\field{name}{\shortargfmt{#1}}\inapp{makeindex}#2}}%
  \def\gxdyswitch#1#2{\glsbibwriteentry{switch}{switch.xdy.#1}{\field{name}{\shortargfmt{#1}}\inapp{xindy}#2}}%
  \def\gmkglsswitch#1#2{\glsbibwriteentry{switch}{switch.mkgls.#1}{\field{name}{\shortargfmt{#1}}\inapp{makeglossaries}#2}}%
  \def\gmkglsliteswitch#1#2{\glsbibwriteentry{switch}{switch.mkglslite.#1}{\field{name}{\shortargfmt{#1}}\inapp{makeglossaries-lite}#2}}%
  \gidxpl{glossarystyle}%
  {%
    \common
    \field{text}{glossary style}%
    \desc{the default style may be set with \gls{setglossarystyle}
or with the \opt{style} package option.
The default style can be overridden for individual \idxpl{glossary}
with the \printglossopt{style} option. For a summary of all
available styles, see \gallerypage{glossaries-styles}{Gallery:
Predefined Styles}}
  }
  \gidx{glossaryformat}%
  {%
    \name{glossary}
    \field{parent}{idx.format}
    \field{text}{glossary format}
    \field{alias}{idx.glossarystyle}
  }
  \gidx{acronymstyle}{\name{acronym style}
   \desc{the style should be set with \gls{setacronymstyle} before
    the first instance of \gls{newacronym}}}
  \gidx{format}{}
  \gidx{abbrvstyle}{\name{\xtrfmt{abbreviation} style (\styfmt{glossaries-extra})}
    \field{text}{\xtrfmt{abbreviation} style}
  }
  \gidx{abbrvformat}%
  {%
    \name{\xtrfmt{abbreviation}}
    \field{parent}{idx.format}
    \field{text}{\xtrfmt{abbreviation} format}
    \field{alias}{idx.abbrvstyle}
  }
  \gidxpl{category}{\field{text}{category}\field{plural}{categories}}
  \gidx{categoryattribute}{\name{category attributes}\field{text}{category attribute}}
  % FILES
  % sample files:
  \gidx{samplefile}{\name{sample files}\field{text}{sample file}}%
  \gfile{minimalgls.tex}{}% file: minimalgls.tex
  \gfile{mwe\dhyphen gls.tex}{}% file: mwe-gls.tex
  \gfile{mwe\dhyphen acr.tex}{}% file: mwe-acr.tex
  \gfile{mwe\dhyphen acr\dhyphen desc.tex}{}% file: mwe-acr-desc.tex
  \gfile{sample.tex}{}% file: sample.tex
  \gfile{sample4col.tex}{}% file: sample4col.tex
  \gfile{sampleaccsupp.tex}{}% file: sampleaccsupp.tex
  \gfile{sampleAcrDesc.tex}{}% file: sampleAcrDesc.tex
  \gfile{sampleacronyms.tex}{}% file: sampleacronyms.tex
  \gfile{sampleAcr.tex}{}% file: sampleAcr.tex
  \gfile{sample\dhyphen chap\dhyphen hyperfirst.tex}{}% file: sample-chap-hyperfirst.tex
  \gfile{sample\dhyphen crossref.tex}{}% file: sample-crossref.tex
  \gfile{sample\dhyphen custom\dhyphen acronym.tex}{}% file: sample-custom-acronym.tex
  \gfile{sampleCustomAcr.tex}{}% file: sampleCustomAcr.tex
  \gfile{sampleDB.tex}{}% file: sampleDB.tex
  \gfile{sampleDesc.tex}{}% file: sampleDesc.tex
  \gfile{sample\dhyphen dot\dhyphen abbr.tex}{}% file: sample-dot-abbr.tex
  \gfile{sample\dhyphen dual.tex}{}% file: sample-dual.tex
  \gfile{sample\dhyphen entrycount.tex}{}% file: sample-entrycount.tex
  \gfile{sample\dhyphen entryfmt.tex}{}% file: sample-entryfmt.tex
  \gfile{sampleEq.tex}{}% file: sampleEq.tex
  \gfile{sampleEqPg.tex}{}% file: sampleEqPg.tex
  \gfile{sampleFnAcrDesc.tex}{}% file: sampleFnAcrDesc.tex
  \gfile{sample\dhyphen FnDesc.tex}{}% file: sample-FnDesc.tex
  \gfile{sample\dhyphen font\dhyphen abbr.tex}{}% file: sample-font-abbr.tex
  \gfile{sample\dhyphen ignored.tex}{}% file: sample-ignored.tex
  \gfile{sample\dhyphen index.tex}{}% file: sample-index.tex
  \gfile{sample\dhyphen inline.tex}{}% file: sample-inline.tex
  \gfile{sample\dhyphen langdict.tex}{}% file: sample-langdict.tex
  \gfile{sample\dhyphen newkeys.tex}{}% file: sample-newkeys.tex
  \gfile{sample\dhyphen noidxapp.tex}{}% file: sample-noidxapp.tex
  \gfile{sample\dhyphen noidxapp\dhyphen utf8.tex}{}% file: sample-noidxapp-utf8.tex
  \gfile{sample\dhyphen nomathhyper.tex}{}% file: sample-nomathhyper.tex
  \gfile{sampleNtn.tex}{}% file: sampleNtn.tex
  \gfile{sample\dhyphen numberlist.tex}{}% file: sample-numberlist.tex
  \gfile{samplePeople.tex}{}% file: samplePeople.tex
  \gfile{sample\dhyphen prefix.tex}{}% file: sample-prefix.tex
  \gfile{sampleSec.tex}{}% file: sampleSec.tex
  \gfile{sample\dhyphen si.tex}{}% file: sample-si.tex
  \gfile{sampleSort.tex}{}% file: sampleSort.tex
  \gfile{sample\dhyphen storage\dhyphen abbr\dhyphen desc.tex}{}% file: sample-storage-abbr-desc.tex
  \gfile{sample\dhyphen storage\dhyphen abbr.tex}{}% file: sample-storage-abbr.tex
  \gfile{sampletree.tex}{}% file: sampletree.tex
  \gfile{sampleutf8.tex}{}% file: sampleutf8.tex
  \gfile{samplexdy2.tex}{}% file: samplexdy2.tex
  \gfile{samplexdy3.tex}{}% file: samplexdy3.tex
  \gfile{samplexdy.tex}{}% file: samplexdy.tex
  % test files:
  \gidx{testfile}{\name{test files}\field{text}{test file}}%
   % example-glossaries-acronym-desc.tex
  \gfile{example\dhyphen glossaries\dhyphen acronym\dhyphen desc.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
   % example-glossaries-longchild.tex
  \gfile{example\dhyphen glossaries\dhyphen longchild.tex}%
  {\providedby{\sty{glossaries} v4.47+}}%
   % example-glossaries-acronyms-lang.tex
  \gfile{example\dhyphen glossaries\dhyphen acronyms\dhyphen lang.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-long.tex
  \gfile{example\dhyphen glossaries\dhyphen long.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-acronym.tex
  \gfile{example\dhyphen glossaries\dhyphen acronym.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-multipar.tex
  \gfile{example\dhyphen glossaries\dhyphen multipar.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-brief.tex
  \gfile{example\dhyphen glossaries\dhyphen brief.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-utf8.tex
  \gfile{example\dhyphen glossaries\dhyphen utf8.tex}%
   {\providedby{\sty{glossaries} v4.53+}}%
  % example-glossaries-parent.tex
  \gfile{example\dhyphen glossaries\dhyphen parent.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-childmultipar.tex
  \gfile{example\dhyphen glossaries\dhyphen childmultipar.tex}%
   {\providedby{\sty{glossaries} v4.47+}}%
  % example-glossaries-symbolnames.tex
  \gfile{example\dhyphen glossaries\dhyphen symbolnames.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-childnoname.tex
  \gfile{example\dhyphen glossaries\dhyphen childnoname.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-symbols.tex
  \gfile{example\dhyphen glossaries\dhyphen symbols.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-cite.tex
  \gfile{example\dhyphen glossaries\dhyphen cite.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-url.tex
  \gfile{example\dhyphen glossaries\dhyphen url.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-images.tex
  \gfile{example\dhyphen glossaries\dhyphen images.tex}%
   {\providedby{\sty{glossaries} v4.33+}}%
  % example-glossaries-user.tex
  \gfile{example\dhyphen glossaries\dhyphen user.tex}%
   {\providedby{\sty{glossaries} v4.51+}}%
  % example-glossaries-xr.tex
  \gfile{example\dhyphen glossaries\dhyphen xr.tex}%
   {\providedby{\sty{glossaries-extra} v1.16+}}%
  % example-glossaries-constants.tex
  \gfile{example\dhyphen glossaries\dhyphen constants.tex}%
   {\providedby{\sty{glossaries} v4.59+}}%
  % glossaries-english.ldf
  \gfile{glossaries\dhyphen english.ldf}{}
  % glossaries-irish.ldf
  \gfile{glossaries\dhyphen irish.ldf}{}
  % glossaries-dictionary-English.dict
  \gfile{glossaries\dhyphen dictionary\dhyphen English.dict}{}
  % glossaries-<lang>.ldf
  \gfilemeta{glossaries\dhyphen}{lang}{.ldf}{}
  % glossaries-dictionary-<Lang>.dict
  \gfilemeta{glossaries\dhyphen dictionary\dhyphen }{Lang}{.dict}{}
  % glossaries-<iso-lang>-<iso-region>.ldf
  \gfilemetameta{glossaries\dhyphen}{iso-lang}{\dhyphen}{iso-region}{.ldf}{}
  % packages:
  \gpkg{glossaries}% glossaries.sty
  {%
    \common
    \syntax{\meta{options}}%
    \desc{base package. This package will be implicitly loaded by
      \sty{glossaries-prefix}, \sty{glossaries-accsupp} and
     \sty{glossaries-extra}}
  }
  \gpkg{glossaries\dhyphen extra}% glossaries-extra.sty
  {%
    \common
    \syntax{\meta{options}}%
    \desc{extension package that loads \sty{glossaries}, provides
      additional commands, and modifies some of the base
      \sty{glossaries} commands to integrate them with the new
      commands or to make them more flexible}
  }
  \gpkg{glossaries\dhyphen extra\dhyphen stylemods}% glossaries-extra-stylemods.sty
  {%
    \syntax{\meta{options}}%
    \note{or \code{\csfmt{usepackage}[\optval{stylemods}{\meta{options}}]\marg{glossaries-extra}}}
    \desc{modifies the \idxpl{glossarystyle} supplied with the base \sty{glossaries}
      package to make them more flexible and to integrate support
     for features provided by \sty{glossaries-extra} or \app{bib2gls}}
  }
  \gpkg{glossaries\dhyphen extra\dhyphen bib2gls}% glossaries-extra-bib2gls.sty
  {%
    \desc{automatically loaded with \optval{record}{only} and
     \optval{record}{nameref}}
  }
  % glossaries-babel.sty
  \gpkg{glossaries\dhyphen babel}
  {
    \syntax{\meta{options}}%
    \desc{interface package that provides \sty{babel} support for
    \sty{glossaries}. The actual language settings are in independently
    distributed packages}
  }
  % glossaries-polyglossia.sty
  \gpkg{glossaries\dhyphen polyglossia}
  {
    \syntax{\meta{options}}%
    \desc{interface package that provides \sty{polyglossia} support for
    \sty{glossaries}. The actual language settings are in independently
    distributed packages}
  }
  % glossaries-prefix.sty
  \gpkg{glossaries\dhyphen prefix}%
  {%
    \syntax{\meta{options}}%
    \note{automatically loaded with
    \code{\csfmt{usepackage}[\opt{prefix}]\marg{glossaries-extra}}}
    \desc{provides additional keys and commands to associated
    prefixes with \idx{glossary} entries. If loaded on its own, it will
    automatically load \sty{glossaries} with the given options}
  }
  % glossaries-accsupp.sty
  \gpkg{glossaries\dhyphen accsupp}%
  {%
    \syntax{\meta{options}}%
    \note{automatically loaded with
    \code{\csfmt{usepackage}[\opt{accsupp}]\marg{glossaries-extra}}}
    \desc{provides additional keys and commands to make it easier to
    integrate accessibility support into \idx{glossary} entry definitions.
    If loaded on its own, it will automatically load \sty{glossaries}
    with the given options}
  }
  % glossary-hypernav.sty
  \gpkg{glossary\dhyphen hypernav}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides support for \idxpl{glossarystyle}, such as \glostyle{listhypergroup}}
  }
  % glossary-list.sty
  \gpkg{glossary\dhyphen list}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides list-like \idxpl{glossarystyle}, such as
    \glostyle{list}. These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-tree.sty
  \gpkg{glossary\dhyphen tree}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides \hierarchical\ index or tree-like \idxpl{glossarystyle}, such as
    \glostyle{index} and \glostyle{tree}.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-mcols.sty
  \gpkg{glossary\dhyphen mcols}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\opt{stylemods}\dequals mcols]\marg{glossaries-extra}}}
    \desc{provides multicolumn \hierarchical\ index and tree-like
    \idxpl{glossarystyle},
    such as \glostyle{mcolindex} and \glostyle{mcoltree}. This package
    automatically loads \sty{glossary-tree} and \sty{multicol}.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-inline.sty
  \gpkg{glossary\dhyphen inline}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{inline}]\marg{glossaries-extra}}}
    \desc{provides the \glostyle{inline} \idx{glossarystyle}.
    This style is patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-long.sty
  \gpkg{glossary\dhyphen long}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{long} that use the \sty{longtable} package.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-longbooktabs.sty
  \gpkg{glossary\dhyphen long\-book\-tabs}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{longbooktabs}]\marg{glossaries-extra}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{long-booktabs} that use the \sty{longtable} package with
    the \sty{booktabs} package to provide horizontal rules.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-longragged.sty
  \gpkg{glossary\dhyphen long\-ragged}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{longragged}]\marg{glossaries-extra}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{longragged} that use the \sty{longtable} package with
    the \sty{array} package to left-justify the description column.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-super.sty
  \gpkg{glossary\dhyphen super}%
  {%
    \note{automatically loaded with \code{\csfmt{usepackage}\marg{glossaries}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{super} that use the \sty{supertabular} package.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-superragged.sty
  \gpkg{glossary\dhyphen super\-ragged}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{superragged}]\marg{glossaries-extra}}}
    \desc{provides tabular-like \idxpl{glossarystyle}, such as
    \glostyle{superragged} that use the \sty{supertabular} package with
    the \sty{array} package to left-justify the description column.
    These styles are patched by \sty{glossaries-extra-stylemods}}
  }
  % glossary-bookindex.sty
  \gpkg{glossary\dhyphen book\-index}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{bookindex}]\marg{glossaries-extra}}}
    \desc{provides the \glostyle{bookindex} \idx{glossarystyle}, which
     doesn't show descriptions. This package is distributed with
     \sty{glossaries-extra}}
  }
  % glossary-longextra.sty
  \gpkg{glossary\dhyphen long\-extra}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{longextra}]\marg{glossaries-extra}}}
    \desc{provides more flexible tabular-like \idxpl{glossarystyle}, such
     as \glostyle{long-name-desc}. This package is distributed with
     \sty{glossaries-extra} and automatically loads
     \sty{glossary-longbooktabs}}
  }
  % glossary-topic.sty
  \gpkg{glossary\dhyphen topic}%
  {%
    \note{load explicitly or with
    \code{\csfmt{usepackage}[\optval{stylemods}{topic}]\marg{glossaries-extra}}}
    \desc{provides the \hierarchical\ \glostyle{topic} and \glostyle{topicmcols}
     \idxpl{glossarystyle}. This package is distributed with
     \sty{glossaries-extra} and automatically loads \sty{multicol}}
  }
  % Language modules
  \gfile{glossaries\dhyphen german.ldf}{}% glossaries-german.ldf
  % OTHER PACKAGES:
  \gpkg{glossary}{}% glossary.sty
  \gpkg{long\-table}{}% longtable.sty
  \gpkg{super\-tabular}{}% supertabular.sty
  \gpkg{array}{}% array.sty
  \gpkg{book\-tabs}{}% booktabs.sty
  \gpkg{multi\-col}{}% multicol.sty
  \gpkg{babel}{}% babel.sty
  \gpkg{poly\-glossia}{}% polyglossia.sty
  \gpkg{translator}{}% translator.sty
  \gcls{memoir}{}% memoir.cls
  \gcls{report}{}% report.cls
  \gcls{book}{}% book.cls
  \gcls{beamer}{}% beamer.cls
  \gpkg{hyper\-ref}{}% hyperref.sty
  \gpkg{name\-ref}{}% nameref.sty
  \gpkg{get\-title\-string}{}% gettitlestring.sty
  \gpkg{ams\-math}{}% amsmath.sty
  \gpkg{ams\-gen}{}% amsgen.sty
  \gpkg{etool\-box}{}% etoolbox.sty
  \gpkg{input\-enc}{}% inputenc.sty
  \gpkg{font\-enc}{}% fontenc.sty
  \gpkg{font\-spec}{}% fontspec.sty
  \gpkg{rel\-size}{}% relsize.sty
  \gpkg{acc\-supp}{}% accsupp.sty
  \gpkg{accessibility}{}% accessibility.sty
  \gpkg{tag\-pdf}{}% tagpdf.sty
  \gpkg{xkey\-val}{}% xkeyval.sty
  \gpkg{text\-case}{}% textcase.sty
  \gpkg{siunitx}{}% siunitx.sty
  \gpkg{latex\-release}{}% latexrelease.sty
  \gpkg{mwe}{}% mwe.sty
  \gpkg{stix}{}% stix.sty
  \gpkg{fmt\-count}{}% fmtcount.sty
  \gpkg{classic\-thesis}{}% classicthesis.sty
  \gpkg{xtab}{}% xtab.sty
  \gpkg{doc}{}% doc.sty
  \gpkg{tabularx}{}% tabularx.sty
  \gpkg{xspace}{}% xspace.sty
  \gpkg{xcolor}{}% xcolor.sty
  \gpkg{flow\-fram}{}% flowfram.sty
  \gpkg{shell\-esc}{}% shellesc.sty
  \gpkg{make\-idx}{}% makeidx.sty
  \gpkg{imake\-idx}{}% imakeidx.sty
  \gpkg{scr\-w\-file}{}% scrwfile.sty
  % mfirstuc package
  \gpkg{mfirst\-uc}{}% mfirstuc.sty
  % \makefirstuc
  \gcmd{make\-first\-uc}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc}}
    \desc{robust command that converts the first character of \meta{text} to
    \idx{uppercase} (\idx{sentencecase}) unless \meta{text}
    starts with a command, in which case it will attempt to apply
    the \idx{casechange} to the first character of the first
    argument following the command, if the command is followed by a
    group. As from \sty{mfirstuc} v2.08, this command internally
    uses \gls{MFUsentencecase} to perform the actual \idx{casechange}.
    See the \sty{mfirstuc} documentation for further details, either:
    \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}}
  }
  % \MFUsentencecase
  \gcmd{MFU\-sentence\-case}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v2.08+}
    \desc{fully expands \meta{text} and converts the first letter to
    \idx{uppercase}\glsadd{idx.sentencecase}. Unlike
    \gls{makefirstuc}, this command is expandable, but only
    recognises commands identified as exclusions. See the
    \sty{mfirstuc} documentation for further details. This command
    is provided by \sty{glossaries-extra} v1.49+ if an old version
    of \sty{mfirstuc} is detected}
  }
  % \MFUexcl
  \gcmd{MFU\-excl}
  {
    \providedby{\sty{mfirstuc} v2.08+}
    \syntax{\margm{cs}}%
    \desc{locally identifies \meta{cs} as an exclusion command,
     which will be recognised by both \gls{makefirstuc} and
    \gls{MFUsentencecase}}
    \field{seealso}{MFUblocker,MFUaddmap}
  }
  % \MFUblocker
  \gcmd{MFU\-blocker}
  {
    \providedby{\sty{mfirstuc} v2.08+}
    \syntax{\margm{cs}}%
    \desc{locally identifies \meta{cs} as a blocker command for
     \gls{makefirstuc} and an exclusion for \gls{MFUsentencecase}
     (which doesn't support blockers)}
    \field{seealso}{MFUexcl,MFUaddmap}
  }
  % \MFUaddmap
  \gcmd{MFU\-add\-map}
  {
    \providedby{\sty{mfirstuc} v2.08+}
    \syntax{\margm{cs1}\margm{cs2}}%
    \desc{identifies a mapping from the command \meta{cs1} to
    command \meta{cs2} for \gls{makefirstuc} and also identifies
    \meta{cs2} as a blocker. Mappings and blockers aren't supported
    by \gls{MFUsentencecase}, so both \meta{cs1} and \meta{cs2} are
    identified as exclusions for \gls{MFUsentencecase}}
    \field{seealso}{MFUexcl,MFUblocker}
  }
  % \glsmfuexcl
  \gcmd{gls\-mfu\-excl}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{cs}}%
    \desc{if \sty{mfirstuc} v2.08+ is installed, this will use
    \gls+{MFUexcl}, otherwise it will implement something similar}
  }
  % \glsmfublocker
  \gcmd{gls\-mfu\-block\-er}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{cs}}%
    \desc{if \sty{mfirstuc} v2.08+ is installed, this will use
    \gls+{MFUblocker}, otherwise it will use \gls{glsmfuexcl} instead.
    See \sectionref{sec:casechanging} for further details}
  }
  % \glsmfuaddmap
  \gcmd{gls\-mfu\-add\-map}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{cs1}\margm{cs2}}%
    \desc{if \sty{mfirstuc} v2.08+ is installed, this will use
    \gls+{MFUaddmap}, otherwise it will use \gls{glsmfuexcl} instead.
    See \sectionref{sec:casechanging} for further details}
  }
  % \capitalisewords
  \gcmd{capitalise\-words}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v1.06+}
    \desc{converts \meta{text} to \idx{titlecase}. Limitations
    apply, see the \sty{mfirstuc} documentation for further details, either:
    \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}}
  }
  % \capitalisefmtwords
  \gcmd{capitalise\-fmt\-words}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v2.03+}
    \desc{converts \meta{text} to \idx{titlecase}, where \meta{text}
    may contain text-block commands. The starred form only permits a
    text-block command at the start of the argument. Limitations
    apply, see the \sty{mfirstuc} documentation for further details, either:
    \texdocref{mfirstuc} or visit \ctanpkg{mfirstuc}}
  }
  % \xcapitalisefmtwords
  \gcmd{xcapitalise\-fmt\-words}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v2.03+}
    \desc{passes the argument to \gls{capitalisefmtwords} but with the
     first token in \meta{text} expanded. The starred version uses
     the starred version of \gls{capitalisefmtwords}}
  }
  % \mfirstucMakeUppercase
  \gcmd{mfirst\-uc\-Make\-Upper\-case}
  {
    \providedby{\sty{mfirstuc}}
    \syntax{\margm{text}}
    \desc{this command was used by \gls{makefirstuc} to convert its argument to
    \idx{allcaps} and was redefined by \sty{glossaries} to use
    \gls{MakeTextUppercase}, but with \sty{mfirstuc} v2.08+ and
     \sty{glossaries} v4.50+ this command is instead defined
     to use the \LaTeX3 \idx{allcaps} command, which is expandable.
     This command is no longer used by \gls{makefirstuc} (which instead uses
    \gls{MFUsentencecase}). The \sty{glossaries} (v4.50+) and
    \sty{glossaries-extra} (v1.49+) packages now use \gls{glsuppercase}
     for the \idx{allcaps} commands, such as \gls{Gls}}
  }
  % \glsmakefirstuc
  \gcmd{gls\-make\-first\-uc}%
  {%
    \syntax{\margm{text}}
    \providedby{\sty{mfirstuc} v1.05+}
    \desc{used by \gls{makefirstuc} to perform the actual
    \idx{casechange}. As from \sty{mfirstuc} v2.08+ this just uses
    \gls{MFUsentencecase}. Despite the \qt{gls} prefix in the
    command name, this command is provided by \sty{mfirstuc}, but dates
    back to when \sty{mfirstuc} was part of the \sty{glossaries}
    package}
  }
  \gpkg{data\-tool}{}% datatool.sty
  \gpkg{data\-tool\dhyphen base}{}% datatool-base.sty
  \gmodule{data\-tool\dhyphen english}{}% datatool-english
  % \DTLformatlist
  \gcmd{DTL\-format\-list}
  {
    \syntax{\margm{csv-list}}
    \providedby{\sty{datatool-base} v2.28+}
    \desc{formats the comma-separated list \meta{csv-list}.
     One-level expansion is performed on \meta{csv-list}. See the
    \sty{datatool} documentation for further details, either:
    \texdocref{datatool} or visit \ctanpkg{datatool}}
  }
  % \DTLifinlist
  \gcmd{DTL\-if\-in\-list}
  {
    \syntax{\margm{element}\margm{csv-list}\margm{true}\margm{false}}
    \providedby{\sty{datatool-base}}
    \desc{does \meta{true} if \meta{element} is contained in the comma-separated
     list \meta{csv-list}, otherwise does \meta{false}.
     One-level expansion is performed on \meta{csv-list}, but not on
     \meta{element}. See the \sty{datatool} documentation for further
     details, either:
    \texdocref{datatool} or visit \ctanpkg{datatool}}
  }
  % \dtlwordindexcompare
  \gcmd{dtl\-word\-index\-compare}{}
  % \dtlletterindexcompare
  \gcmd{dtl\-letter\-index\-compare}{}
  % \dtlicompare
  \gcmd{dtl\-i\-compare}{}
  % \dtlcompare
  \gcmd{dtlcompare}{}
  % \datatoolctrlboundary
  \gcmd{data\-tool\-ctrl\-boundary}{}
  % \datatoolasciistart
  \gcmd{data\-tool\-ascii\-start}{}
  \gpkg{track\-lang}{}% tracklang.sty
  % \CurrentTrackedLanguage
  \gcmd{Current\-Tracked\-Language}
  {
    \providedby{\sty{tracklang}}
    \syntax{placeholder for use in \ext{ldf} files, expands to the
    current language label}
  }
  % \CurrentTrackedDialect
  \gcmd{Current\-Tracked\-Dialect}
  {
    \providedby{\sty{tracklang}}
    \syntax{placeholder for use in \ext{ldf} files, expands to the
     current dialect label}
  }
  % applications:
  \gapp{make\-index}% makeindex
  {%
    \common
    \syntax{\meta{options} \meta{\idx{indexingfile}}}%
    \desc{a general purpose \idx{indexingapp}. See \option{mkidx}. 
Since \app{makeindex} was designed for indexes, it doesn't fully
integrate with the \sty{glossaries} package, which has more complex
use cases than a simple index. A
better solution is to use \app{bib2gls} which is developed alongside
\sty{glossaries} and \sty{glossaries-extra}}%
  }
  \gapp{xindy}%
  {%
    \common
    \syntax{\meta{options} \meta{\idx{indexingfile}}}%
    \desc{a flexible \idx{indexingapp} with multilingual support
    written in Perl. See \option{xdy}. Since \app{xindy} was designed for indexes, it doesn't fully
integrate with the \sty{glossaries} package, which has more complex
use cases than a simple index. A better solution 
is to use \app{bib2gls} which is developed alongside
\sty{glossaries} and \sty{glossaries-extra}. For further information
on \app{xindy}, see \url{http://www.xindy.org/}}
  }
  \gapp{texindy}%
  {%
    \syntax{\meta{options} \meta{\idx{indexingfile}}}%
    \desc{runs \app{xindy} with modules set up for input written in
     \app{makeindex}['s] syntax}
  }
  \gapp{make\-glos\-saries}% makeglossaries
  {%
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{a custom designed Perl script interface
    to \app+{xindy} and \app+{makeindex} provided with the \sty{glossaries}
    package}
  }
  \gapp{make\-glos\-saries\dhyphen lite}% makeglossaries-lite
  {%
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{a custom designed Lua script interface
    to \app+{xindy} and \app+{makeindex} provided with the \sty{glossaries}
    package. This is a cut-down alternative to the Perl
    \app{makeglossaries} script. If you have Perl installed, use the
    Perl script instead}
  }
  \gapp{make\-glos\-saries\-gui}% makeglossariesgui
  {%
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{a Java \gls{gui} alternative to \app{makeglossaries} that
    also provides diagnostic tools. Available separately on
    \CTANpkg{makeglossariesgui}}
  }
  \gapp{bib2gls}%
  {%
    \common
    \syntax{\meta{options} \meta{aux-file}}%
    \desc{an \idx{indexingapp} that combines two functions in
    one: (1) fetches entry definition from a \ext+{bib} file
    based on information provided in the \ext+{aux} file (similar
    to \BibTeX); (2) hierarchically sorts and collates location
    lists (similar to \app{makeindex} and \app{xindy}).
    This application is designed for use with \sty{glossaries-extra}
    and can't be used with just the base \sty{glossaries} package.
    However, unlike general purpose \idxpl{indexingapp}, it's
    specially designed for, and developed alongside,
    \sty{glossaries-extra} and so provides better integration.
    Available separately on \CTANpkg{bib2gls}. See \option{b2g}}
  }
  \gapp{con\-vert\-gls2bib}% convertgls2bib
  {%
    \desc{An application provided with \app{bib2gls} that
    converts \ext+{tex} files containing entry definitions to
    \ext{bib} files suitable for use with \app{bib2gls}.
    This application is designed for files that just contain entry
    definitions, but it can work on a complete document file.
    However, there will be a lot of \qt{undefined command} warnings as
    \app{convertgls2bib} only has a limited set of known commands. You
    can limit it so that it only parses the \idxf{preamble/document} with the
    \switch{preamble-only} switch (requires at least \app{bib2gls} v2.0)}
  }
  \gapp{xindex}{}
  \gapp{arara}{}
  \gapp{latexmk}{}
  \gapp{atom}{}
  \gapp{texdoc}{}
  \gapp{pdflatex}{}
  \gapp{latex}{\name{\appfmt{latex} (DVI)}\field{text}{\appfmt{latex}}}
  % switches
  % bib2gls --group
  \glongswitch{group}{\inapp{bib2gls}}
  % bib2gls -g
  \gbibglsswitch{g}{\field{alias}{switch.group}}
  % bib2gls --no-group
  \glongswitch{no\dhyphen group}{\inapp{bib2gls}}
  % bib2gls --map-format
  \glongswitch{map\dhyphen format}{\inapp{bib2gls}}
  % bib2gls -m
  \gbibglsswitch{m}{\field{alias}{switch.map-format}}
  % convertgls2bib --preamble-only
  \glongswitch{preamble\dhyphen only}{\inapp{convertgls2bib}}
  % convertgls2bib --texenc
  \glongswitch{texenc}{\inapp{convertgls2bib}}
  % convertgls2bib --bibenc
  \glongswitch{bibenc}{\inapp{convertgls2bib}}
  % convertgls2bib --split-on-type
  \glongswitch{split\dhyphen on\dhyphen type}{\inapp{convertgls2bib}}
  % convertgls2bib -t
  \gshortswitch{t}{\inapp{convertgls2bib}\field{alias}{switch.split-on-type}}
  % convertgls2bib --ignore-type
  \glongswitch{ignore\dhyphen type}{\inapp{convertgls2bib}}
  % convertgls2bib --index-conversion
  \glongswitch{index\dhyphen conversion}{\inapp{convertgls2bib}}
  % convertgls2bib -i
  \gshortswitch{i}{\inapp{convertgls2bib}\field{alias}{switch.index-conversion}}
  % makeindex -g
  \gmkidxswitch{g}{}
  % makeindex -s
  \gmkidxswitch{s}{}
  % makeindex -o
  \gmkidxswitch{o}{}
  % makeindex -l
  \gmkidxswitch{l}{}
  % makeindex -p
  \gmkidxswitch{p}{}
  % makeindex -c
  \gmkidxswitch{c}{}
  % makeindex -r
  \gmkidxswitch{r}{}
  % makeindex -t
  \gmkidxswitch{t}{}
  % xindy -M
  \gxdyswitch{M}{}
  % xindy -L
  \gxdyswitch{L}{}
  % xindy -C
  \gxdyswitch{C}{}
  % xindy -I
  \gxdyswitch{I}{}
  % xindy -t
  \gxdyswitch{t}{}
  % xindy -o
  \gxdyswitch{o}{}
  % makeglossaries -Q
  \gmkglsswitch{Q}{\providedby{\appfmt{makeglossaries} v2.14+}}
  % makeglossaries -k
  \gmkglsswitch{k}{\providedby{\appfmt{makeglossaries} v2.14+}}
  % makeglossaries -q
  \gmkglsswitch{q}{}
  % makeglossaries -m
  \gmkglsswitch{m}{%
    \initval{makeindex}
    \providedby{\appfmt{makeglossaries} v2.08+}%
    \syntax{\meta{application}}
  }
  % makeglossaries -x
  \gmkglsswitch{x}{
    \initval{xindy}
    \providedby{\appfmt{makeglossaries} v2.08+}%
    \syntax{\meta{application}}
  }
  % makeglossaries -d
  \gmkglsswitch{d}{%
    \providedby{\appfmt{makeglossaries} v2.05+}
    \syntax{\meta{directory}}
  }
  % makeglossaries -e
  \gmkglsswitch{e}{\providedby{\appfmt{makeglossaries} v4.50+}}
  % makeglossaries -n
  \gmkglsswitch{n}{\providedby{\appfmt{makeglossaries} v1.5+}}
  % makeglossaries -l
  \gmkglsswitch{l}{\providedby{\appfmt{makeglossaries} v1.5+}}
  % makeglossaries -L
  \gmkglsswitch{L}{\syntax{\meta{language}}}
  % makeglossaries -r
  \gmkglsswitch{r}{}
  % makeglossaries -c
  \gmkglsswitch{c}{}
  % makeglossaries -g
  \gmkglsswitch{g}{}
  % makeglossaries -p
  \gmkglsswitch{p}{%
    \syntax{\meta{num}}
  }
  % makeglossaries -s
  \gmkglsswitch{s}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries -o
  \gmkglsswitch{o}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries -t
  \gmkglsswitch{t}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries --help
  \glongswitch{mkgls.help}{%
   \field{name}{\longargfmt{help}}%
   \inapp{makeglossaries}%
   \providedby{\appfmt{makeglossaries} v1.2+}
  }
  % makeglossaries --version
  \glongswitch{mkgls.version}{%
   \field{name}{\longargfmt{version}}%
   \inapp{makeglossaries}%
   \providedby{\appfmt{makeglossaries} v1.2+}
  }
  % makeglossaries-lite -q
  \gmkglsliteswitch{q}{}
  % makeglossaries-lite -l
  \gmkglsliteswitch{l}{}
  % makeglossaries-lite -n
  \gmkglsliteswitch{n}{}
  % makeglossaries-lite -s
  \gmkglsliteswitch{s}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries-lite -o
  \gmkglsliteswitch{o}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries-lite -t
  \gmkglsliteswitch{t}{%
    \syntax{\meta{filename}}
  }
  % makeglossaries-lite -L
  \gmkglsliteswitch{L}{\syntax{\meta{language}}}
  % makeglossaries-lite -r
  \gmkglsliteswitch{r}{}
  % makeglossaries-lite -c
  \gmkglsliteswitch{c}{}
  % makeglossaries-lite -g
  \gmkglsliteswitch{g}{}
  % makeglossaries-lite -p
  \gmkglsliteswitch{p}{%
    \syntax{\meta{num}}
  }
  % makeglossaries-lite -m
  \gmkglsliteswitch{m}{%
    \initval{makeindex}
    \syntax{\meta{application}}
  }
  % makeglossaries-lite -x
  \gmkglsliteswitch{x}{
    \initval{xindy}
    \syntax{\meta{application}}
  }
  % makeglossaries-lite --help
  \glongswitch{mkglslite.help}{%
   \field{name}{\longargfmt{help}}%
   \inapp{makeglossaries-lite}%
  }
  % makeglossaries-lite --version
  \glongswitch{mkglslite.version}{%
   \field{name}{\longargfmt{version}}%
   \inapp{makeglossaries-lite}%
  }
  % COMMANDS: ENTRY DEFINITIONS
  % \loadglsentries
  \gcmd{load\-gls\-entries}
  {
    \providedby{\sty{glossaries}}%
     \syntax{\oargm{type}\margm{filename}}
     \desc{locally assigns \gls{glsdefaulttype} to \meta{type} and
      inputs \meta{filename}. If the optional argument is omitted,
      the default glossary is assumed. Note that if any entries with
      \meta{filename} have the \gloskey{type} key set (including
      implicitly in commands like \gls{newabbreviation}), then this will
      override the type given in the optional argument}
  }
  % \GlsXtrLoadResources
  \gxtrcmd{Gls\-Xtr\-Load\-Resources}%
  {%
    \providedby{\sty{glossaries-extra} v1.11+}
    \syntax{\oargm{options}}
    \desc{for use with \app{bib2gls}, this both sets up the resource options
     (which \app{bib2gls} can detect from the \ext{aux} file) and
     inputs the \ext{glstex} file created by \app{bib2gls}}
  } 
  % \newglossaryentry
  \gcmd{new\-glossary\-entry}%
  {% 
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}\marg{\keyvallist}}
    \desc{defines a new \idx{glossary} entry with the given label. The
    second argument is a comma-separated list of \idxpl{gloskey}}
  }  
  % \longnewglossaryentry
  \gcmd{long\-new\-glossary\-entry}%
  {%
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{entry-label}\margm{key=value list}\margm{description}}
    \desc{defines a new \idx{glossary} entry with the given label. The
    second argument is a comma-separated list of \idxpl{gloskey}.
    The third argument is the description, which may include
    paragraph breaks}
  }
  % \provideglossaryentry
  \gcmd{provide\-glossary\-entry}%
  {% 
    \providedby{\sty{glossaries} v3.14a}
    \syntax{\margm{entry-label}\marg{\keyvallist}}
    \desc{as \gls{newglossaryentry} but does nothing if the entry is
     already defined}
  }  
  % \longprovideglossaryentry
  \gcmd{long\-provide\-glossary\-entry}%
  {%
    \providedby{\sty{glossaries} v3.14a+}
    \syntax{\margm{entry-label}\margm{key=value list}\margm{description}}
    \desc{as \gls{longnewglossaryentry} but does nothing if the entry is
     already defined}
  }
  % \newterm
  \gcmd{new\-term}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\oargm{key=value list}\margm{entry-label}}
    \note{requires \opt{index} package option}
    \desc{defines a new \idx{glossary} entry with the given label,
    \gloskey{type} set to \code{index}, the \gloskey{name}
    set to \meta{entry-label} and the \gloskey{description}
    set to \gls{nopostdesc}. The
    optional argument is a comma-separated list of \idxpl{gloskey},
    which can be used to override the defaults}
  }
  % \glsxtrnewsymbol
  \gxtrcmd{gls\-xtr\-new\-symbol}%
  {%
    \syntax{\oargm{key=value list}\margm{entry-label}\margm{sym}}
    \providedby{\sty{glossaries-extra}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{symbols}}\marg{glossaries-extra}}}
    \desc{defines a new \idx{glossary} entry with the given label,
    \gloskey{type} set to \glostype{symbols}, the \gloskey{category} set
    to \code{symbol}, the \gloskey{name} set to \meta{sym} and the \gloskey{sort}
    set to \meta{entry-label}. The optional argument is a comma-separated list of \idxpl{gloskey},
    which can be used to override the defaults}
  }
  % \glsxtrnewnumber
  \gxtrcmd{gls\-xtr\-new\-number}%
  {%
    \syntax{\oargm{key=value list}\margm{entry-label}\margm{num}}
    \providedby{\sty{glossaries-extra}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{numbers}}\marg{glossaries-extra}}}
    \desc{defines a new \idx{glossary} entry with the given label,
    \gloskey{type} set to \code{numbers}, the \gloskey{category} set
    to \code{number}, the \gloskey{name} set to \meta{num} and the \gloskey{sort}
    set to \meta{entry-label}. The optional argument is a comma-separated list of \idxpl{gloskey},
    which can be used to override the defaults}
  }
  % \glsxtrnopostpunc
  \gxtrcmd{gls\-xtr\-no\-post\-punc}
  {%
    \providedby{\sty{glossaries-extra} v1.22+}
    \desc{when placed at the end of the \gloskey{description}, this
    switches off the post-description punctuation (inserted
    automatically via options such as \opt{postdot}) but doesn't
    suppress the \idx{postdeschook}. Does nothing outside of the
    \idx{glossary}}
    \field{seealso}{nopostdesc}
  }
  % \nopostdesc
  \gcmd{no\-post\-desc}
  {%
    \providedby{\sty{glossaries} v1.17+}
    \desc{when placed at the end of the \gloskey{description}, this
    switches off the \idx{postdeschook} (including the
    post-description punctuation). Does nothing outside of the
    \idx{glossary}}
    \field{seealso}{glsxtrnopostpunc}
  } 
  % \glspar
  \gcmd{gls\-par}
  {
    \providedby{\sty{glossaries}}
    \desc{paragraph break (for instances where \gls{par} can't be used directly)}   
  } 
  % \glsaddkey
  \gcmd{gls\-add\-key}
  {
     \providedby{\sty{glossaries} v3.12a+}
     \syntax{\margm{key}\margm{default value}\margm{no link cs}\margm{no link ucfirst
      cs}\margm{link cs}\margm{link ucfirst cs}\margm{link allcaps cs}}
     \desc{defines a new \idx{gloskey} with the given default value
     and commands that are analogous to \gls{glsentrytext} (\meta{no
     link cs}), \gls{Glsentrytext} (\meta{no link ucfirst cs}),
     \gls{glstext} (\meta{link cs}), \gls{Glstext} (\meta{link ucfirst cs}),
     \gls{GLStext} (\meta{link allcaps cs}). The starred version switches on field
     expansion for the given key}
     \field{seealso}{glsaddstoragekey}
  }
  % \glsaddstoragekey
  \gcmd{gls\-add\-storage\-key}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{key}\margm{default value}\margm{no link cs}}
    \desc{provides a new \idx{gloskey} with a default value and a
          command for simply accessing the value (without indexing
          or \idxpl{hyperlink}). The starred version switches on field
          expansion for the given key}
     \field{seealso}{glsaddkey}
  }
  % \glssetexpandfield
  \gcmd{gls\-set\-ex\-pand\-field}
  {
    \providedby{\sty{glossaries} v3.13a+}
    \syntax{\margm{field}}
    \desc{indicates that the given field should always have its
     value expanded when the entry is defined. This overrides
     \gls{glsnoexpandfields}}
  }
  % \glssetnoexpandfield
  \gcmd{gls\-set\-no\-ex\-pand\-field}
  {
    \providedby{\sty{glossaries} v3.13a+}
    \syntax{\margm{field}}
    \desc{indicates that the given field should always have its
     value expanded when the entry is defined. This overrides
     \gls{glsexpandfields}}
  }
  % \glsnoexpandfields
  \gcmd{gls\-no\-ex\-pand\-fields}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \desc{don't expand values when assigning fields during entry
    definition (except for specific fields that are overridden by
    \gls{glssetexpandfield})}
  }
  % \glsexpandfields
  \gcmd{gls\-ex\-pand\-fields}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \desc{expand values when assigning fields during entry
    definition (except for specific fields that are overridden by
    \gls{glssetnoexpandfield})}
  }
  % \glsmoveentry
  \gcmd{gls\-move\-entry}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{entry-label}\margm{target glossary label}}
    \desc{moves the entry identified by \meta{entry-label} to the
    \idx{glossary} identified by \meta{target glossary label}}
    \field{seealso}{glsxtrcopytoglossary}
  }
  % \glsxtrcopytoglossary
  \gcmds{gls\-xtr\-copy\-to\-glos\-sary}
  {
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\margm{entry-label}\margm{glossary-type}}
    \desc{copies the entry to the internal \idx{glossary} list for
    the given \idx{glossary}. The starred version performs a global
    change. The unstarred version can be localised. Only for use with
    the \idx{unsrtfam}}
    \field{seealso}{glsmoveentry}
  }
  % \glsdoifexistsordo
  \gcmd{gls\-do\-if\-exists\-or\-do}
  {
    \providedby{\sty{glossaries} v4.19+}
     \syntax{\margm{entry-label}\margm{true}\margm{false}}
     \desc{similar to \gls{ifglsentryexists}, this does \meta{true}
     if the \idx{entry} given by \meta{entry-label}
     exists. If the \idx{entry} doesn't it exist, this does \meta{false}
     and generates an error}
     \field{seealso}{ifglsentryexists,glsdoifexists,glsdoifnoexists}
  }
  % \glsdoifexistsorwarn
  \gcmd{gls\-do\-if\-exists\-or\-warn}
  {
    \providedby{\sty{glossaries} v4.03+}
     \syntax{\margm{entry-label}\margm{code}}
     \desc{like \gls{glsdoifexists}, but always warns (no error) if
     the \idx{entry} doesn't exist}
  }
  % \glsdoifnoexists
  \gcmd{gls\-do\-if\-no\-exists}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{entry-label}\margm{code}}
     \desc{does \meta{code} if the \idx{entry} given by \meta{entry-label}
     does not exist. If the entry does exist, this will generate an error}
     \field{seealso}{ifglsentryexists,glsdoifexistsordo,glsdoifexists}
  }
  % \glsdoifexists
  \gcmd{gls\-do\-if\-exists}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{entry-label}\margm{code}}
     \desc{does \meta{code} if the \idx{entry} given by \meta{entry-label}
     exists. If the entry doesn't exist, this will generate
     an error}
     \field{seealso}{ifglsentryexists,glsdoifexistsordo,glsdoifnoexists}
  }
  % \ifglsentryexists
  \gcmd{if\-gls\-entry\-exists}
  {
     \syntax{\margm{entry-label}\margm{true}\margm{false}}
     \desc{does \meta{true} if the entry given by \meta{entry-label}
     exists, otherwise does \meta{false}}
     \field{seealso}{glsdoifexistsordo,glsdoifexists,glsdoifnoexists}
  }
  % COMMANDS: FETCHING AND UPDATING FIELDS
  % \glsletentryfield
  \gcmd{gls\-let\-entry\-field}
  {
    \providedby{\sty{glossaries} v4.07+}
    \syntax{\margm{cs}\margm{entry-label}\margm{field-label}}
    \desc{fetches the value of the given field 
       (identified by its \idxc{internalfieldlabel}{internal label}
       \meta{field-label}) for the entry given by
       \meta{entry-label} and stores it in the command \meta{cs}}
  }
  % \glsfielddef
  \gcmd{gls\-field\-def}
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \desc{locally assigns the \meta{value} to the given field
    (identified by the \idx{internalfieldlabel} \meta{field}) for the entry identified by
    \meta{entry-label}. Produces an error (or warning with
    \opteqvalref{undefaction}{warn}) if the entry or field doesn't
    exist. Note that this doesn't update any associated fields}
  }
  % \glsfieldgdef
  \gcmd{gls\-field\-gdef}
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \desc{as \gls{glsfielddef} but does a global assignment}
  }
  % \glsfieldedef
  \gcmd{gls\-field\-edef}
  {
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \providedby{\sty{glossaries} v4.16+}
    \desc{locally assigns the full expansion of \meta{value} to the given field
    (identified by the \idx{internalfieldlabel} \meta{field}) for the entry identified by
    \meta{entry-label}. Produces an error (or warning with
    \opteqvalref{undefaction}{warn}) if the entry or field doesn't
    exist. Note that this doesn't update any associated fields}
  }
  % \glsfieldxdef
  \gcmd{gls\-field\-xdef} 
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{entry-label}\margm{field}\margm{value}}
    \desc{as \gls{glsfieldedef} but does a global assignment}
  }
  % \glsfieldfetch
  \gcmd{gls\-field\-fetch}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{cs}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{fetches the value of the given field for the given entry and stores it in
     the command \meta{cs}.  Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \glsunexpandedfieldvalue
  \gcmd{gls\-un\-expanded\-field\-value}
  {
     \syntax{\margm{entry-label}\margm{field-label}}
     \providedby{\sty{glossaries} v4.48+}
     \desc{for use in expandable contexts where the field value is
     required but the contents should not be expanded. The field
     should be identified by its \idx{internalfieldlabel}. Expands
     to nothing with no error or warning if the entry or field aren't defined}
  }
  % \ifglsfieldeq
  \gcmd{if\-gls\-field\-eq}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{string}\margm{true}\margm{false}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{tests if the value of the given field is equal to the
     given string using \sty{etoolbox}['s] \csfmt{ifcsstring}.
     Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \ifglsfielddefeq
  \gcmd{if\-gls\-field\-def\-eq}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{cs}\margm{true}\margm{false}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{tests if the value of the given field is equal to the
     replacement text of the given command \meta{cs} using \sty{etoolbox}['s]
    \csfmt{ifdefstrequal}.
     Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \ifglsfieldcseq
  \gcmd{if\-gls\-field\-cs\-eq}
  {
     \syntax{\margm{entry-label}\margm{field-label}\margm{cs-name}\margm{true}\margm{false}}
     \providedby{\sty{glossaries} v4.16+}
     \desc{tests if the value of the given field is equal to the
     replacement text of the command given by the control sequence
     name \meta{cs-name} using \sty{etoolbox}['s] \csfmt{ifcsstrequal}.
     Triggers an error if the given field (identified by its
     \idx{internalfieldlabel}) hasn't been defined. Uses
     \gls{glsdoifexists}}
  }
  % \glsxtrfieldformatlist
  \gxtrcmd{gls\-xtr\-field\-format\-list}
  {
     \providedby{\sty{glossaries-extra} v1.42+}
     \syntax{\margm{entry-label}\margm{field-label}}
     \desc{formats the value of the given field, which should be 
     an \sty{etoolbox} internal list, using the same list handler
     macro as \sty{datatool}['s] \gls{DTLformatlist}}
  }
  % \glsxtrusefield
  \gxtrcmd{gls\-xtr\-use\-field}
  {
     \providedby{\sty{glossaries-extra} v1.12+}
     \syntax{\margm{entry-label}\margm{field-label}}
     \desc{expands to the value of the given field
      (identified by its \idxc{internalfieldlabel}{internal label}
       \meta{field-label}) for the entry given by
       \meta{entry-label}. Expands to \gls{relax} if the entry or field are undefined}
  }
  % COMMANDS: FIRST USE FLAG
  % \glsunset
  \gcmd{gls\-un\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{globally unsets the \idx+{firstuseflag}}
    \field{seealso}{glslocalunset,glsunsetall,glsreset}
  }
  % \glslocalunset
  \gcmd{gls\-local\-un\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{locally unsets the \idx+{firstuseflag}}
    \field{seealso}{glsunset,glsunsetall,glsreset}
  }
  % \glsunsetall
  \gcmd{gls\-un\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{globally unsets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsunset,glslocalunset,glslocalunsetall,glsresetall}
  }
  % \glslocalunsetall
  \gcmd{gls\-local\-un\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{locally unsets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsunset,glslocalunset,glsunsetall,glslocalresetall}
  }
  % \glsreset
  \gcmd{gls\-re\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{globally resets the \idx+{firstuseflag}}
    \field{seealso}{glslocalreset,glsresetall,glsunset}
  }
  % \glslocalreset
  \gcmd{gls\-local\-re\-set}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{locally resets the \idx+{firstuseflag}}
    \field{seealso}{glsreset,glsresetall,glsunset}
  }
  % \glsresetall
  \gcmd{gls\-re\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{globally resets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsreset,glslocalreset,glslocalresetall,glsunsetall}
  }
  % \glslocalresetall
  \gcmd{gls\-local\-re\-set\-all}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{glossary labels list}}
    \desc{locally resets the \idx+{firstuseflag} for all
    \idxpl{entry} in whose labels are listed in the \meta{glossary
     labels list} comma-separated list. If the optional argument is
     omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
    \field{seealso}{glsreset,glslocalreset,glsresetall,glslocalunsetall}
  }
  % \ifglsused
  \gcmd{if\-gls\-used}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the \idx{entry} has been marked as
    \idxc{firstuseflag}{used}, does \meta{false} if the entry is
    marked as \idxc{firstuseflag}{unused}, and does neither if
    the entry hasn't been defined (but will generate an error)}
  }
  % \GlsXtrIfUnusedOrUndefined
  \gcmd{Gls\-Xtr\-If\-Unused\-Or\-Undefined}
  {
    \providedby{\sty{glossaries-extra} v1.34+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}} 
    \desc{does \meta{true} if the entry hasn't been defined or hasn't been marked as
    \idxc{firstuseflag}{used}, otherwise does \meta{true}. Note
    that this command will generate an error or warning (according to
    \opt{undefaction}) if the entry hasn't been defined, but will
    still do \meta{true}}
    \field{seealso}{ifglsused,glsxtrifwasfirstuse}
  }
  % \GlsXtrStartUnsetBuffering
  \gxtrcmds{Gls\-Xtr\-Start\-Unset\-Buffering}
  { 
     \providedby{\sty{glossaries-extra} v1.30+}
    \desc{enables unset buffering. The starred version doesn't check
    for duplicates}
    \field{seealso}{GlsXtrStopUnsetBuffering}
  }
  % \GlsXtrStopUnsetBuffering
  \gxtrcmds{Gls\-Xtr\-Stop\-Unset\-Buffering}
  {
     \providedby{\sty{glossaries-extra} v1.30+}
    \desc{stops buffering. The starred version performs a global unset}
    \field{seealso}{GlsXtrStartUnsetBuffering}
  }
  % \GlsXtrUnsetBufferEnableRepeatLocal
  \gcmd{Gls\-Xtr\-Unset\-Buffer\-Enable\-Repeat\-Local}
  {
     \providedby{\sty{glossaries-extra} v1.49+}
     \desc{allows repeat entries within the buffering code to be
     locally unset before the \idx{linktext}}
  }
  % \GlsXtrResetLocalBuffer
  \gcmd{Gls\-Xtr\-Reset\-Local\-Buffer}
  {
     \providedby{\sty{glossaries-extra} v1.49+}
     \desc{if local unset for repeat entries has been enabled with
      \gls{GlsXtrUnsetBufferEnableRepeatLocal}, this will locally
      reset all entries that are in the buffer that hadn't been
     marked as used before the function was enabled}
  }
  % COMMANDS: UTILITIES - CONDITIONALS
  % \ifignoredglossary
  \gcmds{if\-ignored\-glos\-sary}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{glossary-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the \idx{glossary} identified by
     \meta{glossary-label} has been defined as an
    \idx{ignoredglossary}, otherwise does \meta{false}}
  }
  % \ifglossaryexists
  \gcmds{if\-glos\-sary\-exists}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{glossary-type}\margm{true}\margm{false}}
    \desc{if the \idx{glossary} given by \meta{glossary-type} exists,
    this does \meta{true}, otherwise it does \meta{false}. The
    unstarred form treats \idxpl{ignoredglossary} as non-existent. The
    starred form (v4.46+) will do \meta{true} if \meta{glossary-type} matches
    an ignored glossary}
  }
  % \ifglsfieldvoid
  \gcmd{if\-gls\-field\-void}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
    \desc{an expandable test to determine if the entry is undefined
    or the field is undefined or empty. The \meta{field-label}
    must be the field's \idxc{internalfieldlabel}{internal label}. 
    Internally uses \sty{etoolbox}['s] \gls{ifcsvoid} command}
    \field{seealso}{GlsXtrIfFieldUndef}
  }%
  % \GlsXtrIfFieldUndef
  \gxtrcmd{Gls\-Xtr\-If\-Field\-Undef}
  {
    \providedby{\sty{glossaries-extra} v1.23+}
    \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
    \desc{expandable command that tests if the given field (identified by its
     \idxc{internalfieldlabel}{internal label}) is undefined for the
     entry given by \meta{entry-label}. Internally uses \sty{etoolbox}['s] 
     \gls{ifcsundef} command}
     \field{seealso}{ifglsfieldvoid}
  }
  % \glscurrentfieldvalue
  \gcmd{gls\-current\-field\-value}
  {
     \providedby{\sty{glossaries} v4.23+}
     \desc{conditional commands such as \gls{ifglshasfield} set this
      to the field's value for use within the \meta{true} code}
  }  
  % \ifglshasfield
  \gcmd{if\-gls\-has\-field}
  { 
    \providedby{\sty{glossaries} v4.03+}
    \syntax{\margm{field}\margm{entry-label}\margm{true}\margm{false}}
    \note{robust}
    \desc{if the field identified by either its key or its
    \idx{internalfieldlabel} \meta{field} for the entry identified by
    \meta{entry-label} is set and non-empty, this sets
    \gls{glscurrentfieldvalue} to the field value and does \meta{true}
     otherwise it does \meta{false}}
    \field{seealso}{ifglsfieldvoid}
  }
  % \ifglshasparent
  \gcmd{if\-gls\-has\-parent}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{parent} field is
    set otherwise does \meta{false}}
  }
  % \ifglshasdesc
  \gcmd{if\-gls\-has\-desc}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{description} field is
    set otherwise does \meta{false}}
  }
  % \ifglsdescsuppressed
  \gcmd{if\-gls\-desc\-suppressed}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{description} field is
    just \gls{nopostdesc} otherwise does \meta{false}}
  }
  % \glossaries_if_has_nonsuppressed_desc_p:n
  % and \glossaries_if_has_nonsuppressed_desc:nTF
  \gexplpred{glos\-saries\dsb if\dsb has\dsb non\-suppressed\dsb desc}{n}
  {
    \providedby{\sty{glossaries} v4.59+}
    \syntax{\ \meta{entry-label} \TFsyntax}
    \desc{true if the entry is defined and the \gloskey{description}
field is neither empty nor set to just \gls{nopostdesc}}
  }
  % \ifglshassymbol
  \gcmd{if\-gls\-has\-symbol}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{symbol} field is
    set otherwise does \meta{false}}
  }
  % \ifglshaslong
  \gcmd{if\-gls\-has\-long}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{long} field is
    set otherwise does \meta{false}}
  }
  % \ifglshasshort
  \gcmd{if\-gls\-has\-short}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the entry's \gloskey{short} field is
    set otherwise does \meta{false}}
  }
  % \ifglshaschildren
  \gcmd{if\-gls\-has\-children}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{does \meta{true} if the given entry has child entries
    otherwise does \meta{false}. Note that this has to iterate over
    the set of defined entries for the entry's \idx{glossary} to
    find one that has the entry identified in its \gloskey{parent}
    field. A more efficient approach can be achieved with
    \app{bib2gls} and the \resourceopt{save-child-count} resource option}
  }
  % \GlsXtrIfHasNonZeroChildCount
  \gxtrcmds{Gls\-Xtr\-If\-Has\-Non\-Zero\-Child\-Count}
  { 
    \providedby{\sty{glossaries-extra-bib2gls} v1.47+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{tests if the value in the \glosfield{childcount} field is
    non-zero (using \gls{GlsXtrIfFieldNonZero}). This requires the
    \resourceopt{save-child-count} resource option}
  }
  % \glsxtrifhasfield
  \gxtrcmds{gls\-xtr\-if\-has\-field}
  {   
     \providedby{\sty{glossaries-extra} v1.19+}
    \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
    \desc{tests if the field identified by its
     \idxc{internalfieldlabel}{internal label} \meta{field-label} for the entry
     given by \meta{entry-label} is defined and is not empty. This is like
    \gls{ifglshasfield} but doesn't produce a warning if the entry or field
    doesn't exist.  This sets \gls{glscurrentfieldvalue} to the field value and
    does \meta{true} if its defined and not empty, otherwise it does
    \meta{false}. The unstarred version adds implicit grouping to
    make nesting easier. The starred version doesn't (to make
    assignments easier)}
  }
  % COMMANDS: UTILITIES - LOOPS
  % \forglsentries
  \gcmd{for\-gls\-entries}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{type}\margm{cs}\margm{body}}
    \desc{iterates over all entries in the given \idx{glossary} 
    and, at each iteration, defines the command \meta{cs}
    to the current entry label and does \meta{body}. The optional
    argument \meta{type} is the \idx{glossary}
    label and defaults to \gls{glsdefaulttype} if omitted.
    This command can't be used with \app{bib2gls} since there are no
    defined entries until \app{bib2gls} has selected them and added
    them to the \ext{glstex} file}
  }
  % \forallglsentries
  \gcmd{for\-all\-gls\-entries}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{types}\margm{cs}\margm{body}}
    \desc{does \gls{forglsentries} for each \idx{glossary}. The optional
    argument \meta{types} is a comma-separated list of \idx{glossary}
    labels. If omitted, all non-\idxpl{ignoredglossary} is assumed}
  }
  % \forallglossaries
  \gcmd{for\-all\-glossaries}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{types}\margm{cs}\margm{body}}
    \desc{iterates overall all the \idx{glossary} labels given in
    the \meta{types} argument, defines the command \meta{cs} to the
    current label and does \meta{body}. If the optional argument is
    omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
  }
  % \forallacronyms
  \gcmd{for\-all\-acronyms}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{cs}\margm{body}}
    \desc{iterates overall all \idxpl{glossary} that have been
    declared lists of \idxpl{acronym}, defines the command \meta{cs} to the
    current label and does \meta{body}}
    \note{don't use with \sty{glossaries-extra}}
  }
  % \forallabbreviationlists
  \gxtrcmd{forallabbreviationlists}
  {
    \providedby{\sty{glossaries-extra} v1.42+}
    \syntax{\margm{cs}\margm{body}}
    \desc{iterates overall all lists of abbreviations, defines the 
    command \meta{cs} to the current label and does \meta{body}}
  }
  % \glsxtrforcsvfield
  \gxtrcmds{gls\-xtr\-for\-csv\-field}
  {
     \providedby{\sty{glossaries-extra} v1.24+}
     \syntax{\margm{entry-label}\margm{field-label}\margm{handler cs}}
     \desc{iterates over the comma-separated list stored in the given field 
     (identified by its \idxc{internalfieldlabel}{internal label})
     for the entry identified by \meta{entry-label} and performs
     \code{\meta{handler cs}\margm{element}} for each element of the
     list}
  }
  % COMMANDS: UTILITIES - MEASURING
  % \glsmeasureheight
  \gcmd{gls\-measure\-height}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{length}\margm{text}}
     \desc{measures the height of \meta{text} using \gls{settoheight}
     but temporarily switches off indexing, unset/reset and
     labelling}
  }
  % \glsmeasuredepth
  \gcmd{gls\-measure\-depth}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{length}\margm{text}}
     \desc{measures the depth of \meta{text} using \gls{settodepth}
     but temporarily switches off indexing, unset/reset and
     labelling}
  }
  % \glsmeasurewidth
  \gcmd{gls\-measure\-width}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{length}\margm{text}}
     \desc{measures the width of \meta{text} using \gls{settowidth}
     but temporarily switches off indexing, unset/reset and
     labelling}
  }
  % \glsifmeasuring
  \gcmd{gls\-if\-measuring}
  {
     \providedby{\sty{glossaries} v4.51+}
     \syntax{\margm{true}\margm{false}}
     \desc{does \meta{true} it it occurs inside a measuring content
otherwise does \meta{false}}
  }
  % COMMANDS: ENTRY COUNTING
  % \glsenableentrycount
  \gcmd{gls\-enable\-entry\-count}
  {
    \providedby{\sty{glossaries} v4.14+}
    \desc{enables entry counting}
  }
  % \ifglsresetcurrcount
  \gcond{if\-gls\-reset\-curr\-count}
  { 
    \providedby{\sty{glossaries} v4.50+}
    \initval{\csfmt{iffalse}}
    \desc{conditional that determines whether or not the reset
     commands should reset the entry count stored in
     \glosfield{currcount} to zero}
    \field{seealso}{glsenableentrycount,glsreset,glslocalreset}
  }
  % \glsresetcurrcountfalse
  \gcmd{gls\-re\-set\-curr\-count\-false}
  {
    \providedby{\sty{glossaries} v4.50+}
    \desc{sets the \gls{ifglsresetcurrcount} conditional to \csfmt{iffalse}}
  }
  % \glsresetcurrcounttrue
  \gcmd{gls\-re\-set\-curr\-count\-true}
  {
    \providedby{\sty{glossaries} v4.50+}
    \desc{sets the \gls{ifglsresetcurrcount} conditional to \csfmt{iftrue}}
  }
  % \glsentrycurrcount
  \gcmd{gls\-entry\-curr\-count}
  {
    \syntax{\margm{entry-label}}
    \providedby{\sty{glossaries} v4.14+}
    \desc{expands to the current entry count running total or 0 if
     not available (needs to be enabled with
    \gls{glsenableentrycount})}
  }
  % \glsentryprevcount
  \gcmd{gls\-entry\-prev\-count}
  {
    \syntax{\margm{entry-label}}
    \providedby{\sty{glossaries} v4.14+}
    \desc{expands to the final entry count total from the previous
    \LaTeX\ run or if 0 if not available (needs to be enabled with
    \gls{glsenableentrycount})}
  }
  % \cgls
  \gcmdsp{cgls}
  { 
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{gls} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cglsformat}
  }
  % \cglspl
  \gcmdsp{cgls\-pl}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{glspl} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cglsplformat}
  }
  % \cGls
  \gcmdsp{cGls}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{Gls} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cGlsformat}
  }
  % \cGlspl
  \gcmdsp{cGls\-pl}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{like \gls{Glspl} but hooks into the entry counting mechanism}
    \field{seealso}{glsenableentrycount,cGlsplformat}
  }
  % \cglsformat
  \gcmd{cgls\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cgls} if the entry was only used once 
    on the previous run}
  }
  % \cglsplformat
  \gcmd{cgls\-pl\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cglspl} if the entry was only used once 
    on the previous run}
  }
  % \cGlsformat
  \gcmd{cGls\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cGls} if the entry was only used once 
    on the previous run}
  }
  % \cGlsplformat
  \gcmd{cGls\-pl\-format}
  {
    \providedby{\sty{glossaries} v4.14+}
    \syntax{\margm{entry-label}\margm{insert}}
    \desc{format used by \gls{cGlspl} if the entry was only used
    once on the previous run}
  }
  % COMMANDS: ACRONYMS AND ABBREVIATIONS
  % \newacronym
  \gcmd{new\-acronym}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oarg{\keyvallist}\margm{entry-label}\margm{short}\margm{long}}
    \desc{this command is provided by the base \sty{glossaries}
     package to define a new \idx+{acronym} but it's redefined by 
     \sty{glossaries-extra} to use
     \gls{newabbreviation} with the \gloskey{category} key set to
     \cat{acronym}. With just the base \sty{glossaries} package, use
     \gls{setacronymstyle} to set the style. With
     \sty{glossaries-extra}, use
     \code{\gls{setabbreviationstyle}\oarg{\cat{acronym}}\margm{style}} to
     set the style that governs \gls{newacronym}}
  }
  % \oldacronym
  \gcmd{old\-acronym}
  {
    \providedby{\sty{glossaries} v1.18+}
    \syntax{\oargm{label}\margm{short}\margm{long}\marg{\keyvallist}}
    \desc{defines an \idx{acronym} using the syntax of the old
     \sty{glossary} package}
  }
  % \setacronymstyle
  \gcmd{set\-acronym\-style}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{style-name}}
    \desc{sets the \idx{acronym} style. Don't use with \sty{glossaries-extra}}
  }
  % \newacronymstyle
  \gcmd{new\-acronym\-style}%
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{name}\margm{format def}\margm{style defs}}
    \desc{defines an \idx{acronymstyle} for use with the base
    \sty{glossaries} package's \idx{acronym} mechanism. These styles are not
    compatible with \sty{glossaries-extra}. The \meta{format def}
    part is the code used as the \idx{entryformat} definition within
    \gls{defglsentryfmt}. The \meta{style defs} is the code that
    redefines the \idx{acronym} formatting commands, such as
    \gls{genacrfullformat}, and the additional fields command
    \gls{GenericAcronymFields}}
  }
  % \renewacronymstyle
  \gcmd{re\-new\-acronym\-style}%
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{name}\margm{format def}\margm{display defs}}
    \desc{as \gls{newacronymstyle} but redefines an existing \idx{acronymstyle}}
  }
  \gxtrcmd{new\-abbreviation}
  {  
    \providedby{\sty{glossaries-extra}}
    \syntax{\oarg{\keyvallist}\margm{label}\margm{short}\margm{long}}
    \desc{defines a new entry that represents an \idx+{abbreviation}.
     This internally uses \gls{newglossaryentry} and any provided
     options (\idxpl{gloskey}) given in \keyvallist\ will be appended. The
     \gloskey{category} is set to \cat{abbreviation} by default, but
     may be overridden in \meta{options}. The
     appropriate style should be set before the abbreviation is
     defined with \gls{setabbreviationstyle}}
  } 
  % \setabbreviationstyle
  \gxtrcmd{set\-abbreviation\-style}
  {
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{category}\margm{style-name}}
     \desc{sets the current \idx{abbrvstyle} to \meta{style-name}
      for the category identified by \meta{category}. If the
      optional argument is omitted, \cat{abbreviation} is assumed}
  }
  % \newabbreviationstyle
  \gxtrcmd{new\-ab\-bre\-vi\-a\-tion\-style}%
  {% 
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{style-name}\margm{setup}\margm{display definitions}}
    \desc{defines an abbreviation style, which can be set with
    \gls{setabbreviationstyle}}
  }
  % \GlsXtrUseAbbrStyleSetup
  \gxtrcmd{Gls\-Xtr\-Use\-Abbr\-Style\-Set\-up}
  {
     \providedby{\sty{glossaries-extra}}
    \syntax{\margm{style-name}}
    \desc{implements the \meta{setup} code for the given
     abbreviation style}
  }  
  % \GlsXtrUseAbbrStyleFmts
  \gxtrcmd{Gls\-Xtr\-Use\-Abbr\-Style\-Fmts}
  {
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{style-name}}
    \desc{implements the \meta{display definitions} code for the given
     abbreviation style}
  }
  % \firstacronymfont
  \gcmd{first\-acronym\-font}
  {
    \providedby{\sty{glossaries} v1.14+}
     \syntax{\margm{text}}
     \desc{used to encapsulate the \idx{acronym} short form on \idx{firstuse}}
  }
  % \acronymfont
  \gcmd{acronym\-font}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{text}}
     \desc{used to encapsulate the \idx{acronym} short form on
     \idx{subsequentuse}}
  }
  % \acronymentry
  \gcmd{acronym\-entry}
  {
    \providedby{\sty{glossaries} v4.02+}
     \syntax{\margm{entry-label}}
     \desc{used by \idxpl{acronymstyle} to format the \idx{acronym} name}
  }
  % \acronymsort
  \gcmd{acronym\-sort}
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{short}\margm{long}}
     \desc{used by \idxpl{acronymstyle} in the \idx{acronym} \gloskey{sort} key}
  }
  % \acronymtype
  \gcmd{acronym\-type}%
  {%
    \common
    \providedby{\sty{glossaries}}
    \initval{\gls{glsdefaulttype}}%
    \desc{expands to the label of the default \idx{acronym} \idx{glossary}. The
    \opt{acronym} or \opt{acronyms} package option will redefine
     this to \glostype{acronym}. The \sty{glossaries-extra} package's 
     \opt{abbreviations} option will redefine this to \gls{glsxtrabbrvtype} if
    \opt{acronyms}\slash\opt{acronym} isn't used}
  }%
  % \glsxtrabbrvtype
  \gxtrcmd{gls\-xtr\-abbrv\-type}%
  {%
    \initval{\gls{glsdefaulttype}}%
    \providedby{\sty{glossaries-extra}}
    \desc{expands to the label of the default \idx{abbreviation} \idx{glossary}. The
    \opt{abbreviations} package option will redefine
     this to \code{abbreviations}}
  }
  % \genacrfullformat
  \gcmd{gen\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{used by \gls{glsgenacfmt} to display the \idx{acronym} singular full
     form on \idx{firstuse}. Redefined by \idxpl{acronymstyle}}
  }
  % \Genacrfullformat
  \gcmd{Gen\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{as \gls{genacrfullformat} but \idx{sentencecase}}
  }
  % \genplacrfullformat
  \gcmd{gen\-pl\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{used by \gls{glsgenacfmt} to display the \idx{acronym} plural full
     form on \idx{firstuse}. Redefined by \idxpl{acronymstyle}}
  }
  % \Genplacrfullformat
  \gcmd{Gen\-pl\-acr\-full\-format}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{label}\margm{insert}}
    \desc{as \gls{genplacrfullformat} but \idx{sentencecase}}
  }
  % \acrfullfmt
  \gcmd{acr\-full\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{acrfull} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \Acrfullfmt
  \gcmd{Acr\-full\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{Acrfull} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \ACRfullfmt
  \gcmd{ACR\-full\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{ACRfull} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \acrfullplfmt
  \gcmd{acr\-full\-pl\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{acrfullpl} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \Acrfullplfmt
  \gcmd{Acr\-full\-pl\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{Acrfullpl} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \ACRfullplfmt
  \gcmd{ACR\-full\-pl\-fmt}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{used by \gls{ACRfullpl} to format the full form. This
    command is redefined by \idxpl{acronymstyle}}
  }
  % \acrnameformat
  \gcmd{acr\-name\-format}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{short text}\margm{long text}}
    \desc{used by \idxpl{acronymstyle} that require an additional
    description to determine what information is displayed in the name}
  }
  % \glskeylisttok
  \gcmd{gls\-key\-list\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the \keyvallist\ supplied in the
     optional argument}
  }
  % \glslabeltok
  \gcmd{gls\-label\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the \idx{entry} label}
  }
  % \glsshorttok
  \gcmd{gls\-short\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the supplied short form}
  }
  % \glslongtok
  \gcmd{gls\-long\-tok}
  {
    \providedby{\sty{glossaries}}
    \desc{a token register used by \gls{newacronym} (and
    \gls{newabbreviation}) to store the supplied long form}
  }
  % \newacronymhook
  \gcmd{new\-acronym\-hook}
  {
    \providedby{\sty{glossaries}}
    \desc{hook used by \gls{newacronym} just before the entry is
    defined by \gls{newglossaryentry}}
  }
  % \GlsUseAcrEntryDispStyle
  \gcmd{Gls\-Use\-Acr\-Entry\-Disp\-Style}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{style-name}}
    \desc{implements the \idx{entryformat} part of the given \idx{acronymstyle}
     (the code supplied in the \meta{format def} argument of
     \gls{newacronymstyle})}
  }
  % \GlsUseAcrStyleDefs
  \gcmd{Gls\-Use\-Acr\-Style\-Defs}
  {
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\margm{style-name}}
    \desc{implements the style definitions part of the given \idx{acronymstyle}
      (the code supplied in the \meta{display defs} argument of
      \gls{newacronymstyle})}
  }
  % \GenericAcronymFields
  \gcmd{Generic\-Acronym\-Fields}
  {
    \providedby{\sty{glossaries}}
    \desc{expands to the additional keys that need to be provided to
     \gls{newglossaryentry} when called by \gls{newacronym}. For
     example, the \gloskey{description} key}
  }
  % \glsentryfull
  \gcmd{gls\-entry\-full}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{displays the singular full form of the \idx{acronym} identified by
    \meta{entry-label}, without \idxpl{hyperlink} or \idx{indexing}.
    This command is redefined by \idxpl{acronymstyle} to match the style format}
  }
  % \Glsentryfull
  \gcmd{Gls\-entry\-full}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfull} but \idx{sentencecase}}
  }
  % \GLSentryfull
  \gcmd{GLS\-entry\-full}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfull} but \idx{allcaps}}
  }
  % \glsentryfullpl
  \gcmd{gls\-entry\-full\-pl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{displays the plural full form of the \idx{acronym} identified by
    \meta{entry-label}, without \idxpl{hyperlink} or \idx{indexing}. 
    This command is redefined by \idxpl{acronymstyle} to match the style format}
  }
  % \Glsentryfullpl
  \gcmd{Gls\-entry\-full\-pl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfullpl} but \idx{sentencecase}}
  }
  % \GLSentryfullpl
  \gcmd{GLS\-entry\-full\-pl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryfullpl} but \idx{allcaps}}
  }
  % \acrshort
  \gcmdsp{acr\-short}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{short} value, formatted
    according to the \idx{acronymstyle}.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrshort} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrshort
  \gcmdsp{Acr\-short}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshort} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRshort
  \gcmdsp{ACR\-short}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshort} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrshortpl
  \gcmdsp{acr\-short\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{shortplural} value, formatted
    according to the \idx{acronymstyle}.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrshortpl} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrshortpl
  \gcmdsp{Acr\-short\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshortpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRshortpl
  \gcmdsp{ACR\-short\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrshortpl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrlong
  \gcmdsp{acr\-long}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{long} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrlong} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrlong
  \gcmdsp{Acr\-long}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlong} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRlong
  \gcmdsp{ACR\-long}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlong} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrlongpl
  \gcmdsp{acr\-long\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{longplural} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. With \sty{glossaries-extra}, use
    \gls{glsxtrlongpl} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrlongpl
  \gcmdsp{Acr\-long\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlongpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \ACRlongpl
  \gcmdsp{ACR\-long\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrlongpl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \acrfull
  \gcmdsp{acr\-full}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{acronym} identified by \meta{entry-label}. The text
    produced shows the full form, formatted according to the \idx{acronymstyle}.
    With \sty{glossaries-extra}, use
    \gls{glsxtrfull} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrfull
  \gcmdsp{Acr\-full}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfull} but \idx{sentencecase}}
  }
  % \ACRfull
  \gcmdsp{ACR\-full}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfull} but \idx{allcaps}}
  }
  % \acrfullpl
  \gcmdsp{acr\-full\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfull} but shows the full plural
     form of an \idx{acronym}. With \sty{glossaries-extra}, use
    \gls{glsxtrfullpl} instead. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Acrfullpl
  \gcmdsp{Acr\-full\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfullpl} but \idx{sentencecase}}
  }
  % \ACRfullpl
  \gcmdsp{ACR\-full\-pl}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{acrfullpl} but \idx{allcaps}}
  }
  % \ac
  \gcmdsp{ac}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{gls} defined by the
     \opt{shortcuts} package option} 
  }  
  % \Ac
  \gcmdsp{Ac}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Gls} defined by the
     \opt{shortcuts} package option} 
  }  
  % \acp
  \gcmdsp{acp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{glspl} defined by the
     \opt{shortcuts} package option} 
  }  
  % \Acp
  \gcmdsp{Acp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Glspl} defined by the
     \opt{shortcuts} package option} 
  }  
  % \acs
  \gcmdsp{acs}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{acrshort} defined by the
     \opt{shortcuts} package option} 
  }  
  % \Acs
  \gcmdsp{Acs}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Acrshort} defined by the
     \opt{shortcuts} package option}
  } 
  % \acsp
  \gcmdsp{acsp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{acrshortpl} defined by the
     \opt{shortcuts} package option}
  }
  % \Acsp
  \gcmdsp{Acsp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Acrshortpl} defined by the
     \opt{shortcuts} package option}
  }
  % \acl
  \gcmdsp{acl}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{acrlong} defined by the
     \opt{shortcuts} package option}
  }
  % \aclp
  \gcmdsp{aclp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{acrlongpl} defined by the
     \opt{shortcuts} package option}
  }
  % \Acl
  \gcmdsp{Acl}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Acrlong} defined by the
     \opt{shortcuts} package option}
  }
  % \Aclp
  \gcmdsp{Aclp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Acrlongpl} defined by the
     \opt{shortcuts} package option}
  }
  % \acf
  \gcmdsp{acf}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{acrfull} defined by the
     \opt{shortcuts} package option}
  }
  % \acfp
  \gcmdsp{acfp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{acrfullpl} defined by the
     \opt{shortcuts} package option}
  }
  % \Acf
  \gcmdsp{Acf}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Acrfull} defined by the
     \opt{shortcuts} package option}
  }
  % \Acfp
  \gcmdsp{Acfp}%
  {%
    \syntax{\margm{options}\margm{entry-label}\margm{insert}}
    \desc{a synonym for \gls{Acrfullpl} defined by the
     \opt{shortcuts} package option}
  }
  % \glsxtrshort
  \gxtrcmdsp{gls\-xtr\-short}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{abbreviation} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{short} value, formatted
    according to the \idx{abbrvstyle} associated with the entry's \idx{category}.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glsxtrshort
  \gxtrcmdsp{Gls\-xtr\-short}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrshort
  \gxtrcmdsp{GLS\-xtr\-short}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsxtrshortpl
  \gxtrcmdsp{gls\-xtr\-shortpl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but the text produced is obtained
    from the \gloskey{shortplural} value}
  }
  % \Glsxtrshortpl
  \gxtrcmdsp{Gls\-xtr\-shortpl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshortpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \glsxtrlong
  \gxtrcmdsp{gls\-xtr\-long}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{abbreviation} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{long} value, formatted
    according to the \idx{abbrvstyle} associated with the entry's \idx{category}.    
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}}
  }
  % \Glsxtrlong
  \gxtrcmdsp{Gls\-xtr\-long}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlong} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrlong
  \gxtrcmdsp{GLS\-xtr\-long}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlong} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsxtrlongpl
  \gxtrcmdsp{gls\-xtr\-long\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlong} but the text produced is obtained
    from the \gloskey{longplural} value}
  }
  % \Glsxtrlongpl
  \gxtrcmdsp{Gls\-xtr\-long\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlongpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrlongpl
  \gxtrcmdsp{GLS\-xtr\-long\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrlongpl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsxtrfull
  \gxtrcmdsp{gls\-xtr\-full}{% 
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the \idx{abbreviation} identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{short} and \gloskey{long} values, formatted
    according to the \idx{abbrvstyle} associated with the entry's \idx{category}. 
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. The format produced by this command may not
    match the format produced by the \idx{firstuse} of
    \code{\gls{gls}\margm{entry-label}}, depending on the abbreviation
    style}
  }
  % \Glsxtrfull
  \gxtrcmdsp{Gls\-xtr\-full}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfull} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrfull
  \gxtrcmdsp{GLS\-xtr\-full}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfull} but converts the \idx{linktext} to
    \idx{allcaps}}
  }
  % \glsxtrfull
  \gxtrcmdsp{gls\-xtr\-full\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfull} but for the plural form}
  }
  % \Glsxtrfullpl
  \gxtrcmdsp{Gls\-xtr\-full\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfullpl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSxtrfullpl
  \gxtrcmdsp{GLS\-xtr\-full\-pl}{%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrfullpl} but converts the \idx{linktext} to
    \idx{allcaps}}
  }
  % \glsacspace
  \gcmd{gls\-ac\-space}%
  {
     \providedby{\sty{glossaries} v4.16+}
     \syntax{\margm{label}}
     \desc{uses a non-breakable space if the short form is less than
      3em. This command is redefined by \sty{glossaries-extra} to use
       \gls{glsacspacemax} instead of the hard-coded 3em}
  }
  % \glsacspacemax
  \gxtrcmd{gls\-ac\-space\-max}
  {  
    \providedby{\sty{glossaries-extra}}
     \desc{expands to the maximum width used by \gls{glsacspace}.
     This is a macro not a register. The default is \code{3em}}
  }
  % \glstextup
  \gcmd{gls\-text\-up}
  {
     \providedby{\sty{glossaries} v3.09a+}
     \syntax{\margm{text}}
     \desc{if \gls+{textulc} is defined, this will use that command,
     otherwise it will use \gls+{textup} to cancel the effect of the
     \idx+{smallcaps} font command \gls+{textsc}}
  }
  % COMMANDS: OPTIONS
  % \setupglossaries
  \gcmd{set\-up\-glos\-saries}%
  {%
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{options}}
    \desc{change allowed options that are defined by the base
    \sty{glossaries} package. Note that some options can only be
    passed as package options. To change options defined or modified
    by the \sty{glossaries-extra} package, use
    \gls{glossariesextrasetup}}
  }
  % \glossariesextrasetup
  \gxtrcmd{glos\-saries\-extra\-setup}%
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{options}}
    \desc{change allowed options that are defined or modified by the
    \sty{glossaries-extra} package.  Note that some options can only be
    passed as package options}
  }
  % \ifglsnogroupskip
  \gcond{if\-gls\-no\-group\-skip}
  { 
    \providedby{\sty{glossaries} v3.03+}
    \initval{\csfmt{iffalse}}
    \desc{conditional set by the \opt{nogroupskip} option}
  }
  % \ifglsxindy
  \gcond{if\-gls\-xindy}
  {
    \providedby{\sty{glossaries} v1.17+}
    \initval{\csfmt{iffalse}}
    \desc{conditional that, if true, indicates that \app{xindy}
     should be used}
  }
  % \glsindexingsetting
  \gcmd{gls\-index\-ing\-setting}
  {
    \providedby{\sty{glossaries} v4.50+}
    \desc{indicates what \idx{indexing} option has been chosen}
  }
  % \ifglstoc
  \gcond{if\-gls\-toc}
  {
    \providedby{\sty{glossaries}}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{toc} option}
  }
  % \glstoctrue
  \gcmd{gls\-toc\-true}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglstoc} to true}
  }
  % \glstocfalse
  \gcmd{gls\-toc\-false}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglstoc} to false}
  }
  % \ifglshyperfirst
  \gcond{if\-gls\-hyper\-first}
  {
    \providedby{\sty{glossaries}}
    \initval{\csfmt{iftrue}}
    \desc{conditional corresponding to the \opt{hyperfirst} option}
  }
  % \glshyperfirsttrue
  \gcmd{gls\-hyper\-first\-true}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglshyperfirst} to true}
  }
  % \glshyperfirstfalse
  \gcmd{gls\-hyper\-first\-false}
  {
    \providedby{\sty{glossaries}}
    \desc{sets \gls{ifglshyperfirst} to false}
  }
  % \setglossarysection
  \gcmd{set\-glossary\-section}
  {
    \providedby{\sty{glossaries} v1.1+}
    \syntax{\margm{name}}
    \desc{equivalent to the package option \optval{section}{\meta{name}}}
  }
  % \glossarytitle
  \gcmd{glossary\-title}
  {
    \desc{defined by \gls{print...glossary} to the current
      \idx{glossary}['s] title}
  }
  % \glossarytoctitle
  \gcmd{glossary\-toc\-title}
  {
    \desc{defined by \gls{print...glossary} to the current
      \idx{glossary}['s] title for the \idx{tableofcontents}
      (if \opt{toc}{true})}
  }
  % \glssettoctitle
  \gcmd{gls\-set\-toc\-title}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{glossary-type}}
    \desc{used by \gls{print...glossary} to set the table of contents title 
     for the given \idx{glossary} if a title hasn't been supplied
     with \printglossopt{toctitle} or \printglossopt{title}}
  }
  % \glsglossarymark
  \gcmd{gls\-glossary\-mark}
  {
    \providedby{\sty{glossaries} v2.02+}
    \syntax{\meta{glossary title}}
    \desc{sets the header mark for the \idx{glossary}}
  }
  % \glossarymark
  \gcmd{glossary\-mark}
  {
    \deprecated
    \providedby{\sty{glossaries} v1.0+}
    \syntax{\meta{glossary title}}
    \desc{only provided if it hasn't already been defined for
    backward-compatibility. Use \gls{glsglossarymark} instead}
  }
  % \glsclearpage
  \gcmd{gls\-clear\-page}
  {
    \providedby{\sty{glossaries} v1.19+}
    \desc{used to clear the page at the start of a \idx{glossary}}
  }
  % \ifglsucmark
  \gcond{if\-gls\-uc\-mark}
  {
    \providedby{\sty{glossaries} v3.02+}
    \initvalvaries
    \desc{conditional corresponding to the \opt{ucmark} option}
  }
  % \glsucmarktrue
  \gcmd{gls\-uc\-mark\-true}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsucmark} to true}
  }
  % \glsucmarkfalse
  \gcmd{gls\-uc\-mark\-false}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsucmark} to false}
  }
  % \glsautoprefix
  \gcmd{gls\-auto\-prefix}
  {
    \providedby{\sty{glossaries} v1.14+}
    \desc{expands to the prefix for the label used by
     \optval{numberedsection}{autolabel} and \optval{numberedsection}{nameref}}
  }
  % \ifglsentrycounter
  \gcond{if\-gls\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.0+}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{entrycounter} option}
  }
  % \glsentrycountertrue
  \gcmd{gls\-entry\-count\-er\-true}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglsentrycounter} to true}
  }
  % \glsentrycounterfalse
  \gcmd{gls\-entry\-count\-er\-false}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglsentrycounter} to false}
  }
  % \ifglssubentrycounter
  \gcond{if\-gls\-sub\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.0+}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{subentrycounter} option}
  }
  % \glssubentrycountertrue
  \gcmd{gls\-sub\-entry\-count\-er\-true}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglssubentrycounter} to true}
  }
  % \glssubentrycounterfalse
  \gcmd{gls\-sub\-entry\-count\-er\-false}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{sets \gls{ifglssubentrycounter} to false}
  }
  % \glsrefentry
  \gcmd{gls\-ref\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{for use with \opt{entrycounter} and \opt{subentrycounter}, 
     this references the value of the \ctr{glossaryentry} or 
     \ctr{glossarysubentry} counter associated with the glossary entry 
     identified by \meta{label}. If \optval{entrycounter}{false}
     and \optval{subentrycounter}{false}, this simply uses \gls{gls}
     otherwise it uses \gls{ref}}
  }
  % \GlsEntryCounterLabelPrefix
  \gcmd{Gls\-Entry\-Count\-er\-Label\-Pre\-fix}
  {
    \providedby{\sty{glossaries} v4.38+}
    \initval{glsentry-}
    \desc{expands to the prefix used by \gls{glsrefentry}}
  }
  % \glsresetentrycounter
  \gcmd{gls\-reset\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{resets \ctr{glossaryentry} back to zero if
      \optval{entrycounter}{true}}
  }
  % \glsresetsubentrycounter
  \gcmd{gls\-reset\-sub\-entry\-count\-er}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{resets \ctr{glossarysubentry} back to zero if
      \optval{entrycounter}{true}}
  }
  % \glsstepentry
  \gcmd{gls\-step\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{increments \ctr{glossaryentry} with \gls{refstepcounter} if
      \optval{entrycounter}{true}}
  }
  % \glsstepsubentry
  \gcmd{gls\-step\-sub\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{increments \ctr{glossarysubentry} with \gls{refstepcounter} if
      \optval{subentrycounter}{true}}
  }
  % \theglossaryentry
  \gcmd{the\-glossary\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the value of the \ctr{glossaryentry} counter}
    \note{requires \optval{entrycounter}{true}}
  }
  % \glsentrycounterlabel
  \gcmd{gls\-entry\-count\-er\-label}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the formatted value of the \ctr{glossaryentry} counter
     or does nothing if \optval{entrycounter}{false}}
  }
  % \theglossarysubentry
  \gcmd{the\-glossary\-sub\-entry}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the value of the \ctr{glossarysubentry} counter}
    \note{requires \optval{subentrycounter}{true}}
  }
  % \glssubentrycounterlabel
  \gcmd{gls\-sub\-entry\-count\-er\-label}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{displays the formatted value of the \ctr{glossarysubentry} counter
     or does nothing if \optval{subentrycounter}{false}}
  }
  % \glsentryitem
  \gcmd{gls\-entry\-item}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{used for \toplevel\ entries in \idxpl{glossarystyle} to
     increment and display the entry counter if \optval{entrycounter}{true}}
  }
  % \glssubentryitem
  \gcmd{gls\-sub\-entry\-item}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{label}}
    \desc{used for \hierlevel{1} entries in 
    \idxpl{glossarystyle} to increment and display the sub-entry counter 
    if \optval{subentrycounter}{true}}
  }
  % \ifglsindexonlyfirst
  \gcond{if\-gls\-index\-only\-first}
  {
    \providedby{\sty{glossaries} v3.02+}
    \initval{\csfmt{iffalse}}
    \desc{conditional corresponding to the \opt{indexonlyfirst} option}
  }
  % \glsindexonlyfirsttrue
  \gcmd{gls\-index\-only\-first\-true}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsindexonlyfirst} to true}
  }
  % \glsindexonlyfirstfalse
  \gcmd{gls\-index\-only\-first\-false}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{sets \gls{ifglsindexonlyfirst} to false}
  }
  % \GlsDeclareNoHyperList
  \gcmd{GlsDeclareNoHyperList}
  {
    \providedby{\sty{glossaries} v3.05+}
    \syntax{\margm{list}}
    \desc{identifies the list of \idxpl{glossary} that should have
     \idxpl{hyperlink} suppressed}
  }
  % \DeclareAcronymList
  \gcmd{Declare\-Acronym\-List}
  {
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{list}}
    \desc{identifies the list of \idxpl{glossary} as lists of acronyms}
  }
  % \glsIfListOfAcronyms
  \gcmd{glsIfListOfAcronyms}
  {
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{glossary-label}\margm{true}\margm{false}}
    \desc{does \meta{true}, if the \meta{glossary-label} has been
    identified as a list of acronyms}
  }
  % \SetAcronymLists
  \gcmd{Set\-Acronym\-Lists}
  {
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{list}}
    \desc{sets the list of \idx{acronym} lists (overriding any that have
     previously been identified)}
    \field{seealso}{DeclareAcronymList,opt.acronymlists}
  }
  % \DefineAcronymSynonyms
  \gcmd{Define\-Acronym\-Synonyms}
  {
    \providedby{\sty{glossaries} v2.04+}
    \desc{provides the shortcut commands for \idxpl{acronym}}
    \field{seealso}{opt.shortcuts}
  }
  % \glsdisablehyper
  \gcmd{gls\-disable\-hyper}
  {
    \providedby{\sty{glossaries}}
    \desc{disables \idxpl{hyperlink} (may be scoped to localise the effect)}
  }
  % \glsenablehyper
  \gcmd{gls\-enable\-hyper}
  {
    \providedby{\sty{glossaries}}
    \desc{enables \idxpl{hyperlink} (may be scoped to localise the effect)}
    \note{requires \sty{hyperref}}
  }
  % COMMANDS: REFERENCING ENTRIES
  % \gls
  \gcmdsp{gls}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced depends on whether or not this is the \idx{firstuse}.
    The \meta{insert} argument may be inserted at the end of the
    \idx{linktext} or may be inserted at a different point (for
    example, after the long form on \idx{firstuse} for some
    \idx{acronym} or \idx{abbreviation}
    styles. For the first optional argument, see \idxpl{glsopt}}
  }
  % \Gls
  \gcmdsp{Gls}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{gls} but converts the \idx{linktext} to \idx{sentencecase}}
  }
  % \GLS
  \gcmdsp{GLS}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{gls} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glspl
  \gcmdsp{glspl}{%
    \providedby{\sty{glossaries}}
    \common
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{gls} but uses the relevant plural form}
  }
  % \Glspl
  \gcmdsp{Glspl}{%
    \common
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glspl} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSpl
  \gcmdsp{GLSpl}{%
    \common
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glspl} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsdisp
  \gcmdsp{gls\-disp}{%
    \providedby{\sty{glossaries} v1.19+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{references the entry identified by \meta{entry-label} with the
     given \meta{text} as the \idx{linktext}. This command unsets the
    \idx{firstuseflag} (use \gls{glslink} instead, if the
    \idx{firstuseflag} should not be altered).
    This command is considered a \gls{glslike} command.
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glsdisp
  \gcmdsp{Glsdisp}{%
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{as \gls{glsdisp} but converts \meta{text} to
    \idx{sentencecase}}
  }
  % \glslink
  \gcmdsp{gls\-link}{%
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{references the entry identified by \meta{entry-label} with the
     given \meta{text} as the \idx{linktext}. This command does not
     alter or depend on the \idx{firstuseflag} (use \gls{glsdisp} instead, if the
    \idx{firstuseflag} needs to be unset).
    This command is considered a \gls{glstextlike} command.
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glslink
  \gcmdsp{Glslink}{%
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{as \gls{glslink} but converts \meta{text} to
    \idx{sentencecase}}
  }
  % \glsname
  \gcmdsp{gls\-name}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{name} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see \idxpl{glsopt}.
    Use \gls{glossentryname} within custom glossary styles
    instead of this command}
  }
  % \Glsname
  \gcmdsp{Gls\-name}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsname} but converts the \idx{linktext} to 
    \idx{sentencecase}. Use \gls{Glossentryname} within custom glossary styles
    instead of this command}
  }
  % \GLSname
  \gcmdsp{GLS\-name}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsname} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsdesc
  \gcmdsp{gls\-desc}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{description} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}. Use \gls{glossentrydesc} within custom glossary styles
    instead of this command}
  }
  % \Glsdesc
  \gcmdsp{Gls\-desc}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdesc} but converts the 
    \idx{linktext} to \idx{sentencecase}. Use 
    \gls{Glossentrydesc} within custom glossary styles
    instead of this command}
  }
  % \GLSdesc
  \gcmdsp{GLS\-desc}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdesc} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsdescplural
  \gcmdsp{gls\-desc\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdesc} but for the \gloskey{descriptionplural} field}
  }
  % \Glsdescplural
  \gcmdsp{Gls\-desc\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdescplural} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSdescplural
  \gcmdsp{GLS\-desc\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsdescplural} but converts the 
    \idx{linktext} to \idx{allcaps}}
  }
  % \glssymbol
  \gcmdsp{gls\-symbol}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{symbol} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}. Use \gls{glossentrysymbol} within custom glossary styles
    instead of this command}
  }
  % \Glssymbol
  \gcmdsp{Gls\-symbol}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbol} but converts the 
    \idx{linktext} to \idx{sentencecase}. Use 
    \gls{Glossentrysymbol} within custom glossary styles
    instead of this command}
  }
  % \GLSsymbol
  \gcmdsp{GLS\-symbol}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbol} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glssymbolplural
  \gcmdsp{gls\-symbol\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbol} but for the \gloskey{symbolplural} field}
  }
  % \Glssymbolplural
  \gcmdsp{Gls\-symbol\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbolplural} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSsymbolplural
  \gcmdsp{GLS\-symbol\-plural}{%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glssymbolplural} but converts the 
    \idx{linktext} to \idx{allcaps}}
  }
  % \glstext
  \gcmdsp{gls\-text}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{text} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrshort} for the short form (or
    \gls{glsxtrshort} with \sty{glossaries-extra}).
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glstext
  \gcmdsp{Gls\-text}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glstext} but converts the first character of the
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLStext
  \gcmdsp{GLS\-text}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glstext} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsplural
  \gcmdsp{gls\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{plural} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrshortpl} (or \gls{glsxtrshortpl}
    with \sty{glossaries-extra}) instead}
  }
  % \Glsplural
  \gcmdsp{Gls\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsplural} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSplural
  \gcmdsp{GLS\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsplural} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsfirst
  \gcmdsp{gls\-first}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{first} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrfull} (or \gls{glsxtrfull} 
    with \sty{glossaries-extra})
    for the full form or \gls{acrlong} (or \gls{glsxtrlong} with
    \sty{glossaries-extra}) for the long form instead}
  }
  % \Glsfirst
  \gcmdsp{Gls\-first}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirst} but converts \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSfirst
  \gcmdsp{GLS\-first}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirst} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsfirstplural
  \gcmdsp{gls\-first\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{firstplural} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. If you have defined the entry with
    \gls{newacronym} consider using \gls{acrfullpl} (or \gls{glsxtrfullpl} with
    \sty{glossaries-extra}) for the full form or \gls{acrlongpl} 
    (or \gls{glsxtrlongpl} with \sty{glossaries-extra}) for the long form instead.
    For the first optional argument, see \idxpl{glsopt}}
  }
  % \Glsfirstplural
  \gcmdsp{Gls\-first\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirstplural} but converts the \idx{linktext} to
    \idx{sentencecase}}
  }
  % \GLSfirstplural
  \gcmdsp{GLS\-first\-plural}{%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsfirstplural} but converts the \idx{linktext} to \idx{allcaps}}
  }
  % \glsuseri
  \gcmdsp{gls\-useri}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user1} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuseri
  \gcmdsp{Gls\-useri}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseri} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuseri
  \gcmdsp{GLS\-useri}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseri} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuserii
  \gcmdsp{gls\-userii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user2} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuserii
  \gcmdsp{Gls\-userii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserii} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuserii
  \gcmdsp{GLS\-userii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserii} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuseriii
  \gcmdsp{gls\-useriii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user3} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuseriii
  \gcmdsp{Gls\-useriii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriii} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuseriii
  \gcmdsp{GLS\-useriii}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriii} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuseriv
  \gcmdsp{gls\-useriv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user4} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuseriv
  \gcmdsp{Gls\-useriv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriv} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuseriv
  \gcmdsp{GLS\-useriv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuseriv} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuserv
  \gcmdsp{gls\-userv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user5} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuserv
  \gcmdsp{Gls\-userv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserv} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuserv
  \gcmdsp{GLS\-userv}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuserv} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glsuservi
  \gcmdsp{gls\-uservi}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{references the entry identified by \meta{entry-label}. The text
    produced is obtained from the \gloskey{user6} value.
    The \meta{insert} argument will be inserted at the end of the
    \idx{linktext}. This command does not alter or depend on the
    \idx{firstuseflag}. For the first optional argument, see
    \idxpl{glsopt}}
  }
  % \Glsuservi
  \gcmdsp{Gls\-uservi}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuservi} but converts the 
    \idx{linktext} to \idx{sentencecase}}
  }
  % \GLSuservi
  \gcmdsp{GLS\-uservi}{%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsuservi} but converts the \idx{linktext} to
   \idx{allcaps}}
  }
  % \glshyperlink
  \gcmd{gls\-hyper\-link}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\oargm{text}\margm{entry-label}}
     \desc{creates a hyperlink to the given entry with the hyperlink
      text provided in the optional argument. If omitted, the default is
      \code{\gls{glsentrytext}\margm{entry-label}}}
  } 
  % COMMANDS: INDEXING
  % \glsadd
  \gcmd{gls\-add}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}\margm{entry-label}}
    \desc{indexes the entry identified by \meta{entry-label}}
  }
  % \glsaddall
  \gcmd{gls\-add\-all}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}}
    \desc{iterates over all non-\idxpl{ignoredglossary} (or all those
    listed in the \glsopt{types} option)
    and \idxc{indexing}{indexes} each entry in the \idx{glossary}. The optional
    argument \meta{options} are passed to \gls{glsadd}.
    This command can't be used with \app{bib2gls}. Use the
    \resourceoptval{selection}{all} \idx{resourceopt} instead}
  }
  % \glsaddallunused
  \gcmd{gls\-add\-all\-unused}
  {%
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\oargm{glossary types}}
    \desc{iterates over all \idxpl{glossary} listed in
     \meta{glossary types} (all all non-\idxpl{ignoredglossary} if
     omitted) and \idxc{indexing}{indexes} each entry
     (with \glsoptval{format}{\encap{glsignore}}) that hasn't been used.
    This command can't be used with \app{bib2gls}. Use the
    \resourceoptval{selection}{all} \idx{resourceopt} instead}
  }
  % \glsaddeach
  \gcmd{gls\-add\-each}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\oargm{options}\margm{entry label list}}
     \desc{does \code{\gls{glsadd}\oargm{options}\margm{entry-label}} for each label
       in the supplied comma-separated list}
  }
  % \glsstartrange
  \gcmd{gls\-start\-range}
  {
    \providedby{\sty{glossaries-extra} v1.50+}
    \syntax{\oargm{options}\margm{entry label list}}
    \desc{essentially does
\code{\gls{glsaddeach}\oarg{\meta{options},\glsoptval{format}{\sym{startrange}\meta{encap}}}\margm{entry label
list}}
where \meta{encap} can either be provided by the \glsopt{format} key
in \meta{options}}
  }
  % \glsendrange
  \gcmd{gls\-end\-range}
  {
    \providedby{\sty{glossaries-extra} v1.50+}
    \syntax{\oargm{options}\margm{entry label list}}
    \desc{as \gls{glsstartrange} but with the end range marker
    \sym{endrange}}
  }
  % \glssee
  \gcmd{gls\-see}
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\oargm{tag}\margm{entry-label}\margm{xr-list}}
    \desc{indexes the \idx{entry} identified by \meta{entry-label} as a
     general cross-reference to the \idxpl{entry} identified in the comma-separated
     list \meta{xr-list}. The optional argument is the textual tag
     that's inserted before the cross-reference list and defaults to
     \gls{seename}}
  }
  % \glsseeformat
  \gcmd{gls\-see\-format}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\oargm{tag}\margm{xr-list}\margm{location}}
    \desc{used to format the \gloskey{see} cross-reference in the
     \idx{locationlist}. This requires a \location\ argument for
      \app{makeindex} even though it isn't required. The default
      definition is \code{\csfmt{emph}\margm{tag} \gls{glsseelist}\margm{xr-list}}}
  }
  % \glsseelist
  \gcmd{gls\-see\-list}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{label-list}}
    \desc{iterates over a comma-separated list of entry labels
     \meta{label-list} and formats them. Each label in the list is
     encapsulated with \gls{glsseeitem}. The separators are
     \gls{glsseelastsep} (between the penultimate and last items)
     and \gls{glsseesep} (between all the other items)}
  }
  % \glsseeitem
  \gcmd{gls\-see\-item}
  {
    \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{entry-label}}
     \desc{used by \gls{glsseelist} to format each \idx{entry} item. 
     This adds a \idx{hyperlink}, if enabled, to the appropriate
     \idx{entryline} in the \idx{glossary} with the text obtained
     with \gls{glsseeitemformat}}
  }
  % \glsseeitemformat
  \gcmd{gls\-see\-item\-format}
  {
     \providedby{\sty{glossaries} v3.0+}
     \syntax{\margm{entry-label}}
     \desc{used by \gls{glsseeitem} to produce the \idx{hyperlink} text}
  }
  % \glsseesep
  \gcmd{gls\-see\-sep}
  {
    \providedby{\sty{glossaries} v1.17+}
    \initval{,\sym{vbsp}}
    \desc{used by \gls{glsseelist} as a separator between each \idx{entry}
     except the last pair}
  }
  % \glsseelastsep
  \gcmd{gls\-see\-last\-sep}
  {
    \providedby{\sty{glossaries} v1.17+}
    \initval{,\sym{vbsp}}
    \desc{used by \gls{glsseelist} as a separator between the final pair}
  }
  % COMMANDS: INDEXING INITIALISATION
  % \writeist
  \gcmd{write\-ist}
  {
    \providedby{\sty{glossaries}}
    \desc{writes the \app{makeindex}\slash\app{xindy} style file.
    This command is used by \gls{makeglossaries} and then disabled}
  }
  % \GlsSetWriteIstHook
  \gcmd{Gls\-Set\-Write\-Ist\-Hook}
  {
    \providedby{\sty{glossaries} v4.24+}
    \syntax{\margm{code}}
    \desc{adds \meta{code} to the \idx{indexing} style file}
  }
  % \glswrite
  \gcmd{gls\-write}
  {
     \desc{the write register used to create the \idx{indexing} style file}
  }
  % \setStyleFile
  \gcmd{set\-Style\-File}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{name}}
    \desc{sets the file name of the \app{makeindex} or \app{xindy}
    style file that's created by \gls{makeglossaries}}
  }
  % \glsSetCompositor
  \gcmd{gls\-Set\-Compositor}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{character}}
    \desc{sets the location \idx{compositor} for the \idx{indexing} style file created by
     \gls{makeglossaries}}
  }
  % \glsSetAlphaCompositor
  \gcmd{gls\-Set\-Alpha\-Compositor}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{character}}
    \desc{sets the \idx{compositor} for \locations\ that start with
     an \idx{uppercase} alphabetical character}
    \note{\app{xindy} only}
  }
  % \GlsSetQuote
  \gcmd{Gls\-Set\-Quote}
  {
    \providedby{\sty{glossaries} v4.24+}
    \syntax{\margm{character}}
    \desc{set \app{makeindex}['s] quote character (used for escaping
    special characters) to \meta{character}}
    \note{\app{makeindex} only}
  }
  % \glsprestandardsort
  \gcmd{gls\-pre\-standard\-sort}
  {
    \providedby{\sty{glossaries} v3.13a+}
    \syntax{\margm{sort cs}\margm{type}\margm{entry-label}}
    \desc{hook used with \opteqvalref{sort}{standard} to adjust the
     default sort value (with \gls{makeglossaries} or
     \gls{makenoidxglossaries} only)}
  }
  % \glsdosanitizesort
  \gcmd{gls\-do\-sanitize\-sort}
  {
    \desc{sanitizes the sort value if \optval{sanitizesort}{true}}
    \note{only available with \opteqvalref{sort}{standard}}
  }
  % \glssortnumberfmt
  \gcmd{gls\-sort\-number\-fmt}
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{number}}
    \desc{expands to the given \meta{number} zero-padded to six digits}
  }
  % \noist
  \gcmd{no\-ist}
  {
    \providedby{\sty{glossaries}}
    \desc{prevents \gls{makeglossaries} from creating the default
    \idx{indexingapp} style file}
  }
  % \makeglossaries
  \gcmd{make\-glossaries}%
  {%
    \providedby{\sty{glossaries}}
    \desc{opens the associated \idxpl{indexingfile} that need to be
     processed by \app+{makeindex} or \app+{xindy}. This command has
     an optional argument with \sty{glossaries-extra}}
    \note{\options{mkidx,xdy} only}
  }
  % \makenoidxglossaries
  \gcmd{make\-noidx\-glossaries}%
  {%
    \providedby{\sty{glossaries} v4.04+}
    \desc{sets up all non-\idxpl{ignoredglossary} so that they can be displayed
    with \gls{printnoidxglossary}}
    \note{\option{noidx} only}
  } 
  % \GlsSetXdyLanguage
  \gcmd{Gls\-Set\-Xdy\-Language}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\oargm{glossary-type}\margm{language}}
     \desc{sets the \app{xindy} language for the given
     \idx{glossary}. This information is written to the \ext{aux} file
     for \app{makeglossaries} to pick up. It has no effect if \app{xindy}
     is called explicitly}
    \note{\app{xindy} \& \app{makeglossaries} only}
  }
  % \GlsSetXdyCodePage
  \gcmd{Gls\-Set\-Xdy\-Code\-Page}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{codepage}}
     \desc{sets the \app{xindy} \idx{codepage}. 
     This information is written to the \ext{aux} file
     for \app{makeglossaries} to pick up. It has no effect if \app{xindy}
     is called explicitly}
    \note{\app{xindy} \& \app{makeglossaries} only}
  }
  % \GlsAddLetterGroup
  \gcmd{Gls\-Add\-Letter\-Group}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{name}\margm{xindy code}}
     \desc{adds a new \app{xindy} letter \idx{group}, identified by
     \meta{name} and defined by \meta{xindy code}. This information
     is written to the \ext{xdy} file that's created by
     \gls{makeglossaries}}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyCounters
  \gcmd{Gls\-Add\-Xdy\-Counters}
  {
     \providedby{\sty{glossaries} v3.0+}
     \syntax{\margm{counter list}}
     \desc{identifies all the \idxpl{locationcounter} required in
     the document}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyAttribute
  \gcmd{Gls\-Add\-Xdy\-Attribute}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{name}}
    \desc{adds the \idxpl{xindyattr} associated with \meta{name} to the
    \ext{xdy} style file}
    \note{\app{xindy} only}
  }
  % \glsX<counter>X<format>
  \gcmdmetameta{glsX}{counter}{X}{format}{}%
  {%
     \syntax{\margm{H-prefix}\margm{location}}
     \desc{used with \app{xindy} for location formats}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyLocation
  \gcmd{Gls\-Add\-Xdy\-Location}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\oargm{H-prefix}\margm{name}\margm{definition}}
    \desc{adds the given location syntax to the \ext{xdy} style file}
    \note{\app{xindy} only}
  }
  % \GlsSetXdyLocationClassOrder
  \gcmd{Gls\-Set\-Xdy\-Location\-Class\-Order}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{location names}}
    \desc{may be used to change the ordering of location class names}
    \note{\app{xindy} only}
  }
  % \GlsAddXdyStyle
  \gcmd{Gls\-Add\-Xdy\-Style}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{style-name}}
    \desc{adds a required \app{xindy} file to the \ext{xdy} style file}
    \note{\app{xindy} only}
    \field{seealso}{GlsSetXdyStyles}
  }
  % \GlsSetXdyStyles
  \gcmd{Gls\-Set\-Xdy\-Styles}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{style name list}}
    \desc{resets the list of required \app{xindy} files}
    \note{\app{xindy} only}
    \field{seealso}{GlsAddXdyStyle}
  }
  % \GlsSetXdyFirstLetterAfterDigits
  \gcmds{Gls\-Set\-Xdy\-First\-Letter\-After\-Digits}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{letter}}
    \desc{identifies the first letter \idx{group} to occur after the number group}
    \note{\app{xindy} only}
  }
  % \GlsSetXdyNumberGroupOrder
  \gcmds{Gls\-Set\-Xdy\-Number\-Group\-Order}
  {
    \providedby{\sty{glossaries} v4.33+}
    \syntax{\margm{relative location}}
    \desc{sets the relative location of the number \idx{group}}
    \note{\app{xindy} only}
  }
  % \glsopenbrace
  \gcmd{gls\-open\-brace}
  {
     \desc{expands to \sym+{bg} (a literal open brace)}
  }
  % \glsclosebrace
  \gcmd{gls\-close\-brace}
  {
     \desc{expands to \sym+{eg} (a literal closing brace)}
  }
  % \glsbackslash
  \gcmd{gls\-back\-slash}
  {
     \providedby{\sty{glossaries} v4.11+}
     \desc{expands to \sym+{bksl} (a literal backslash)}
  }
  % \glspercentchar
  \gcmd{gls\-per\-cent\-char}
  {
     \providedby{\sty{glossaries} v4.10+}
     \desc{expands to \sym+{pc} (a literal percent character)}
  }
  % \glstildechar
  \gcmd{gls\-tilde\-char}
  {
     \providedby{\sty{glossaries} v4.10+}
     \desc{expands to \sym+{tilde} (a literal tilde character)}
  }
  % \glsquote
  \gcmd{gls\-quote}
  {
     \providedby{\sty{glossaries}}
     \syntax{\margm{text}}
     \desc{expands to \sym{dblquote}\meta{text}\sym{dblquote}, where
     the \sym{dblquote} is a literal character}
  }
  % \GlsSetXdyMinRangeLength
  \gcmd{Gls\-Set\-Xdy\-Min\-Range\-Length}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{value}}
     \desc{sets the minimum number of consecutive \locations\ to
      form an implicit \idx{range}. The value may be \qt{none} to
      indicate no \idx{range} formation}
    \note{\app{xindy} only}
  }
  % \glsSetSuffixF
  \gcmd{gls\-Set\-SuffixF}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{suffix}}
     \desc{the suffix for two consecutive locations}
  }
  % \glsSetSuffixFF
  \gcmd{gls\-Set\-SuffixFF}
  {
     \providedby{\sty{glossaries} v1.17+}
     \syntax{\margm{suffix}}
     \desc{the suffix for three or more consecutive locations}
  }
  % \glslocationcstoencap
  \gcmd{gls\-location\-cs\-to\-encap}
  {
     \providedby{\sty{glossaries} v4.50+}
     \syntax{\margm{encap-csname}\margm{location-csname}}
     \desc{used by \app{makeglossaries} when repairing problematic
     locations with \app{makeindex}}
  }
  % \ifglswrallowprimitivemods
  \gcond{if\-gls\-wr\-allow\-primitive\-mods}
  {
    \providedby{\sty{glossaries} v4.22+}
    \initval{\csfmt{iffalse}}
    \desc{if \optval{esclocations}{true} and this conditional is
    true, then some primitives will be locally redefined while
    \idx{indexing} occurs in order to escape special characters in the
    location without prematurely expanding \gls{thepage}}
  }
  % \glswrallowprimitivemodstrue
  \gcmd{gls\-wr\-allow\-primitive\-mods\-true}
  {
    \desc{sets \gls{ifglswrallowprimitivemods} to true}
  }
  % \glswrallowprimitivemodsfalse
  \gcmd{gls\-wr\-allow\-primitive\-mods\-false}
  {
    \desc{sets \gls{ifglswrallowprimitivemods} to false}
  }
  % \glossaryentry
  \gcmd{glossary\-entry}
  {
    \syntax{\margm{data}\margm{location}}
    \desc{this isn't actually defined as a command but is used 
     as a keyword for \app{makeindex}}
  }
  % \glswrglossdisableanchorcmds
  \gcmd{gls\-wr\-gloss\-disable\-anchor\-cmds}
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{hook used to locally disable problematic commands whilst
     constructing the anchor for \gls{glshypernumber}}
  }
  % \glswrglosslocationtarget
  \gcmd{gls\-wr\-gloss\-location\-target}
  {
     \providedby{\sty{glossaries} v4.50+}
     \syntax{\margm{location}}
     \desc{must be expandable. May be used to alter the location
      suffix whilst constructing the anchor for \gls{glshypernumber}}
  }
  % \glswrglosslocationtextfmt
  \gcmd{gls\-wr\-gloss\-location\-text\-fmt}
  {
     \providedby{\sty{glossaries} v4.50+}
     \syntax{\margm{location}}
     \desc{used to encapsulate the location in the \idx{hyperlink}
      text for \gls{glshypernumber}}
  }
  % \glswrglossdisablelocationcmds
  \gcmd{gls\-wr\-gloss\-disable\-location\-cmds}
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{hook used to locally disable problematic commands whilst
     writing the location to the \idx{indexingfile} with
     \options{mkidx,xdy}}
  }
  % COMMANDS: FORMATTING
  % \glstextformat
  \gcmd{gls\-text\-format}
  {
    \providedby{\sty{glossaries} v1.04+}
    \syntax{\margm{text}}
    \desc{used by the \gls{glslike} and \gls{glstextlike} commands 
     to format the \idx{linktext}}
  }
  % \glsentryfmt
  \gcmd{gls\-entry\-fmt}
  {
    \providedby{\sty{glossaries} v3.11a+}
     \desc{the default display format used by the \gls{glslike}
      commands. This command is redefined by the
     \sty{glossaries-extra} package}
    \field{seealso}{glsgenentryfmt,defglsentryfmt}
  }
  % \defglsentryfmt
  \gcmd{def\-gls\-entry\-fmt}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\oargm{glossary-type}\margm{definition}}
    \desc{defines the display format used by the \gls{glslike}
      commands for entries assigned to the glossary identified by
      \meta{glossary-type} (\gls{glsdefaulttype} if omitted)}
  }
  % \glsgenentryfmt
  \gcmd{gls\-gen\-entry\-fmt}
  {
    \providedby{\sty{glossaries} v3.11a+}
     \desc{the generic display format used by the \gls{glslike}
      commands}
  }
  % \glsgenacfmt
  \gcmd{gls\-gen\-ac\-fmt}
  {
    \providedby{\sty{glossaries} v4.02a+}
     \desc{the generic \idx{acronym} display \idxc{acronymformat}{format} 
     used by the \gls{glslike} commands}
  }
  % \glslabel
  \gcmd{gls\-label}
  {
    \providedby{\sty{glossaries} v1.15+}
     \desc{placeholder command that expands to the entry label}
    \field{seealso}{glsentryfmt,glsifplural,glscapscase,glsinsert,glscustomtext,glstype}
  }
  % \glstype
  \gcmd{gls\-type}
  {
    \providedby{\sty{glossaries} v4.08+}
     \desc{placeholder command that expands to the entry's \idx{glossary} type}
    \field{seealso}{glslabel}
  }
  % \glscustomtext
  \gcmd{gls\-custom\-text}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \desc{placeholder command that expands to the text provided in \gls{glsdisp}}
    \field{seealso}{glsentryfmt,glslabel,glsifplural,glscapscase,glsinsert}
  }
  % \glsinsert
  \gcmd{gls\-insert}
  {
    \providedby{\sty{glossaries} v3.11a+}
     \desc{placeholder command that expands to the \meta{insert}
      final optional argument of the \gls{glslike} commands}
    \field{seealso}{glsentryfmt,glslabel,glsifplural,glscapscase,glscustomtext}
  }
  % \glsifplural
  \gcmd{gls\-if\-plural}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{true}\margm{false}}
    \desc{defined by the \gls{glslike} commands to expand to 
     \meta{true} if the calling command was a plural form (for
      example, \gls{glspl}) and to \meta{false} for the other
      commands}
    \field{seealso}{glsentryfmt,glslabel,glscapscase,glsinsert,glscustomtext}
  }
  % \glscapscase
  \gcmd{gls\-caps\-case}
  {
    \providedby{\sty{glossaries} v3.11a+}
    \syntax{\margm{no change}\margm{sentence}\margm{all caps}}
    \desc{defined by the \gls{glslike} commands to expand to 
     \meta{no change} if the calling command wasn't a \casechanging\
     command (\gls{gls} or \gls{glspl}), to
      \meta{sentence} for \idx{sentencecase} commands (\gls{Gls} or
      \gls{Glspl}) or to \meta{all caps} for \idx{allcaps} commands
      (\idx{GLS} or \idx{GLSpl})}
    \field{seealso}{glsentryfmt,glslabel,glsifplural,glsinsert,glscustomtext}
  }
  % \glsifhyperon
  \gcmd{gls\-if\-hyper\-on}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{true}\margm{false}}
    \desc{defined by the \gls{glslike} commands to expand to 
     \meta{true} if the \idx{hyperlink} setting is on for the
     current reference. Otherwise it expands to \meta{false}}
    \field{seealso}{glsentryfmt,glslinkvar}
  }
  % \glslinkvar
  \gcmd{gls\-link\-var}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{unmodified}\margm{star case}\margm{plus case}}
    \desc{defined by the \gls{glslike} commands test if the
    unmodified, starred (\sym{starmod}) or plus (\sym{plusmod}) command
    was used}
    \field{seealso}{glsentryfmt,glslinkvar}
  }
  % \glsxtrifwasfirstuse
  \gxtrcmd{gls\-xtr\-if\-was\-first\-use}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{true}\margm{false}}
     \desc{initialised by the \gls{glslike}
     and \gls{glstextlike} commands, this expands to \meta{true} if
     the calling command was considered the \idx{firstuse},
     otherwise it expands to \meta{false}. This command may be used
     within the \idx{postlinkhook} (where it's too late to test the
     \idx{firstuseflag} with \gls{ifglsused})}
  }
  % COMMANDS: HOOKS
  % \glslinkcheckfirsthyperhook
  \gcmd{gls\-link\-check\-first\-hyper\-hook}
  {
    \providedby{\sty{glossaries} v4.08+}
    \desc{hook used when checking whether or not to switch off
    \idxpl{hyperlink} on \idx{firstuse}}
  }
  % \glswriteentry
  \gcmd{glswriteentry}
  {
    \providedby{\sty{glossaries} v4.16+}
    \syntax{\margm{label}\margm{indexing code}}
    \desc{does \meta{indexing code} unless
    \optval{indexonlyfirst}{true} and the entry identified by
    \meta{label} has been marked as \glslink{firstuseflag}{used}}
  }
  % \glslinkpostsetkeys
  \gcmd{gls\-link\-post\-set\-keys}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \desc{hook implemented after setting the options passed to the
      \gls{glslike} and \gls{glstextlike} commands}
  }
  % \glslinkpresetkeys
  \gxtrcmd{gls\-link\-pre\-set\-keys}
  {%
    \providedby{\sty{glossaries-extra} v1.26+}
    \desc{hook implemented before setting the options passed to the
      \gls{glslike} and \gls{glstextlike} commands}
  }
  % \glspostlinkhook
  \gcmd{gls\-post\-link\-hook}{%
   \providedby{\sty{glossaries} v4.16}
    \desc{a \idx{postlinkhook} used after all the \gls{glslike} and
    \gls{glstextlike} commands. This is redefined by
    \sty{glossaries-extra} to use \gls{glsxtrpostlinkhook}}
  }   
  % \glsxtrpostlinkhook
  \gxtrcmd{gls\-xtr\-post\-link\-hook}{%
   \providedby{\sty{glossaries-extra} v1.0+}% 
   \desc{an additional \idx{postlinkhook} that supports categories}
  }
  % \glsxtrpostlinkAddSymbolOnFirstUse
  \gxtrcmd{gls\-xtr\-post\-link\-Add\-Symbol\-On\-First\-Use}{%
    \providedby{\sty{glossaries-extra}}%
    \desc{may be used within a \idx{postlinkhook} to display the
    symbol in parentheses on \idx{firstuse}}
  }
  % \glsdefpostlink
  \gcmd{gls\-def\-post\-link}{%
    \syntax{\margm{category}\margm{definition}}
    \providedby{\sty{glossaries-extra} v1.31+}%
    \desc{defines \idx{postlinkhook} associated with the category
    identified by the label \meta{category}}
  } 
  % \glswritedefhook
  \gcmd{gls\-write\-def\-hook}
  {
   \providedby{\sty{glossaries} v3.10a}
    \desc{hook used when writing entries to the \ext+{glsdefs} file
    after all the \keyval\ information has been written and before the
    end brace that closes the final argument of \gls{glsdefs@newdocentry}}
  }
  % COMMANDS: REFERENCING ENTRIES - extra
  % \GlsXtrSetAltModifier
  \gxtrcmd{Gls\-Xtr\-Set\-Alt\-Modifier}
  {
    \syntax{\margm{token}\margm{options}}
    \desc{sets \meta{token} as a modifier for the \gls{glslike} and
    \gls{glstextlike} commands that will automatically implement the
    given options}
  }
  % \GlsXtrSetStarModifier
  \gcmd{Gls\-Xtr\-Set\-Star\-Modifier}
  { 
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{options}}
    \desc{overrides the options that should be implemented by the
     star (\code{*}) modifier for \gls{glslike} and
    \gls{glstextlike} commands}
  }
  % \GlsXtrSetPlusModifier
  \gcmd{Gls\-Xtr\-Set\-Plus\-Modifier}
  {
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{options}}
    \desc{overrides the options that should be implemented by the
     plus (\code{+}) modifier for \gls{glslike} and
    \gls{glstextlike} commands}
  }
  % \glsxtrp
  \gxtrcmd{gls\-xtrp}%
  {%
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{field}\margm{entry-label}}
    \desc{for use in headings and captions (instead of the
     \gls{glslike} or \gls{glstextlike} commands). This command is
      designed to expand to the field value if used in a
      \idx{PDFbookmark} and can also expand to a more appropriate command if
      it ends up in the page header. Note that there's no option
      argument}
  }
  % \glsps
  \gxtrcmd{gls\-ps}
  { 
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{entry-label}}
    \desc{shortcut for \code{\gls{glsxtrp}\marg{short}\margm{entry-label}}}
  }
  % \glspt
  \gxtrcmd{gls\-pt}
  {%
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{entry-label}}
    \desc{shortcut for \code{\gls{glsxtrp}\marg{text}\margm{entry-label}}}
  }
  % \glsxtrfmt
  \gxtrcmd{gls\-xtr\-fmt}{%
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\oargm{options}\margm{entry-label}\margm{text}}
    \desc{behaves like
\code{\gls{glslink}\oargm{options}\margm{entry-label}\marg{\cmd{\meta{csname}}\margm{text}\meta{insert}}}
     where the control sequence name \meta{csname} is obtained from
     a designated field}
  }
  % \GlsXtrFmtField
  \gxtrcmd{Gls\-Xtr\-Fmt\-Field}{%
    \providedby{\sty{glossaries-extra} v1.12+}
    \initval{\code{useri}}
    \desc{expands to the name of the \idxc{internalfieldlabel} used by \gls{glsxtrfmt}}
  }
  % \glsxtrnewgls
  \gxtrcmd{gls\-xtr\-new\-gls}
  {
     \providedby{\sty{glossaries-extra} v1.21+}
     \syntax{\oargm{default-options}\margm{prefix}\margm{cs}}
     \desc{defines the command
\meta{cs}\oargm{options}\margm{entry-label} to behave like
      \code{\gls{gls}\oarg{\meta{default-options},\meta{options}}\marg{\meta{prefix}\meta{entry-label}}}}
  }
  % \glsxtrnewglslike
  \gxtrcmd{gls\-xtr\-new\-gls\-like}
  {
     \providedby{\sty{glossaries-extra} v1.21+}
     \syntax{\oargm{default-options}\margm{prefix}\margm{\gls{gls}-like
cs}\margm{\gls{glspl}-like cs}\margm{\gls{Gls}-like cs}\margm{\gls{Glspl}-like cs}}
     \desc{like \gls{glsxtrnewgls} but provides plural and
      \idx{sentencecase} commands as well}
  }
  % \dgls
  \gxtrcmdsp{dgls}{%
    \providedby{\sty{glossaries-extra-bib2gls} v1.37+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{does \code{\gls{gls}\oargm{options}\marg{\meta{prefix}\marg{entry-label}}\oargm{insert}}
     for the first prefix in the prefix list that matches a defined \idx{entry}}
  } 
  % \glsfmttext
  \gxtrcmd{gls\-fmt\-text}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \gloskey{text}}
  }
  % \glsfmtfirst
  \gcmd{gls\-fmt\-first}
  {
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \gloskey{first}}
  } 
  % \glsfmtname
  \gcmd{gls\-fmt\-name}
  {  
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \gloskey{name}}
  }
  % COMMANDS: REFERENCING ENTRIES - no indexing or hyperlinks
  % \glsentrytype
  \gcmd{gls\-entry\-type}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{type} key.
     Does nothing if the entry hasn't been defined}
  } 
  % \glsentrysort
  \gcmd{gls\-entry\-sort}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{sort} key.
     Does nothing if the entry hasn't been defined}
  } 
  % \glsentryname
  \gcmd{gls\-entry\-name}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{name} key.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{name} key doesn't
     contain any fragile commands}
  }
  % \Glsentryname
  \gcmd{Gls\-entry\-name}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{name} field with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryparent
  \gcmd{gls\-entry\-parent}
  {%
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{parent} field.
     Expands to nothing if the \gloskey{parent} field hasn't been set
     and expands to \gls{relax} if the entry hasn't been defined}
  }
  % \glsentrytext
  \gcmd{gls\-entry\-text}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{text} field.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{text} field doesn't
     contain any fragile commands}
  }
  % \Glsentrytext
  \gcmd{Gls\-entry\-text}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{text} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryplural
  \gcmd{gls\-entry\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{plural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{plural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryplural
  \gcmd{Gls\-entry\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{plural} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryfirst
  \gcmd{gls\-entry\-first}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{first} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{first} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryfirst
  \gcmd{Gls\-entry\-first}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{first} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryfirstplural
  \gcmd{gls\-entry\-first\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{firstplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{firstplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryfirstplural
  \gcmd{Gls\-entry\-first\-plural}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{firstplural} \idx{field} with \idx{sentencecase}
     applied. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentrydesc
  \gcmd{gls\-entry\-desc}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{description} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{description} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentrydesc
  \gcmd{Gls\-entry\-desc}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{description} \idx{field} with \idx{sentencecase}
     applied. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentrydescplural
  \gcmd{gls\-entry\-desc\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{descriptionplural}
    \idx{field}.  Does nothing if the entry hasn't been defined.
    May be used in expandable contexts provided that the
    \gloskey{descriptionplural} \idx{field} doesn't contain any fragile commands}
  }
  \gcmd{Gls\-entry\-desc\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{descriptionplural} \idx{field} with \idx{sentencecase}
     applied. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
    expand to a robust internal command}
  }
  % \glsentryshort
  \gcmd{gls\-entry\-short}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{short} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{short} \idx{field} doesn't
     contain any fragile commands}
  }
  % \glsentryshortpl
  \gcmd{gls\-entry\-short\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{shortplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{shortplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \glsentrylong
  \gcmd{gls\-entry\-long}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{long} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{long} \idx{field} doesn't
     contain any fragile commands}
  }
  % \glsentrylongpl
  \gcmd{gls\-entry\-long\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{longplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{longplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryshort
  \gcmd{Gls\-entry\-short}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{short} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \Glsentrylong
  \gcmd{Gls\-entry\-long}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{long} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \Glsentryshortpl
  \gcmd{Gls\-entry\-short\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{shortplural} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \Glsentrylong
  \gcmd{Gls\-entry\-long\-pl}
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{displays the value of the \gloskey{longplural} \idx{field} with
     \idx{sentencecase} applied.
     Does nothing if the entry hasn't been defined. As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentrysymbol
  \gcmd{gls\-entry\-symbol}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{symbol} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{symbol} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentrysymbol
  \gcmd{Gls\-entry\-symbol}
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{symbol} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentrysymbolplural
  \gcmd{gls\-entry\-symbol\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{symbolplural} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{symbolplural} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentrysymbolplural
  \gcmd{Gls\-entry\-symbol\-plural}
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{symbolplural} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuseri
  \gcmd{gls\-entry\-useri}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user1} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user1} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuseri
  \gcmd{Gls\-entry\-useri}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user1} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuserii
  \gcmd{gls\-entry\-user\-ii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user2} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user2} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuserii
  \gcmd{Gls\-entry\-user\-ii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user2} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuseriii
  \gcmd{gls\-entry\-user\-iii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user3} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user3} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuseriii
  \gcmd{Gls\-entry\-user\-iii}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user3} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuseriv
  \gcmd{gls\-entry\-user\-iv}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user4} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user4} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuseriv
  \gcmd{Gls\-entry\-user\-iv}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user4} \idx{field} with \idx{sentencecase} applied.
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuserv
  \gcmd{gls\-entry\-user\-v}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user5} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user5} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuserv
  \gcmd{Gls\-entry\-user\-v}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user5} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glsentryuservi
  \gcmd{gls\-entry\-user\-vi}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{simply expands to the value of the \gloskey{user6} \idx{field}.
     Does nothing if the entry hasn't been defined. May be used in
     expandable contexts provided that the \gloskey{user6} \idx{field} doesn't
     contain any fragile commands}
  }
  % \Glsentryuservi
  \gcmd{Gls\-entry\-user\-vi}
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{entry-label}}
    \desc{partially robust command that displays the value of the
     \gloskey{user6} \idx{field} with \idx{sentencecase} applied. 
     As from \sty{glossaries} v4.50, this command
     can expand in \idxpl{PDFbookmark}. Outside of \idxpl{PDFbookmark} it will
     expand to a robust internal command}
  }
  % \glossentryname
  \gcmd{gloss\-entry\-name}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{used within \idxpl{glossarystyle} to display the name
    encapsulated with \gls{glsnamefont}}
  }
  % \Glossentryname
  \gcmd{Gloss\-entry\-name}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glossentryname} but \idx{sentencecase}}
  }
  % \glossentrydesc
  \gcmd{gloss\-entry\-desc}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{used within \idxpl{glossarystyle} to display the description}
  }
  % \Glossentrydesc
  \gcmd{Gloss\-entry\-desc}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glossentrydesc} but \idx{sentencecase}}
  }
  % \glossentrysymbol
  \gcmd{gloss\-entry\-symbol}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{used within \idxpl{glossarystyle} to display the symbol}
  }
  % \Glossentrysymbol
  \gcmd{Gloss\-entry\-symbol}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glossentrysymbol} but \idx{sentencecase}}
  }
  % COMMANDS: AUX
  % \@newglossary
  \gcmd{@new\-glossary}
  {
    \syntax{\margm{glossary-label}\margm{log}\margm{out-ext}\margm{in-ext}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The arguments indicate the file extensions associated with the given
    glossary}
  }
  % \glsxtr@makeglossaries
  \gcmd{gls\-xtr\-@\-make\-glos\-saries}
  {
    \providedby{\sty{glossaries-extra} v1.09+}
    \syntax{\margm{label-list}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}}
  }
  % \@istfilename
  \gcmd{@ist\-file\-name}
  {
    \syntax{\margm{filename}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{filename} is the name of the style file}
  }
  % \@glsorder
  \gcmd{@gls\-order}
  {
    \syntax{\margm{order}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{order} should be either \code{letter} or \code{word}}
  }
  % \@xdylanguage
  \gcmd{@xdy\-language}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{glossary-label}\margm{language}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{language} is the language to pass to \app{xindy} for the
    given glossary}
  }
  % \@gls@codepage
  \gcmd{@gls\-@\-code\-page}
  {
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{code-page}}
    \desc{this command is written to the \ext{aux} file for the
    benefit of \app{makeglossaries} and \app{makeglossaries-lite}.
    The \meta{code-page} indicates the \app{xindy} \idx{codepage}}
  }
  % \@gls@reference
  \gcmd{@gls@reference}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{type}\margm{label}\margm{location}}
    \desc{this command is written to the \ext{aux} file to provide
    the information for \gls{printnoidxglossary}}
  }
  % \glsxtr@resource
  \gcmd{glsxtr@resource}
  {
    \providedby{\sty{glossaries-extra} v1.08+}
    \syntax{\margm{options}\margm{basename}}
    \desc{this command is written to the \ext{aux} file to provide
    the resource options for \app{bib2gls}}
  }
  % \glsxtr@record
  \gcmd{glsxtr@record}
  {
    \providedby{\sty{glossaries-extra} v1.08+}
    \syntax{\margm{label}\margm{h-prefix}\margm{counter}\margm{format}\margm{loc}}
    \desc{this command is written to the \ext{aux} file to provide
    the indexing information for \app{bib2gls}}
  }
  % \glsxtr@record@nameref
  \gcmd{glsxtr@record@nameref}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{label}\margm{href prefix}\margm{counter}\margm{format}\margm{location}\margm{title}\margm{href anchor}\margm{href value}}
    \desc{this command is written to the \ext{aux} file to provide
    the indexing information for \app{bib2gls} when the
    \optval{record}{nameref} option is used}
  }
  % \glsxtr@recordsee
  \gcmd{glsxtr@recordsee}
  {
    \providedby{\sty{glossaries-extra} v1.14+}
    \syntax{\margm{label}\margm{xr list}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{glssee} information for \app{bib2gls}}
  }
  % \@glsxtr@newglslike
  \gcmd{@glsxtr@newglslike}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{label-prefix}\margm{cs}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{glsxtrnewglslike} information for \app{bib2gls}}
  }
  % \@glsxtr@altmodifier
  \gcmd{@glsxtr@altmodifier}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{character}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{GlsXtrSetAltModifier} information for \app{bib2gls}}
  }
  % \@glsxtr@prefixlabellist
  \gcmd{@glsxtr@prefixlabellist}
  {
    \providedby{\sty{glossaries-extra} v1.37+}
    \syntax{\margm{list}}
    \desc{this command is written to the \ext{aux} file to provide
    the \gls{dgls} information for \app{bib2gls}}
  }
  % \glsxtr@texencoding
  \gcmd{gls\-xtr\-@\-tex\-encoding}
  {
    \providedby{\sty{glossaries-extra} v1.11+}
    \syntax{\margm{encoding}}
    \desc{this command is written to the \ext{aux} file to provide
    the file \idx{encoding} information for \app{bib2gls}}
  }
  % \glsdefs@newdocentry (.glsdefs file)
  \gcmd{glsdefs@newdocentry}
  {
    \providedby{\sty{glossaries-extra} v4.47+}
    \syntax{\margm{entry-label}\marg{\keyvallist}}
    \desc{this command is written to the \ext+{glsdefs} file to
    define the given \idx{entry} using the definition provided in the
    \env+{document} environment on the previous \LaTeX\ run}
  }
  % COMMANDS: GLOSSARIES
  % \newglossary
  \gcmd{new\-glos\-sary}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{log-ext}\margm{glossary-label}\margm{in-ext}\margm{out-ext}\margm{title}\oargm{counter}}
    \desc{defines a \idx{glossary} identified by \meta{glossary-label} (which can    
    be referenced by the \gloskey{type} key when defining an entry).
    The \meta{title} will be used when displaying the \idx{glossary}
    (using commands like \gls{printglossary}), but this title can be
    overridden by the \printglossopt{title} option. The optional
    \meta{counter} indicates which \idxc{locationcounter}{counter} should be used by default
    for the \location\ when \idx{indexing} any entries that have been assigned to this
    \idx{glossary}. (This can be overridden by the \glsopt{counter}
    option.) The other arguments are file extensions for use with
    \app{makeindex} or \app{xindy}. These arguments aren't relevant
    for other \idx{indexing} options (in which case, you may prefer to use
    \gls{newglossary*})}
  }
  % \newglossary*
  \gcmd{new\-glos\-sary*}%
  {%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{glossary-label}\margm{title}\oargm{counter}}
    \desc{a shortcut that supplies file extensions based on the
    \idx{glossary} label:\begin{compactcodebox}%
\gls{newglossary}\oarg{\meta{glossary-label}-glg}\margm{glossary-label}\marg{\meta{glossary-label}-gls}\margm{\meta{glossary-label}-glo}\margm{title}\oargm{counter}%
\end{compactcodebox}\glsxtrnopostpunc
}
  }
  % \altnewglossary
  \gcmd{alt\-new\-glos\-sary}%
  {%
    \providedby{\sty{glossaries} v2.06+}
    \syntax{\margm{glossary-label}\margm{tag}\margm{title}\oargm{counter}}
    \desc{a shortcut that supplies file extensions based on the
    \meta{tag} argument:\begin{compactcodebox}%
\gls{newglossary}\oarg{\meta{tag}-glg}\margm{tag}\marg{\meta{tag}-gls}\margm{\meta{tag}-glo}\margm{title}\oargm{counter}%
\end{compactcodebox}\glsxtrnopostpunc
}
  }
  % \newignoredglossary
  \gcmd{new\-ignored\-glos\-sary}%
  {%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{glossary-label}}
    \desc{defines a \idx{glossary} that should be ignored by iterative
     commands, such as \gls{printglossaries}. This \idx{glossary} has no
     associated \idxpl{indexingfile} and has \idxpl{hyperlink} disabled. You can
     use an \idx+{ignoredglossary} for common terms or \idxpl{acronym} 
     or \idxpl{abbreviation} that don't need to be included in any listing 
     (but you may want these terms defined
     as entries to allow automated formatting with the \gls{glslike}
     commands). An \idx{ignoredglossary} can't be displayed with
     \gls{printglossary} but may be displayed with the \idx{unsrtfam}, such as
     \gls{printunsrtglossary}. The \sty{glossaries-extra} package
     provides a starred form of this command}
  }
  % \provideignoredglossary
  \gxtrcmds{provide\-ignored\-glos\-sary}
  {
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\margm{glossary-label}}
    \desc{as \gls{newignoredglossary} but does nothing if the
    \idx{glossary} has already been defined}
  }
  % \glossarypostamble
  \gcmd{glossary\-postamble}%
  {%
    \providedby{\sty{glossaries}}
    \desc{used at the end of the \idx{glossary}}
  }
  % \glossarypreamble
  \gcmd{glossary\-preamble}%
  {%
    \providedby{\sty{glossaries}}
    \desc{used at the start of the \idx{glossary}. This will be
    locally redefined to the \idx{preamble/glossary} associated with 
    the current glossary, if one has been set}
    \field{seealso}{setglossarypreamble}
  }
  % \setglossarypreamble
  \gcmd{set\-glossary\-preamble}%
  {%
    \providedby{\sty{glossaries} v3.07+}
    \syntax{\oargm{type}\margm{text}}
    \desc{globally sets the \idx{preamble/glossary} for the \idx{glossary} identified by
    \meta{type} to \meta{text}. If \meta{type} is omitted,
    \gls{glsdefaulttype} is assumed}
  }
  % \apptoglossarypreamble
  \gxtrcmd{app\-to\-glossary\-preamble}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\oargm{type}\margm{text}}
    \desc{locally appends \meta{text} to the \idx{preamble/glossary} for the 
     \idx{glossary} identified by \meta{type}. If \meta{type} is omitted, 
    \gls{glsdefaulttype} is assumed}
  }
  % \pretoglossarypreamble
  \gxtrcmd{pre\-to\-glossary\-preamble}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\oargm{type}\margm{text}}
    \desc{locally prepends \meta{text} to the \idx{preamble/glossary} 
    for the \idx{glossary} identified by \meta{type}. If \meta{type} is omitted,
    \gls{glsdefaulttype} is assumed}
  }
  % \print<...>glossary
  \gcmd{print...glossary}{
    \common
    \name{\csmetafmt{print}{\protect\ldots}{glossary}}
    \field{see}{printglossary,printnoidxglossary,printunsrtglossary,printunsrtinnerglossary}
  }
  % \printglossaries
  \gcmd{print\-glos\-saries}%
  {%
    \providedby{\sty{glossaries}}
    \desc{iterates over all non-\idxpl{ignoredglossary} and does
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\meta{type}}}}
     for each \idx{glossary}}
  }
  % \printnoidxglossaries
  \gcmd{print\-no\-idx\-glos\-saries}%
  {%
    \providedby{\sty{glossaries} v4.04+}
    \desc{iterates over all non-\idxpl{ignoredglossary} and does
     \code{\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\meta{type}}}}
     for each \idx{glossary}}
  }
  % \printunsrtglossaries
  \gxtrcmd{print\-un\-srt\-glos\-saries}%
  {%
    \providedby{\sty{glossaries-extra} v1.08+}
    \desc{iterates over all non-\idxpl{ignoredglossary} and does
     \code{\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\meta{type}}}}
     for each \idx{glossary}}
  }
  % \printunsrtglossaryentryprocesshook
  \gxtrcmd{print\-un\-srt\-glos\-sary\-en\-try\-pro\-cess\-hook}%
  {%
    \providedby{\sty{glossaries-extra} v1.21+}
    \syntax{\margm{entry-label}}
    \desc{hook used within \gls{printunsrtglossary} while the
\idx{glossary} content is being constructed}
  }
  % \printunsrtinnerglossary
  \gxtrcmd{print\-unsrt\-inner\-glos\-sary}%
  {%
    \providedby{\sty{glossaries-extra} v1.44+}
    \syntax{\oargm{options}\margm{pre-code}\margm{post-code}}
    \desc{similar to \gls{printunsrtglossary} but doesn't contain
     the code that starts and ends the \idx{glossary} (such as
     beginning and ending the \env{theglossary} environment). See
   the \sty{glossaries-extra} manual for further details}
  }%
  % \printglossary
  \gcmd{print\-glos\-sary}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\oargm{options}}
    \desc{displays the \idx{glossary} by inputting a file created by
     \app+{makeindex} or \app+{xindy}. Must be used with
     \gls{makeglossaries} and either \app{makeindex} or \app{xindy}}
  }%
  % \printacronyms
  \gcmd{print\-acronyms}%
  {%
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\oargm{options}}
    \note{requires the \opt{acronyms} package option}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}}}
  }%
  % \printsymbols
  \gcmd{print\-symbols}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\oargm{options}}
    \note{requires the \opt{symbols} package option}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{symbols}}}}}
  }%
  % \printnumbers
  \gcmd{print\-numbers}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \syntax{\oargm{options}}
    \note{requires the \opt{numbers} package option}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{numbers}}}}
  }%
  % \printindex
  \gcmd{print\-index}%
  {%
    \syntax{\oargm{options} v4.02+}
    \note{requires  the \opt{index} package option}
    \desc{shortcut provided by the \opt{index} package option that simply does
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{index}}}}
  }%
  % \printnoidxglossary
  \gcmd{print\-no\-idx\-glos\-sary}%
  {%
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\oargm{options}}
    \desc{displays the \idx{glossary} by obtaining the \idx{indexing} information from
     the \ext+{aux} file and using \TeX\ to sort and collate. Must be used with
     \gls{makenoidxglossaries} or with the \idxpl{glossary} not identified
     in the optional argument of \gls{makeglossaries} when using the
     hybrid method. This method can be very slow and has limitations}
  }%
  % \GlsNoIdxMissingAction
  \gcmd{Gls\-No\-Idx\-Missing\-Action}
  {%
    \providedby{\sty{glossaries} v4.59+}
    \syntax{\margm{glossary-type}}
    \desc{used by \gls{printnoidxglossary} if there are no entries
to list}
  }%
  % \GlsNoIdxDoRerunCheck
  \gcmd{Gls\-No\-Idx\-Do\-Re\-run\-Check}
  {
    \providedby{\sty{glossaries} v4.59+}
    \desc{added to the end document hook by
\gls{makenoidxglossaries}, this command iterates through the list of 
all entries that have been indexed using the \qt{noidx} method
and the list of all entries have been displayed with
\gls{printnoidxglossary} to determine if a new entry has been added
or if an old entry has been removed in order to give a rerun warning}
  }
  % \printunsrtglossary
  \gxtrcmd{print\-unsrt\-glossary}%
  {%
    \providedby{\sty{glossaries-extra} v1.08+}
    \syntax{\oargm{options}}
    \desc{displays the \idx{glossary} by iterating over all entries
     associated with the given \idx{glossary} (in the order in which they
     were added to the \idx{glossary}). \Idx{group} headers will only be
     inserted if the \gloskey{group} key has been defined and has
     been set (typically with the \opt{record} option and
     \app{bib2gls}). \Idxpl{locationlist} will only be shown if the
     \gloskey{location} or \glosfield{loclist} fields have been set
     (typically by \app{bib2gls})}
  }%
  % \printunsrtacronyms
  \gxtrcmd{print\-unsrt\-acronyms}%
  {%
    \providedby{\sty{glossaries-extra-bib2gls} v1.40+}
    \syntax{\oargm{options}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{acronyms},\opt{record}}\marg{glossaries-extra}}}
    \desc{shortcut for
     \code{\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}}}
  }%
  % \printabbreviations
  \gxtrcmd{print\-ab\-bre\-vi\-a\-tions}%
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\oargm{options}}
    \note{requires \code{\csfmt{usepackage}\oarg{\opt{abbreviations}}\marg{glossaries-extra}}}
    \desc{shortcut for
     \code{\gls{printglossary}\oarg{\printglossoptval{type}{\gls{glsxtrabbrvtype}}}}}
  }%
  % \glossarysection
  \gcmd{glossary\-section}
  {
     \syntax{\oargm{toc title}\margm{title}}
     \desc{used to display the glossary heading}
  }
  % \currentglossary
  \gcmd{current\-glossary}
  {
    \providedby{\sty{glossaries} v3.0+}
    \desc{defined by the \gls{print...glossary} commands to
      the current \idx{glossary} label}
  }
  % \glsdefaulttype
  \gcmd{gls\-default\-type}%
  {%
    \providedby{\sty{glossaries}}
    \initval{main}%
    \desc{expands to the label of the default \idx{glossary}, which is
    normally \code{main} but if \opt{nomain} is used, it will be the
    label of the first \idx{glossary} to be defined}
  }%
  % \glscurrententrylabel
  \gcmd{gls\-current\-entry\-label}
  {
    \providedby{\sty{glossaries} v3.02+}
    \desc{assigned at the start of each \idx{entry} item within the
      \idx{glossary}. This command may be used by \idx{glossary} hooks, such
      as \gls{glspostdescription}, to reference the current entry}
  }
  % \glsnoidxprenumberlist
  \gcmd{gls\-no\-idx\-pre\-number\-list}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{entry-label}}
    \desc{used before the \idx{numberlist} for \option{noidx}.
     By default it expands to the value of the
     \glosfield{prenumberlist} internal field, if set}
  }
  % \glsnoidxprecontenthook
  \gcmd{gls\-no\-idx\-pre\-content\-hook}
  {
    \providedby{\sty{glossaries} v4.57+}
    \desc{hook used in \gls{printnoidxglossary} just before the
constructed token list is used}
  }
  % \glsnoidxinithook
  \gcmd{gls\-no\-idx\-init\-hook}
  {
    \providedby{\sty{glossaries} v4.59+}
    \desc{hook used in \gls{printnoidxglossary} just before the
internal token list is constructed (after the list has been sorted)}
  }
  % \glsnoidxitemhook
  \gcmd{gls\-no\-idx\-item\-hook}
  {
    \providedby{\sty{glossaries} v4.59+}
    \syntax{\margm{level}\margm{entry-label}}
    \desc{hook used in \gls{printnoidxglossary} at the start of each
iteration of the loop that adds an item to the internal
token list}
  }
  % \glossaries_adjust_parent_sort:Nn
  \gcmd{glos\-saries\dsb adjust\dsb parent\dsb sort:Nn}
  {
    \providedby{\sty{glossaries} v4.59+}
    \syntax{\ \meta{tl-var} \margm{parent-label}}
    \desc{used by the pre-sort processing function to adjust the
sort value of parent entries to help ensure that they are
immediately followed by their child entries}
  }
  % \glossaryentrynumbers
  \gcmd{glossary\-entry\-numbers}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{locations}}
    \desc{encapsulations the \idx{numberlist} in the \idx{glossary}
     and is also used to save the \idx{numberlist} with the
     \opt{savenumberlist} option.
     This command is redefined by options such as \opt{nonumberlist}
     or commands like \gls{glsnonextpages}}
  }
  % \glsresetentrylist
  \gcmd{gls\-re\-set\-entry\-list}
  {
    \providedby{\sty{glossaries}}
    \desc{resets \gls{glossaryentrynumbers}}
  }
  % \glsnonextpages
  \gcmd{gls\-no\-next\-pages}
  {
    \providedby{\sty{glossaries}}
    \desc{does nothing outside of \gls{print...glossary}. Within the
     \idx{glossary}, this redefines \gls{glossaryentrynumbers} to
     ignore its argument and then reset itself}
  }
  % \glsnextpages
  \gcmd{gls\-next\-pages}
  {
    \providedby{\sty{glossaries}}
    \desc{does nothing outside of \gls{print...glossary}. Within the
     \idx{glossary}, this redefines \gls{glossaryentrynumbers} to
     do its argument and then reset itself}
  }
  % COMMANDS: GLOSSARY STYLES
  % \setglossarystyle
  \gcmd{set\-glossary\-style}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{style-name}}
    \desc{sets the default \idx{glossarystyle} to \meta{style-name}}
  }
  % \glossarystyle
  \gcmd{glossary\-style}
  {
    \deprecated
    \providedby{\sty{glossaries} v1.0--v4.49}
    \syntax{\margm{style-name}}
    \desc{sets the default \idx{glossarystyle} to \meta{style-name}.
     Deprecated in v3.08a and removed in v4.50. Now only available with
     rollback. Use \gls{setglossarystyle} instead}
  }
  % \newglossarystyle
  \gcmd{new\-glossary\-style}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{style-name}\margm{definitions}}
    \desc{defines a new \idx{glossarystyle} called \meta{style-name}}
  }
  % \renewglossarystyle
  \gcmd{re\-new\-glossary\-style}
  {
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\margm{style-name}\margm{definitions}}
    \desc{redefines the \idx{glossarystyle} called \meta{style-name}}
  }
  % \glossaryheader
  \gcmd{glossaryheader}
  {
    \providedby{\sty{glossaries}}
    \desc{does the header code after \code{\cbeg{\env{theglossary}}}}
    \note{\idx{glossarystyle} command}
  }
  % \glsgroupheading
  \gcmd{gls\-group\-heading}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{group-label}}
    \desc{redefined by \idxpl{glossarystyle} to show, if applicable, the title
    associated with the \idx{lettergroup} identified by \meta{group-label}}
    \note{\idx{glossarystyle} command}
  }
  % \glssubgroupheading
  \gxtrcmd{gls\-sub\-group\-head\-ing}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{previous level}\margm{level}\margm{parent-label}\margm{group-label}}
    \desc{used to format sub-\idx{group} headings}
    \note{\idx{glossarystyle} command}
  }
  % \glsgroupskip
  \gcmd{gls\-group\-skip}
  {
     \desc{redefined by \idxpl{glossarystyle} to produce a vertical
     gap between \idxpl{lettergroup}, if applicable}
    \note{\idx{glossarystyle} command}
  }
  % \glossentry
  \gcmd{gloss\-entry}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{entry-label}\margm{number-list}}
    \desc{redefined by the \idxpl{glossarystyle} to display
    \toplevel\ entries}
    \note{\idx{glossarystyle} command}
  }
  % \subglossentry
  \gcmd{sub\-gloss\-entry}
  {
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\margm{level}\margm{entry-label}\margm{number-list}}
    \desc{redefined by the \idxpl{glossarystyle} to display
    child entries}
    \note{\idx{glossarystyle} command}
  }
  % \glsnamefont
  \gcmd{gls\-name\-font}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{used by \gls{glossentryname} to apply a font change to the
    \gloskey{name}}
  }
  % \glspostdescription
  \gcmd{gls\-post\-de\-scrip\-tion}%
  {%
     \providedby{\sty{glossaries}}
     \desc{a hook that is usually placed after the description in
      \idxpl{glossarystyle}. Some of the styles provided with the
      \sty{glossaries} package don't use this hook. The
      \sty{glossaries-extra-stylemods} redefines those styles to
      include the hook. The default definition of this command
      tests for the \opt{nopostdot} option, but the \opt{postpunc}
      option redefines the command to implement the chosen punctuation}
  }
  % \glstarget
  \gcmd{gls\-target}% 
  {%
    \providedby{\sty{glossaries} v1.18+}
     \syntax{\margm{entry-label}\margm{text}}
     \desc{used by \idxpl{glossarystyle} to create a hypertarget (if enabled) for 
      the \idx{entry} (identified by \meta{entry-label}). The \meta{text} is usually
      \gls{glossentryname}\margm{entry-label}, but it can be something
      else}
  }
  % \glolinkprefix
  \gcmd{glolinkprefix}
  {
    \initval{glo:}
    \desc{expands to the prefix used for entry targets}
  }
  % \glsdescwidth
  \gcmd{gls\-desc\-width}
  {
    \providedby{\sty{glossary-long} \& \sty{glossary-super}}
    \desc{a length register used to set the width of the description
     column for \env{tabular}-like styles}
  }
  % \glspagelistwidth
  \gcmd{gls\-page\-list\-width}
  {
    \providedby{\sty{glossary-long} \& \sty{glossary-super}}
    \desc{a length register used to set the width of the
    \idx{locationlist} column for \env{tabular}-like styles}
  }
  % \glsgetgrouptitle
  \gcmd{gls\-get\-group\-title}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{group-label}}
    \desc{robust command that determines the title associated with \meta{group-label}
     and displays it}
    \field{seealso}{glsxtrsetgrouptitle}
  }
  % \glsxtrsetgrouptitle
  \gxtrcmd{gls\-xtr\-set\-group\-title}
  {
    \providedby{\sty{glossaries-extra} v1.14+}
    \syntax{\margm{group-label}\margm{group-title}}
    \desc{globally assigns the given title \meta{group-title} to the
    \idx{group} identified by \meta{group-label}}
  }
  % \glsxtrlocalsetgrouptitle
  \gxtrcmd{gls\-xtr\-local\-set\-group\-title}
  {
    \providedby{\sty{glossaries-extra} v1.24+}
    \syntax{\margm{group-label}\margm{group-title}}
    \desc{locally assigns the given title \meta{group-title} to the
    \idx{group} identified by \meta{group-label}}
  }
  % \glsxtrgetgrouptitle
  \gxtrcmd{gls\-xtr\-get\-group\-title}
  {
    \providedby{\sty{glossaries-extra} v1.14+}
    \syntax{\margm{group-label}\margm{cs}}
    \desc{obtains the title corresponding to the \idx{group}
    identified by \meta{group-label} and stores the result in the
    control sequence \meta{cs}} 
  }
  % \glsxtrhiername
  \gxtrcmd{gls\-xtr\-hier\-name}
  {
     \providedby{\sty{glossaries-extra} v1.37+}
     \syntax{\margm{entry-label}}
     \desc{displays the entry's hierarchical name}
  }
  % COMMANDS: hyperlinks
  % \glsdohypertarget
  \gcmd{gls\-do\-hyper\-target}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{target}\margm{text}}
    \desc{creates a hypertarget, and includes the debugging
     information if \opteqvalref{debug}{showtargets}. This uses \gls{hypertarget}
     but measures the height of \meta{text} so that the target can
     be placed at the top of \meta{text} instead of along the baseline}
     \field{seealso}{glsdohyperlink,glsdohypertargethook}
  }
  % \glsdohypertargethook
  \gcmd{gls\-do\-hyper\-target\-hook}
  {
    \providedby{\sty{glossaries} v4.54+}
    \syntax{\margm{target}\margm{text}}
    \desc{hook used by \gls{glsdohypertarget}. Does nothing by default}
  }
  % \glslabelhypertarget
  \gcmd{gls\-label\-hyper\-target}
  {
    \providedby{\sty{glossaries} v4.54+}
    \syntax{\margm{target}\margm{text}}
    \desc{may be used in the definition of \gls{glsdohypertargethook}
    to simulate a label corresponding to the target where the label is
    given by \code{\gls{glslabelhypertargetprefix}\meta{target}}}
  }
  % \glslabelhypertargetprefix
  \gcmd{gls\-label\-hyper\-target\-prefix}
  {
    \initvalempty
    \providedby{\sty{glossaries} v4.54+}
    \desc{expands to the prefix used for the label created by
     \gls{glslabelhypertarget}}
  }
  % \glslabelhypertargetdefs
  \gcmd{gls\-label\-hyper\-target\-defs}
  {
    \providedby{\sty{glossaries} v4.54+}
    \desc{hook used by \gls{glslabelhypertarget} to locally redefine
    problematic commands}
  }
  % \glslabelhypertargetvalue
  \gcmd{gls\-label\-hyper\-target\-value}
  {
    \providedby{\sty{glossaries} v4.54+}
    \desc{expands to the value part of the label created by
     \gls{glslabelhypertarget}}
  }
  % \glsdohyperlink
  \gcmd{gls\-do\-hyper\-link}
  {
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\margm{target}\margm{text}}
    \desc{creates a hyperlink to the given target using
    \gls{hyperlink}, and includes the debugging
     information if \opteqvalref{debug}{showtargets}}
    \field{seealso}{glsdohypertarget,glsdonohyperlink,glsdohyperlinkhook}
  }
  % \glsdohyperlinkhook
  \gcmd{gls\-do\-hyper\-link\-hook}
  {
    \providedby{\sty{glossaries} v4.54+}
    \syntax{\margm{target}\margm{text}}
    \desc{hook used by \gls{glsdohyperlink}. Does nothing by default}
  }
  % \glsdonohyperlink
  \gcmd{gls\-do\-no\-hyper\-link}
  {
    \providedby{\sty{glossaries} v4.20+}
    \syntax{\margm{target}\margm{text}}
    \desc{used instead of \gls{glsdohyperlink} when
    \idxpl{hyperlink} are disabled. This simply expands to \meta{text}}
  }
  % \glstexorpdfstring
  \gcmd{gls\-tex\-or\-pdf\-string}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{\TeX}\margm{PDF}}
    \desc{if \sty{hyperref} has been loaded, this uses
    \gls{texorpdfstring} otherwise it just expands to \meta{\TeX}}
  }
  % COMMANDS: hypernav
  % \glsnavhyperlink
  \gcmd{gls\-nav\-hyper\-link}
  {
    \providedby{\sty{glossary-hypernav}}
    \syntax{\oargm{glossary-label}\margm{group-label}\margm{group-title}}
    \desc{creates a hyperlink to the given \idx{group}, where the
    target name is obtained from \gls{glsnavhyperlinkname}}
  }
  % \glsnavhyperlinkname
  \gcmd{gls\-nav\-hyper\-link\-name}
  {
    \providedby{\sty{glossary-hypernav} v4.29+}
    \syntax{\oargm{glossary-label}\margm{group-label}}
    \desc{expands to the anchor for the given \idx{group}}
  }
  % \glsnavhypertarget
  \gcmd{gls\-nav\-hyper\-target}
  {
    \providedby{\sty{glossary-hypernav}}
    \syntax{\oargm{glossary-label}\margm{group-label}\margm{group-title}}
    \desc{used to create a hyper target for a \idx{group} in order
    to support styles that have navigation links to glossary
    \idxpl{group}. Note that if you only want to change the way that
    the target is created, redefine \gls{glsnavhypergroupdotarget}
    instead}
  }
  % \glsnavhypergroupdotarget
  \gcmd{gls\-nav\-hyper\-group\-do\-target}
  {
    \providedby{\sty{glossary-hypernav} v4.53+}
    \syntax{\margm{glossary-label}\margm{group-label}\margm{group-title}}
    \desc{used by \gls{glsnavhypertarget} to create the hypertarget
for the given group}
  }
  % \glsnavigationitem
  \gcmd{gls\-navigation\-item}
  {
    \providedby{\sty{glossary-hypernav} v4.53+}
    \syntax{\margm{group-label}}
    \desc{used by \gls{glsnavigation} to create the hyperlink
for the given group (with the title corresponding to the group label)}
  }
  % \glsnavigation
  \gcmd{gls\-navigation}
  {
    \providedby{\sty{glossary-hypernav}}
    \desc{displays a simple glossary \idx{group} navigation line
      with the items separated by \gls{glshypernavsep}}
  }
  % \glshypernavsep
  \gcmd{gls\-hyper\-nav\-sep}
  {
    \providedby{\sty{glossary-hypernav}}
    \desc{used as a separator by \gls{glsnavigation}}
  }
  % \glssymbolnav
  \gcmd{gls\-symbol\-nav}
  {
    \providedby{\sty{glossary-hypernav}}
    \desc{produces a simple navigation set of links for just the 
     symbols and number groups separated by \gls{glshypernavsep}}
  }
  % COMMANDS: tree
  % \glstreepredesc
  \gcmd{gls\-tree\-pre\-desc}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{space inserted before top-level descriptions}
  }
  % \glstreechildpredesc
  \gcmd{gls\-tree\-child\-pre\-desc}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{space inserted before child descriptions}
  }
  % \glstreenamefmt
  \gcmd{gls\-tree\-name\-fmt}
  {
    \providedby{\sty{glossary-tree} v4.08+}
    \syntax{\margm{text}}
    \desc{used to format the name for the \glostyle{tree} and
     \glostyle{index} styles}
  }
  % \glstreegroupheaderfmt
  \gcmd{gls\-tree\-group\-header\-fmt}
  {
    \providedby{\sty{glossary-tree} v4.22+}
    \syntax{\margm{text}}
    \desc{used to format the \idx{group} title for the \glostyle{treegroup} and
     \glostyle{indexgroup} styles}
  }
  % \glstreenavigationfmt
  \gcmd{gls\-tree\-navigation\-fmt}
  {
    \providedby{\sty{glossary-tree} v4.22+}
    \syntax{\margm{text}}
    \desc{used to format the navigation element for styles like \glostyle{treehypergroup}}
  }
  % \glstreeitem
  \gcmd{gls\-tree\-item}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{used to indent the top-level entries for the \glostyle{index} styles}
  }
  % \glstreesubitem
  \gcmd{gls\-tree\-sub\-item}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{used to indent the level~1 entries for the \glostyle{index} styles}
  }
  % \glstreesubsubitem
  \gcmd{gls\-tree\-sub\-sub\-item}
  {
    \providedby{\sty{glossary-tree} v4.26+}
    \desc{used to indent the level~2 entries for the \glostyle{index} styles}
  }
  % \glstreeindent
  \gcmd{gls\-tree\-indent}
  {
    \providedby{\sty{glossary-tree}}
    \initval{10pt}
    \desc{length register used by the \glostyle{tree} style}
  }
  % \glssetwidest
  \gcmd{gls\-set\-widest}
  {
    \providedby{\sty{glossary-tree}}
    \syntax{\oargm{level}\margm{name}}
    \desc{indicates that \meta{name} is the widest name for the
      given \idx{hierarchicallevel}}
  }
  % \glsupdatewidest
  \gxtrcmd{gls\-update\-widest}
  {
    \providedby{\sty{glossaries-extra-stylemods} v1.23+}
    \syntax{\oargm{level}\margm{name}}
    \desc{similar to \gls{glssetwidest} but only if \meta{name} is
    wider than the current widest value for the given
    \idx{hierarchicallevel}}
  }
  % \glsfindwidesttoplevelname
  \gcmd{gls\-find\-widest\-top\-level\-name}
  {
    \providedby{\sty{glossary-tree} v4.22+}
    \syntax{\oargm{glossary labels}}
    \desc{finds and sets the widest name for all top-level entries
    in the given \idxpl{glossary}. If the optional argument is
    omitted, the list of all non-\idxpl{ignoredglossary} is assumed}
  }
  % \glstreenamebox
  \gcmd{gls\-tree\-name\-box}
  {
    \providedby{\sty{glossary-tree} v4.19+}
    \syntax{\margm{width}\margm{text}}
    \desc{creates the box for the name with styles like
    \glostyle{alttree}}
  }
  % COMMANDS: mcols
  % \glsmcols
  \gcmd{gls\-m\-cols}
  {
    \providedby{\sty{glossary-mcols} v3.05+}
    \initval{2}
    \desc{expands to the number of columns for the \qt{mcol} styles}
  }
  % COMMANDS: list style
  % \indexspace
  \gcmd{index\-space}
  {
    \desc{provided by various packages, including \sty{glossary-list}
      and \sty{glossary-tree}, this creates a vertical space}
  }
  % \glslistdottedwidth
  \gcmd{gls\-list\-dotted\-width}
  {
    \providedby{\sty{glossary-list}}
    \desc{a length register used by \glostyle{listdotted}}
  }
  % \glslistinit
  \gcmd{gls\-list\-init}
  {%
    \providedby{\sty{glossary-list} v4.48+}
    \desc{used to disable problematic commands at the start the
    \glostyle{list} styles to provide better integration with
    \sty{gettitlestring}}
  }
  % \glslistexpandedname
  \gcmd{gls\-list\-expanded\-name}
  {%
    \providedby{\sty{glossary-list} v4.48+}
    \syntax{\margm{entry-label}}
    \desc{used by \gls{glslistinit} to provide better integration with
    \sty{gettitlestring}}
  }
  % \glslistnavigationitem
  \gcmd{gls\-list\-navigation\-item}
  {
    \providedby{\sty{glossary-list} v4.22+}
    \syntax{\margm{navigation items}}
    \desc{used in styles like \glostyle{listhypergroup} to display
     the navigation line}
  }
  % \glslistgroupheaderfmt
  \gcmd{gls\-list\-group\-header\-fmt}
  {
    \providedby{\sty{glossary-list} v4.22+}
    \syntax{\margm{title}}
    \desc{used to encapsulate the \idx{group} title}
  }
  % COMMANDS: longbooktabs style
  % \glspatchLToutput
  \gcmd{gls\-patch\-LT\-output}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{applies a patch to \env{longtable} to check for instances
    of the group skip occurring at a page break}
  }
  % \glsrestoreLToutput
  \gcmd{glsrestoreLToutput}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{reverses the effect of \gls{glspatchLToutput}}
  }
  % \glsLTpenaltycheck
  \gcmd{gls\-LT\-penalty\-check}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{penalty check used by \gls{glspatchLToutput}}
  }
  % \glspenaltygroupskip
  \gcmd{gls\-penalty\-group\-skip}
  {
    \providedby{\sty{glossary-longbooktabs} v4.21+}
    \desc{the definition of \gls{glsgroupskip} with
     \optval{nogroupskip}{false} for the \sty{glossary-longbooktabs} 
     styles}
  }
  % COMMANDS: inline style
  % \glsinlinenameformat
  \gcmd{gls\-in\-line\-name\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{entry-label}\margm{name}}
    \desc{creates the target for \toplevel\ entries and may be 
     used to adjust the format of the name}
  }
  % \glsinlinesubnameformat
  \gcmd{gls\-in\-line\-sub\-name\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{entry-label}\margm{name}}
    \desc{creates the target for sub entries and may be used to adjust the format of
     the name}
  }
  % \glsinlinedescformat
  \gcmd{gls\-in\-line\-desc\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the description, symbol and \idx{locationlist} for
     top-level entries}
  }
  % \glsinlinesubdescformat
  \gcmd{gls\-in\-line\-sub\-desc\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the description, symbol and \idx{locationlist} for
     child entries}
  }
  % \glspostinline
  \gcmd{gls\-post\-in\-line}
  {%
    \providedby{\sty{glossary-inline} v3.03+}
    \desc{used at the end of the \env{theglossary} environment}
  }
  % \glspostinlinedescformat
  \gcmd{gls\-post\-in\-line\-desc\-format}
  {%
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the top-level entry's description, symbol and \idx{locationlist}}
  }
  % \glsinlineemptydescformat
  \gcmd{gls\-in\-line\-empty\-desc\-format}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{symbol}\margm{location list}}
    \desc{used to format the symbol and \idx{locationlist} when the
    description is suppressed}
  }
  % \glspostinlinesubdescformat
  \gcmd{gls\-post\-in\-line\-sub\-desc\-format}
  {%
    \providedby{\sty{glossary-inline} v3.03+}
    \syntax{\margm{description}\margm{symbol}\margm{location list}}
    \desc{formats the child entry's description, symbol and \idx{locationlist}}
  }
  % \glsinlinedopostchild
  \gcmd{gls\-in\-line\-do\-post\-child}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \desc{hook at the start of \gls{glossentry} that finishes off
     the previous child entry, if the current \toplevel\ entry
     follows a child entry. This command is redefined within
     \gls{glossentry} to use \gls{glsinlinepostchild} after a
     \toplevel\ entry if that entry has any children}
  }
  % \glsinlinepostchild
  \gcmd{gls\-in\-line\-post\-child}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \desc{hook used between a \toplevel\ entry and its first sub-entry}
  }
  % \glsinlineseparator
  \gcmd{gls\-in\-line\-separator}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \initval{;\gls{space}}
    \desc{separator used between \toplevel\ entries}
  }
  % \glsinlinesubseparator
  \gcmd{gls\-in\-line\-sub\-separator}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \initval{,\gls{space}}
    \desc{separator used between sub-entries}
  }
  % \glsinlineparentchildseparator
  \gcmd{gls\-in\-line\-parent\-child\-separator}
  {
    \providedby{\sty{glossary-inline} v3.03+}
    \initval{:\gls{space}}
    \desc{separator used between a \toplevel\ parent and its first child entry}
  }
  % \glsinlineifhaschildren
  \gcmd{gls\-in\-line\-if\-has\-child\-ren}
  {
    \providedby{\sty{glossary-inline} v4.50+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{used to test if the entry has any children}
  }
  % COMMANDS: LOCATIONS
  % \glsdisplaynumberlist
  \gcmd{gls\-display\-number\-list}
  {
     \providedby{\sty{glossaries} v3.02+}
     \syntax{\margm{entry-label}}
     \desc{formats the \idx{locationlist} for the given entry.
     Redefined by \sty{glossaries-extra-bib2gls} to obtain the
     \idx{locationlist} from the \gloskey{location} field}
  }
  % \glsentrynumberlist
  \gcmd{gls\-entry\-number\-list}
  {
     \providedby{\sty{glossaries} v3.02+}
     \syntax{\margm{entry-label}}
     \desc{displays the \idx{locationlist} for the given entry.
     Redefined by \sty{glossaries-extra-bib2gls} to obtain the
     \idx{locationlist} from the \gloskey{location} field}
  }
  % \glsnumlistsep
  \gcmd{gls\-num\-list\-sep}
  {
     \providedby{\sty{glossaries} v3.02+}
     \initval{,\sym{vbsp}}
     \desc{separator used by \gls{glsdisplaynumberlist} between all
     but the last two \locations}
  }
  % \glsnumlistlastsep
  \gcmd{gls\-num\-list\-last\-sep}
  {
     \providedby{\sty{glossaries} v3.02+}
     \initval{\sym{vbsp}\gls{cs.amp}\sym{vbsp}}
     \desc{separator used by \gls{glsdisplaynumberlist} between 
     the last two \locations}
  }
  % \glsnoidxdisplayloc
  \gcmd{gls\-no\-idx\-display\-loc}
  {
     \providedby{\sty{glossaries} v4.04+}
     \syntax{\margm{prefix}\margm{counter}\margm{format}\margm{location}}
     \desc{used to display an individual location within the
     \idx{numberlist} when \gls{printnoidxglossary} formats the
     \idx{numberlist}}
  }
  % \glsnoidxloclist
  \gcmd{gls\-no\-idx\-loc\-list}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{list cs}}
    \desc{displays the \idx{locationlist} by iterating over the
      \glosfield{loclist} field with the \gls{glsnoidxloclisthandler}
      handler}
    \note{\options{noidx,b2g}}
  }
  % \glsnoidxloclisthandler
  \gcmd{gls\-no\-idx\-loc\-list\-handler}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{location}}
    \desc{handler macro used by \gls{glsnoidxloclist}}
    \note{\option{noidx}}
  }
  % \glsnoidxdisplayloclisthandler
  \gcmd{gls\-no\-idx\-display\-loc\-list\-handler}
  {
     \providedby{\sty{glossaries} v4.04+}
     \syntax{\margm{location}}
     \desc{handler macro used by \gls{glsdisplaynumberlist} with
      \option{noidx}}
  }
  % \glsnoidxnumberlistloophandler
  \gcmd{gls\-no\-idx\-number\-list\-loop\-handler}
  {
     \providedby{\sty{glossaries} v4.04+}
     \syntax{\margm{location item}}
     \desc{list loop handler used by \gls{glsnumberlistloop}}
  }
  % \glsxtr<counter>locfmt
  \gxtrcmdmeta{gls\-xtr}{counter}{loc\-fmt}%
  {%
    \syntax{\margm{location}\margm{title}}
    \desc{if defined, used with \optval{record}{name} to format locations
     associated with \meta{counter}}
  }
  % \glsnumberformat
  \gcmd{gls\-number\-format}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{the default \idxc{locationencap}{format} for \idxpl{entrylocation}. If
     \idxpl{hyperlink} are defined, this will use \gls{glshypernumber}
     otherwise it will simply display its argument, which may be a
     single \location, or locations delimited by \gls{delimR} or
     \gls{delimN}}
  }
  % \delimR
  \gcmd{delimR}%
  {%
    \desc{used between the start and end of a \location\ \idx{range}}
  }
  % \delimN
  \gcmd{delimN}%
  {%
    \desc{used as a separator between \locations}
  }
  % \setentrycounter
  \gcmd{set\-entry\-counter}
  {
    \providedby{\sty{glossaries}}
    \syntax{\oargm{prefix}\margm{counter}}
    \desc{sets up the hypertarget prefix and \idx{locationcounter}
     for use with \gls{glshypernumber}}
  }
  % \glsentrycounter
  \gcmd{gls\-entry\-counter}
  {
    \providedby{\sty{glossaries}}
    \initval{\gls{glscounter}}
    \desc{defined by \gls{setentrycounter} to its \meta{counter}
      argument.}
  }
  % \glscounter
  \gcmd{gls\-counter}
  {
    \providedby{\sty{glossaries}}
    \initval{page}
    \desc{the default counter as specified by the \opt{counter} option}
  }
  % \glshypernumber
  \gcmd{gls\-hyper\-number}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{this will encapsulate each \location\ with a \idx{hyperlink}, if
    supported. This may be used as a \idx{locationencap}.
    The argument may be a single location or locations
    delimited by \gls{delimR} or \gls{delimN}. This command should
    not be used outside of \idxpl{locationlist} as it
    requires additional information in order to correctly form the
    \idxpl{hyperlink}}
  }
  % \glsignore
  \gcmd{gls\-ignore}
  {
    \providedby{\sty{glossaries} v4.12+}
    \syntax{\margm{text}}
    \desc{does nothing. When used as a \idx{locationencap}, this
    signifies to \app{bib2gls} that the entry is required but the
    \location\ shouldn't be added to the \idx{locationlist}. With
    other \idx{indexing} methods, this simply creates an invisible
    \location}
  }
  % \hyperrm
  \gcmd{hyper\-rm}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textrm}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textrm}\margm{location(s)}}}
  }
  % \hypersf
  \gcmd{hyper\-sf}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textsf}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textsf}\margm{location(s)}}}
  }
  % \hypertt
  \gcmd{hyper\-tt}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{texttt}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{texttt}\margm{location(s)}}}
  }
  % \hyperbf
  \gcmd{hyper\-bf}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textbf}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textbf}\margm{location(s)}}}
  }
  % \hypermd
  \gcmd{hyper\-md}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textmd}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textmd}\margm{location(s)}}}
  }
  % \hyperit
  \gcmd{hyper\-it}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textit}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textit}\margm{location(s)}}}
  }
  % \hypersl
  \gcmd{hyper\-sl}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textsl}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textsl}\margm{location(s)}}}
  }
  % \hyperup
  \gcmd{hyper\-up}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textup}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textup}\margm{location(s)}}}
  }
  % \hypersc
  \gcmd{hyper\-sc}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{textsc}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{textsc}\margm{location(s)}}}
  }
  % \hyperemph
  \gcmd{hyper\-emph}
  {
    \providedby{\sty{glossaries}}
    \syntax{\margm{location(s)}}
    \desc{if \idxpl{hyperlink} are supported this does
    \code{\cmd{emph}\marg{\gls{glshypernumber}\margm{location(s)}}} otherwise it just
    does \code{\cmd{emph}\margm{location(s)}}}
  }
  % \glsnumberlistloop
  \gcmd{glsnumberlistloop}
  {
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{entry-label}\margm{handler}\margm{xr handler cs}}
    \desc{iterates over the \glosfield{loclist} internal field}
  }
  % COMMANDS: STANDALONE
  % \glsxtrglossentry
  \gcmd{gls\-xtr\-gloss\-entry}
  {
    \providedby{\sty{glossaries-extra} v1.21+}
    \syntax{\margm{entry-label}}
    \desc{used for standalone entries to display the name with
     \gls{glossentryname}, with appropriate hooks}
  } 
  % \Glsxtrglossentry
  \gcmd{Gls\-xtr\-gloss\-entry}
  {
    \providedby{\sty{glossaries-extra} v1.54+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsxtrglossentry} but applies \idx{sentencecase}}
  } 
  % COMMANDS: LANGUAGE
  % \ProvidesGlossariesLang
  \gcmd{Provides\-Glos\-saries\-Lang}%
  {%
     \providedby{\sty{glossaries} v4.12+}
     \syntax{\margm{language}\oargm{version}}
     \desc{used at the start of a \sty{glossaries} language
     definition file (\ext+{ldf}) to declare the file and version
     details}
  }
  % \RequireGlossariesLang
  \gcmd{Require\-Glos\-saries\-Lang}%
  {%
    \providedby{\sty{glossaries} v4.12+}
    \syntax{\margm{language}}
    \desc{indicates that
    the language definition file (\ext{ldf}) corresponding to the given
    language should be loaded, if it hasn't already been loaded}
  }
  % \glsifusedtranslatordict
  \gcmd{gls\-if\-used\-trans\-lator\-dict}
  {
    \providedby{\sty{glossaries} v4.12+}
    \syntax{\margm{Lang}\margm{true}\margm{false}}
    \desc{does \meta{true} if \opteqvalref{translate}{true} and the
    \file{glossaries-dictionary-Lang.dict} file has been loaded,
    otherwise does \meta{false}}
  }
  % \addglossarytocaptions
  \gcmd{add\-glos\-sary\-to\-captions}%
  {%
    \providedby{\sty{glossaries}}
     \syntax{\margm{language}}
     \desc{adds the redefinition of \gls{glossaryname} to
     \gls{captionslanguage} if \sty{translator} has been loaded
      (does nothing if \sty{translator} hasn't been loaded)}
  }
  % \glossaryname
  \gcmd{glossary\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Glossary}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as the default title for \idxpl{glossary} without a
    specified title. May already be defined by a language package}
    \note{language-sensitive}
  }
  % \acronymname
  \gcmd{acronym\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Acronyms}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as the default title for the \idx{glossary} created by
    the \opt{acronyms} option}
    \note{language-sensitive}
  }
  % \entryname
  \gcmd{entry\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Notation}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as a column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \descriptionname
  \gcmd{description\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Description}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as a column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \symbolname
  \gcmd{symbol\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Symbol}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as a column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \pagelistname
  \gcmd{page\-list\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Page List}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. Used as the \idx{pagelist} column header for some of the tabular-like
    \idxpl{glossarystyle}}
    \note{language-sensitive}
  }
  % \glssymbolsgroupname
  \gcmd{gls\-symbols\-group\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Symbols}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. The title associated with the \code{glssymbols} 
    \idx{lettergroup}. Also used as the title for the \idx{glossary} created with
    the \opt{symbols} package option}
    \note{language-sensitive}
  }
  % \glsnumbersgroupname
  \gcmd{gls\-numbers\-group\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{Numbers}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. The title associated with the \code{glsnumbers} 
    \idx{lettergroup}. Also used as the title for the \idx{glossary} created with
    the \opt{numbers} package option}
    \note{language-sensitive}
  }
  % \<group-label>groupname
  \gcmdmeta{}{group-label}{group\-name}{}
  % \abbreviationsname
  \gxtrcmd{abbre\-vi\-a\-tions\-name}%
  {% 
    \initval{Abbreviations}%
    \providedby{\sty{glossaries-extra}}
    \note{language-sensitive}
    \desc{expands to the title of the \glostype{abbreviations} \idx{glossary}.
     The default is \qt{Abbreviations} or \gls{acronymname} if \sty{babel} 
     has been detected}
  }%
  % \glspluralsuffix
  \gcmd{gls\-plural\-suffix}
  {
    \providedby{\sty{glossaries}}
    \initval{s}
    \desc{suffix used to obtain default plurals}
  }
  % \acrpluralsuffix
  \gcmd{acr\-plural\-suffix}
  {
    \providedby{\sty{glossaries} v4.12+}
    \initval{\gls{glsacrpluralsuffix}}
    \desc{suffix used in the default \gloskey{shortplural} value by \gls{newacronym}}
  }
  % \glsacrpluralsuffix
  \gcmd{gls\-acr\-plural\-suffix}
  {
    \providedby{\sty{glossaries} v4.12+}
    \initval{\gls{glspluralsuffix}}
    \desc{short plural suffix, this command is changed by \idxpl{acronymstyle}}
  }
  % \glsupacrpluralsuffix
  \gcmd{gls\-up\-acr\-plural\-suffix}
  {
    \providedby{\sty{glossaries} v4.12+}
    \desc{suffix used to obtain the default \gloskey{shortplural}
    value with the base \idx{smallcaps} \idxpl{acronymstyle}}
  }
  % \seename
  \gcmd{see\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{see}
    \desc{provided by \sty{glossaries} if it hasn't already been
    defined. May already be defined by a language package}
    \note{language-sensitive}
  }
  % \seealsoname
  \gxtrcmd{see\-also\-name}%
  {%
    \providedby{\sty{glossaries-extra} v1.16+}
    \initval{see also}%
    \note{language-sensitive}
    \desc{used as a cross-reference tag. The default value is
    \gls{alsoname}, if that command has been defined, or \qt{see also}}
  }%  
  % \andname
  \gcmd{and\-name}
  {
    \providedby{\sty{glossaries}}
    \initval{\gls{cs.amp}}
    \desc{provided by \sty{glossaries} if it hasn't already been defined}
  }
  % COMMANDS: PREFIXES (glossaries-prefix.sty)
  % \glsprefixsep
  \gcmd{gls\-pre\-fix\-sep}
  {
    \providedby{\sty{glossaries-prefix} v4.45}
    \initvalempty
    \desc{separator between the prefix and the term}
  }
  % \pgls
  \gcmdsp{pgls}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{similar to \gls{gls} but inserts the appropriate prefix,
     if provided}
  }
  % \Pgls
  \gcmdsp{Pgls}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{sentencecase}}
  }
  % \PGLS
  \gcmdsp{PGLS}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{allcaps}}
  }
  % \pglspl
  \gcmdsp{pgls\-pl}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{similar to \gls{glspl} but inserts the appropriate prefix,
     if provided}
  }
  % \Pglspl
  \gcmdsp{Pgls\-pl}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{sentencecase}}
  }
  % \PGLSpl
  \gcmdsp{PGLS\-pl}{%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{pgls} but \idx{allcaps}}
  }
  % \ifglshasprefix
  \gcmd{if\-gls\-has\-prefix}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefix} field is
non-empty}
  }
  % \ifglshasprefixplural
  \gcmd{if\-gls\-has\-prefix\-plural}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefixplural} field is
non-empty}
  }
  % \ifglshasprefixfirst
  \gcmd{if\-gls\-has\-prefix\-first}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefixfirst} field is
non-empty}
  }
  % \ifglshasprefixfirstplural
  \gcmd{if\-gls\-has\-prefix\-first\-plural}
  {
    \providedby{\sty{glossaries-prefix} v4.45+}
    \syntax{\margm{entry-label}\margm{true}\margm{false}}
    \desc{expands to \meta{true} if the \gloskey{prefixfirstplural} field is
non-empty}
  }
  % \glsentryprefix
  \gcmd{gls\-entry\-prefix}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefix} field}
  }
  % \glsentryprefixfirst
  \gcmd{gls\-entry\-prefix\-first}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefixfirst} field}
  }
  % \glsentryprefixplural
  \gcmd{gls\-entry\-prefix\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefixplural} field}
  }
  % \glsentryprefixfirstplural
  \gcmd{gls\-entry\-prefix\-first\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{prefixfirstplural} field}
  }
  % \Glsentryprefix
  \gcmd{Gls\-entry\-prefix}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefix} but \idx{sentencecase}}
  }
  % \Glsentryprefixplural
  \gcmd{Gls\-entry\-prefix\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefixplural} but \idx{sentencecase}}
  }
  % \Glsentryprefixfirst
  \gcmd{Gls\-entry\-prefix\-first}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefixfirst} but \idx{sentencecase}}
  }
  % \Glsentryprefixfirstplural
  \gcmd{Gls\-entry\-prefix\-first\-plural}
  {
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{entry-label}}
    \desc{as \gls{glsentryprefixfirstplural} but \idx{sentencecase}}
  }
  % \pglsxtrshort
  \gxtrcmdsp{pgls\-xtr\-short}{%
    \providedby{\sty{glossaries-extra} v1.49+}
    \note{requires \sty{glossaries-prefix}}
    \syntax{\oargm{options}\margm{entry-label}\oargm{insert}}
    \desc{as \gls{glsxtrshort} but inserts the \gloskey{prefix}
    field and separator in front if set}
  }
  % COMMANDS: ACCESSIBILITY (glossaries-accsupp.sty)
  % \gls<field-label>accsupp
  \gxtrcmdmeta{gls}{field-label}{acc\-supp}%
  {%
    \syntax{\margm{replacement}\margm{content}}
    \desc{if defined, used by \gls{glsfieldaccsupp} for the accessibility support
    for the \idx{internalfieldlabel} given by \meta{field-label}}
  }
  % \glsxtr<category><field>accsupp
  \gxtrcmdmetameta{gls\-xtr}{category}{}{field}{acc\-supp}%
  {%
    \syntax{\margm{replacement}\margm{content}}
    \desc{if defined, used by \gls{glsfieldaccsupp} for the accessibility support
    for the category identified by \meta{category} and the 
    \idx{internalfieldlabel} given by \meta{field}}
  }
  % \glsxtr<category>accsupp
  \gxtrcmdmeta{gls\-xtr}{category}{acc\-supp}%
  {%
    \syntax{\margm{replacement}\margm{content}}
    \desc{if defined, used by \gls{glsfieldaccsupp} for the accessibility support
    for the category identified by \meta{category}}
  }
  % \glsfieldaccsupp
  \gcmd{gls\-field\-acc\-supp}
  { 
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{replacement}\margm{content}\margm{field-label}\margm{entry-label}}
     \desc{if \sty{glossaries-extra} has been loaded, this command
     will first check for the existence of the command 
     \gls{glsxtrcategoryfieldaccsupp}. If that command doesn't
     exist or if \sty{glossaries-extra} hasn't been loaded, it then
     checks for the existence of \csfmt{gls\meta{field}accsupp} (for
     example, \gls{glsshortaccsupp}).
     Failing that it will use \gls{glsaccsupp}. Whichever command is
     found first, \code{\meta{cs}\margm{replacement}\margm{content}}
     is performed.}
  }
  % \glsaccsupp
  \gcmd{gls\-acc\-supp}
  {
     \providedby{\sty{glossaries-accsupp}}
     \syntax{\margm{replacement}\margm{content}}
     \desc{applies \meta{replacement} as the ActualText for
     \meta{content} using \gls{glsaccessibility}}
  }
  % \glsdefaultshortaccess
  \gcmd{gls\-default\-short\-access}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{long}\margm{short}}
     \desc{the default value for the \gloskey{shortaccess} key when
     defining \idxpl{acronym} with \gls{newacronym}}
  }
  % \glsshortaccsupp
  \gcmd{gls\-short\-acc\-supp}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{replacement}\margm{content}}
     \desc{applies \meta{replacement} as the expansion (E) 
     \idxc{accessattr}{attribute} for
     \meta{content} using \gls{glsaccessibility} for the \gloskey{short} field}
  }
  % \glsshortplaccsupp
  \gcmd{gls\-short\-pl\-acc\-supp}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{replacement}\margm{content}}
     \desc{applies \meta{replacement} as the expansion (E) 
      \idxc{accessattr}{attribute} for
     \meta{content} using \gls{glsaccessibility} for the \gloskey{shortplural} field}
  }
  % \glsaccessibility
  \gcmd{gls\-ac\-ces\-si\-bil\-ity}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\oargm{options}\margm{PDF element}\margm{value}\margm{content}}
     \desc{applies \meta{value} as the \idx{accessattr}
     \meta{PDF element} for the given \meta{content}. This
     internally uses the accessibility support provided by \sty{accsupp}}
  }
  % \gls@accsupp@engine
  \gcmd{gls\-@\-acc\-supp\-@\-engine}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \initval{accsupp}
    \desc{expands to the accessibility support engine. This command
    may be defined before \sty{glossaries-accsupp} is loaded}
  }
  % \gls@accessibility
  \gcmd{gls\-@\-ac\-ces\-si\-bil\-ity}
  {
     \providedby{\sty{glossaries-accsupp} v4.45+}
     \syntax{\margm{options}\margm{PDF element}\margm{value}\margm{content}}
     \desc{used by \gls{glsaccessibility} to provide the
      accessibility support}
  }
  % \glsnameaccessdisplay
  \gcmd{gls\-name\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{access} replacement
     text (if set)}
  }
  % \glstextaccessdisplay
  \gcmd{gls\-text\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{textaccess} replacement
     text (if set)}
  }
  % \glspluralaccessdisplay
  \gcmd{gls\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{pluralaccess} replacement
     text (if set)}
  }
  % \glsfirstaccessdisplay
  \gcmd{gls\-first\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{firstaccess} replacement
     text (if set)}
  }
  % \glsfirstpluralaccessdisplay
  \gcmd{gls\-first\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{firstpluralaccess} replacement
     text (if set)}
  }
  % \glssymbolaccessdisplay
  \gcmd{gls\-symbol\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{symbolaccess} replacement
     text (if set)}
  }
  % \glssymbolpluralaccessdisplay
  \gcmd{gls\-symbol\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{symbolpluralaccess} replacement
     text (if set)}
  }
  % \glsdescriptionaccessdisplay
  \gcmd{gls\-description\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{descriptionaccess} replacement
     text (if set)}
  }
  % \glsdescriptionpluralaccessdisplay
  \gcmd{gls\-description\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{descriptionpluralaccess} replacement
     text (if set)}
  }
  % \glsshortaccessdisplay
  \gcmd{gls\-short\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{shortaccess} replacement
     text (if set)}
  }
  % \glsshortpluralaccessdisplay
  \gcmd{gls\-short\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{shortpluralaccess} replacement
     text (if set)}
  }
  % \glslongaccessdisplay
  \gcmd{gls\-long\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{longaccess} replacement
     text (if set)}
  }
  % \glslongpluralaccessdisplay
  \gcmd{gls\-long\-plural\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{longpluralaccess} replacement
     text (if set)}
  }
  % \glsuseriaccessdisplay
  \gcmd{gls\-user\-i\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user1access} replacement
     text (if set)}
  }
  % \glsuseriiaccessdisplay
  \gcmd{gls\-user\-ii\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user2access} replacement
     text (if set)}
  }
  % \glsuseriiiaccessdisplay
  \gcmd{gls\-user\-iii\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user3access} replacement
     text (if set)}
  }
  % \glsuserivaccessdisplay
  \gcmd{gls\-user\-iv\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user4access} replacement
     text (if set)}
  }
  % \glsuservaccessdisplay
  \gcmd{gls\-user\-v\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user5access} replacement
     text (if set)}
  }
  % \glsuserviaccessdisplay
  \gcmd{gls\-user\-vi\-access\-display}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}\margm{entry-label}}
    \desc{does \meta{text} with the \gloskey{user6access} replacement
     text (if set)}
  }
  % \glsentryaccess
  \gcmd{gls\-entry\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{access} field}
  }
  % \glsentrytextaccess
  \gcmd{gls\-entry\-text\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{textaccess} field}
  }
  % \glsentryfirstaccess
  \gcmd{gls\-entry\-first\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{firstaccess} field}
  }
  % \glsentrypluralaccess
  \gcmd{gls\-entry\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{pluralaccess} field}
  }
  % \glsentryfirstpluralaccess
  \gcmd{gls\-entry\-first\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{firstpluralaccess} field}
  }
  % \glsentrysymbolaccess
  \gcmd{gls\-entry\-symbol\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{symbolaccess} field}
  }
  % \glsentrysymbolpluralaccess
  \gcmd{gls\-entry\-symbol\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{symbolpluralaccess} field}
  }
  % \glsentrydescaccess
  \gcmd{gls\-entry\-desc\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \glosfield{descaccess} field}
  }
  % \glsentrydescpluralaccess
  \gcmd{gls\-entry\-desc\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \glosfield{descpluralaccess} field}
  }
  % \glsentryshortaccess
  \gcmd{gls\-entry\-short\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{shortaccess} field}
  }
  % \glsentryshortpluralaccess
  \gcmd{gls\-entry\-short\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{shortpluralaccess} field}
  }
  % \glsentrylongaccess
  \gcmd{gls\-entry\-long\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{longaccess} field}
  }
  % \glsentrylongpluralaccess
  \gcmd{gls\-entry\-long\-plural\-access}
  {
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{longpluralaccess} field}
  }
  % \glsentryuseriaccess
  \gcmd{gls\-entry\-user\-i\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user1access} field}
  }
  % \glsentryuseriiaccess
  \gcmd{gls\-entry\-user\-ii\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user2access} field}
  }
  % \glsentryuseriiiaccess
  \gcmd{gls\-entry\-user\-iii\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user3access} field}
  }
  % \glsentryuserivaccess
  \gcmd{gls\-entry\-user\-iv\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user4access} field}
  }
  % \glsentryuservaccess
  \gcmd{gls\-entry\-user\-v\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user5access} field}
  }
  % \glsentryuserviaccess
  \gcmd{gls\-entry\-user\-vi\-access}
  {
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{entry-label}}
    \desc{expands to the value of the \gloskey{user6access} field}
  }
  % COMMANDS: ACCESSIBILITY - extra
  % \glsaccessname
  \gxtrcmd{gls\-access\-name}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{name} key with the accessibility
     support enabled for that key (\gloskey{access}). If there is no accessibility
     support, this just uses \gls{glsentryname}}
  }
  % \glsaccesslong
  \gxtrcmd{gls\-access\-long}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{long} key with the accessibility
     support enabled for that key (\gloskey{longaccess}). If there is
     no accessibility support, this just uses \gls{glsentrylong}}
  }
  % \Glsaccesslong
  \gxtrcmd{Gls\-access\-long}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{the \idx{sentencecase} version of \gls{glsaccesslong}}
  }
  % \glsaccesslongpl 
  \gxtrcmd{gls\-access\-longpl}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{longplural} key with the accessibility
     support enabled for that key (\gloskey{longpluralaccess}). If there is
     no accessibility support, this just uses \gls{glsentrylongpl}}
  }
  % \Glsaccesslongpl
  \gxtrcmd{Gls\-access\-longpl}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{the \idx{sentencecase} version of \gls{glsaccesslongpl}}
  }
  % \glsaccessshort
  \gxtrcmd{gls\-access\-short}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{short} key with the accessibility
     support enabled for that key (\gloskey{shortaccess}). If there is
     no accessibility support, this just uses \gls{glsentryshort}}
  }
  % \glsaccessshortpl
  \gxtrcmd{gls\-access\-shortpl}
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{if accessibility support was enabled when
     \sty{glossaries-extra} was loaded (\opt{accsupp}) this will
     display the value of the \gloskey{shortplural} key with the accessibility
     support enabled for that key (\gloskey{shortpluralaccess}). If there is
     no accessibility support, this just uses \gls{glsentryshortpl}}
  }
  % COMMANDS: DEBUGGING
  % \glsshowtarget
  \gcmd{gls\-show\-target}%
  {
    \providedby{\sty{glossaries} v4.32+}
    \syntax{\margm{target name}}
    \desc{used with \opteqvalref{debug}{showtargets} to show the target}
  }
  % \glsshowtargetinner
  \gcmd{gls\-show\-target\-inner}%
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{target name}}
    \desc{used by \gls{glsshowtarget} in \idx{mathmode} and inner mode}
  }
  % \glsshowtargetfonttext
  \gcmd{gls\-show\-target\-font\-text}%
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{text}}
    \desc{used by \gls{glsshowtargetinner} to set the font}
  }
  % \glsshowtargetfont
  \gcmd{gls\-show\-target\-font}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \initval{\csfmt{ttfamily}\csfmt{footnotesize}}
    \desc{used by \gls{glsshowtargetfonttext} and 
    \gls{glsshowtargetouter} to set the font}
  }
  % \glsshowtargetouter
  \gcmd{gls\-show\-target\-outer}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{target name}}
    \desc{used by \gls{glsshowtarget} in outer mode}
  }
  % \glsshowtargetsymbol
  \gcmd{gls\-show\-target\-symbol}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{target name}}
    \desc{used by \gls{glsshowtargetouter} to mark the target}
  }
  % \glsshowaccsupp
  \gcmd{gls\-show\-acc\-supp}%
  {
    \providedby{\sty{glossaries} v4.45+}
    \syntax{\margm{options}\margm{PDF element}\margm{value}}
    \desc{used by \gls{glsshowtarget} in outer mode}
  }
  % \showgloparent
  \gcmd{show\-glo\-parent}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{parent} field for the
entry given by \meta{entry-label}}
  }
  % \showglolevel
  \gcmd{show\-glo\-level}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the hierarchical level for the
entry given by \meta{entry-label}}
  }
  % \showglotext
  \gcmd{show\-glo\-text}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{text} field for the
entry given by \meta{entry-label}}
  }
  % \showgloplural
  \gcmd{show\-glo\-plural}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{plural} field for the
entry given by \meta{entry-label}}
  }
  % \showglofirst
  \gcmd{show\-glo\-first}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{first} field for the
entry given by \meta{entry-label}}
  }
  % \showglofirstpl
  \gcmd{show\-glo\-first\-pl}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{firstplural} field for the
entry given by \meta{entry-label}}
  }
  % \showglotype
  \gcmd{show\-glo\-type}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{type} field for the
entry given by \meta{entry-label}}
  }
  % \showglocounter
  \gcmd{show\-glo\-counter}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{counter} field for the
entry given by \meta{entry-label}}
  }
  % \showglouseri
  \gcmd{show\-glo\-useri}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{user1} field for the
entry given by \meta{entry-label}}
  }
  % \showglouserii
  \gcmd{show\-glo\-userii}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{user2} field for the
entry given by \meta{entry-label}}
  }
  % \showglouseriii
  \gcmd{show\-glo\-useriii}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{user3} field for the
entry given by \meta{entry-label}}
  }
  % \showglouseriv
  \gcmd{show\-glo\-useriv}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{user4} field for the
entry given by \meta{entry-label}}
  }
  % \showglouserv
  \gcmd{show\-glo\-userv}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{user5} field for the
entry given by \meta{entry-label}}
  }
  % \showglouservi
  \gcmd{show\-glo\-uservi}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{user6} field for the
entry given by \meta{entry-label}}
  }
  % \showgloname
  \gcmd{show\-glo\-name}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{name} field for the
entry given by \meta{entry-label}}
  }
  % \showglodesc
  \gcmd{show\-glo\-desc}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{description} field for the
entry given by \meta{entry-label}}
  }
  % \showglodescplural
  \gcmd{show\-glo\-desc\-plural}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{descriptionplural} field for the
entry given by \meta{entry-label}}
  }
  % \showglosort
  \gcmd{show\-glo\-sort}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{sort} field for the
entry given by \meta{entry-label}. This may not match the value of
the internal \glosfield{sortvalue} field}
  }
  % \showglosymbol
  \gcmd{show\-glo\-symbol}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{symbol} field for the
entry given by \meta{entry-label}}
  }
  % \showglosymbolplural
  \gcmd{show\-glo\-symbol\-plural}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{symbolplural} field for the
entry given by \meta{entry-label}}
  }
  % \showgloshort
  \gcmd{show\-glo\-short}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{short} field for the
entry given by \meta{entry-label}}
  }
  % \showgloshortplural
  \gcmd{show\-glo\-short\-plural}%
  {
    \providedby{\sty{glossaries} v5.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{short}plural field for the
entry given by \meta{entry-label}}
  }
  % \showglolong
  \gcmd{show\-glo\-long}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{long} field for the
entry given by \meta{entry-label}}
  }
  % \showglolongplural
  \gcmd{show\-glo\-long\-plural}%
  {
    \providedby{\sty{glossaries} v5.0+}
    \syntax{\margm{entry-label}}
    \desc{shows the value of the \gloskey{longplural} field for the
entry given by \meta{entry-label}}
  }
  % COMMANDS: OTHER
  % \glspatchtabularx
  \gcmd{gls\-patch\-tab\-u\-larx}%
  {%
    \providedby{\sty{glossaries} v4.28+}
    \desc{patches \sty{tabularx} (if it has been loaded) to prevent
    the \idx{firstuseflag} from being unset while \env{tabularx} is
    calculating the column widths}
  }
  % \GlsXtrSetField
  \gxtrcmd{Gls\-Xtr\-Set\-Field}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
     \syntax{\margm{entry-label}\margm{field-label}\margm{value}}
     \desc{assigns \meta{value} to the field identified by its
     \idxc{internalfieldlabel}{internal label} \meta{field-label}
     for the entry identified by \meta{entry-label}. An error (or
     warning with \optval{undefaction}{warn}) occurs
     if the entry hasn't been defined}
  }
  % \xGlsXtrSetField
  \gxtrcmd{xGls\-Xtr\-Set\-Field}%
  {%
     \providedby{\sty{glossaries-extra} v1.12+}
     \syntax{\margm{entry-label}\margm{field-label}\margm{value}}
     \desc{as \gls{GlsXtrSetField} but expands the value and uses a
      global assignment}
  }
  % \glsFindWidestUsedTopLevelName
  \gxtrcmd{gls\-Find\-Widest\-Used\-Top\-Level\-Name}
  { 
    \providedby{\sty{glossaries-extra-stylemods} v1.05+}
    \syntax{\oargm{glossary labels}}
    \desc{finds and sets the widest name for all top-level entries
    that have been marked as \idxc{firstuseflag}{used} in the given \idxpl{glossary}}
  } 
  % \glsFindWidestUsedLevelTwo
  \gxtrcmd{gls\-Find\-Widest\-Used\-Level\-Two}
  {
    \providedby{\sty{glossaries-extra-stylemods} v1.05+}
    \syntax{\oargm{glossary labels}}
    \desc{finds and sets the widest name for all entries
    that have been marked as \idxc{firstuseflag}{used} with
    \idx{hierarchicallevel} less than or equal to 2 in the given \idxpl{glossary}}
  }
  % \glsdefpostdesc
  \gxtrcmd{gls\-def\-post\-desc}{%
    \providedby{\sty{glossaries-extra} v1.31+}
    \syntax{\margm{category}\margm{definition}}
    \desc{defines \idx{postdeschook} associated with the category
    identified by the label \meta{category}}
  }
  % \glsxtrbookindexname
  \gxtrcmd{gls\-xtr\-book\-index\-name}
  {
    \providedby{\sty{glossary-bookindex} v1.21+}
    \syntax{\margm{entry-label}}
    \desc{used by the \glostyle{bookindex} style to display a
     top-level entry's name}
  }
  % \glsxtrbookindexmarkentry
  \gxtrcmd{gls\-xtr\-book\-index\-mark\-en\-try}
  {
    \providedby{\sty{glossary-bookindex} v1.21+}
    \syntax{\margm{entry-label}} 
    \desc{used by the \glostyle{bookindex} style to mark an entry in
     the \ext{aux} file (for example, to add the first and last
entry in the page to the page header or footer on the next \LaTeX\
run)}
  }
  % \glossentrynameother
  \gxtrcmd{gloss\-entry\-name\-other}
  {%
    \providedby{\sty{glossaries-extra} v1.22+}
    \syntax{\margm{entry-label}\margm{field-label}}
    \desc{behaves like \gls{glossentryname} but uses the given field
     (identified by its \idxc{internalfieldlabel}{internal label})
     instead of \gloskey{name}}
  }
  % \glslongfont
  \gxtrcmd{gls\-long\-font}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{text}}
     \desc{font formatting command for the long form, initialised by
      the abbreviation style}
  }
  % \glsxtrfullsep
  \gxtrcmd{gls\-xtr\-full\-sep}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{Separator used by the parenthetical inline full
      and also for some display full forms}
  }
  % \glsxtrparen
  \gxtrcmd{gls\-xtr\-paren}
  {
    \providedby{\sty{glossaries-extra} v1.17+}
     \syntax{\margm{text}}
     \desc{used to encapsulate \meta{text} in parentheses}
  }
  % \glsabbrvfont
  \gcmd{gls\-abbrv\-font}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{text}}
     \desc{font formatting command for the short form, initialised by
      the abbreviation style} 
  }  
  % \glsxtrfootnotedescsort
  \gxtrcmd{gls\-xtr\-foot\-note\-desc\-sort}
  {
    \providedby{\sty{glossaries-extra} v1.42+}
    \desc{expands to the sort value for footnote styles like
     \abbrstyle{short-footnote-desc}}
  } 
  % \glsxtrabbrvfootnote
  \gxtrcmd{gls\-xtr\-abbrv\-foot\-note}
  {
    \providedby{\sty{glossaries-extra} v1.07+}
    \syntax{\margm{entry-label}\margm{text}}
    \desc{command that produces the footnote for the footnote
    abbreviation styles, such as \abbrstyle{footnote}
    and \abbrstyle{postfootnote}}
  }
  % \glsxtrfootnotedescname
  \gxtrcmd{gls\-xtr\-foot\-note\-desc\-name}
  {
    \providedby{\sty{glossaries-extra} v1.42+}
    \desc{expands to the name value for styles like
     \abbrstyle{short-footnote-desc}}
  }
  % \glsfirstabbrvscfont
  \gxtrcmd{gls\-first\-abbrv\-sc\-font}
  {
    \providedby{\sty{glossaries-extra} v1.17+}
     \syntax{\margm{text}}
     \desc{short form font used by the \idx{smallcaps} \qt{sc} abbreviation
     styles on \idx{firstuse}}
  }
  % \Glsfmtlong
  \gxtrcmd{Gls\-fmt\-long}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted \idx{sentencecase} long form}
  } 
  % \glsfmtshort
  \gxtrcmd{gls\-fmt\-short}
  {
     \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}}
     \desc{for use within captions or section titles to display the
      formatted short form}
  } 
  % \glsxtrdopostpunc
  \gxtrcmd{gls\-xtr\-do\-post\-punc}{%
     \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\margm{code}\meta{token}}
    \desc{if \meta{token} is a recognised punctuation character
     this does the punctuation character and then \meta{code}, 
     otherwise if does \meta{code} followed by \meta{token}}
  }
  % \glsxtrinlinefullformat
  \gxtrcmd{gls\-xtr\-in\-line\-full\-format}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{glsxtrfull} to display the inline full
     form (defined by the abbreviation style)}
  }
  % \glsxtrinlinefullplformat
  \gxtrcmd{gls\-xtr\-in\-line\-full\-pl\-format}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{glsxtrfullpl} to display the plural inline
full
     form (defined by the abbreviation style)}
  }
  % \Glsxtrinlinefullformat
  \gxtrcmd{Gls\-xtr\-in\-line\-full\-format}
  {
    %\providedby{\sty{glossaries-extra} v1.0+}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{Glsxtrfull} to display the
\idx{sentencecase} inline full
     form (defined by the abbreviation style)}
  }
  % \Glsxtrinlinefullplformat
  \gxtrcmd{Gls\-xtr\-in\-line\-full\-pl\-format}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{entry-label}\margm{insert}}
     \desc{used by \gls{Glsxtrfullpl} to display the plural \idx{sentencecase} 
     inline full form (defined by the abbreviation style)}
  }
  % \glsfirstlongfootnotefont
  \gxtrcmd{gls\-first\-long\-foot\-note\-font}
  {
    \providedby{\sty{glossaries-extra} v1.05+}
    \syntax{\margm{text}}
    \desc{formatting command for the \idx{firstuse} long form 
     used by the footnote abbreviation styles}
  }
  % \ifglsxtrinsertinside
  \gxtrcmd{if\-gls\-xtr\-insert\-inside}
  {
    \providedby{\sty{glossaries-extra} v1.02}
    \initval{\csfmt{iffalse}}
    \syntax{\conditionsyntax}
    \desc{a conditional used by the predefined abbreviation styles to determine
     whether the \meta{insert} part should go inside or outside of the style's font 
     formatting commands}
  }
  % \glscategory
  \gxtrcmd{gls\-category}
  {
     \providedby{\sty{glossaries-extra}}
    \syntax{\margm{entry-label}}
    \desc{expands to the entry's category}
  } 
  % \glssetcategoryattribute
  \gxtrcmd{gls\-set\-category\-attribute}
  {
    \providedby{\sty{glossaries-extra}}
     \syntax{\margm{category}\margm{attribute}\margm{value}}
     \desc{locally sets the given \idxc{categoryattribute}{attribute}
      to \meta{value} for the given category}
  }
  % \bibglsdelimN
  \gxtrcmd{bib\-gls\-delimN}
  {
     \providedby{\app{bib2gls}}
     \initval{\gls{delimN}}
     \desc{delimiter used between \locations\ in the \idx{locationlist},
      except for the last pair}
  }
  % \bibglslastDelimN
  \gxtrcmd{bib\-gls\-last\-DelimN}
  {
     \providedby{\app{bib2gls}}
     \initval{\gls{delimN}}
     \desc{delimiter used between the last pair of \locations\ in the \idx{locationlist}}
  }
  % \glsxtrGeneralLatinAtoGrules
  \gxtrcmd{gls\-xtr\-General\-Latin\-A\-to\-G\-rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{expands to the A--G subset of General Latin I sort rules}
  }
  % \glsxtrGeneralLatinNtoZrules
  \gxtrcmd{gls\-xtr\-General\-Latin\-N\-to\-Z\-rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{expands to the N--Z subset of General Latin I sort rules}
  }
  % \glsxtrIgnorableRules
  \gxtrcmd{gls\-xtr\-Ignorable\-Rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{a shortcut that expands to the control rules, space rules
     and non-printable rules}
  }
  % \glsxtrGeneralInitRules
  \gxtrcmd{gls\-xtr\-General\-Init\-Rules}
  {
    \providedby{\sty{glossaries-extra-bib2gls} v1.49+}
    \desc{a shortcut that expands to the ignorable rules, 
     combining diacritic rules, hyphen rules, general punctuation 
    rules, digit rules, and fraction rules}
  }
  % \GlsXtrIfFieldEqNum
  \gxtrcmds{Gls\-Xtr\-If\-Field\-Eq\-Num}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{number}\margm{true}\margm{false}}
     \desc{compares the numeric value stored in the given field with
      \meta{number}}
  }
  % \GlsXtrIfFieldNonZero
  \gxtrcmds{Gls\-Xtr\-If\-Field\-Non\-Zero}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{true}\margm{false}}
     \desc{tests if the numeric value stored in the given field is non-zero}
  }
  % \GlsXtrIfFieldEqStr
  \gxtrcmds{Gls\-Xtr\-If\-Field\-Eq\-Str}
  {
     \providedby{\sty{glossaries-extra} v1.21+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{value}\margm{true}\margm{false}}
     \desc{tests if the entry given by \meta{entry-label} has the
    \idx{field} identified by its \idxc{internalfieldlabel}{internal label}
    \meta{field-label} set to \meta{value}}
  } 
  % \GlsXtrIfXpFieldEqXpStr
  \gxtrcmds{Gls\-Xtr\-If\-Xp\-Field\-Eq\-Xp\-Str}
  {
     \providedby{\sty{glossaries-extra} v1.31+}
     \syntax{\margm{field-label}\margm{entry-label}\margm{value}\margm{true}\margm{false}}
     \desc{like \gls{GlsXtrIfFieldEqStr} but first (protected) expands
      both the field value and the supplied \meta{value}}
  }
  % \glsxtrfieldforlistloop
  \gxtrcmd{gls\-xtr\-field\-for\-list\-loop}
  {
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\margm{entry-label}\margm{field}\margm{handler-cs}}
    \desc{iterates over the given field's value using
    \sty{etoolbox}['s] \gls{forlistcsloop}}
  }
  % \glssentencecase
  \gcmd{gls\-sentence\-case}
  {
    \providedby{\sty{glossaries} v4.50+ \& \sty{glossaries-extra} v1.49+}
    \syntax{\margm{text}}
    \desc{used by \idx{sentencecase} commands, such as \gls{Gls}, to
    perform the \idx{casechange}. This is simply defined to use
    \gls{makefirstuc}}
  }
  % \glscapitalisewords
  \gcmd{gls\-capitalise\-words}
  { 
    \providedby{\sty{glossaries} v4.48+}
    \syntax{\margm{content}}
    \desc{just does \gls{capitalisewords} but may be redefined to
    use \gls{capitalisefmtwords}, if required}
  }
  % \glsentrytitlecase
  \gcmd{gls\-entry\-title\-case}%
  {%
    \syntax{\margm{entry-label}\margm{field}}
    \providedby{\sty{glossaries} v4.22+}
    \desc{applies \idx+{titlecase} to the given field using
    \gls{glscapitalisewords} or \idx{sentencecase} in \idxpl{PDFbookmark}}
  }
  % \glslowercase
  \gcmd{gls\-lower\-case}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{text}}
    \desc{converts \meta{text} to \idx+{lowercase} using the modern \LaTeX3
    \casechanging\ command, which is expandable}
  }
  % \glsuppercase
  \gcmd{gls\-upper\-case}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\margm{text}}
    \desc{converts \meta{text} to \idx+{uppercase} using the modern \LaTeX3
    \casechanging\ command, which is expandable}
  }
  % COMMANDS: DEPRECATED
  % \glsifhyper
  \gcmd{gls\-if\-hyper}
  {
    \deprecated
    \desc{this was originally used in \gls{glsgenentryfmt} to test
     if the \glsopt{hyper} option was set. Deprecated in v4.08 and
     removed in v4.50. Use \gls{glsifhyperon} instead}
  }
  % \glsdisplayfirst
  \gcmd{gls\-display\-first}
  {
    \deprecated
    \desc{this was originally used to format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{glsentryfmt}}
  }
  % \glsdisplay
  \gcmd{gls\-display}
  {
    \deprecated
    \desc{this was originally used to format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{glsentryfmt}}
  }
  % \defglsdisplay
  \gcmd{def\-gls\-display}
  {
    \deprecated
    \desc{this was originally used to define a format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{defglsentryfmt}}
  }
  % \defglsdisplayfirst
  \gcmd{def\-gls\-display\-first}
  {
    \deprecated
    \desc{this was originally used to define a format the way the
     \idx{linktext} was displayed on \idx{firstuse} by the \gls{glslike}
     commands. Deprecated in v3.11a and removed in v4.50. Use
     rollback if backward-compatibility required, but it's better to
     switch to \gls{defglsentryfmt}}
  }
  % \SetAcronymStyle
  \gcmd{Set\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.04}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetCustomStyle
  \gcmd{Set\-Custom\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.06}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \SetDefaultAcronymStyle
  \gcmd{Set\-Default\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.04}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \code{\gls{setacronymstyle}\marg{\acrstyle{long-short}}}}
  }
  % \DefaultNewAcronymDef
  \gcmd{Default\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \CustomNewAcronymDef
  \gcmd{Custom\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.06}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \CustomAcronymFields
  \gcmd{Custom\-Acronym\-Fields}
  {
    \deprecated
    \providedby{\sty{glossaries} v2.06}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \SetDUAStyle
  \gcmd{Set\-DUA\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{newacronymstyle} and \gls{setacronymstyle}}
  }
  % \SetDescriptionFootnoteAcronymDisplayStyle
  \gcmd{Set\-Description\-Foot\-note\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DescriptionFootnoteNewAcronymDef
  \gcmd{Description\-Foot\-note\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionFootnoteAcronymStyle
  \gcmd{Set\-Description\-Footnote\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionDUAAcronymDisplayStyle
  \gcmd{Set\-Description\-DUA\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DescriptionDUANewAcronymDef
  \gcmd{Description\-DUA\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionDUAAcronymStyle
  \gcmd{Set\-Description\-DUA\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionAcronymDisplayStyle
  \gcmd{Set\-Description\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DescriptionNewAcronymDef
  \gcmd{Description\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDescriptionAcronymStyle
  \gcmd{Set\-Description\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetFootnoteAcronymDisplayStyle
  \gcmd{Set\-Footnote\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \FootnoteNewAcronymDef
  \gcmd{Foot\-note\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetFootnoteAcronymStyle
  \gcmd{Set\-Footnote\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetSmallAcronymDisplayStyle
  \gcmd{Set\-Small\-Acronym\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SmallNewAcronymDef
  \gcmd{Small\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetSmallAcronymStyle
  \gcmd{Set\-Small\-Acronym\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \SetDUADisplayStyle
  \gcmd{Set\-DUA\-Display\-Style}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \DUANewAcronymDef
  \gcmd{DUA\-New\-Acronym\-Def}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \desc{deprecated with the introduction of \gls{setacronymstyle}.
     Removed in v4.50. Use rollback if backward-compatibility
     required or use \gls{setacronymstyle}}
  }
  % \acrlinkfullformat
  \gcmd{acr\-link\-full\-format}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \syntax{\margm{internal long cs}\margm{internal short
      cs}\margm{options}\margm{entry-label}\margm{insert}}
    \desc{deprecated with the introduction of \gls{setacronymstyle} 
     but used in the initial definition of commands like
     \gls{acrfullfmt} before they are redefined by the
     \idx{acronymstyle}.  This may be removed in a future release}
  }
  % \acrfullformat
  \gcmd{acr\-full\-format}
  {
    \deprecated
    \providedby{\sty{glossaries}}
    \syntax{\margm{long text}\margm{short text}}
    \desc{deprecated with the introduction of \gls{setacronymstyle} 
     but used in the initial definition of commands like
     \gls{glsentryfmt} before they are redefined by the
     \idx{acronymstyle}.  This may be removed in a future release}
  }
  % OPTIONS
  % print*glossary options
  \gidxpl{printglossopt}{
    \field{text}{\NoCaseChange{\glsentrytext{print...glossary}} option}%
    \desc{most (but not all) of these options can be used in the optional argument
    of all the \gls+{print...glossary} commands}
  }
  % printgloss type
  \gprintglossopt{type}{%
    \syntax{\meta{glossary-label}}
    \defval{\gls{glsdefaulttype}}%
    \desc{identifies the \idx{glossary} to display}}
  % printgloss sort
  \gprintglossopt{sort}{%
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\meta{method}}
    \desc{only available with \gls{printnoidxglossary}, this
    indicates how the \idx{glossary} should be ordered}}
  % printgloss sort=word
  \goptval{printgloss.sort}{word}%
  {%
     \desc{word order}
  }
  % printgloss sort=letter
  \goptval{printgloss.sort}{letter}%
  {%
     \desc{letter order}
  }
  % printgloss sort=standard
  \goptval{printgloss.sort}{standard}%
  {%
     \desc{word or letter order according to the \opt{order} package option}
  }
  % printgloss sort=use
  \goptval{printgloss.sort}{use}%
  {%
     \desc{order of use}
  }
  % printgloss sort=def
  \goptval{printgloss.sort}{def}%
  {%
     \desc{order of definition}
  }
  % printgloss sort=case
  \goptval{printgloss.sort}{case}%
  {%
     \desc{case-sensitive sort}
  }
  % printgloss sort=nocase
  \goptval{printgloss.sort}{nocase}%
  {%
     \desc{case-insensitive sort}
  }
  % printgloss sort=wordcase
  \goptval{printgloss.sort}{wordcase}%
  {%
    \providedby{\sty{glossaries} v4.59+}
     \desc{case-insensitive word sort}
  }
  % printgloss sort=lettercase
  \goptval{printgloss.sort}{lettercase}%
  {%
    \providedby{\sty{glossaries} v4.59+}
     \desc{case-insensitive letter sort}
  }
  % printgloss title
  \gprintglossopt{title}{%
    \syntax{\meta{text}}
    \desc{sets the glossary title (overriding the default)}}
  % printgloss toctitle
  \gprintglossopt{toc\-title}{%
    \providedby{\sty{glossaries} v3.03+}
    \syntax{\meta{text}}
    \desc{sets the glossary toc title (overriding the default)}}
  % printgloss style
  \gprintglossopt{style}{%
    \syntax{\meta{style-name}}
    \desc{use the \meta{style-name} \idx{glossarystyle}}
  }
  % printgloss numberedsection
  \gprintglossopt{numbered\-section}{%
    \providedby{\sty{glossaries} v1.14+}
    \syntax{\meta{value}}
    \initval{false}%
    \defval{nolabel}%
    \desc{indicates whether or not \idx{glossary} section headers will be numbered
     and also if they should automatically be labelled.
     The \opt{numberedsection} package option will change the default
     setting to match}
  }
  % printgloss nogroupskip
  \gprintglossopt{no\-group\-skip}{%
    \providedby{\sty{glossaries} v3.08a+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, suppress the gap implemented by some \idxpl{glossarystyle}
     between \idxpl{group}}
  }
  % printgloss nopostdot
  \gprintglossopt{no\-post\-dot}{%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, suppress the post-description punctuation}
  }
  % printgloss entrycounter
  \gprintglossopt{entry\-counter}{%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, enable the entry counter}
  }
  % printgloss subentrycounter
  \gprintglossopt{sub\-entry\-counter}{%
    \providedby{\sty{glossaries} v4.08+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, enable the sub-entry counter}
  }
  % printgloss nonumberlist
  \gprintglossopt{no\-number\-list}{%
    \providedby{\sty{glossaries} v1.14+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{suppress the \gls{locationlist}. Note that
     \printglossoptval{nonumberlist}{true}
     will have no effect with the \resourceopt{save-locations}{false}
     \idx{resourceopt} as there won't be any \glspl{locationlist} to
     display. Likewise if \gls{printunsrtglossary} is used without
    \app{bib2gls}}
  }
  % printgloss label
  \gxtrprintglossopt{label}{%
    \providedby{\sty{glossaries-extra} v1.39+}
    \syntax{\meta{label}}
    \desc{adds \code{\gls{label}\margm{label}} to the start of the
    \idx{glossary} (after the title)}
  }
  % printgloss target
  \gxtrprintglossopt{target}{%
    \providedby{\sty{glossaries-extra} v1.12+}
    \syntax{\meta{boolean}}
    \initval{true}% 
    \defval{true}%
    \desc{if true, each entry in the \idx{glossary} should have a
    hypertarget created, if supported by the \idx{glossarystyle} and if
    \idxpl{hyperlink} are enabled}
  } 
  % printgloss prefix
  \gxtrprintglossopt{prefix}{%
    \providedby{\sty{glossaries-extra} v1.31+}
    \syntax{\meta{prefix}}
    \desc{redefines \gls{glolinkprefix} to \meta{prefix}}
  }
  % printgloss targetnameprefix
  \gxtrprintglossopt{target\-name\-prefix}{%
    \providedby{\sty{glossaries-extra} v1.20+}
    \syntax{\meta{prefix}}
    \desc{inserts \meta{prefix} at the start of the hypertarget names}}
  % printgloss leveloffset
  \gxtrprintglossopt{level\-offset}{%
    \providedby{\sty{glossaries-extra} v1.44+}
    \syntax{\meta{offset}}
    \initval{0}%
    \desc{set or increment the \gls{hierarchicallevel} offset. If
    \meta{offset} starts with \code{++} then the current offset is
    incremented by the given amount otherwise the current offset is
    set to \meta{offset}. For example, an entry with a normal
    \gls{hierarchicallevel} of 1 will be treated as though it has
    \gls{hierarchicallevel} $1+\meta{offset}$. This option is only available for the
    \qt{unsrt} commands}%
  }
  % printgloss groups
  \gxtrprintglossopt{groups}{%
    \providedby{\sty{glossaries-extra} v1.44+}
    \syntax{\meta{boolean}}
    \initval{true}%
    \defval{true}%
    \desc{enables \idx{lettergroup} formation. This option is only available for the
    \qt{unsrt} commands. Note that no \idxpl{group} will be formed when
    invoking \app{bib2gls} with the default \switch{no-group}, regardless of
    this setting}
  }
  % printgloss flatten
  \gxtrprintglossopt{flatten}{%
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\meta{boolean}}
    \initval{false}%
    \defval{true}%
    \desc{if true, treats all entries as though they have the same
      hierarchical level (the value of \printglossopt{leveloffset}).
      This option is only available for the \qt{unsrt} commands}
  }
  % COUNTERS
  % counter: glossaryentry
  \gctr{glossary\-entry}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \desc{defined if \optval{entrycounter}{true}}
  }
  % counter: glossarysubentry
  \gctr{glossary\-sub\-entry}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \desc{defined if \optval{subentrycounter}{true}}
  }
  % counter wrglossary
  \gxtrctr{wr\-glossary}
  {
    \providedby{\sty{glossaries-extra}}
    \desc{a counter that is incremented every time an entry is \indexed}
  }
  % ENVIRONMENTS
  % theglossary
  \genv{the\-glossary}
  {
    \providedby{\sty{glossaries}}
    \desc{redefined by the \idxpl{glossarystyle} to format the
    \idx{glossary} according to the style specifications. 
     The entire \idx{glossary} content (not including
     the section header, \idx{preamble/glossary} and \idx{postamble}) is contained
     within this environment}
    \note{\idx{glossarystyle} environment}
  }
  % PACKAGE OPTIONS
  % package option nolangwarn
  \gstyopt{no\-lang\-warn}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.33+}
    \desc{suppresses the warning if no language support is found}
  }
  % package option disablemakegloss
  \gstyopt{disable\-make\-gloss}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.45+}
    \desc{disables \gls{makeglossaries}}
  }
  % package option restoremakegloss
  \gstyopt{restore\-make\-gloss}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.45+}
    \desc{cancels the effect of \opt{disablemakegloss}}
  }
  % package option prefix
  \gxtrstyopt{prefix}
  {%
    \providedby{\sty{glossaries-extra} v1.42+}
    \inpackage{glossaries-extra}
    \desc{loads \sty{glossaries-prefix}}
  }
  % package option accsupp
  \gxtrstyopt{accsupp}
  {%
    \inpackage{glossaries-extra}
    \desc{loads \sty{glossaries-accsupp}}
  }
  % package option nomissingglstext
  \gxtrstyopt{no\-missing\-gls\-text}%
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{determines whether or not to display warning text if the
     external \idx{indexingfile} hasn't been generated due to an
     incomplete build}
  }
  % package option style-options
  \gstyopt{style-options}
  {
    \syntax{\margm{options}}
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.59+}%
    \desc{adjusts options for the newer styles that support this
interface}
  }
  % package option style-options values
  \gopt{style-options.tree*}%
  {%
    \parent{opt.style-options}
    \name{\glostyleoptfmt{tree*}}
    \syntax{\keyvallist}
    \desc{sets the options for the \glostyle{tree*} style}
  }
  \gopt{style-options.mcoltree*}%
  {%
    \parent{opt.style-options}
    \name{\glostyleoptfmt{mcoltree*}}
    \syntax{\keyvallist}
    \desc{sets the options for the \glostyle{mcoltree*} style}
  }
  % package option style
  \gstyopt{style}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{style-name}}
    \initvalvaries
    \desc{sets the default \idx{glossarystyle} to \meta{style-name}}%
  }
  % package option nostyles
  \gstyopt{nostyles}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load the default set of predefined styles. Note that
    if \sty{glossaries} is loaded before \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option nolist
  \gstyopt{nolist}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-list}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option nolong
  \gstyopt{nolong}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-long}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option nosuper
  \gstyopt{nosuper}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-super}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option notree
  \gstyopt{notree}%
  {%
    \providedby{\sty{glossaries} v1.18+}
    \inpackage{glossaries}%
    \desc{don't load \sty{glossary-tree}, which is normally loaded
    automatically. Note that if \sty{glossaries} is loaded before
    \sty{glossaries-extra},
    then this option should be passed directly to \sty{glossaries}
    not \sty{glossaries-extra} otherwise it will be too late to
    implement}%
  }
  % package option stylemods
  \gxtrstyopt{stylemods}
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{list}}
    \defval{default}
    \desc{loads \sty{glossaries-extra-stylemods} with the given
    options. If \optval{stylemods}{default} then no options are
    passed to \sty{glossaries-extra-stylemods}}
  }
  % package option section
  \gstyopt{section}
  {
    \inpackage{glossaries}%
    \syntax{\meta{name}}
    \defval{section}
    \desc{indicates which section heading command to use for the
    \idx{glossary}. The value may be one of the standard sectioning
    command's control sequence name (without the leading backslash),
    such as \code{chapter} or \code{section}}
  }
  % package option sort
  \gstyopt{sort}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}%
    \syntax{\meta{value}}
    \initval{standard}
    \desc{indicates how the \gloskey{sort} key should automatically
     be assigned if not explicitly provided (for \gls{makeglossaries}
     and \gls{makenoidxglossaries} only)}
  }
  \goptval{sort}{none}%
  {%
    \providedby{\sty{glossaries} v4.30+}
    \desc{don't process the \gloskey{sort} key. Use this option if no 
     \idx{indexing} is required for a slightly faster build}%
  }
  \goptval{sort}{clear}%
  {%
    \providedby{\sty{glossaries} v4.50+}
    \desc{sets the \gloskey{sort} key to an empty value. Use this option if no 
     \idx{indexing} is required for a slightly faster build}%
  }
  \goptval{sort}{standard}%
  {%
    \desc{use the value of the \gloskey{name} key as the default for the
     \gloskey{sort} key and implement the \gls{glsprestandardsort} hook}%
  }
  \goptval{sort}{def}%
  {%
    \desc{use the (zero-padded) order of definition as the default for the
     \gloskey{sort} key}%
  }
  \goptval{sort}{use}%
  {%
    \desc{use the (zero-padded) order of use as the default for the
     \gloskey{sort} key}%
  }
  % package option sanitizesort
  \gstyopt{sanitize\-sort}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{boolean}}
    \initvalvaries
    \defval{true}
    \desc{indicates whether the default sort value should be sanitized
      (only applicable with \opteqvalref{sort}{standard})}
  }
  % package option preprocess-sort
  \gstyopt{pre\-process\dhyphen sort}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{boolean}}
    \defval{true}
    \desc{switches off sanitize sort option but also switches off
field expansion for the sort value. If true, the sort value will be
processed when the entry is defined, otherwise the sort value will
be processed when the list is sorted (\option{noidx} only)}
  }
  % package option debug
  \gstyopt{debug}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \initval{false}%
    \syntax{\meta{value}}
    \inpackage{glossaries}
    \desc{adds markers to the document for debugging purposes}
  }
  % package option debug values
  \goptval{debug}{true}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \desc{writes \code{wrglossary(\meta{type})(\meta{\idx{indexing} info})}
    to the \ext+{log} file if there is an attempt to index an entry
    before the associated \idx{indexingfile} has been opened (\app{makeindex}
    and \app{xindy} only). With \sty{glossaries-extra}, this setting will
    also display the label of any undefined entries that are
    referenced in the document}
  }
  \goptval{debug}{false}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \desc{disable debugging actions}
  }
  \goptval{debug}{showtargets}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \desc{implements \optval{debug}{true} and also shows target
     markers in the document}%
  }
  \goptval{debug}{showaccsupp}%
  {%
    \providedby{\sty{glossaries} v4.45+}%
    \desc{implements \optval{debug}{true} and also shows accessibility information
    in the document}
  }
  % package option order
  \gstyopt{order}
  {
    \providedby{\sty{glossaries} v1.17+}%
    \inpackage{glossaries}
    \initval{word}
    \desc{indicates whether word or letter order should be used.
    With \options{mkidx,xdy}, this information is written to the
    \ext{aux} file, where it can be picked up by
    \app{makeglossaries}. This option will have no effect if you call
    \app{makeindex} or \app{xindy} explicitly}
  }
  \goptval{order}{word}%
  {%
    \desc{word order (\qt{sea lion} before \qt{seal})}
  }
  \goptval{order}{letter}%
  {%
    \desc{letter order (\qt{seal} before \qt{sea lion})}
  }
  % package option makeindex
  \gstyopt{makeindex}
  {
    \inpackage{glossaries}
    \desc{indicates that the \idx{indexing} should be performed by
     \app+{makeindex} (default)}
    \note{\option{mkidx}}
  }
  % package option xindy
  \gstyopt{xindy}
  {
    \syntax{\margm{options}}
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v1.17+}%
    \desc{indicates that the \idx{indexing} should be performed by \app+{xindy}}
    \note{\option{xdy}}
  }
  % package option xindy values
  \gopt{xindy.glsnumbers}%
  {%
    \parent{opt.xindy}
    \name{\optfmt{glsnumbers}}
    \syntax{\margm{boolean}}
    \initval{true}
    \defval{true}
    \desc{indicates whether or not to add the \code{glsnumbers} \idx{lettergroup}}
  }
  \gopt{xindy.language}%
  {%
    \parent{opt.xindy}
    \name{\optfmt{language}}
    \syntax{\margm{value}}
    \desc{sets the \app{xindy} language module. Only
     applicable if you use \app{makeglossaries} or \opt{automake}}
  }
  \gopt{xindy.codepage}%
  {%
    \parent{opt.xindy}
    \name{\optfmt{codepage}}
    \syntax{\margm{value}}
    \desc{sets the \app{xindy} \idx+{codepage}. Defaults to
     \code{utf8} if \gls{inputencodingname} isn't defined. Only
     applicable if you use \app{makeglossaries} or \opt{automake}}
  }
  % package option xindynoglsnumbers
  \gstyopt{xindy\-no\-gls\-numbers}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v4.02+}%
    \desc{equivalent to \optvalm{xindy}{\styoptxdyval{glsnumbers}{false}}}
    \note{\option{xdy}}
  }
  % package option xindygloss
  \gstyopt{xindy\-gloss}
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v3.14a+}%
    \desc{equivalent to \opt{xindy} with no value}
    \note{\option{xdy}}
  }
  % package option indexonlyfirst
  \gstyopt{index\-only\-first}%
  {%
    \providedby{\sty{glossaries} v3.02+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{indicates whether or not to only \idxc{indexing}{index}
    the \idx{firstuse}}
  }
  % package option seenoindex
  \gstyopt{see\-no\-index}%
  {%
    \providedby{\sty{glossaries} v4.24+}%
    \syntax{\meta{value}}
    \initval{error}
    \inpackage{glossaries}
    \desc{indicates what to do if the \gloskey{see} key is used
    before the associated \idxpl{indexingfile} have been opened by
     \gls{makeglossaries}}
  }
  \goptval{seenoindex}{error}%
  {%
    \desc{triggers an error if the \gloskey{see} key is used before
      \gls{makeglossaries}}
  }
  \goptval{seenoindex}{warn}%
  {%
    \desc{triggers a warning if the \gloskey{see} key is used before
      \gls{makeglossaries}}
  }
  \goptval{seenoindex}{ignore}%
  {%
    \desc{does nothing if the \gloskey{see} key is used before
      \gls{makeglossaries}}
  }
  % package option esclocations
  \gstyopt{esc\-locations}%
  {%
    \providedby{\sty{glossaries} v4.33+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, escapes \locations\ before \idx{indexing}}
  }
  % package option savenumberlist
  \gstyopt{save\-number\-list}%
  {%
    \providedby{\sty{glossaries} v3.02+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, save \idxpl{numberlist}. Only applicable with
     \options{mkidx,xdy} as \options{noidx,b2g} have the
     \idx{numberlist} stored in the \glosfield{loclist} field and
     \option{b2g} also has the formatted \idx{numberlist} in the
     \gloskey{location} field}
    \note{\options{mkidx,xdy} only}
  }
  % package option autoseeindex
  \gxtrstyopt{auto\-see\-index}%
  {%
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \inpackage{glossaries-extra}
    \desc{indicates whether or not to enable automatic \idx{indexing} of
    \gloskey{see} and \gloskey{seealso} fields}
  }
  % package option indexcrossrefs
  \gxtrstyopt{index\-cross\-refs}%
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{if true, automatically indexes cross references at the end
     of the document}
  }
  % package option record
  \gxtrstyopt{record}%
  {%   
    \syntax{\meta{value}}
    \initval{off}
    \defval{only}
    \inpackage{glossaries-extra}
    \desc{indicates whether or not \app{bib2gls} is being used (in
    which case entry \idx{indexing} is performed by adding \app{bib2gls}
    \records\ in the \ext{aux} file)}
  }
  % package option record=off
  \gxtroptval{record}{off}%
  {%
    \desc{entry \idx{indexing} is performed as per the base \sty{glossaries} package, using
       either \gls{makeglossaries} or \gls{makenoidxglossaries}}
  }
  % package option record=only
  \gxtroptval{record}{only}%
  {%
    \desc{entry \idx{indexing} is performed by adding \app{bib2gls}
     \records\ in the \ext{aux} file. Glossaries should be displayed with the \idx{unsrtfam}}
  }
  % package option record=nameref
  \gxtroptval{record}{name\-ref}%
  {%
    \desc{entry \idx{indexing} is performed by adding \app{bib2gls}
     nameref \records\ in the \ext{aux} file. Glossaries should be displayed with the \idx{unsrtfam}}
  }
  % package option record=hybrid
  \gxtroptval{record}{hybrid}%
  {%
    \desc{performs a mixture of \app{bib2gls} \records\ in the
     \ext{aux} file (to select entries from a \ext{bib} file)
     and \app{makeindex}\slash\app{xindy}
     \idx{indexing} in their associated files. This option is best
     avoided}
  }
  % package option equations
  \gxtrstyopt{equations}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries-extra}
    \desc{automatically switch the \idx{locationcounter} to
    \ctr{equation} when inside a numbered equation environment}
  }
  % package option floats
  \gxtrstyopt{floats}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries-extra}
    \desc{automatically switch the \idx{locationcounter} to
    the corresponding counter when inside a floating environment}
  }
  % package option indexcounter
  \gxtrstyopt{index\-counter}
  {
    \inpackage{glossaries-extra}
    \desc{defines the index counter \ctr{wrglossary} and implements
     \optval{counter}{wrglossary}}
  }
  % package option numberedsection
  \gstyopt{numbered\-section}
  {
    \providedby{\sty{glossaries} v1.1+}
    \syntax{\meta{value}}
    \initval{false}
    \defval{nolabel}
    \inpackage{glossaries}
    \desc{indicates whether or not \idx{glossary} section headers will be numbered
     and also if they should automatically be labelled}
  }
  \goptval{numberedsection}{false}%
  {
    \desc{use unnumbered sectional units for \idxpl{glossary}}
  }
  \goptval{numberedsection}{no\-label}% nolabel
  {
    \desc{use numbered sectional units for \idxpl{glossary} but no label}
  }
  \goptval{numberedsection}{auto\-label}% autolabel
  {
    \desc{use numbered sectional units for \idxpl{glossary} and
     automatically add a label based on the \idx{glossary} label}
  }
  \goptval{numberedsection}{nameref}% nameref
  {
    \desc{use unnumbered sectional units for \idxpl{glossary} and
     automatically add a label based on the \idx{glossary} label}
  }
  % package option savewrites
  \gstyopt{save\-writes}
  {
    \providedby{\sty{glossaries} v3.0+}%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, \idx{indexing} information is stored until the end of
    the document to reduce the number of write registers}
  }
  % package option counter
  \gstyopt{counter}%
  {%
    \inpackage{glossaries}%
    \syntax{\meta{counter-name}}
    \initval{page}
    \desc{sets the default \idx{locationcounter}}%
  }
  % package option nonumberlist
  \gstyopt{no\-number\-list}%
  {
    \inpackage{glossaries}
    \desc{set no \glspl{locationlist} as the default for all
     \idxpl{glossary}. May be overridden for individual \idxpl{glossary} with
     \printglossoptval{nonumberlist}{true}}
  }
  % package option seeautonumberlist
  \gstyopt{see\-auto\-number\-list}%
  {
    \inpackage{glossaries}
    \providedby{\sty{glossaries} v3.0+}
    \desc{automatically adds \gloskeyval{nonumberlist}{false} to 
    any \idxpl{entry} with the \gloskey{see} key set}
  }
  % package option entrycounter
  \gstyopt{entry\-counter}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{enables the entry counter for top-level entries}
  }
  % package option counterwithin
  \gstyopt{counter\-within}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}
    \syntax{\meta{parent-counter}}
    \desc{sets the parent counter for \ctr{glossaryentry}}
  }
  % package option subentrycounter
  \gstyopt{sub\-entry\-counter}%
  {
    \providedby{\sty{glossaries} v3.0+}
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{enables the entry counter for level~1 entries}
  }
  % package option writeglslabels
  \gstyopt{write\-gls\-labels}%
  {
    \providedby{\sty{glossaries} v4.45+}%
    \inpackage{glossaries}
    \desc{creates a file called \code{\gls{jobname}.\ext+{glslabels}}
     that contains all defined entry labels (for the benefit of
     \idx{auto-completion} tools)}
  }
  % package option writeglslabelnames
  \gstyopt{write\-gls\-label\-names}%
  {
    \providedby{\sty{glossaries} v4.47+}%
    \inpackage{glossaries}
    \desc{creates a file called \code{\gls{jobname}.\ext+{glslabels}}
     that contains all defined entry labels and names (for the benefit of
     \idx{auto-completion} tools)}
  }
  % package option nomain
  \gstyopt{nomain}%
  {%
    \providedby{\sty{glossaries} v2.01+}%
    \inpackage{glossaries}%
    \desc{prevents the definition of the \glostype+{main} \idx{glossary}. You
    will need to define another \idx{glossary} to use instead. For
    example, with the \opt{acronyms} package option}%
  }
  % package option acronymlists
  \gstyopt{acronym\-lists}%
  {
    \providedby{\sty{glossaries} v2.04+}%
    \inpackage{glossaries}
    \syntax{\margm{label-list}}
    \desc{identifies the \idxpl{glossary} that contain \idxpl{acronym}
    (defined with the base \sty{glossaries} packages \idx{acronym} mechanism)}
  }
  % package option shortcuts
  \gstyopt{shortcuts}%
  {
    \inpackage{glossaries}
    \syntax{\margm{boolean}}
    \initval{false}
    \defval{false}
    \desc{defines various shortcut commands. Has additional values
with \sty{glossaries-extra}}
  }
  % package option acronyms
  \gstyopt{acronyms}%
  {
    \providedby{\sty{glossaries} v3.14a+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \glostype+{acronym},
     redefines \gls{acronymtype} to \code{acronym}, and provides
     \gls{printacronyms}}
  }
  % package option acronym
  \gstyopt{acronym}%
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{if true, provides a new \idx{glossary} with the label
     \glostype+{acronym} and title given by \gls{acronymname},
     redefines \gls{acronymtype} to \code{acronym}, and provides
     \gls{printacronyms}}
  }
  % package option abbreviations
  \gxtrstyopt{abbreviations}%
  {
    \inpackage{glossaries-extra}
    \desc{provides a new \idx{glossary} with the label
     \glostype{abbreviations} and title given by \gls{abbreviationsname},
     redefines \gls{glsxtrabbrvtype} to \glostype{abbreviations},
     redefines \gls{acronymtype} to \gls{glsxtrabbrvtype} (unless
     the \opt{acronym} or \opt{acronyms} option has been used), and provides
     \gls{printabbreviations}}
  }
  % package option symbols
  \gstyopt{symbols}%
  {
    \providedby{\sty{glossaries} v3.11a+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \glostype{symbols} and
     the title \gls{glssymbolsgroupname}, and provides
     \gls{printsymbols}. With \sty{glossaries-extra}, this additionally
     defines \gls{glsxtrnewsymbol}}
  }
  % package option numbers
  \gstyopt{numbers}%
  {
    \providedby{\sty{glossaries} v3.11a+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \code{numbers} and
     the title \gls{glsnumbersgroupname}, and provides \gls{printnumbers}.
     With \sty{glossaries-extra}, this additionally
     defines \gls{glsxtrnewnumber}}
  }
  % package option index
  \gstyopt{index}%
  {
    \providedby{\sty{glossaries} v4.02+}%
    \inpackage{glossaries}
    \desc{provides a new \idx{glossary} with the label \code{index} and
     the title \gls{indexname}, and provides \gls{printindex} and
     \gls{newterm}}
  }
  % package option noglossaryindex
  \gstyopt{no\-glossary\-index}%
  {
    \providedby{\sty{glossaries} v4.42+}%
    \inpackage{glossaries}
    \desc{counteracts the \opt{index} option}
  }
  % package option hyperfirst
  \gstyopt{hyper\-first}%
  {%
    \providedby{\sty{glossaries} v2.03+}%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{if false, this option will suppress \idxpl{hyperlink} on \idx{firstuse}
    for the \gls{glslike} commands}
  }
  % package option nohypertypes
  \gstyopt{no\-hyper\-types}%
  {%
    \providedby{\sty{glossaries} v3.05+}%
    \inpackage{glossaries}
    \syntax{\margm{list}}
    \desc{identifies the list of \idxpl{glossary} that should have
     \idxpl{hyperlink} suppressed}
  }
  % package option nopostdot
  \gstyopt{nopostdot}%
  {%
    \providedby{\sty{glossaries} v3.03+}%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{if true, suppresses the automatic insertion of a
    \idx{fullstop} after each entry's description in the \idx{glossary}
    (for styles that support this). The default is
    \optval{nopostdot}{true} for \sty{glossaries-extra} and
    \optval{nopostdot}{false} for just \sty{glossaries}}
    \field{seealso}{opt.postdot,opt.postpunc}
  }
  % package option postdot
  \gxtrstyopt{postdot}%
  {%
    \inpackage{glossaries-extra}
    \providedby{\sty{glossaries-extra} v1.12+}%
    \desc{a shortcut for \optval{nopostdot}{false}}
    \field{seealso}{opt.nopostdot,opt.postpunc}
  }
  % package option postpunc
  \gxtrstyopt{postpunc}%
  {%
    \inpackage{glossaries-extra}
    \providedby{\sty{glossaries-extra} v1.21+}%
    \syntax{\meta{value}}
    \desc{an alternative to \opt{postdot}, this can be used to
     insert a different punctuation character after the description}
  }
  % package option nowarn
  \gstyopt{no\-warn}%
  {%
    \inpackage{glossaries}
    \desc{suppresses warnings}
  }
  % package option noredefwarn
  \gstyopt{noredefwarn}%
  {%
    \inpackage{glossaries}
    \desc{suppresses a warning if \env{theglossary} or
    \gls{printglossary} have already been defined (which indicates
     that the document class or another package also provides a mechanism
     for creating a \idx{glossary} that could potentially conflict with
     \sty{glossaries}). This option is automatically implemented with
     \sty{glossaries-extra}}
  }
  % package option undefaction
  \gxtrstyopt{undef\-action}%
  {%
    \syntax{\meta{value}}
    \initval{error}
    \inpackage{glossaries-extra}
    \desc{indicates whether to trigger an error or warning if an
     unknown entry label is referenced}
  }
  \gxtroptval{undefaction}{error}%
  {%
    \desc{trigger an error if an unknown entry label is referenced}
  }
  \gxtroptval{undefaction}{warn}%
  {%
    \desc{trigger a warning if an unknown entry label is referenced}
  }
  % package option translate
  \gstyopt{translate}%
  {%
    \providedby{\sty{glossaries} v1.1+}%
    \inpackage{glossaries}
    \syntax{\meta{value}}
    \initvalvaries
    \defval{true}
    \desc{indicates how multilingual support should be provided, if
     applicable}
  }
  % package option translate values
  \goptval{translate}{babel}%
  {%
    \desc{uses \sty{babel}['s] language hooks to implement
      multilingual support (default for \sty{glossaries-extra} if
      \sty{babel} has been detected)}
  }
  \goptval{translate}{true}%
  {%
    \desc{uses \sty{translator}['s] language hooks to implement
      multilingual support (default for \sty{glossaries} if a
      language package has been detected)}
  }
  \goptval{translate}{false}%
  {%
    \desc{don't implement multilingual support (default if no
     language package has been detected)}
  }
  % package option notranslate
  \gstyopt{notranslate}%
  {%
    \providedby{\sty{glossaries} v3.14a+}%
    \inpackage{glossaries}
    \desc{equivalent to \optval{translate}{false}}
  }
  % package option languages
  \gstyopt{languages}%
  {%
    \providedby{\sty{glossaries} v4.50+}%
    \inpackage{glossaries}
    \desc{implements \optval{translate}{babel} and adds the supplied
     languages to \sty{tracklang}['s] list of tracked languages}
  }
  % package option locales
  \gstyopt{locales}%
  {%
    \providedby{\sty{glossaries} v4.55+}%
    \inpackage{glossaries}
    \desc{synonym of \opt{languages}}
    \field{alias}{opt.languages}
  }
  % package option nogroupskip
  \gstyopt{no\-group\-skip}%
  {%
    \providedby{\sty{glossaries} v3.03+}%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, suppress the gap between \idxpl{lettergroup} in the
     \idxpl{glossary} by default}
  }
  % numberline
  \gstyopt{number\-line}%
  {%
    \providedby{\sty{glossaries} v1.1+}
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true (and \optval{toc}{true}), includes \gls{numberline} when adding a
    \idx{glossary} to the table of contents}
  }
  % package option toc
  \gstyopt{toc}%
  {%
    \inpackage{glossaries}
    \syntax{\meta{boolean}}
    \initvalvaries
    \defval{true}
    \desc{if true, each \idx{glossary} will be automatically added to the
    \idx{tableofcontents} if the starred (unnumbered) sectioning command is used. 
    The default is \optval{toc}{false} with
     \sty{glossaries} and \optval{toc}{true} with
\sty{glossaries-extra}. This option has no effect if the unstarred
(numbered) sectioning command is used}
  }
  % package option docdef
  \gxtrstyopt{docdef}%
  {%
    \inpackage{glossaries-extra}
    \syntax{\meta{value}}
    \initval{false}
    \defval{true}
    \desc{determines whether or not \gls{newglossaryentry} is
     permitted in the \env{document} environment}
  }
  \gxtroptval{docdef}{false}%
  {%
    \desc{don't allow \gls{newglossaryentry} in the \env{document}
     environment}
  }
  \gxtroptval{docdef}{true}%
  {%
    \desc{allow \gls{newglossaryentry} in the \env{document}
     environment if the base \sty{glossaries} package would allow it}
  }
  \gxtroptval{docdef}{restricted}%
  {%
    \desc{allow \gls{newglossaryentry} in the \env{document}
     environment, but only before any \idxpl{glossary}}
  }
  \gxtroptval{docdef}{atom}%
  {%
    \desc{as \optfmt{restricted} but creates the \ext{glsdefs} file
     for atom's autocomplete support}
  }
  % package option automake
  \gstyopt{automake}%
  {%
    \providedby{\sty{glossaries} v4.08+}%
    \inpackage{glossaries}
    \syntax{\meta{value}}
    \initval{false}
    \defval{immediate}
    \desc{indicates whether or not to attempt to use \TeX's
    \idx{shellescape} to run an \idx{indexingapp}}
  }
  \goptval{automake}{true}%
  {
     \deprecated
     \providedby{\sty{glossaries} v4.08+}
     \desc{deprecated synonym for \opteqvalref{automake}{delayed}}
     \field{alias}{optval.automake.delayed}
  }
  \goptval{automake}{delayed}%
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{use the \idx{shellescape} to run \app{makeindex} or
     \app{xindy} at the end of the document}
  }
  \goptval{automake}{false}%
  {
     \providedby{\sty{glossaries} v4.08+}
     \desc{don't use the \idx{shellescape}}
  }
  \goptval{automake}{immediate}%
  {
     \providedby{\sty{glossaries} v4.42+}
     \desc{use the \idx{shellescape} to run \app{makeindex} or
     \app{xindy} before \gls{makeglossaries} opens the associated
     \idxpl{indexingfile}}
  }
  \goptval{automake}{makegloss}%
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{use the \idx{shellescape} to run \app{makeglossaries} 
     before \gls{makeglossaries} opens the associated \idxpl{indexingfile}}
  }
  \goptval{automake}{lite}%
  {
     \providedby{\sty{glossaries} v4.50+}
     \desc{use the \idx{shellescape} to run \app{makeglossaries-lite} 
     before \gls{makeglossaries} opens the associated \idxpl{indexingfile}}
  }
  \gstyopt{automakegloss}%
  {
    \inpackage{glossaries}
     \providedby{\sty{glossaries} v4.50+}
     \desc{synonym for \opteqvalref{automake}{makegloss}}
     \field{alias}{optval.automake.makegloss}
  }
  \gstyopt{automakeglosslite}%
  {
    \inpackage{glossaries}
     \providedby{\sty{glossaries} v4.50+}
     \desc{synonym for \opteqvalref{automake}{lite}}
     \field{alias}{optval.automake.lite}
  }
  % package option ucmark
  \gstyopt{uc\-mark}%
  {%
    \providedby{\sty{glossaries} v3.02+}
    \syntax{\meta{boolean}}
    \initvalvaries
    \defval{true}
    \inpackage{glossaries}
    \desc{indicates whether or not to use \idx{allcaps} in the
     \idx{glossary} header}
  }
  % package option kernelglossredefs
  \gstyopt{kernel\-gloss\-re\-defs}%
  {%
    \providedby{\sty{glossaries} v4.41+}
    \syntax{\meta{value}}
    \initval{false}
    \defval{true}
    \inpackage{glossaries}
    \desc{indicates whether or not to redefined the 
    kernel glossary commands \gls{cs.glossary} and \gls{makeglossary}}
  }
  \goptval{kernelglossredefs}{false}%
  {
     \desc{don't redefine \gls{cs.glossary} and \gls{makeglossary}}
  }
  \goptval{kernelglossredefs}{true}%
  {
     \desc{redefine \gls{cs.glossary} and \gls{makeglossary} but their
     use will trigger a warning}
  }
  \goptval{kernelglossredefs}{nowarn}%
  {
     \desc{redefine \gls{cs.glossary} and \gls{makeglossary} without
     any warnings}
  }
  % package option mfirstuc
  \gstyopt{mfirstuc}
  {
    \providedby{\sty{glossaries} v4.50+}
    \syntax{\meta{value}}
    \initval{unexpanded}
    \inpackage{glossaries}
    \desc{the value may be either \optfmt{expanded} or
    \optfmt{unexpanded} and performs the same function as
    \sty{mfirstuc}['s] \optfmt{expanded} and \optfmt{unexpanded}
     package options. Note that there's no value corresponding to 
     \sty{mfirstuc}['s] other package option}
  }
  % DEPRECATED PACKAGE OPTIONS
  % package option compatible-2.07
  \gstyopt{compatible\dhyphen 2.07}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{option removed in version 4.50. Now only available with rollback}
  }
  % package option compatible-3.07
  \gstyopt{compatible\dhyphen 3.07}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{option removed in version 4.50. Now only available with rollback}
  }
  % package option description
  \gstyopt{description}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option footnote
  \gstyopt{footnote}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option smallcaps
  \gstyopt{smallcaps}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option smaller
  \gstyopt{smaller}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % package option dua
  \gstyopt{dua}%
  {
    \deprecated
    \inpackage{glossaries}
    \desc{deprecated in version 4.02 (2013-12-05) and removed in
     version 4.50. Now only available with rollback}
  }
  % OPTIONS: KEYS (glossentry)
  \gidxpl{gloskey}{%
    \common
    \field{text}{glossary entry key}
    \desc{these are options that can be passed to commands that
     define entries, such as \gls{newglossaryentry} or
     \gls{newacronym}}
  }
  % glossentry name
  \ggloskey{name}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's name, as displayed in the \idx{glossary}. This
     typically isn't used outside of the \idx{glossary} (the \gloskey{text} and
     \gloskey{plural} keys are used instead). However, if there is a
     need to specifically display the entry name,
     use \gls{glsname} (if \idx{indexing} and \idxpl{hyperlink}
     are required) or \gls{glsentryname}. \Idxpl{glossarystyle} should use
     \gls{glossentryname} rather than explicitly using \gls{glsentryname}}
  }
  % glossentry description
  \ggloskey{description}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's description, as displayed in the \idx{glossary}. If
     required in the text, use \gls{glsdesc} (if \idx{indexing} and \idxpl{hyperlink}
     are required) or \gls{glsentrydesc}. \Idxpl{glossarystyle} should use
     \gls{glossentrydesc} and \gls{glspostdescription} to
     incorporate the \idx{postdeschook}}
  }
  % glossentry descriptionplural
  \ggloskey{description\-plural}%
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{text}}
    \desc{the plural form of the entry's description, if applicable.
    If omitted, this is set to the same value as the
    \gloskey{description}, since descriptions tend not to be a singular
    entity}
  }
  % glossentry type
  \ggloskey{type}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{\idx{glossary}-label}}
    \initval{\gls{glsdefaulttype}}%
    \desc{assigns the entry to the \idx{glossary} identified by
      \meta{\idx{glossary}-label}}
  }
  % glossentry parent
  \ggloskey{parent}%
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\meta{parent-label}}
    \initvalempty
    \desc{the label of the entry's parent (from which the entry's
    \idx{hierarchicallevel} is obtained)}
  }
  % glossentry category
  \gxtrgloskey{category}%
  {%
    \syntax{\meta{category-label}}%
    \initval{general}%
    \providedby{\sty{glossaries-extra}}
    \desc{the entry's \idx{category} (must be a simple label)}
  }
  % glossentry sort
  \ggloskey{sort}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{value}}
    \initval{\meta{entry name}}
    \desc{specifies the value to use for sorting (overrides the
     default). This key is usually required for \app+{xindy} if the
      \gloskey{name} key only contains commands (for example, the
      entry is a symbol), but explicitly using this key in other
      contexts can break certain sort methods.
      \gallerypage{bib2gls-sorting}{Don't use the \gloskey{sort} field
      with \app{bib2gls}}}
  }
  % glossentry text
  \ggloskey{text}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's text, as displayed on \idx{subsequentuse} of
     \gls{glslike} commands. If omitted, this value is assumed to be
     the same as the \gloskey{name} key}
  }
  % glossentry plural
  \ggloskey{plural}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's plural form, as displayed on \idx{subsequentuse} of
     plural \gls{glslike} commands, such as \gls{glspl}. This should
     be the appropriate plural form of the value provided by the
    \gloskey{text} key. If omitted, this value is assumed to be the
    value of the \gloskey{text} key with \gls{glspluralsuffix}
    appended}
  }
  % glossentry symbol
  \ggloskey{symbol}%
  {%
    \providedby{\sty{glossaries}}
    \initval{\gls{relax}}
    \syntax{\margm{symbol}}
    \desc{the entry's associated symbol (optional), which can be
     displayed with \gls{glssymbol} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentrysymbol}}
  }
  % glossentry symbolplural
  \ggloskey{symbol\-plural}%
  {%
    \providedby{\sty{glossaries} v1.12+}
    \syntax{\margm{symbol plural}}
    \desc{The plural form of the \gloskey{symbol}, if applicable,
     which can be displayed with \gls{glssymbolplural} (if \idx{indexing}
     and \idxpl{hyperlink} are required) or with \gls{glsentrysymbolplural}.
     If omitted, this value is set to the same as the
     \gloskey{symbol} key (since symbols usually don't have a plural
     form)}
  }
  % glossentry first
  \ggloskey{first}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{first}}
    \desc{the entry's text, as displayed on \idx{firstuse} of
     \gls{glslike} commands. Note that using an \idx{acronymstyle}
     or \idxpl{postlinkhook} is a more flexible approach. If omitted,
     this value is assumed to be the same as the \gloskey{text} key}
  }
  % glossentry firstplural
  \ggloskey{first\-plural}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\margm{text}}
    \desc{the entry's plural form, as displayed on \idx{firstuse} of
     plural \gls{glslike} commands, such as \gls{glspl}. If this key
    is omitted, then the value will either be the same as the
    \gloskey{plural} field, if the \gloskey{first} key wasn't used, or
    the value will be taken from the \gloskey{first} key with
    \gls{glspluralsuffix} appended}
  }
  % glossentry short
  \ggloskey{short}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{short-form}}
    \desc{a \idx{field} that is set by \gls{newacronym}
     to the entry's short (abbreviated) form. It
     typically shouldn't be used explicitly with
     \gls{newglossaryentry} as \gls{newacronym} (and \gls{newabbreviation})
     makes other modifications to ensure that when the entry is
     referenced with the \gls{glslike} commands, it will obey the
     appropriate \idx{acronymstyle} (or \idx{abbrvstyle}). If you are using \app{bib2gls}
     then this field should be used in the \ext{bib} file when
     defining \idxpl{abbreviation}}
  }
  % glossentry shortplural
  \ggloskey{short\-plural}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{short-form}}
    \desc{as \gloskey{short} but the plural form. The default is
    obtained by appending the \idx{acronym} or \idx{abbreviation} plural suffix}
  }
  % glossentry long
  \ggloskey{long}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{long-form}}
    \desc{a \idx{field} that is set by \gls{newacronym} (and
     \gls{newabbreviation}) to the entry's long (unabbreviated) form. It
     typically shouldn't be used explicitly with
     \gls{newglossaryentry} as \gls{newacronym} (and \gls{newabbreviation})
     makes other modifications to ensure that when the entry is
     referenced with the \gls{glslike} commands, it will obey the
     appropriate \idx{acronymstyle} (or \idx{abbrvstyle}). If you are using \app{bib2gls}
     then this field should be used in the \ext{bib} file when
     defining \idxpl{abbreviation}}
  }
  % glossentry longplural
  \ggloskey{long\-plural}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{long-form}}
    \desc{as \gloskey{long} but the plural form}
  }
  % glossentry user1
  \ggloskey{user1}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \initvalempty
    \desc{a generic field, which can be
     displayed with \gls{glsuseri} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuseri}}
  }
  % glossentry user2
  \ggloskey{user2}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \initvalempty
    \desc{a generic field, which can be
     displayed with \gls{glsuserii} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuserii}}
  }
  % glossentry user3
  \ggloskey{user3}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \initvalempty
    \desc{a generic field, which can be
     displayed with \gls{glsuseriii} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuseriii}}
  }
  % glossentry user4
  \ggloskey{user4}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \initvalempty
    \desc{a generic field, which can be
     displayed with \gls{glsuseriv} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuseriv}}
  }
  % glossentry user5
  \ggloskey{user5}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \initvalempty
    \desc{a generic field, which can be
     displayed with \gls{glsuserv} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuserv}}
  }
  % glossentry user6
  \ggloskey{user6}%
  {%
    \providedby{\sty{glossaries} v2.04+}
    \syntax{\margm{text}}
    \initvalempty
    \desc{a generic field, which can be
     displayed with \gls{glsuservi} (if \idx{indexing} and \idxpl{hyperlink} are
     required) or with \gls{glsentryuservi}}
  }
  % glossentry counter
  \ggloskey{counter}%
  {%
    \providedby{\sty{glossaries} v3.0+}
    \syntax{\margm{counter-name}}
    \desc{if set, the value indicates the \idx{locationcounter} to use
     by default when \idx{indexing} this entry (overrides the
     counter associated with the \idx{glossary} or the \opt{counter}
     package option)}
  }
  % glossentry nonumberlist
  \ggloskey{no\-number\-list}%
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\margm{boolean}}
    \initval{false}
    \defval{true}
    \desc{if set, suppress the \idx{locationlist} for this entry.
      This is done by adding \gls{glsnonextpages} or
     \gls{glsnextpages} to the \idx{indexing} information for
     \options{mkidx,xdy} or to the \glosfield{prenumberlist} field
     for \option{noidx}}
  }
  % glossentry see
  \ggloskey{see}%
  {%
    \providedby{\sty{glossaries} v1.17+}
    \syntax{\marg{\oargm{tag}\meta{xr-list}}}
    \desc{with the base \sty{glossaries} package this simply
    triggers an automatic cross-reference with \gls{glssee}. The
    \sty{glossaries-extra} package additionally saves the value.
    Use \optval{autoseeindex}{false} to prevent the automatic
    cross-reference. The \meta{tag} defaults to \gls{seename} and
    \meta{xr-list} should be a comma-separated list of entries that
    have already been defined}
  }
  % glossentry seealso
  \gxtrgloskey{see\-also}%
  {%
    \providedby{\sty{glossaries-extra} v1.16+}
    \syntax{\margm{xr-list}}
    \initvalempty
    \desc{behaves in a similar manner to
     \gloskeyval{see}{\oarg{\gls{seealsoname}}\meta{xr-list}}}
  }
  % glossentry alias
  \gxtrgloskey{alias}%
  {%
    \providedby{\sty{glossaries-extra} v1.12}
    \syntax{\margm{xr-label}}
    \initvalempty
    \desc{behaves in a similar manner to
     \gloskeyval{see}{\oarg{\gls{seealsoname}}\meta{xr-label}} but also
     sets up aliasing which makes the \idx{linktext} hyperlink to
     \meta{xr-label} instead}
  }
  % glossentry location
  \gxtrgloskey{location}%
  {%
    \providedby{\sty{glossaries-extra}}
    \syntax{\margm{location-list}}
    \initvalempty
    \desc{the formatted \idx{locationlist} used by the \idx{unsrtfam}. This key
    is only available with the \opt{record} option and is set by \app{bib2gls}
    unless \resourceopt{save-locations}{false} is set. Although it
    has an associated key, it's usually considered an internal field}
    \note{requires \opt{record}}
  } 
  % glossentry group
  \gxtrgloskey{group}%
  {%
    \providedby{\sty{glossaries-extra} v1.11+}
    \syntax{\margm{group-label}}
    \initvalempty
    \desc{the \idx{group} label that identifies which \idx{lettergroup} the
     entry belongs to. This key is only available with the 
     \opteqvalref{record}{only} and \opteqvalref{record}{nameref} options,
     and is set by \app{bib2gls}, if invoked with \switch{group} or \bibglsopt{g}.
     Although this has a key, this is considered an 
     \idxc{bib2glsinternalfield}{internal key} assigned by
     \app{bib2gls} as a by-product of sorting.
     Explicit use without reference to the order of entries can result in
     fragmented groups. The corresponding title can be set with
     \gls{glsxtrsetgrouptitle}, although this is more commonly done
     implicitly within the \ext{glstex} file. See also
     \gallerypage{logicaldivisions}{Gallery: Logical Glossary Divisions 
     (type vs group vs parent)}}
  }
  % OPTIONS: INTERNAL FIELDS
  \gidxpl{glosfield}{%
    \common
    \field{text}{glossary entry field}
    \desc{these are \idxpl{internalfield} that don't have a corresponding
     \idxc{gloskey}{key}}
  } 
  % internal field loclist
  \gglosfield{loc\-list}% 
  {%
    \providedby{\sty{glossaries} v4.04+}
    \syntax{\margm{\sty{etoolbox} list}}
    \desc{used by \gls{printnoidxglossary} to provide the locations.
    The value is an \sty{etoolbox} list of individual locations
    which are obtained from the \ext+{aux} file. This field will also
    be used by the \idx{unsrtfam} if \gloskey{location} isn't set}
  }
  % internal field currcount
  \gglosfield{curr\-count}
  {
    \providedby{\sty{glossaries} v4.14+}
    \desc{used by entry counting to store the current running total}
  }
  % internal field prevcount
  \gglosfield{prev\-count}
  {
    \providedby{\sty{glossaries} v4.14+}
    \desc{used by entry counting to store the total from the previous \LaTeX\ run}
  }
  % internal field desc
  \gglosfield{desc}
  {
    \desc{corresponds to \gloskey{description} key}
  }
  % internal field descplural
  \gglosfield{desc\-plural}
  {
    \desc{corresponds to \gloskey{descriptionplural} key}
  }
  % internal field descaccess
  \gglosfield{desc\-access}
  {
    \desc{corresponds to \gloskey{descriptionaccess} key}
  }
  % internal field descpluralaccess
  \gglosfield{desc\-plural\-access}
  {
    \desc{corresponds to \gloskey{descriptionpluralaccess} key}
  }
  \gglosfield{user\-i\-access}
  {
    \desc{corresponds to \gloskey{user1access} key}
  }
  \gglosfield{user\-ii\-access}
  {
    \desc{corresponds to \gloskey{user2access} key}
  }
  \gglosfield{user\-iii\-access}
  {
    \desc{corresponds to \gloskey{user3access} key}
  }
  \gglosfield{user\-iv\-access}
  {
    \desc{corresponds to \gloskey{user4access} key}
  }
  \gglosfield{user\-v\-access}
  {
    \desc{corresponds to \gloskey{user5access} key}
  }
  \gglosfield{user\-vi\-access}
  {
    \desc{corresponds to \gloskey{user6access} key}
  }
  % internal field firstpl
  \gglosfield{first\-pl}
  {
    \desc{corresponds to \gloskey{firstplural} key}
  }
  % internal field longpl
  \gglosfield{long\-pl}
  {
    \desc{corresponds to \gloskey{longplural} key}
  }
  % internal field shortpl
  \gglosfield{short\-pl}
  {
    \desc{corresponds to \gloskey{shortplural} key}
  }
  % internal field sortvalue
  \gglosfield{sort\-value}
  {
    \desc{corresponds to \gloskey{sort} key}
  }
  % internal field level
  \gglosfield{level}
  {
    \desc{the \idx{hierarchicallevel} is stored in this field. The
     value is calculated when the \idx{entry} is defined and should not be changed}
  }
  % internal field prenumberlist
  \gglosfield{pre\-number\-list}
  {
    \desc{set by the \gloskey{nonumberlist} key and used in
     \gls{glsnoidxprenumberlist} with \option{noidx}}
  }
  % internal field useri
  \gglosfield{useri}
  {
    \desc{corresponds to \gloskey{user1} key}
  }
  % internal field userii
  \gglosfield{userii}
  {
    \desc{corresponds to \gloskey{user2} key}
  }
  % internal field useriii
  \gglosfield{useriii}
  {
    \desc{corresponds to \gloskey{user3} key}
  }
  % internal field useriv
  \gglosfield{useriv}
  {
    \desc{corresponds to \gloskey{user4} key}
  }
  % internal field userv
  \gglosfield{userv}
  {
    \desc{corresponds to \gloskey{user5} key}
  }
  % internal field uservi
  \gglosfield{uservi}
  {
    \desc{corresponds to \gloskey{user6} key}
  }
  % internal field dtlsortgroup
  \gglosfield{dtl\-sort\-group}
  {
    \desc{used by \gls{printnoidxglossary} to store the letter
    group information obtained from \gls{datatoolsortwordseq:NN}}
  }
  % internal field siblingcount
  \gxtrglosfield{sibling\-count}
  {
     \desc{used by \app{bib2gls} to store the number of (selected) siblings an entry has}
  }
  % internal field siblinglist
  \gxtrglosfield{sibling\-list}
  {
     \desc{used by \app{bib2gls} to store an entry's list of (selected) siblings}
  }
  % internal field childcount
  \gglosfield{child\-count}%
  {%
    \desc{used with the \resourceopt{save-child-count} resource
     option to store the entry's child count. As from
\sty{glossaries} v4.59, this field may also be locally set by
\gls{printnoidxglossary} (unless \optval{sort}{def} or
\optval{sort}{use})}
  }
  % internal field childlist
  \gxtrglosfield{child\-list}
  {
     \desc{used by \app{bib2gls} to store an entry's list of (selected) child entries}
  }
  % ACCESSIBILITY KEYS
  % glossentry access
  \ggloskey{access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{name} field}
  }
  % glossentry textaccess
  \ggloskey{text\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{text} field}
  }
  % glossentry pluralaccess
  \ggloskey{plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{plural} field}
  }
  % glossentry firstaccess
  \ggloskey{first\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{first} field}
  }
  % glossentry firstpluralaccess
  \ggloskey{first\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{firstplural} field}
  }
  % glossentry shortaccess
  \ggloskey{short\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{short} field}
  }
  % glossentry shortpluralaccess
  \ggloskey{short\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{shortplural} field}
  }
  % glossentry longaccess
  \ggloskey{long\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{long} field}
  }
  % glossentry longpluralaccess
  \ggloskey{long\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{longplural} field}
  }
  % glossentry descriptionaccess
  \ggloskey{description\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{description} field}
  }
  % glossentry descriptionpluralaccess
  \ggloskey{description\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{descriptionplural} field}
  }
  % glossentry symbolaccess
  \ggloskey{symbol\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{symbol} field}
  }
  % glossentry symbolpluralaccess
  \ggloskey{symbol\-plural\-access}%
  {%
    \providedby{\sty{glossaries-accsupp}}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{symbolplural} field}
  }
  % glossentry user1access
  \ggloskey{user1\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user1} field}
  }
  % glossentry user2access
  \ggloskey{user2\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user2} field}
  }
  % glossentry user3access
  \ggloskey{user3\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user3} field}
  }
  % glossentry user4access
  \ggloskey{user4\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user4} field}
  }
  % glossentry user5access
  \ggloskey{user5\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user5} field}
  }
  % glossentry user6access
  \ggloskey{user6\-access}%
  {%
    \providedby{\sty{glossaries-accsupp} v4.45+}
    \syntax{\margm{text}}
    \desc{accessibility text corresponding to the \gloskey{user6} field}
  }
  % PREFIX KEYS
  % glossentry prefix
  \ggloskey{prefix}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{subsequentuse} singular prefix}
  }
  % glossentry prefixplural
  \ggloskey{prefix\-plural}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{subsequentuse} plural prefix}
  }
  % glossentry prefixfirst
  \ggloskey{prefix\-first}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{firstuse} singular prefix}
  }
  % glossentry prefixfirstplural
  \ggloskey{prefix\-first\-plural}%
  {%
    \providedby{\sty{glossaries-prefix} v3.14a+}
    \syntax{\margm{text}}
    \desc{the \idx{firstuse} plural prefix}
  }
  % GLS OPTIONS
  \gidx{glsopt}{\name{\csfmt{gls}-like and \csfmt{glstext}-like options}%
    \common
    \field{text}{\csfmt{glslink} option}%
    \desc{most (but not all) of these options can be used in the optional argument
    of all the \gls{glslike}, \gls{glstextlike} and \gls{glsadd} commands}
  }
  % format
  \gglsopt{format}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{cs-name}}
    \desc{the \idx{encap} or control sequence name (without the leading backslash)
    that should be used to \idxc{locationencap}{encapsulate} the \idx{entrylocation}}%
  }%
  % counter
  \gglsopt{counter}%
  {%
    \providedby{\sty{glossaries}}
    \syntax{\meta{counter-name}}
    \desc{the \idx{locationcounter}}%
  }%
  % local
  \gglsopt{local}%
  {%
    \providedby{\sty{glossaries} v3.04+}
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true use \gls{glslocalunset} to unset the
     \idx{firstuseflag}, otherwise use \gls{glsunset} (only applies
     to \gls{glslike} commands)}%
  }%
  % hyper
  \gglsopt{hyper}%
  {%
    \providedby{\sty{glossaries}}
    \initval{true}
    \defval{true}
    \syntax{\meta{boolean}}
    \desc{determines whether or not the \idx{linktext} should have a
     \idx{hyperlink} (provided \idxpl{hyperlink} are supported)}%
  }%
  % types
  \gglsopt{types}%
  {
    \providedby{\sty{glossaries}}
     \syntax{\margm{glossary list}}
     \desc{only available with \gls{glsaddall}, the value is the
     list of glossaries to iterate over}
  }
  % textformat
  \gxtrglsopt{text\-format}%
  {%
    \providedby{\sty{glossaries-extra} v1.30+}
    \syntax{\meta{csname}}
    \desc{the name of the control sequence to use instead of \gls{glstextformat}
to encapsulate the \idx{linktext}}%
  }%
  % hyperoutside
  \gxtrglsopt{hyper\-outside}%
  {%
    \providedby{\sty{glossaries-extra} v1.21+}
    \initval{true}
    \defval{true}
    \syntax{\meta{boolean}}
    \desc{determines whether the \idx{hyperlink} should be inside or outside of \gls{glstextformat}}%
  }%
  % wrgloss
  \gxtrglsopt{wr\-gloss}%
  {%
    \providedby{\sty{glossaries-extra} v1.14+}
    \initval{before}
    \syntax{\meta{position}}
    \desc{determines whether to do the \idx{indexing} before or after the
\idx{linktext}. Allowed values: \optfmt{before} and \optfmt{after}}%
  }%
  % noindex
  \gxtrglsopt{no\-index}%
  {%
    \providedby{\sty{glossaries-extra}}
    \initval{false}
    \defval{true}
    \syntax{\meta{boolean}}
    \desc{if \optfmt{true} this option will suppress \idx{indexing}.
    If you are using \app{bib2gls}, you may want to consider using
    \glsoptval{format}{\encap{glsignore}} to prevent a \location\ but
    ensure that the entry is selected}%
  }%
  % prefix
  \gxtrglsopt{prefix}%
  {%
    \providedby{\sty{glossaries-extra} v1.31+}
    \syntax{\meta{link-prefix}}
    \desc{the prefix to use for the entry's hyperlink target}%
  }%
  % thevalue
  \gxtrglsopt{the\-value}%
  {%
    \providedby{\sty{glossaries-extra} v1.19+}
    \syntax{\meta{location}}
    \desc{set the \location\ to this value instead of obtaining it from the
     \idx{locationcounter}}%
  }%
  % theHvalue
  \gxtrglsopt{the\-H\-value}%
  {%
    \providedby{\sty{glossaries-extra} v1.19+}
    \syntax{\meta{the-H-value}}
    \desc{set the hyper \location\ to this value instead of obtaining it
from \gls{theHcounter}}%
  }%
  % prereset
  \gxtrglsopt{pre\-reset}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \initval{none}
    \defval{local}
    \syntax{\meta{value}}
    \desc{determines whether or not to reset the entry before the
    \idx{linktext}. Allowed values: \optfmt{none} (no reset),
    \optfmt{local} (localise the reset) and \optfmt{global}}%
  }%
  % preunset
  \gxtrglsopt{pre\-unset}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \initval{none}
    \defval{local}
    \syntax{\meta{value}}
    \desc{determines whether or not to unset the entry before the
    \idx{linktext}. Allowed values: \optfmt{none} (no unset),
    \optfmt{local} (localise the unset) and \optfmt{global}}%
  }%
  % postunset
  \gxtrglsopt{post\-unset}%
  {%
    \providedby{\sty{glossaries-extra} v1.49+}
    \syntax{\meta{value}}
    \initval{global}
    \defval{global}
    \desc{determines whether or not to unset the \idx{firstuseflag}
     after the \idx{linktext}. The value may be one of:
     \code{global}, \code{local} or \code{none}
    (only applies to \gls{glslike} commands)}%
  }%
  % GLOSSARY STYLES
  % STYLES: glossary-list
  % list
  \gglosty{list}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment}
  }
  % listgroup
  \gglosty{list\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
   letter \idx{group} headings}
  }
  % listhypergroup
  \gglosty{list\-hyper\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
   letter \idx{group} headings and a navigation line}
  }
  % altlist
  \gglosty{alt\-list}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
the entry's description starting on a new line}
  }
  % altlistgroup
  \gglosty{alt\-list\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
the entry's description starting on a new line with
   letter \idx{group} headings}
  }
  % altlisthypergroup
  \gglosty{alt\-list\-hyper\-group}{\providedby{\sty{glossary-list}}
   \desc{a list style using the \env{description} environment with
the entry's description starting on a new line with
   letter \idx{group} headings and a navigation line}
  }
  % listdotted
  \gglosty{list\-dotted}{\providedby{\sty{glossary-list}}
    \desc{a list style with a dotted leader between the name and
description}
  }
  % sublistdotted
  \gglosty{sub\-list\-dotted}{\providedby{\sty{glossary-list}}
    \desc{a list style with just the name for top-level entries and
    a dotted leader between the name and description for sub-entries}
  }
  % STYLES: glossary-long
  % long
  \gglosty{long}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns}
  }
  % longborder
  \gglosty{long\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns and
border lines}
  }
  % longheader
  \gglosty{long\-header}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns and a
header row}
  }
  % longheaderborder
  \gglosty{long\-header\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 2 columns, a
header row and border lines}
  }
  % long3col
  \gglosty{long\-3\-col}{\providedby{\sty{glossary-long}}%
   \desc{a tabular style using \env{longtable} with 3 columns}
  }
  % long3colborder
  \gglosty{long\-3\-col\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 3 columns and
border lines}
  }
  % long3colheader
  \gglosty{long\-3\-col\-header}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 3 columns and a
header row}
  }
  % long3colheaderborder
  \gglosty{long\-3\-col\-header\-border}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 3 columns, a
header row and border lines}
  }
  % long4col
  \gglosty{long\-4\-col}{\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns}
  }
  % long4colheader
  \gglosty{long\-4\-col\-header}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns and a
header row}
  }
  % long4colborder
  \gglosty{long\-4\-col\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns and
border lines}
  }
  % long4colheaderborder
  \gglosty{long\-4\-col\-header\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns, a
header row and border lines}
  }
  % altlong4col
  \gglosty{alt\-long\-4\-col}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description}
  }
  % altlong4colheader
  \gglosty{alt\-long\-4\-col\-header}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description with a header row}
  }
  % altlong4colborder
  \gglosty{alt\-long\-4\-col\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description with border lines}
  }
  % altlong4colheaderborder
  \gglosty{alt\-long\-4\-col\-header\-border}
  {\providedby{\sty{glossary-long}}
   \desc{a tabular style using \env{longtable} with 4 columns
allowing a multiline description with a header row and border lines}
  }
  % STYLES: glossary-longragged
  % longragged
  \gglosty{long\-ragged}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description}
  }
  % longraggedborder
  \gglosty{long\-ragged\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description and border lines}
  }
  % longraggedheader
  \gglosty{long\-ragged\-header}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description, and a
header row}
  }
  % longraggedheaderborder
  \gglosty{long\-ragged\-header\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 2 columns and
ragged right formatting for the description, border lines and a
header row}
  }
  % longragged3col
  \gglosty{long\-ragged\-3\-col}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description}
  }
  % longragged3colborder
  \gglosty{long\-ragged\-3\-col\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description and border lines}
  }
  % longragged3colheader
  \gglosty{long\-ragged\-3\-col\-header}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description, and a
header row}
  }
  % longragged3colheaderborder
  \gglosty{long\-ragged\-3\-col\-header\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 3 columns and
ragged right formatting for the description, border lines and a
header row}
  }
  % altlongragged4col
  \gglosty{alt\-long\-ragged\-4\-col}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description}
  }
  % altlongragged4colheader
  \gglosty{alt\-long\-ragged\-4\-col\-header}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description, and a
header row}
  }
  % altlongragged4colborder
  \gglosty{alt\-long\-ragged\-4\-col\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description and border lines}
  }
  % altlongragged4colheaderborder
  \gglosty{alt\-long\-ragged\-4\-col\-header\-border}
  {\providedby{\sty{glossary-longragged}}
   \desc{a tabular style using \env{longtable} with 4 columns and
ragged right formatting for the description, border lines and a
header row}
  }
  % STYLES: glossary-longbooktabs
  % long-booktabs
  \gglosty{long\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 2 columns a
   header row and rules}
  }
  % long3col-booktabs
  \gglosty{long3col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 3 columns a
   header row and rules}
  }
  % long4col-booktabs
  \gglosty{long\-4\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 4 columns a
   header row and rules}
  }
  % altlong4col-booktabs
  \gglosty{alt\-long\-4\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 4 columns
   allowing for multi-lined descriptions, a header row and rules}
  }
  % longragged-booktabs
  \gglosty{long\-ragged\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 2 columns, a
   header row and rules, and ragged right formatting for the
description}
  }
  % longragged3col-booktabs
  \gglosty{long\-ragged\-3\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 3 columns, a
   header row and rules, and ragged right formatting for the
description}
  }
  % altlongragged4col-booktabs
  \gglosty{alt\-long\-ragged\-4\-col\dhyphen booktabs}
  {\providedby{\sty{glossary-longbooktabs} v4.21+}
   \desc{a tabular style using \env{longtable} with 4 columns, a
   header row and rules, and ragged right formatting for the
description}
  }
  % STYLES: glossary-super
  % super
  \gglosty{super}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns}
  }
  % superborder
  \gglosty{super\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
border lines}
  }
  % superheader
  \gglosty{super\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
a header row}
  }
  % superheaderborder
  \gglosty{super\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 2 columns,
a header row and border lines}
  }
  % super3col
  \gglosty{super\-3\-col}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns}
  }
  % super3colborder
  \gglosty{super\-3\-col\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
border lines}
  }
  % super3colheader
  \gglosty{super\-3\-col\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns and a
header row}
  }
  % super3colheaderborder
  \gglosty{super\-3\-col\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 3 columns, a
header row and border lines}
  }
  % super4col
  \gglosty{super\-4\-col}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns}
  }
  % super4colheader
  \gglosty{super\-4\-col\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns and
a header row}
  }
  % super4colborder
  \gglosty{super\-4\-col\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns and border lines}
  }
  % super4colheaderborder
  \gglosty{super\-4\-col\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns,
a header row and border lines}
  }
  % altsuper4col
  \gglosty{alt\-super\-4\-col}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns
   allowing multiline descriptions}
  }
  % altsuper4colheader
  \gglosty{alt\-super\-4\-col\-header}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns
   and a header row
   allowing multiline descriptions}
  }
  % altsuper4colborder
  \gglosty{alt\-super\-4\-col\-border}
  {\providedby{\sty{glossary-super}}}
  % altsuper4colheaderborder
  \gglosty{alt\-super\-4\-col\-header\-border}
  {\providedby{\sty{glossary-super}}
   \desc{a tabular style using \env{supertabular} with 4 columns,
   a header row and border lines
   allowing multiline descriptions}
  }
  % STYLES: glossary-superragged
  % superragged
  \gglosty{super\-ragged}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
ragged right formatting for the description}
  }
  % superraggedborder
  \gglosty{super\-ragged\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
border lines, and
ragged right formatting for the description}
  }
  % superraggedheader
  \gglosty{super\-ragged\-header}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns and
a header row, and
ragged right formatting for the description}
  }
  % superraggedheaderborder
  \gglosty{super\-ragged\-header\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 2 columns,
a header row and border lines, and
ragged right formatting for the description}
  }
  % superragged3col
  \gglosty{super\-ragged\-3\-col}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
ragged right formatting for the description}
  }
  % superragged3colborder
  \gglosty{super\-ragged\-3\-col\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
border lines, and
ragged right formatting for the description}
  }
  % superragged3colheader
  \gglosty{super\-ragged\-3\-col\-header}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns and
a header row, and
ragged right formatting for the description}
  }
  % superragged3colheaderborder
  \gglosty{super\-ragged\-3\-col\-header\-border}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 3 columns,
a header row and border lines, and
ragged right formatting for the description}
  }
  % altsuperragged4col
  \gglosty{alt\-super\-ragged\-4\-col}%
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns and
ragged right formatting for the description}
  }
  % altsuperragged4colheader
  \gglosty{alt\-super\-ragged\-4\-col\-header}
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns and
a header row, and
ragged right formatting for the description}
  }
  % altsuperragged4colborder
  \gglosty{alt\-super\-ragged\-4\-col\-border}%
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns
and border lines, and
ragged right formatting for the description}
  }
  % altsuperragged4colheaderborder
  \gglosty{alt\-super\-ragged\-4\-col\-header\-border}%
  {\providedby{\sty{glossary-superragged}}
   \desc{a tabular style using \env{supertabular} with 4 columns,
a header row and border lines, and
ragged right formatting for the description}
  }
  % STYLES: glossary-tree
  % tree*
  \gglosty{tree*}{\providedby{\sty{glossary-tree} v4.59+}
   \desc{a flexible \hierarchical\ style that shows the name, description
and, if set, the symbol. The style may be modified with the
\glostyleopt{tree*} options}
  }
 % tree* options
 % group-headings
 \gtreestaropt{group\dhyphen headings}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, show letter group headings}
  }
 % hide-groups
 \gtreestaropt{hide\dhyphen groups}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, omit group skip and group heading, regardless of
the current \treestaropt{group-headings} or \opt{nogroupskip}
settings}
  }
 % bookmark-groups
 \gtreestaropt{bookmark\dhyphen groups}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true and \treestaroptval{group-headings}{true} and
    \gls{pdfbookmark} has been defined, this will add each letter
group to the PDF bookmarks}
  }
 % group-skip
 \gtreestaropt{group\dhyphen skip}
  {
    \syntax{\meta{dimension}}
    \initval{1ex plus 2pt minus 1pt}
    \desc{the value of the group skip (that is, the height of the
gap between letter groups) if enabled}
  }
 % post-group-heading-skip
 \gtreestaropt{post\dhyphen group\dhyphen heading\dhyphen skip}
  {
    \syntax{\meta{dimension}}
    \initval{1pt plus 2pt}
    \desc{the value of the post group heading skip (that is, the height of the
gap after letter group heading) if enabled}
  }
  % par-indent
  \gtreestaropt{par\dhyphen indent}
   {
     \syntax{\meta{value}}
     \initvalempty 
     \desc{the value may be empty (use the current paragraph
indentation) or a dimension to use as the paragraph indentation
within the glossary}
   }
  % par-skip
  \gtreestaropt{par\dhyphen skip}
   {
     \syntax{\meta{value}}
     \initval{0pt plus 0.3pt} 
     \desc{the value may be empty (use the current paragraph
skip) or a dimension to use as the paragraph skip
within the glossary}
   }
  % child-offset
  \gtreestaropt{child\dhyphen offset}
   {
     \syntax{\meta{dimension}}
     \initval{1em} 
     \desc{the sub-level offset dimension}
   }
  % hang-indent
  \gtreestaropt{hang\dhyphen indent}
   {
     \syntax{\meta{value}}
     \initvalempty 
     \defval{calculated}
     \desc{the value may be empty (use the current hanging
indentation) or the keyword \optfmt{calculated} to 
calculate the indentation or a dimension to use as the hanging indentation
within the glossary}
   }
  % name-symbol-padding
  \gtreestaropt{name\dhyphen symbol\dhyphen padding}
   {
     \syntax{\meta{value}}
     \initvalempty
     \desc{the extra padding that should be taken into account by
\treestaroptval{hang-indent}{calculated}} 
   }
  % name-padding
  \gtreestaropt{name\dhyphen padding}
   {
     \syntax{\meta{value}}
     \initvalempty
     \desc{the extra padding taken up by the name box that should be 
taken into account when calculating the width of the \idx{tree*.name+symbolbox}}
   }
  % symbol-padding
  \gtreestaropt{symbol\dhyphen padding}
   {
     \syntax{\meta{value}}
     \initvalempty
     \desc{the extra padding taken up by the symbol box that should be 
taken into account when calculating the width of the \idx{tree*.name+symbolbox}}
   }
  % item-counter-padding
  \gtreestaropt{item\dhyphen counter\dhyphen padding}
   {
     \syntax{\meta{value}}
     \initvalempty
     \desc{the extra padding that should be taken into account by
\treestaroptval{hang-indent}{calculated} for the top-level entry
counter} 
   }
  % sub-item-counter-padding
  \gtreestaropt{sub\dhyphen item\dhyphen counter\dhyphen padding}
   {
     \syntax{\meta{value}}
     \initvalempty
     \desc{the extra padding that should be taken into account by
\treestaroptval{hang-indent}{calculated} for the level~1 entry
counter} 
   }
  % header-font
  \gtreestaropt{header\dhyphen font}
   {
     \syntax{\meta{value}}
     \initvalcs{textbf} 
     \desc{the font declarations to use for the letter group headers
(if shown). The final command in the list may be a text-block
command}
   }
  % header-align
  \gtreestaropt{header\dhyphen align}
   {
     \syntax{\meta{value}}
     \initval{left}
     \desc{the horizontal alignment of the group header (if shown)}
   }
  % sub-header-font
  \gtreestaropt{sub\dhyphen header\dhyphen font}
   {
     \syntax{\meta{value}}
     \initval{inherit} 
     \desc{the font declarations to use for the sub-group headers
(if supported). The final command in the list may be a text-block
command. The \meta{value} may also be the keyword \optfmt{inherit}
which indicates to use the same setting as \treestaropt{header-font}}
   }
  % sub-header-align
  \gtreestaropt{sub\dhyphen header\dhyphen align}
   {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{the horizontal alignment of the sub-group header (if
supported)}
   }
  % hyper-nav
  \gtreestaropt{hyper\dhyphen nav}
  {
     \syntax{\meta{boolean}}
     \initval{false}
     \defval{true}
     \desc{if true, show the navigation strip}
  }
  % hyper-nav-skip
  \gtreestaropt{hyper\dhyphen nav\dhyphen skip}
  {
     \syntax{\meta{value}}
     \desc{the height of the space after the navigation strip. The
default setting is to use the same value as \treestaropt{group-skip}}
  }
  % hyper-nav-font
  \gtreestaropt{hyper\dhyphen nav\dhyphen font}
   {
     \syntax{\meta{value}}
     \initvalcs{textbf} 
     \desc{the font declarations to use for the navigation strip
(if shown). The final command in the list may be a text-block
command}
   }
  % hyper-nav-align
  \gtreestaropt{hyper\dhyphen nav\dhyphen align}
  {
     \syntax{\meta{value}}
     \initval{left}
     \desc{set the horizontal alignment of the navigation strip}
  }
  % name-symbol-sep
  \gtreestaropt{name\dhyphen symbol\dhyphen sep}
  {
     \syntax{\meta{value}}
     \initval{\visiblespace}
     \desc{set the \idx{tree*.namesymbolsep} for top-level entries}
  }
  % child-name-symbol-sep
  \gtreestaropt{child\dhyphen name\dhyphen symbol\dhyphen sep}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the \idx{tree*.namesymbolsep} for child entries}
  }
  % post-name-symbol
  \gtreestaropt{post\dhyphen name\dhyphen symbol}
  {
     \syntax{\meta{value}}
     \initval{\visiblespace}
     \desc{set the \idx{tree*.post-namesymbol} content for top-level entries}
  }
  % post-child-name-symbol
  \gtreestaropt{post\dhyphen child\dhyphen name\dhyphen symbol}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the \idx{tree*.post-namesymbol} content for child
entries}
  }
  % pre-description
  \gtreestaropt{pre\dhyphen description}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the \idx{tree*.pre-description} content for top-level
entries}
  }
  % pre-child-description
  \gtreestaropt{pre\dhyphen child\dhyphen description}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the \idx{tree*.pre-description} content for child
entries}
  }
  % pre-location
  \gtreestaropt{pre\dhyphen location}
  {
     \syntax{\meta{value}}
     \initval{\visiblespace}
     \desc{set the \idx{tree*.pre-location} content for top-level
entries}
  }
  % pre-child-location
  \gtreestaropt{pre\dhyphen child\dhyphen location}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the \idx{tree*.pre-location} content for
child-entries}
  }
  % post-location
  \gtreestaropt{post\dhyphen location}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the \idx{tree*.post-location} content for top-level
entries}
  }
  % post-child-location
  \gtreestaropt{post\dhyphen child\dhyphen location}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the \idx{tree*.post-location} content for child
entries}
  }
  % name-case
  \gtreestaropt{name\dhyphen case}
  {
     \syntax{\meta{value}}
     \initval{normal}
     \desc{apply a \idx{casechange} when displaying the name for
top-level entries}
  }
  % child-name-case
  \gtreestaropt{child\dhyphen name\dhyphen case}
  {
     \syntax{\meta{value}}
     \initval{normal}
     \desc{apply a \idx{casechange} when displaying the name for
child entries}
  }
  % symbol-case
  \gtreestaropt{symbol\dhyphen case}
  {
     \syntax{\meta{value}}
     \initval{normal}
     \desc{apply a \idx{casechange} when displaying the symbol for
top-level entries}
  }
  % child-symbol-case
  \gtreestaropt{child\dhyphen symbol\dhyphen case}
  {
     \syntax{\meta{value}}
     \initval{normal}
     \desc{apply a \idx{casechange} when displaying the symbol for
child entries}
  }
  % description-case
  \gtreestaropt{de\-scrip\-tion\dhyphen case}
  {
     \syntax{\meta{value}}
     \initval{normal}
     \desc{apply a \idx{casechange} when displaying the description for
top-level entries}
  }
  % child-description-case
  \gtreestaropt{child\dhyphen de\-scrip\-tion\dhyphen case}
  {
     \syntax{\meta{value}}
     \initval{normal}
     \desc{apply a \idx{casechange} when displaying the description for
child entries}
  }
  % name-style
  \gtreestaropt{name\dhyphen style}
  {
     \syntax{\meta{value}}
     \initval{name (symbol)}
     \desc{set the style used to display the name and\slash or symbol for
top-level entries}
  }
  % name-style = name (symbol)
  \gtreestaroptval{name-style}{name-psymbol}%
  {%
     \name{\optfmt{name (symbol)}}
     \desc{name first, followed by the symbol in parenthesis (if set)}
  }
  % name-style = name symbol
  \gtreestaroptval{name-style}{name-symbol}%
  {%
     \name{\optfmt{name symbol}}
     \desc{name first, followed by the symbol (if set)}
  }
  % name-style = symbol name
  \gtreestaroptval{name-style}{symbol-name}%
  {%
     \name{\optfmt{symbol name}}
     \desc{symbol first (if set), followed by the name}
  }
  % name-style = symbol (name)
  \gtreestaroptval{name-style}{symbol-pname}%
  {%
     \name{\optfmt{symbol (name)}}
     \desc{symbol first (if set), followed by the name in
parentheses}
  }
  % name-style = symbol
  \gtreestaroptval{name-style}{symbol}%
  {%
     \desc{symbol only}
  }
  % name-style = name
  \gtreestaroptval{name-style}{name}%
  {%
     \desc{name only}
  }
  % child-name-style
  \gtreestaropt{child\dhyphen name\dhyphen style}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the style used to display the name and\slash or symbol for
child entries}
  }
  % child-name-style = inherit
  \gtreestaroptval{child-name-style}{inherit}%
  {%
     \desc{match the \treestaropt{name-style} setting}
  }
  % child-name-style = omit
  \gtreestaroptval{child-name-style}{omit}%
  {%
     \desc{don't show either the name or symbol}
  }
  % child-name-style = name (symbol)
  \gtreestaroptval{child-name-style}{name-psymbol}%
  {%
     \name{\optfmt{name (symbol)}}
     \desc{name first, followed by symbol in parenthesis (if set)}
  }
  % child-name-style = name symbol
  \gtreestaroptval{child-name-style}{name-symbol}%
  {%
     \name{\optfmt{name symbol}}
     \desc{name first, followed by symbol (if set)}
  }
  % child-name-style = symbol name
  \gtreestaroptval{child-name-style}{symbol-name}%
  {%
     \name{\optfmt{symbol name}}
     \desc{symbol first (if set), followed by the name}
  }
  % child-name-style = symbol (name)
  \gtreestaroptval{child-name-style}{symbol-pname}%
  {%
     \name{\optfmt{symbol (name)}}
     \desc{symbol first (if set), followed by the name in
parentheses}
  }
  % child-name-style = symbol
  \gtreestaroptval{child-name-style}{symbol}%
  {%
     \desc{symbol only}
  }
  % child-name-style = name
  \gtreestaroptval{child-name-style}{name}%
  {%
     \desc{name only}
  }
  % omit-description
  \gtreestaropt{omit\dhyphen description}
  {
     \syntax{\meta{boolean}}
     \initval{false}
     \defval{true}
     \desc{if true, omit the description and the \idx{tree*.pre-description}
content, otherwise only omit if the description is empty or
suppressed}
  }
  % omit-child-description
  \gtreestaropt{omit\dhyphen child\dhyphen description}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \defval{true}
     \desc{if true, omit the description and the \idx{tree*.pre-description}
content, if false only omit if the description is empty or
suppressed, or if inherit match \treestaropt{omit-description}}
  }
  % omit-location
  \gtreestaropt{omit\dhyphen location}
  {
     \syntax{\meta{boolean}}
     \initval{false}
     \defval{true}
     \desc{if true, omit the location and the pre- and post-location
content, otherwise only omit if the \idx{locationlist} is empty}
  }
  % omit-child-location
  \gtreestaropt{omit\dhyphen child\dhyphen location}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \defval{true}
     \desc{if true, omit the location and the pre- and post-location
content for child entries, otherwise only omit if the \idx{locationlist} is empty}
  }
  % name-font
  \gtreestaropt{name\dhyphen font}
  {
     \syntax{\meta{value}}
     \initvalcs{textbf}
     \desc{set the font declarations to use when typesetting the name for
top-level entries}
  }
  % child-name-font
  \gtreestaropt{child\dhyphen name\dhyphen font}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the font declarations to use when typesetting the name for
child entries}
  }
  % symbol-font
  \gtreestaropt{symbol\dhyphen font}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the font declarations to use when typesetting the symbol for
top-level entries}
  }
  % child-symbol-font
  \gtreestaropt{child\dhyphen symbol\dhyphen font}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the font declarations to use when typesetting the symbol for
child entries}
  }
  % description-font
  \gtreestaropt{description\dhyphen font}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the font declarations to use when typesetting the description for
top-level entries}
  }
  % child-description-font
  \gtreestaropt{child\dhyphen description\dhyphen font}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the font declarations to use when typesetting the description for
child entries}
  }
  % location-font
  \gtreestaropt{location\dhyphen font}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the font declarations to use when typesetting the
\idx{locationlist} for top-level entries}
  }
  % child-location-font
  \gtreestaropt{child\dhyphen location\dhyphen font}
  {
     \syntax{\meta{value}}
     \initval{inherit}
     \desc{set the font declarations to use when typesetting the
\idx{locationlist} for child entries}
  }
  % item-counter-width
  \gtreestaropt{item\dhyphen counter\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the top-level entry counter box}
  }
  % sub-item-counter-width
  \gtreestaropt{sub\dhyphen item\dhyphen counter\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the level~1 entry counter box}
  }
  % item-counter-align
  \gtreestaropt{item\dhyphen counter\dhyphen align}
  {
     \syntax{\meta{h-align}}
     \initval{l}
     \desc{set the horizontal alignment of the top-level entry counter box, if it
has a fixed width}
  }
  % sub-item-counter-align
  \gtreestaropt{sub\dhyphen item\dhyphen counter\dhyphen align}
  {
     \syntax{\meta{h-align}}
     \initval{l}
     \desc{set the horizontal alignment of the level~1 entry counter box, if it
has a fixed width}
  }
  % item-counter-font
  \gtreestaropt{item\dhyphen counter\dhyphen font}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the font declarations to use when typesetting the
top-level entry counter}
  }
  % sub-item-counter-font
  \gtreestaropt{sub\dhyphen item\dhyphen counter\dhyphen font}
  {
     \syntax{\meta{value}}
     \initvalempty
     \desc{set the font declarations to use when typesetting the
level~1 entry counter}
  }
  % name-width
  \gtreestaropt{name\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.namebox} for top-level
entries}
  }
  % sub-name-width
  \gtreestaropt{sub\dhyphen name\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.namebox} for level~1
entries}
  }
  % sub-sub-name-width
  \gtreestaropt{sub\dhyphen sub\dhyphen name\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.namebox} for level~2
entries}
  }
  % name-align
  \gtreestaropt{name\dhyphen align}
  {
     \syntax{\meta{h-align}}
     \initval{l}
     \desc{set the horizontal alignment of the \idx{tree*.namebox}, 
     if it has a fixed width}
  }
  % widest-name
  \gtreestaropt{widest\dhyphen name}
  {
     \syntax{\meta{text}}
     \initvalempty
     \desc{set the widest name for top-level entries, used to
calculate the width if \treestaroptval{name-width}{widest}}
  }
  % widest-sub-name
  \gtreestaropt{widest\dhyphen sub\dhyphen name}
  {
     \syntax{\meta{text}}
     \initvalempty
     \desc{set the widest name for level~1 entries, used to
calculate the width if \treestaroptval{sub-name-width}{widest}}
  }
  % widest-sub-sub-name
  \gtreestaropt{widest\dhyphen sub\dhyphen sub\dhyphen name}
  {
     \syntax{\meta{text}}
     \initvalempty
     \desc{set the widest name for level~2 entries, used to
calculate the width if \treestaroptval{sub-sub-name-width}{widest}}
  }
  % update-widest-name
  \gtreestaropt{update\dhyphen widest\dhyphen name}
  {
     \syntax{\meta{text}}
     \desc{updates the widest name for top-level entries, if
\meta{text} is wider than the current value}
  }
  % update-widest-sub-name
  \gtreestaropt{update\dhyphen widest\dhyphen sub\dhyphen name}
  {
     \syntax{\meta{text}}
     \desc{updates the widest name for level~1 entries, if
\meta{text} is wider than the current value}
  }
  % update-widest-sub-sub-name
  \gtreestaropt{update\dhyphen widest\dhyphen sub\dhyphen sub\dhyphen name}
  {
     \syntax{\meta{text}}
     \desc{updates the widest name for level~2 entries, if
\meta{text} is wider than the current value}
  }
  % symbol-width
  \gtreestaropt{symbol\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.symbolbox} for top-level
entries}
  }
  % sub-symbol-width
  \gtreestaropt{sub\dhyphen symbol\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.symbolbox} for level~1
entries}
  }
  % sub-sub-symbol-width
  \gtreestaropt{sub\dhyphen sub\dhyphen symbol\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.symbolbox} for level~2
entries}
  }
  % symbol-align
  \gtreestaropt{symbol\dhyphen align}
  {
     \syntax{\meta{h-align}}
     \initval{l}
     \desc{set the horizontal alignment of the \idx{tree*.symbolbox}, 
     if it has a fixed width}
  }
  % widest-symbol
  \gtreestaropt{widest\dhyphen symbol}
  {
     \syntax{\meta{text}}
     \initvalempty
     \desc{set the widest symbol for top-level entries, used to
calculate the width if \treestaroptval{symbol-width}{widest}}
  }
  % widest-sub-symbol
  \gtreestaropt{widest\dhyphen sub\dhyphen symbol}
  {
     \syntax{\meta{text}}
     \initvalempty
     \desc{set the widest symbol for level~1 entries, used to
calculate the width if \treestaroptval{sub-symbol-width}{widest}}
  }
  % widest-sub-sub-symbol
  \gtreestaropt{widest\dhyphen sub\dhyphen sub\dhyphen symbol}
  {
     \syntax{\meta{text}}
     \initvalempty
     \desc{set the widest symbol for level~2 entries, used to
calculate the width if \treestaroptval{sub-sub-symbol-width}{widest}}
  }
  % update-widest-symbol
  \gtreestaropt{update\dhyphen widest\dhyphen symbol}
  {
     \syntax{\meta{text}}
     \desc{updates the widest symbol for top-level entries, if
\meta{text} is wider than the current value}
  }
  % update-widest-sub-symbol
  \gtreestaropt{update\dhyphen widest\dhyphen sub\dhyphen symbol}
  {
     \syntax{\meta{text}}
     \desc{updates the widest symbol for level~1 entries, if
\meta{text} is wider than the current value}
  }
  % update-widest-sub-sub-symbol
  \gtreestaropt{update\dhyphen widest\dhyphen sub\dhyphen sub\dhyphen symbol}
  {
     \syntax{\meta{text}}
     \desc{updates the widest symbol for level~2 entries, if
\meta{text} is wider than the current value}
  }
  % name-symbol-width
  \gtreestaropt{name\dhyphen symbol\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.name+symbolbox} for top-level
entries}
  }
  % sub-name-symbol-width
  \gtreestaropt{sub\dhyphen name\dhyphen symbol\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.name+symbolbox} for
level~1 entries}
  }
  % sub-sub-name-symbol-width
  \gtreestaropt{sub\dhyphen sub\dhyphen name\dhyphen symbol\dhyphen width}
  {
     \syntax{\meta{value}}
     \initval{natural}
     \desc{set the width of the \idx{tree*.name+symbolbox} for
level~2 entries}
  }
  % name-symbol-align
  \gtreestaropt{name\dhyphen symbol\dhyphen align}
  {
     \syntax{\meta{h-align}}
     \initval{l}
     \desc{set the horizontal alignment of the \idx{tree*.name+symbolbox}, 
     if it has a fixed width}
  }
  % \glossaries_tree_bookmark_group:nnn
  \gcmd{glos\-saries\dsb tree\dsb book\-mark\dsb group:nnn}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{bookmark-level} \margm{group-label} \margm{group-title}}
     \desc{uses \gls{pdfbookmark}, if defined, otherwise does
nothing}
   }
  % \glossaries_tree_pre_item:nnn
  \gcmd{glossaries\dsb tree\dsb pre\dsb item:nnn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{entry-label} \margm{location-list}}
     \desc{hook used at the start of each item}
  }
  % \glossaries_tree_post_item:nnn
  \gcmd{glossaries\dsb tree\dsb post\dsb item:nnn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{entry-label} \margm{location-list}}
     \desc{hook used at the end of each item}
  }
  % \GlsTreeSetup
  \gcmd{Gls\-Tree\-Setup}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\keyvallist}
     \desc{set the options for just the \glostyle{tree*} style}
  }
  % \GlsTreeStarNameBox
  \gcmd{Gls\-Tree\-Star\-Name\-Box}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\meta{text}}
     \desc{encapsulates the \idx{tree*.namebox}}
   }
  % \GlsTreeStarSymbolBox
  \gcmd{Gls\-Tree\-Star\-Symbol\-Box}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\meta{text}}
     \desc{encapsulates the \idx{tree*.symbolbox}}
   }
  % \GlsTreeStarOuterBox
  \gcmd{Gls\-Tree\-Star\-Outer\-Box}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\meta{text}}
     \desc{encapsulates the \idx{tree*.name+symbolbox}}
   }
  % \GlsTreeStarBox
  \gcmd{Gls\-Tree\-Star\-Box}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\meta{text}}
     \desc{used in the default definition of
\gls{GlsTreeStarNameBox}, \gls{GlsTreeStarSymbolBox}, and
\gls{GlsTreeStarOuterBox}}
   }
  % \GlsTreeStarItemCounterBox
  \gcmd{Gls\-Tree\-Star\-Item\-Count\-er\-Box}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\meta{text}}
     \desc{encapsulates the top-level counter value}
   }
  % \GlsTreeStarSubItemCounterBox
  \gcmd{Gls\-Tree\-Star\-Sub\-Item\-Count\-er\-Box}
   {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\meta{text}}
     \desc{encapsulates the level~1 counter value}
   }
  % \glossaries_tree_subgroup_title:nn
  \gcmd{glos\-saries\dsb tree\dsb sub\-group\dsb title:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{parent-label} \margm{group title}}
     \desc{used to format the sub-group title}
  }
  % \glossaries_tree_namenobox:n
  \gcmd{glossaries\dsb tree\dsb namenobox:n}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{text}}
     \desc{used to format the \idx{tree*.namebox} for the natural
width setting}
  }
  % \glossaries_tree_namebox:nnn
  \gfnsuffix{glos\-saries\dsb tree\dsb name\-box}{nnn}{vVn,vvn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{width} \margm{h-align} \margm{text}}
     \desc{used to format the \idx{tree*.namebox} for the fixed
width setting}
  }
  % \glossaries_tree_symbolnobox:n
  \gcmd{glossaries\dsb tree\dsb symbolnobox:n}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{text}}
     \desc{used to format the \idx{tree*.symbolbox} for the natural
width setting}
  }
  % \glossaries_tree_symbolbox:nnn
  \gfnsuffix{glos\-saries\dsb tree\dsb symbol\-box}{nnn}{vVn,vvn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{width} \margm{h-align} \margm{text}}
     \desc{used to format the \idx{tree*.symbolbox} for the fixed
width setting}
  }
  % \glossaries_tree_paren:n
  \gcmd{glos\-saries\dsb tree\dsb paren:n}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{text}}
     \desc{applies parentheses to \meta{text}}
  }
  % \glossaries_tree_entryitem_nobox:n
  \gcmd{glos\-saries\dsb tree\dsb entry\-item\dsb nobox:n}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{text}}
     \desc{used to format the top-level entry item counter for the natural
width setting}
  }
  % \glossaries_tree_entryitembox:nnn
  \gfnsuffix{glos\-saries\dsb tree\dsb entry\-item\-box}{nnn}{VVn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{width} \margm{h-align} \margm{text}}
     \desc{used to format the top-level entry item counter for the fixed
width setting}
  }
  % \glossaries_tree_subentryitem_nobox:n
  \gcmd{glos\-saries\dsb tree\dsb sub\-entry\-item\dsb nobox:n}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{text}}
     \desc{used to format the level~1 entry item counter for the natural
width setting}
  }
  % \glossaries_tree_subentryitembox:nnn
  \gfnsuffix{glos\-saries\dsb tree\dsb sub\-entry\-item\-box}{nnn}{VVn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{width} \margm{h-align} \margm{text}}
     \desc{used to format the level~1 entry item counter for the fixed
width setting}
  }
  % \glossaries_tree_set_name_width:nn
  \gcmd{glos\-saries\dsb tree\dsb set\dsb name\dsb width:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{value}}
     \desc{sets the name width for the given level}
  }
  % \glossaries_tree_set_symbol_width:nn
  \gcmd{glos\-saries\dsb tree\dsb set\dsb symbol\dsb width:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{value}}
     \desc{sets the symbol width for the given level}
  }
  % \glossaries_tree_set_widest_name:nn
  \gcmd{glos\-saries\dsb tree\dsb set\dsb widest\dsb name:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{text}}
     \desc{locally sets the widest name for the given level}
  }
  % \glossaries_tree_gset_widest_name:nn
  \gcmd{glos\-saries\dsb tree\dsb gset\dsb widest\dsb name:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{text}}
     \desc{globally sets the widest name for the given level}
  }
  % \glossaries_tree_set_widest_symbol:nn
  \gcmd{glos\-saries\dsb tree\dsb set\dsb widest\dsb symbol:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{text}}
     \desc{locally sets the widest symbol for the given level}
  }
  % \glossaries_tree_gset_widest_symbol:nn
  \gcmd{glos\-saries\dsb tree\dsb gset\dsb widest\dsb symbol:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{text}}
     \desc{globally sets the widest symbol for the given level}
  }
  % \glossaries_tree_set_name_symbol_width:nn
  \gcmd{glos\-saries\dsb tree\dsb set\dsb name\dsb symbol\dsb width:nn}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{value}}
     \desc{sets the width for the \idx{tree*.name+symbolbox}, which should
include room for the \idx{tree*.namesymbolsep} and
\idx{tree*.post-namesymbol} content}
  }
  % \glossaries_tree_update_widest_name:nn
  \gfnsuffix{glos\-saries\dsb tree\dsb update\dsb widest\dsb name}{nn}
   {ne,nV,nv,no}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{text}}
     \desc{updates the widest name for the given level}
  }
  % \glossaries_tree_update_widest_symbol:nn
  \gfnsuffix{glos\-saries\dsb tree\dsb update\dsb widest\dsb symbol}{nn}
   {ne,nV,nv,no}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{text}}
     \desc{updates the widest symbol for the given level}
  }
  % \glossaries_tree_update_widest_name_symbol:nnn
  \gfnsuffix{glos\-saries\dsb tree\dsb update\dsb widest\dsb name\dsb symbol}{nnn}
   {nee,nVV,nvv,noo}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\ \margm{level} \margm{name} \margm{symbol}}
     \desc{updates the widest name and symbol combination for the given level}
  }
  % \glossaries_tree_reset_all_widest:
  \gcmd{glos\-saries\dsb tree\dsb re\-set\dsb all\dsb widest:}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \desc{resets the widest name and symbol for all levels and
reverts back to natural}
  }
  % \GlsTreeUpdateWidestNameOrSymbol
  \gcmd{Gls\-Tree\-Update\-Widest\-Name\-Or\-Symbol}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\oargm{level}\margm{entry-label}}
     \desc{updates the current widest name or widest symbol if the
entry's name is wider than the current name width or if the entry's
symbol is wider than the current symbol width}
  }
  % \GlsTreeUpdateWidestNameAndSymbol
  \gcmd{Gls\-Tree\-Update\-Widest\-Name\-And\-Symbol}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\oargm{level}\margm{entry-label}}
     \desc{updates the current widest name and widest symbol if the
combined width of the given entry's name and symbol is wider than 
the current name+symbol setting}
  }
  % index
  \gglosty{index}{\providedby{\sty{glossary-tree}}
   \desc{a style similar to standard indexes but also shows the
description and, if set, the symbol}
  }
  % indexgroup
  \gglosty{index\-group}{\providedby{\sty{glossary-tree}}
   \desc{a style similar to standard indexes with letter \idx{group}
headings but also shows the
description and, if set, the symbol}
  }
  % indexhypergroup
  \gglosty{index\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a style similar to standard indexes with letter \idx{group}
headings and a navigation line but also shows the
description and, if set, the symbol}
  }
  % tree
  \gglosty{tree}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style that shows the name, description
and, if set, the symbol}
  }
  % treegroup
  \gglosty{tree\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings 
   that shows the name, description and, if set, the symbol}
  }
  % treehypergroup
  \gglosty{tree\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings 
   and navigation line
   that shows the name, description and, if set, the symbol}
  }
  % treenoname
  \gglosty{tree\-no\-name}{\providedby{\sty{glossary-tree}}
   \desc{a \idx{homograph} style that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % treenonamegroup
  \gglosty{tree\-no\-name\-group}{\providedby{\sty{glossary-tree}} 
   \desc{a \idx{homograph} style with letter \idx{group} headings that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % treenonamehypergroup
  \gglosty{tree\-no\-name\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \idx{homograph} style with letter \idx{group} headings
and navigation line that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % alttree
  \gglosty{alt\-tree}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % alttreegroup
  \gglosty{alt\-tree\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % alttreehypergroup
  \gglosty{alt\-tree\-hyper\-group}{\providedby{\sty{glossary-tree}}
   \desc{a \hierarchical\ style with letter \idx{group} headings and
navigation line that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % STYLES: glossary-mcols
  % mcoltree*
  \gglosty{mcoltree*}{\providedby{\sty{glossary-mcols} v4.59+}
   \desc{a multicolumn style built on the \glostyle{tree*} style.
   This style may be modified with the \glostyleopt{mcoltree*} or
   \glostyleopt{tree*} options}
  }
  % \GlsMcolTreeSetup
  \gcmd{Gls\-Mcol\-Tree\-Setup}
  {
     \providedby{\sty{glossary-tree} v4.59+}
     \syntax{\keyvallist}
     \desc{set the options for just the \glostyle{mcoltree*} style}
  }
 % mcoltree* options
 % balance
 \gmcoltreestaropt{balance}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, balance the columns}
  }
 % columns
 \gmcoltreestaropt{columns}
  {
    \syntax{\meta{n}}
    \initval{2}
    \desc{sets the number of columns}
  }
 % span-nav
 \gmcoltreestaropt{span\dhyphen nav}
  {
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true and the \glostyleopt{tree*} option \treestaropt{hyper-nav}
     is also true, then the hyper navigation panel will span all
columns}
  }
  % mcolindex
  \gglosty{mcol\-index}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn style similar to standard indexes but also shows the
description and, if set, the symbol}
  }
  % mcolindexgroup
  \gglosty{mcol\-index\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn style similar to standard indexes with letter \idx{group}
headings but also shows the
description and, if set, the symbol}
  }
  % mcolindexhypergroup
  \gglosty{mcol\-index\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn style similar to standard indexes with letter \idx{group}
headings and a navigation line at the start of the first column but also shows the
description and, if set, the symbol}
  }
  % mcolindexspannav
  \gglosty{mcol\-index\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a multicolumn style similar to standard indexes with letter \idx{group}
headings and a navigation line spanning all columns but also shows the
description and, if set, the symbol}
  }
  % mcoltree
  \gglosty{mcol\-tree}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style that shows the name, description
and, if set, the symbol}
  }
  % mcoltreegroup
  \gglosty{mcol\-tree\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings 
   that shows the name, description and, if set, the symbol}
  }
  % mcoltreehypergroup
  \gglosty{mcol\-tree\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings 
   and navigation line at the start of the first column
   that shows the name, description and, if set, the symbol}
  }
  % mcoltreespannav
  \gglosty{mcol\-tree\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings 
   and navigation line spanning all columns
   that shows the name, description and, if set, the symbol}
  }
  % mcoltreenoname
  \gglosty{mcol\-tree\-no\-name}{\providedby{\sty{glossary-mcols} v3.02+} 
   \desc{a multicolumn \idx{homograph} style that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcoltreenonamegroup
  \gglosty{mcol\-tree\-no\-name\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \idx{homograph} style with letter \idx{group} headings that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcoltreenonamehypergroup
  \gglosty{mcol\-tree\-no\-name\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \idx{homograph} style with letter \idx{group} headings
and navigation line at the start of the first column that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcoltreenonamespannav
  \gglosty{mcol\-tree\-no\-name\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a multicolumn \idx{homograph} style with letter \idx{group} headings
and navigation line spanning all columns that shows the top-level name,
description and, if set, the symbol, but omits the name for
sub-entries}
  }
  % mcolalttree
  \gglosty{mcol\-alt\-tree}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % mcolalttreegroup
  \gglosty{mcol\-alt\-tree\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a multicolumn \hierarchical\ style with letter \idx{group} headings that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % mcolalttreehypergroup
  \gglosty{mcol\-alt\-tree\-hyper\-group}{\providedby{\sty{glossary-mcols} v3.02+}
   \desc{a \hierarchical\ style with letter \idx{group} headings and
navigation line at the start of the first column that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
  }
  % mcolalttreespannav
  \gglosty{mcol\-alt\-tree\-span\-nav}{\providedby{\sty{glossary-mcols} v4.22+}
   \desc{a \hierarchical\ style with letter \idx{group} headings and
navigation line spanning all columns that shows the name, description
and, if set, the symbol. The name is set in a box whose width is
given by the widest name that has to be identified with
\gls{glssetwidest}}
}
  % STYLES: glossaries-inline
  % inline
  \gglosty{in\-line}{\providedby{\sty{glossary-inline} v3.03+}
    \desc{an inline \idx{homograph} style}
  }
  % EXTRA STYLES
  % bookindex style
  \gxtrglosty{book\-index}{\providedby{\sty{glossary-bookindex} v1.21+}
   \desc{designed for indexes, the description isn't shown}
  }
  % long-name-desc-sym-loc
  \gxtrglosty{long\dhyphen name\dhyphen desc\dhyphen sym\dhyphen loc}%
   {\providedby{\sty{glossary-longextra} v1.21+}
   \desc{tabular style with 4 columns}
  }
  % long-name-desc
  \gxtrglosty{long\dhyphen name\dhyphen desc}%
   {\providedby{\sty{glossary-longextra} v1.37+}
   \desc{tabular style with 2 columns}
  }
  % topic
  \gxtrglosty{topic}
  {\providedby{\sty{glossary-topic} v1.40+}
   \desc{designed for paragraph length top-level descriptions}
  }
  % topicmcols
  \gxtrglosty{topic\-mcols}
  {\providedby{\sty{glossary-topic} v1.40+}
   \desc{designed for paragraph length top-level descriptions with
    sub-entries in multiple columns}
  }
  % ACRONYM STYLES
  % long-short
  \gacrsty{long\dhyphen short}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short})}
  }
  % short-long
  \gacrsty{short\dhyphen long}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long})}
  }
  % sc-short-long
  \gacrsty{sc\dhyphen short\dhyphen long}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with short form
    in smallcaps}
  }
  % sm-short-long
  \gacrsty{sm\dhyphen short\dhyphen long}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with short form
    in a smaller font}
  }
  % short-long-desc
  \gacrsty{short\dhyphen long\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) and a
description must be supplied}
  }
  % sc-short-long-desc
  \gacrsty{sc\dhyphen short\dhyphen long\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with the short
form in smallcaps and a
description must be supplied}
  }
  % sm-short-long-desc
  \gacrsty{sm\dhyphen short\dhyphen long\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} (\meta{long}) with the short
form in a smaller font and a
description must be supplied}
  }
  % long-sp-short
  \gacrsty{long\dhyphen sp\dhyphen short}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \desc{first use shows \meta{long} (\meta{short}) where the space
may be converted to a non-breaking space}
  }
  % long-sc-short
  \gacrsty{long\dhyphen sc\dhyphen short}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in smallcaps}
  }
  % long-sm-short
  \gacrsty{long\dhyphen sm\dhyphen short}%
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in a smaller font}
  }
  % long-short-desc
  \gacrsty{long\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) where the
description must be supplied}
  }
  % long-sp-short-desc
  \gacrsty{long\dhyphen sp\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.16+}
    \desc{first use shows \meta{long} (\meta{short}) where the space
may be converted to a non-breaking space and the description must be
supplied}
  }
  % long-sc-short-desc
  \gacrsty{long\dhyphen sc\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in smallcaps and the description must be supplied}
  }
  % long-sm-short-desc
  \gacrsty{long\dhyphen sm\dhyphen short\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{long} (\meta{short}) with the short
form in a smaller font and the description must be supplied}
  }
  % dua
  \gacrsty{dua}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{both the first use and subsequent use only show the long
form}
  }
  % dua-desc
  \gacrsty{dua\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{both the first use and subsequent use only show the long
form and the description must be supplied}
  }
  % footnote
  \gacrsty{footnote}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} followed by the long form in
a footnote}
  }
  % footnote-sc
  \gacrsty{footnote\dhyphen sc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in smallcaps followed by the long form in
a footnote}
  }
  % footnote-sm
  \gacrsty{footnote\dhyphen sm}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in a smaller font followed by the long form in
a footnote}
  }
  % footnote-desc
  \gacrsty{footnote\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} followed by the long form in
a footnote and the description must be supplied}
  }
  % footnote-sc-desc
  \gacrsty{footnote\dhyphen sc\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in smallcaps followed by the long form in
a footnote and the description must be supplied}
  }
  % footnote-sm-desc
  \gacrsty{footnote\dhyphen sm\dhyphen desc}
  {%
    \providedby{\sty{glossaries} v4.02+}
    \desc{first use shows \meta{short} in a smaller font followed by the long form in
a footnote and the description must be supplied}
  }
  % ABBREVIATION STYLES
  % long-short
  \gabbrsty{long\dhyphen short}{}
  % short-long
  \gabbrsty{short\dhyphen long}{}
  % long-short-desc
  \gabbrsty{long\dhyphen short\dhyphen desc}{}
  % long-short-user
  \gabbrsty{long\dhyphen short\dhyphen user}{}
  % long-short-sc
  \gabbrsty{long\dhyphen short\dhyphen sc}{}
  % long-short-sc-desc
  \gabbrsty{long\dhyphen short\dhyphen sc\dhyphen desc}{}
  % long-em-short-em
  \gabbrsty{long\dhyphen em\dhyphen short\dhyphen em}{}
  % long-short-em
  \gabbrsty{long\dhyphen short\dhyphen em}{}
  % short-nolong
  \gabbrsty{short\dhyphen nolong}{}
  % short-nolong-noreg
  \gabbrsty{short\dhyphen nolong\dhyphen noreg}{}
  % long-noshort
  \gabbrsty{long\dhyphen noshort}{}
  % short-sc-footnote
  \gabbrsty{short\dhyphen sc\dhyphen footnote}{}
  % short-footnote-desc
  \gabbrsty{short\dhyphen footnote\dhyphen desc}{}
  % short-sc-footnote-desc
  \gabbrsty{short\dhyphen sc\dhyphen footnote\dhyphen desc}{}
  % short-sc-postfootnote-desc
  \gabbrsty{short\dhyphen sc\dhyphen postfootnote\dhyphen desc}{}
  % footnote
  \gabbrsty{footnote}{}
  % postfootnote
  \gabbrsty{postfootnote}{}
  % RESOURCE OPTIONS
  \gidx{resourceopt}{\name{resource options}%
    \field{text}{resource option}%
    \field{see}{GlsXtrLoadResources}
  } 
  % resource option src
  \gresourceopt{src}%
  {%
    \syntax{\meta{list}}
    \initval{\csfmt{jobname}}
    \desc{a comma-separated list of \ext+{bib} files that contain the
      entry data (the file extension may be omitted)}
  }
  % resource option selection
  \gresourceopt{selection}%
  {%
    \syntax{\meta{value}}
    \initval{recorded and deps and see}
    \desc{the selection criteria}
  }
  % resource option sort-field
  \gresourceopt{sort\dhyphen field}%
  {%
    \syntax{\meta{value}}
    \initval{sort}
    \desc{the field to use for sorting}
  }
  % resource option save-locations
  \gresourceopt{save\dhyphen locations}%
  {%
    \syntax{\meta{value}}
    \initval{true}
    \defval{true}
    \desc{determines whether or not to save the \idx{locationlist}.
     This was originally a boolean option but as from \app{bib2gls}
     v3.0 it takes additional values}
  }
  % resource option save-loclist
  \gresourceopt{save\dhyphen loclist}%
  {%
    \syntax{\meta{boolean}}
    \initval{true}
    \defval{true}
    \desc{determines whether or not to save the \locations\
     in the \glosfield{loclist} field (as an \sty{etoolbox} list)}
  }
  % resource option sort
  \gresourceopt{sort}%
  {%
    \syntax{\meta{value}}
    \initval{doc}
    \desc{identifies the sort method. The default is to use the
    document's language or (if not set) the default locale}
  }
  % resource option dual-sort
  \gresourceopt{dual\dhyphen sort}%
  {%
    \syntax{\meta{value}}
    \initval{combine}
    \desc{identifies the sort method for dual entries}
  }
  % resource option sort-rule
  \gresourceopt{sort\dhyphen rule}%
  {%
    \syntax{\meta{value}}
    \desc{the sort rule to use with \resourceoptval{sort}{custom}}
  }
  % resource option group-level
  \gresourceopt{group\dhyphen level}%
  {%
    \syntax{\meta{value}}
    \desc{if letter \idx{group} formation is enabled, this option
may be used to create sub-groups}
  }
  % resource option type
  \gresourceopt{type}
  {
    \syntax{\meta{glossary-type}}
    \desc{indicates that primary entries should be
     assigned to the given \idx{glossary}}
  }
  % resource option dual-type
  \gresourceopt{dual\dhyphen type}
  {
    \syntax{\meta{glossary-type}}
    \desc{indicates that dual entries should be
     assigned to the given \idx{glossary}}
  }
  % resource option category
  \gresourceopt{category}
  {
    \syntax{\meta{category-label}}
    \desc{indicates that primary entries should be
     assigned to the given category}
  }
  % resource option dual-category
  \gresourceopt{dual\dhyphen category}
  {
    \syntax{\meta{category-label}}
    \desc{indicates that dual entries should be
     assigned to the given category}
  }
  % resource option group
  \gresourceopt{group}
  {
    \syntax{\meta{group-label}}
    \desc{indicates that primary entries should have the
     \gloskey{group} field set to the given value. See also
     \gallerypage{logicaldivisions}{Gallery: Logical Glossary Divisions 
     (type vs group vs parent)}}
  }
  % resource option replicate-fields
  \gresourceopt{replicate\dhyphen fields}
  {
    \syntax{\margm{assignments}}
    \desc{copies the values of fields into other fields}
  }
  % resource option name-case-change
  \gresourceopt{name\dhyphen case\dhyphen change}
  {
    \syntax{\margm{value}}
    \desc{applies a \idx{casechange} to the \gloskey{name} field}
  }
  % resource option label-prefix
  \gresourceopt{label\dhyphen prefix}
  {
    \syntax{\margm{prefix}}
    \desc{applies the given prefix to entry labels}
  }
  % resource option dual-prefix
  \gresourceopt{dual\dhyphen prefix}
  {
    \syntax{\margm{prefix}}
    \desc{applies the given prefix to dual entry labels}
  }
  % resource option ext-prefixes
  \gresourceopt{ext\dhyphen prefixes}
  {
    \syntax{\margm{prefix list}}
    \desc{supplies external prefix labels}
  }
  % resource option append-prefix-field
  \gresourceopt{append\dhyphen prefix\dhyphen field}
  {
    \syntax{\margm{value}}
    \desc{may be used to append a space to the prefix fields}
  }
  % resource option identical-sort-action
  \gresourceopt{identical\dhyphen sort\dhyphen action}
  {
    \syntax{\margm{value}}
    \desc{indicates what to do with entries that have identical sort values}
  }
  % resource option break-at
  \gresourceopt{break\dhyphen at}
  {
    \syntax{\margm{value}}
    \desc{indicates if the sort value should be broken into words (word order) or 
      no break (letter order)}
  }
  % resource option set-widest
  \gresourceopt{set\dhyphen widest}
  {
    \syntax{\margm{boolean}}
    \initval{false}
    \defval{true}
    \desc{instructs \app{bib2gls} to compute the widest names for 
    use with styles such as \glostyle{alttree}}
  }
  % resource option write-preamble
  \gresourceopt{write\dhyphen preamble}
  {
    \syntax{\margm{boolean}}
    \initval{true}
    \defval{true}
    \desc{instructs \app{bib2gls} to write the contents of the
     \idx+{preamble/bib} (\atentry{preamble}) to the \ext+{glstex}
     file}
  }
  % resource option field-aliases
  \gresourceopt{field\dhyphen alias}
  {
    \syntax{\margm{\keyvallist}}
    \desc{identifies field names that should be aliased}
  }
  % resource option entry-type-aliases
  \gresourceopt{entry\dhyphen type\dhyphen aliases}
  {
    \syntax{\margm{\keyvallist}}
    \desc{identifies entry types that should be aliased}
  }
  % resource option min-loc-range
  \gresourceopt{min\dhyphen loc\dhyphen range}
  {
    \syntax{\meta{value}}
    \desc{sets the minimum number of consecutive \locations\ to
    compact into a \idx{range}}
  }
  % resource option max-loc-diff
  \gresourceopt{max\dhyphen loc\dhyphen diff}
  {
    \syntax{\meta{value}}
    \desc{sets the maximum difference between two sequential \locations\ to 
     consider them for a merger into an implicit \idx{range}}
  }
  % resource option suffixF
  \gresourceopt{suffixF}
  {
    \syntax{\meta{value}}
    \desc{sets the suffix for two consecutive \locations}
  }
  % resource option suffixFF
  \gresourceopt{suffixFF}
  {
    \syntax{\meta{value}}
    \desc{sets the suffix for three or more consecutive \locations}
  }
  % resource option compact-ranges
  \gresourceopt{compact\dhyphen ranges}
  {
    \syntax{\meta{value}}
    \desc{compacts ranges (for example, \qt{184--189} will be
    shortened to \qt{184--9})}
  }
  % resource option save-child-count
  \gresourceopt{save\dhyphen child\dhyphen count}%
  {%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, each entry will have the total number of child
     entries stored in the \glosfield{childcount} field and the list of
     children will be stored in the \glosfield+{childlist} field}
  }
  % resource option save-sibling-count
  \gresourceopt{save\dhyphen sibling\dhyphen count}%
  {%
    \syntax{\meta{boolean}}
    \initval{false}
    \defval{true}
    \desc{if true, each entry will have the total number of sibling
     entries stored in the \glosfield{siblingcount} field and the list of
     siblings will be stored in the \glosfield{siblinglist} field}
  }
  % resource option abbreviation-sort-fallback
  \gresourceopt{abbreviation\dhyphen sort\dhyphen fallback}
  {
    \syntax{\meta{field}}
    \initval{short}
    \desc{the fallback field to use for \atentry{abbreviation} if the 
    \gloskey{sort} field hasn't been supplied}
  }
  % resource option ignore-fields
  \gresourceopt{ignore\dhyphen fields}
  {
    \syntax{\meta{field list}}
    \desc{ignore the listed fields}
  }
  % resource option loc-counters
  \gresourceopt{loc\dhyphen counters}
  {
    \syntax{\meta{counter list}}
    \desc{group the \locations\ according the their 
     \idx{locationcounter} in the given order}
  }
  % resource option primary-location-formats
  \gresourceopt{primary\dhyphen location\dhyphen formats}
  {
    \syntax{\meta{list}}
    \desc{identifies \idxpl{encap} that should be considered primary
formats}
  }
  % resource option combine-dual-locations
  \gresourceopt{combine\dhyphen dual\dhyphen locations}
  {
    \syntax{\meta{value}}
    \desc{allows \idxpl{locationlist} for primary and dual entries to be merged}
  }
  % resource option field-aliases
  \gresourceopt{field\dhyphen aliases}
  {
    \syntax{\keyvallist}
    \desc{sets up field aliases}
  }
  % CATEGORIES
  \gcat{general}{}
  \gcat{abbreviation}{}
  \gcat{acronym}{}
  \gcat{symbol}{}
  \gcat{number}{}
  \gcat{index}{}
  % CATEGORy ATTRIBUTES
  \gcatattr{gloss\-name}{}% glossname
  \gcatattr{gloss\-name\-font}{}% glossnamefont
  \gcatattr{gloss\-desc}{}% glossdesc
  \gcatattr{gloss\-desc\-font}{}% glossdescfont
  \gcatattr{gloss\-symbol\-font}{}% glosssymbolfont
  \gcatattr{no\-hyper}{}% nohyper
  \gcatattr{no\-hyper\-first}{}% nohyperfirst
  \gcatattr{discard\-period}{}% discardperiod
  \gcatattr{insert\-dots}{}% insertdots
  \gcatattr{index\-only\-first}{}% indexonlyfirst
  \gcatattr{no\-short\-plural}{}% noshortplural
  \gcatattr{retain\-first\-use\-period}{}% retainfirstuseperiod
  \gcatattr{plural\-discard\-period}{}% pluraldiscardperiod
  % language files
  \gfilemeta{glossaries\dhyphen}{language}{}{}% glossaries-<language>
  \gfile{glossaries\dhyphen french}{}% glossaries-french
  \gfile{glossaries\dhyphen german}{}% glossaries-german
  % file extensions
  \gidxpl{fileextension}{%
    \field{text}{file extension}
    \field{seealso}{fileformat}
  }
  \gext{log}{}
  \gext{tex}{}
  \gext{bib}{}
  \gext{glo}{}
  \gext{gls}{}
  \gext{glg}{}
  \gext{glo2}{}
  \gext{gls2}{}
  \gext{glg2}{}
  \gext{ist}{}
  \gext{xdy}{}
  \gext{aux}{}
  \gext{glstex}{}
  \gext{glslabels}{}
  \gext{alg}{}
  \gext{acr}{}
  \gext{acn}{}
  \gext{slo}{}
  \gext{sls}{}
  \gext{slg}{}
  \gext{nlo}{}
  \gext{nls}{}
  \gext{nlg}{}
  \gext{ind}{}
  \gext{idx}{}
  \gext{ilg}{}
  \gext{glsdefs}{}
  \gext{ldf}{}
  \gext{toc}{}
  % GENERAL INDEX
  \gidxpl{acronym}{\common}
  \gidxpl{abbreviation}{%
    \common
    \field{text}{\xtrfmt{abbreviation}}
    \field{plural}{\xtrfmt{abbreviations}}
  }
  \gidxpl{glossaryentry}%
  {%
    \common
    \field{text}{glossary entry}%
    \field{plural}{glossary entries}%
  }
  \gidx{entry}{\common\field{plural}{entries}\field{alias}{idx.glossaryentry}}
  \gidx{entryformat}{\name{entry format}}
  \gidx{displaystyle}{\name{display style (or format)}
    \field{text}{display style}
    \field{alias}{idx.entryformat}}
  \gidx{formatentry}{\name{entry}\field{parent}{idx.format}\field{alias}{idx.entryformat}}
  \gidx{acronymformat}{\name{acronym format}
   \field{alias}{idx.acronymstyle}
  }
  \gidx{formatacronym}%
  {%
    \name{acronym}
    \field{parent}{idx.format}
    \field{text}{acronym format}
    \field{alias}{idx.acronymstyle}
  }
  \gidxpl{xindyattr}{\field{text}{xindy attribute}}
  \gidx{accessattr}{\name{accessibility attribute}}
  \gidx{attribute}{\field{see}{idx.accessattr,idx.categoryattribute,idx.xindyattr}}
  \gidx{preamble}{}
  \gidx{preamble/glossary}
  {
    \name{glossary}
    \field{first}{glossary preamble}
    \field{text}{preamble}
    \field{parent}{idx.preamble}
  }
  \gidx{preamble/document}
  {
    \common
    \name{document}
    \field{first}{document preamble}
    \field{text}{preamble}
    \field{parent}{idx.preamble}
  }
  \gidx{preamble/bib}
  {
    \name{\filefmt{bib}}
    \field{text}{preamble}
    \field{parent}{idx.preamble}
  }
  \gidx{postamble}{}
  \gidx{compositor}{}
  \gidx{pageprecedence}{\name{page precedence}}
  \gidx{pagecompositor}{\name{page compositor}\field{alias}{idx.compositor}}
  \gidx{compositelocation}{\name{composite location}\field{alias}{idx.compositor}}
  \gidx{auto-completion}{}
  \gidxpl{PDFbookmark}{\field{text}{\glsxtrsmfont{PDF} bookmark}}
  \gidx{PDFelement}{\name{\glsxtrsmfont{PDF} element}}
  \gidx{hyperlink}{\common}
  \gidx{hypertarget}{}
  \gidx{tableofcontents}{\name{table of contents}\common}
  \gidx{uppercase}{\field{seealso}{idx.titlecase,idx.sentencecase,idx.allcaps}}
  \gidx{lowercase}{}
  \gidx{titlecase}{\name{title case}}
  \gidx{sentencecase}{\common\name{sentence case}}
  \gidx{allcaps}{\common\name{all caps}}
  \gidx{mathmode}{\name{math mode}}
  \gidx{encoding}{\field{seealso}{idx.codepage}}
  \gidx{codepage}{\field{seealso}{idx.encoding}}
  \gidx{range}{\name{ranges (locations)}
    \field{text}{range}
  }
  \gidx{locationrange}{\name{location range}}
  \gacr{PDF}{PDF}{Portable Document Format}{}
  \gacr{URL}{URL}{Uniform Resource Locator}{}
  \gacr{DVI}{DVI}{device independent file format}{}
  \gidx{interwordspace}{\name{inter-word space}}
  \gidx{intersentencespace}{\name{inter-sentence space}}
  \gidx{spacefactor}{\name{space factor}}
  \gidxpl{tree*elem}{\field{text}{\glostylefmt{tree*} element}}
  \gidx{tree*.namebox}{\parent{idx.tree*elem}\name{name box}}
  \gidx{tree*.symbolbox}{\parent{idx.tree*elem}\name{symbol box}}
  \gidx{tree*.name+symbolbox}{\parent{idx.tree*elem}\name{name+symbol box}}
  \gidx{tree*.namesymbolsep}{\parent{idx.tree*elem}\name{name\slash symbol separator}}
  \gidx{tree*.post-namesymbol}{\parent{idx.tree*elem}\name{post name\slash symbol}}
  \gidx{tree*.pre-namesymbol}{\parent{idx.tree*elem}\name{pre name\slash symbol}}
  \gidx{tree*.pre-description}{\parent{idx.tree*elem}\name{pre description}}
  \gidx{tree*.pre-location}{\parent{idx.tree*elem}\name{pre location}}
  \gidx{tree*.post-location}{\parent{idx.tree*elem}\name{post location}}
  % COMMANDS: GENERAL
  \gcmd{data\-tool\dsb sort\-word\-seq:NN}{}% \datatool_sortwordseq:NN
  \gcmd{new\-dual\-entry}{}% \newdualentry
  \gcmd{cs.glossary}{\name{\csfmt{glossary}}}% \glossary
  \gcmd{make\-glossary}{}% \makeglossary
  \gcmd{Print\-Changes}{}% \PrintChanges
  \gcmd{pro\-vide\-com\-mand}{}% \providecommand
  \gcmd{job\-name}{}% \jobname
  \gcmd{new\-write}{}% \newwrite
  \gcmd{no\-files}{}% \nofiles
  \gcmd{write}{}% \write
  \gcmd{num\-ber\-line}{}% \numberline
  \gcmd{add\-con\-tents\-line}{}% \addcontentsline
  \gcmd{en\-sure\-math}{}% \ensuremath
  \gcmd{set\-to\-width}{}% \settowidth
  \gcmd{set\-to\-height}{}% \settoheight
  \gcmd{set\-to\-depth}{}% \settodepth
  \gcmd{def}{}% \def
  \gcmd{gdef}{}% \gdef
  \gcmd{space}{\common}% \space
  \gcmd{show}{}% \show
  \gcmd{protected\-@\-edef}{}% \protected@edef
  \gcmd{protected\-@\-write}{}% \protected@write
  \gcmd{protected\-@\-cs\-edef}{}% \protected@csedef
  \gcmd{protected\-@\-cs\-xdef}{}% \protected@csxdef
  \gcmd{@for}{}% \@for
  \gcmd{index\-entry}{}% \indexentry
  \gcmd{un\-skip}{}% \unskip
  \gcmd{relax}{}% \relax
  \gcmd{markboth}{}% \markboth
  \gcmd{markright}{}% \markright
  \gcmd{front\-matter}{}% \frontmatter
  \gcmd{main\-matter}{}% \mainmatter
  \gcmd{protect}{}% \protect
  \gcmd{string}{}% \string
  \gcmd{null}{}% \null
  \gcmd{make\-box}{}% \makebox
  \gcmd{frame\-box}{}% \framebox
  \gcmd{fbox}{}% \fbox
  \gcmd{fbox\-sep}{}% \fboxsep
  \gcmd{fbox\-rule}{}% \fboxrule
  \gcmd{@gobble}{}% \@gobble
  \gcmd{@first\-of\-one}{}% \@firstofone
  \gcmd{index}{}% \index
  \gcmd{input}{}% \input
  \gcmd{include}{}% \include
  \gcmd{item}{}% \item
  \gcmd{sub\-item}{}% \subitem
  \gcmd{sub\-sub\-item}{}% \subsubitem
  \gcmd{par}{}% \par
  \gcmd{the}{}% \the
  \gcmd{foot\-note}{}% \footnote
  \gcmd{ref\-step\-counter}{}% \refstepcounter
  \gcmd{the\-page}{}% \thepage
  \gcmdmeta{the}{counter}{}{}% \the<counter>
  \gcmdmeta{theH}{counter}{}{}% \theH<counter>
  \gcmd{At\-Be\-gin\-Doc\-u\-ment}{}% \AtBeginDocument
  \gcmd{cite}{}% \cite
  \gcmd{ref}{}% \ref
  \gcmd{page\-ref}{}% \pageref
  \gcmd{label}{}% \label
  \gcmd{caption}{}% \caption
  \gcmd{section}{}% \section
  \gcmd{chapter}{}% \chapter
  \gcmd{part}{}% \part
  \gcond{if\-@\-open\-right}{}% \if@openright
  \gopt{open\-right}{}% openright class option
  \gcmd{two\-column}{}% \twocolumn
  \gcmd{one\-column}{}% \onecolumn
  \gcmd{index\-name}{}% \indexname
  \gcmd{S}{}% \S
  \gcmd{c}{}% \c
  \gcmd{text\-bar}{}% \textbar
  \gcmd{make\-at\-letter}{}% \makeatletter
  \gcmd{make\-at\-other}{}% \makeatother
  \gcmd{space\-factor}{}% \spacefactor
  \gcmd{alpha}{}% \alpha
  \gcmd{arabic}{}% \arabic
  \gcmd{@arabic}{}% \@arabic
  \gcmd{roman}{}% \roman
  \gcmd{@roman}{}% \@roman
  \gcmd{Roman}{}% \Roman
  \gcmd{alph}{}% \alph
  \gcmd{Alph}{}% \Alph
  \gcmd{tex\-or\-pdf\-string}{}% \texorpdfstring
  \gcmd{pdf\-string\-def\-Disable\-Commands}{}% \pdfstringdefDisableCommands
  \gcmd{pdf\-string\-def\-Pre\-Hook}{}% \pdfstringdefPreHook
  \gcmd{hyper\-page}{}% \hyperpage
  \gcmd{hyper\-link}{}% \hyperlink
  \gcmd{hyper\-target}{}% \hypertarget
  \gcmd{no\-hyper\-page}{}% \nohyperpage
  \gcmd{phantom\-section}{}% \phantomsection
  \gcmd{name\-ref}{}% \nameref
  \gcmd{pdf\-bookmark}{}% \pdfbookmark
  \gcmd{text\-smaller}{}% \textsmaller
  \gcmd{text\-rm}{}% \textrm
  \gcmd{text\-sf}{}% \textsf
  \gcmd{text\-tt}{}% \texttt
  \gcmd{text\-bf}{}% \textbf
  \gcmd{text\-md}{}% \textmd
  \gcmd{text\-it}{}% \textit
  \gcmd{text\-sl}{}% \textsl
  \gcmd{text\-sc}{}% \textsc
  \gcmd{text\-up}{}% \textup
  \gcmd{text\-ulc}{}% \textulc
  \gcmd{emph}{}% \emph
  \gcmd{bfseries}{}% \bfseries
  \gcmd{lan\-guage\-name}{}% \languagename
  \gcmd{for\-eign\-lan\-guage}{}% \foreignlanguage
  \gcmd{babel\-pro\-vide}{}% \babelprovide
  \gcmd{es@scroman}{}% \es@scroman
  \gcmd{in\-put\-en\-cod\-ing\-name}{}% \inputencodingname
  \gcmdmeta{cap\-tions}{lan\-guage}{}{}% \captions<language>
  \gcmd{also\-name}{}% \alsoname
  \gcmd{set\-main\-language}{}% \setmainlanguage
  \gcmd{set\-other\-language}{}% \setotherlanguage
  \gcmd{list\-break}{}% \listbreak
  \gcmd{for\-list\-loop}{}% \forlistloop
  \gcmd{if\-cs\-un\-def}{}% \ifcsundef
  \gcmd{if\-cs\-void}{}% \ifcsvoid
  \gcmd{if\-cs\-str\-equal}{}% \ifcsstrequal
  \gcmd{if\-def\-str\-equal}{}% \ifdefstrequal
  \gcmd{if\-cs\-string}{}% \ifcsstring
  \gcmd{if\-def}{}% \ifdef
  \gcmd{if\-un\-def}{}% \ifundef
  \gcmd{cs\-let\-cs}{}% \csletcs
  \gcmd{app\-to}{}% \appto
  \gcmd{dicei}{}% \dicei
  \gcmd{diceii}{}% \diceii
  \gcmd{diceiii}{}% \diceiii
  \gcmd{diceiv}{}% \diceiv
  \gcmd{dicev}{}% \dicev
  \gcmd{dicevi}{}% \dicevi
  \gcmd{Num\-ber\-string}{}% \Numberstring
  \gcmd{Begin\-Acc\-Supp}{}% \BeginAccSupp
  \gcmd{End\-Acc\-Supp}{}% \EndAccSupp
  \gcmd{in\-clude\-graph\-ics}{}% \includegraphics
  \gcmd{@mk\-both}{}% \@mkboth
  \gcmd{mark-both}{}% \markboth
  \gcmd{mem\-UC\-head}{}% \memUChead
  \gcmd{clear\-double\-page}{}% \cleardoublepage
  \gcmd{clear\-page}{}% \clearpage
  \gcmd{Pass\-Op\-tions\-To\-Pack\-age}{}% \PassOptionsToPackage
  \gcmd{new\-line}{}% \newline
  \gcmd{Make\-Upper\-case}{}% \MakeUppercase
  \gcmd{Make\-Text\-Upper\-case}{}% \MakeTextUppercase
  \gcmd{Make\-Lower\-case}{}% \MakeLowercase
  \gcmd{xspace}{}% \xspace
  \gcmd{for\-list\-cs\-loop}{}% \forlistcsloop
  \gcmd{Get\-Title\-String\-Set\-up}{}% \GetTitleStringSetup
  \gcmd{No\-Case\-Change}{}% \NoCaseChange
  \gcmd{top\-rule}{}% \toprule
  \gcmd{mid\-rule}{}% \midrule
  \gcmd{bottom\-rule}{}% \bottomrule
  % COMMANDS: CONTROL SYMBOL
  \gpunccmd{cs.bsl}{\glsbackslash}{}% \\
  \gpunccmd{cs.amp}{\&}{}% \&
  \gpunccmd{cs.dollar}{\$}{}% \$
  \gpunccmd{cs.apos}{'}{}% \'
  \gpunccmd{cs.at}{@}{}% \@
  \gpunccmd{cs.hash}{\#}{}% \#
  \gpunccmd{cs.openbrace}{\glsopenbrace}{}% \{
  \gpunccmd{cs.closebrace}{\glsclosebrace}{}% \}
  \gpunccmd{cs.sp}{\textvisiblespace}% \<space>
  {%
    \field{text}{\csfmt{\space}}
  }
  % PUNCTUATION AND LITERAL CHARACTERS 
  \gpunc{sym.comma}{\name{\code{,} (comma)}\field{symbol}{\code{,}}}
  \gpunc{sym.equals}{\name{\code{=} (equals)}\field{symbol}{\code{=}}}
  \gpunc{sym.colon}{\name{\code{:} (colon)}\field{symbol}{\code{:}}}
  \gpunc{sym.dblquote}{\name{\code{"} (double-quote)}\field{symbol}{\code{"}}}
  \gpunc{sym.apos}{\name{\code{'} (apostrophe)}\field{symbol}{\code{'}}}
  \gpunc{sym.questionmark}{\name{\code{?} (question mark)}\field{symbol}{\code{?}}}
  \gpunc{sym.exclammark}{\name{\code{!} (exclamation mark)}\field{symbol}{\code{!}}}
  \gpunc{sym.pipe}{\name{\code{|} (pipe)}\field{symbol}{\code{|}}}
  \gpunc{sym.at}{\name{\code{@} (at)}\field{symbol}{\code{@}}}
  \gpunc{sym.bksl}{\name{\code{\glsbackslash} (literal backslash)}
    \field{symbol}{\code{\glsbackslash}}
  }
  \gpunc{sym.hash}{\name{\code{\#}}}% #
  \gpunc{sym.hashhash}{\name{\code{\#\#}}}% ##
  \gpunc{sym.dollar}{\name{\code{\$}}}% $
  \gpunc{sym.bg}{\name{\code{\glsopenbrace}}}% {
  \gpunc{sym.eg}{\name{\code{\glsclosebrace}}}% }
  \gpunc{sym.pc}{\name{\code{\glspercentchar}}}% %
  \gpunc{sym.tilden}{\name{\code{\glstildechar n}}}% ~n
  \gpunc{sym.sp}{\name{\code{\textasciicircum}}}% ^
  \gpunc{sym.sb}{\name{\code{\_}}} % _
  \gpunc{sym.amp}{\name{\code{\&}}} % &
  \gpunc{starmod}{\name{\code{*} (star modifier)}
   \field{text}{star}
   \field{symbol}{\code{*}}
  }
  \gpunc{plusmod}{\name{\code{+} (plus modifier)}
   \field{text}{plus}
   \field{symbol}{\code{+}}
  }
  \gpunc{sym.startrange}{\name{\code{\nlctopenparen} (range start)}
   \field{symbol}{\code{\nlctopenparen}}
   \field{seealso}{idx.range}
  }
  \gpunc{sym.endrange}{\name{\code{\nlctcloseparen} (range end)}
   \field{symbol}{\code{\nlctcloseparen}}
   \field{seealso}{idx.range}
  }
  \gpunc{vbsp}{\name{\code{\textvisiblespace} (space)}
   \field{symbol}{\code{\textvisiblespace}}
  }
  \gpunc{sym.fullstop}{\name{\code{.} (full stop or period)}
    \field{see}{idx.fullstop}
  }
  \gpunc{sym.nbsp}{\name{\code{\textasciitilde} (non-breaking space)}
    \field{symbol}{\code{\textasciitilde}}
    \field{see}{idx.nbsp}
  }
  \gpunc{sym.tilde}{\name{\code{\textasciitilde} (literal)}
    \field{symbol}{\code{\textasciitilde}}
  }
  \gidx{period}{\name{period (\code{.})}%
    \field{text}{period}
    \field{alias}{idx.fullstop}
  }
  \gidx{fullstop}{\name{full stop (\code{.})}%
    \field{text}{full stop}
    \field{symbol}{\code{.}}
  }
  \gidx{nbsp}{\name{non-breaking space (\code{\textasciitilde})}
    \field{symbol}{\code{\textasciitilde}}
  }
  % GENERAL ENVIRONMENTS
  \genv{document}{}
  \genv{equation}{}
  \genv{table}{}
  \genv{tabular}{}
  \genv{description}{}
  \genv{itemize}{}
  \genv{long\-table}{}% longtable
  \genv{super\-tabular}{}% supertabular
  \genv{multi\-cols}{}% multicols
  \genv{multi\-cols*}{}% multicols*
  \genv{tab\-u\-larx}{}% tabularx
  \genv{align}{}% align
  \genv{frame}{}% (beamer)
  % GENERAL COUNTERS
  \gctr{equation}{}
  \gctr{section}{}
  \gctr{chapter}{}
  \gctr{part}{}
  \gctr{page}{}
  \gctr{table}{}
  % INDEXING OPTIONS
  \gidx{opt.noidx}{\name{Option 1 (\qt{noidx})}\field{text}{1}}
  \gidx{opt.mkidx}{\name{Option 2 (\appfmt{makeindex})}\field{text}{2}}
  \gidx{opt.xdy}{\name{Option 3 (\appfmt{xindy})}\field{text}{3}}
  \gidx{opt.b2g}{\name{Option 4 (\appfmt{bib2gls})}\field{text}{4}}
  \gidx{opt.unsrt}{\name{Option 5 (\qt{unsrt})}\field{text}{5}}
  \gidx{opt.standalone}{\name{Option 6 (\qt{standalone})}\field{text}{6}}
  % TERMS
  \gterm{field}%
  {%
   \common
    \name{field}
    \desc{entry data is stored in fields. These may have a
     corresponding key used to set the value, such as \gloskey{name}
     or \gloskey{description}}
  }
  \gterm{internalfield}%
  {%
    \name{internal field}
    \desc{an \idxc{bib2glsinternalfield}{internal field} may refer to a key 
    that shouldn't be used in the \ext{bib} file, such as
    the \gloskey{group} field, or an internal \idx{field} may refer to the
    \idxc{internalfieldlabel}{label} used to internally represent the
    \idx{field} (which may or may not match the key used to set the
    \idx{field} or may not have an associated key), such as \glosfield{useri} which
    corresponds to the \gloskey{user1} key, or it may refer to a \idx{field}
    that is only ever used internally that should not be explicitly
    modified, such as the field used to store the entry's
    hierarchical level
}
    \field{see}{idx.glosfield}
  }
  \gterm{bib2glsinternalfield}%
  {%
    \name{internal field (\appfmt{bib2gls})}
    \desc{a \idx{field} that is used or assigned by \app{bib2gls}
    that should typically not be used in the \ext+{bib} file}
  }
  \gterm{internalfieldlabel}%
  {%
    \name{internal field label}
    \desc{the field label that forms part of the internal control
    sequence used to store the field value. This may or may not
    match the key used to assign the value when defining the entry.
    See \Tableref{tab:fieldmap}}
  }
  \gterm{unsrtfam}%
  {%
    \name{print \qt{unsrt} glossary commands}
    \field{text}{\qt{unsrt} family of commands}
    \desc{the set of commands used for displaying a \idx{glossary} or
     partial \idx{glossary} that have \qt{unsrt} in the name, such as
     \gls{printunsrtglossary}. See the \sty{glossaries-extra} manual
    for further details}
  }
  \gterm{whatsit}%
  {%
    \desc{a command whose execution is delayed or an OS-specific special command.
    This includes writing to external files (which is what indexing does)}
  }
  \gterm{indexingapp}{\name{indexing application}%
   \common
   \desc{an application (piece of software) separate from
    \protect\TeX/\protect\LaTeX\ that collates and sorts information that has an
    associated page reference. Generally the information is an index
    entry but in this case the information is a \idx{glossary} entry.\glspar
    The original indexing application used with \TeX\ is
    \app+{makeindex} (which can be also be used with other non-\TeX\
    text formatters). This was then followed by \app+{xindy}, which
    provided more flexible support for different languages and encodings.
    The original release of \sty{glossaries} only supported 
    \app{makeindex}, since it was readily available in all \TeX\
    distributions, and a later release added support for \app{xindy}.
    There is now also a newer indexing application called
    \app{xindex}, which isn't supported by \sty{glossaries}
    or \sty{glossaries-extra} (unless a way can be found of
    converting \app{makeindex}['s] \ext{ist} file to an equivalent
    \app{xindex} configuration file).\glspar General purpose indexing applications
    that are developed independently are harder to fully integrate
    with the \sty{glossaries} package, which has more complex
    requirements than a simple index.  The \sty{glossaries-extra} 
    package additionally supports \app{bib2gls}, which is designed
    specifically for, and developed
    alongside, the \sty{glossaries-extra} package. These are all
    \idx{cli} applications.}%
  }% 
  \gterm{indexingfile}%
  {
    \name{indexing file}
    \desc{a file that's input (read) by an \idx{indexingapp}, such
    as the style file (\ext{ist} or \ext{xdy}) or the files
    containing the \idx{indexing} data (the sort value, \hierarchical\
    information, \idx{locationencap} and
    \idx{entrylocation}). These files are output files from the
    point of view of the \sty{glossaries} package as it's \TeX\ that
    creates and writes to those files. An indexing file may also
    refer to the files that are created by the \idx{indexingapp}.
    These are output files from the \idx{indexingapp}['s] point of
    view, but they are input files from \TeX's point of view as they
    are input by commands used in the document.}
  }
  \gidx{glossaryfile}{\name{glossary file}\field{alias}{indexingfile}}
  \gterm{indexing}{%
   \common
    \name{indexing (or recording)}
    \field{text}{indexing}
    \desc{the process of saving the \idx+{entrylocation} and any
      associated information that is required in the \idx{glossary}. In
      the case of \app{makeindex} and \app{xindy}, the
      \idx{entrylocation}, \idx{encap}, entry item and sort value are written
      to a supplementary file associated with the \idx{glossary} that is
      subsequently read by \app{makeindex}\slash\app{xindy}. In the
      case of \app{bib2gls} and the \qt{noidx} method, the
      \idx{entrylocation}, \idx{encap} and label is written to the
      \ext+{aux} file.}
  }
  \gtermacr{cli}{CLI}{command-line interface}%
  {%
    \desc{an application that doesn't have a graphical user
     interface. That is, an application that doesn't have any windows,
     buttons or menus and can be run in
     \dickimawhref{latex/novices/html/terminal.html}{a command
     prompt or terminal}}%
  }%
  \gtermacr{gui}{GUI}{graphical user interface}%
  {%
    \desc{an application that has windows, buttons or menus}
  }
  \gtermacr{ascii}{ASCII}{American Standard Code for Information Interchange}
  {%
    \desc{a single-byte character \idx+{encoding}. Related blog article:
    \blog{binary-files-text-files-and-file-encodings/}{Binary
    Files, Text Files and File Encodings}}
  }
  \gtermacr{utf8}{UTF\glsxtrrevert{-8}}{Unicode Transformation Format (8-bit)}
  {%
    \desc{a variable-width \idx+{encoding} that uses 8-bit code units. This
    means that some characters are represented by more that one byte.
    \XeLaTeX\ and \LuaLaTeX\ treat the multi-byte sequence as a single
    token, but the older \LaTeX\ formats have single-byte tokens, which
    can cause complications, although these have mostly been addressed with
    the newer kernels introduced over the past few years. Related blog article:
    \blog{binary-files-text-files-and-file-encodings/}{Binary Files,
    Text Files and File Encodings}}
  }
  \gtermacr{cldr}{CLDR}{Common Locale Data Repository}
  {%
    \desc{a project of the Unicode Consortium that provides
    locale-specific information which an operating system 
    will typically provide to applications}
  }
  \gterm{latinchar}%
  {%
    \name{Latin character}
    \desc{One of the letters \qt{a}, \ldots, \qt{z}, 
    \qt{A}, \ldots, \qt{Z}\@}
    \field{seealso}{exlatinchar}
  }
  \gterm{exlatinchar}
  {%
    \name{extended Latin character}
    \desc{a character that's created by combining \idxpl{latinchar}
     to form ligatures (e.g.\ \ae) or by applying diacritical marks
     to a~\idx{latinchar} or characters (e.g.\ \'a)}
    \field{seealso}{nonlatinchar}
  }%
  \gterm{latexexlatinchar}%
  {%
    \name{standard \LaTeX\ extended Latin character}
    \desc{an \idx{exlatinchar} that can be created by a~core
    \LaTeX\ command, such as \csfmt{o} (\o) or \code{\csfmt{'}e} (\'e). 
    That is, the character can be produced without the need to load 
    a~particular package}
  }%
  \gterm{nonlatinchar}%
  {%
    \name{non-Latin character}
    \desc{an \idx{exlatinchar} or a~character that isn't a~\idx{latinchar}}
  }%
  \gterm{latinalph}%
  {%
    \name{Latin alphabet}%
    \desc{the alphabet consisting of \idxpl{latinchar}}
    \field{seealso}{exlatinalph}
  }%
  \gterm{exlatinalph}%
  {%
    \name{extended Latin alphabet}
    \desc{an alphabet consisting of \idxpl{latinchar} and \idxpl{exlatinchar}.}
  }%
  \gterm{nonlatinalph}%
  {%
    \name{non-Latin alphabet}
    \desc{an alphabet consisting of \idxpl{nonlatinchar}}
  }%
  \gterm{sanitize}%
  {%
    \desc{converts command names into character sequences. That is, a command called,
  say, \csfmt{foo}, is converted into the sequence of characters:
  \csfmt{}, \code{f}, \code{o}, \code{o}. Depending on the font,
  the backslash character may appear as a dash when used in the
  main document text, so \csfmt{foo} will appear as: ---foo.
  \glspar
  Earlier versions of \sty{glossaries} used this technique to write
  information to the files used by the indexing applications to
  prevent problems caused by fragile commands. Now, this is only used
  for the \gloskey{sort} key.}
  }%
  \gterm{idx.group}{\name{group (letters, numbers, symbols)}
   \field{text}{group}%
   \desc{a logical division within a \idx{glossary} that is typically a
    by-product of the \idx{indexingapp}['s] sorting algorithm.
    \Idxpl{glossarystyle} may or may not start each group with a
    title (such as \qt{Symbols} or \qt{A}) or a vertical space. See also
    \gallerypage{logicaldivisions}{Gallery: Logical Glossary Divisions
    (type vs group vs parent)}}%
  }%
  \gidx{lettergroup}{\name{letter group}\field{alias}{idx.group}}
  \gterm{hierarchicallevel}{\name{hierarchical level}%
   \common
   \desc{a number that indicates how many ancestors an entry has.
    An entry with no parent has hierarchical level~0. If an entry
    has a parent then the hierarchical level for the entry is one
    more than the hierarchical level of the parent. Most styles will
    format an entry according to its hierarchical level, giving
    prominence to level~0 entries, although some may have a maximum
    supported limit. The level is stored in the \glosfield{level}
    internal field. It can be accessed using commands like
    \gls{glsfieldfetch} or \gls{glsxtrusefield}, but neither the
    \glosfield{level} nor the \gloskey{parent} values should be altered
    as it will cause inconsistencies in the sorting and
    \idx{glossary} formatting. See also \sectionref{sec:subentries}}
  }
  \gidx{sub-entry}{%
    \field{plural}{sub-entries}
    \field{see}{hierarchicallevel}
  }
  \gterm{homograph}
  {
    \desc{each of a set of words that have the same spelling but
    have different meanings and origins. They may or may not have
    different pronunciations}
  }
  \gterm{locationlist}{\name{location list}%
   \common
    \desc{a list of \idxpl+{entrylocation} (also called a number
    list). May be suppressed for all \idxpl{glossary} with the package option
    \opt{nonumberlist} or for individual \idxpl{glossary} with
    \printglossopt{nonumberlist}. With \app{bib2gls}, the list may
    also be suppressed with \resourceoptval{save-locations}{false}}
  }
  \gterm{locationencap}{\name{location encap (format)}
    \field{text}{location encap}
    \desc{a command used to encapsulate an \idx{entrylocation}.
     The control sequence name (without the leading backslash)
     is identified by the \glsopt{format} key. The default encap is
     \gls{glsnumberformat}. See \sectionref{sec:encap} for further details}
  }
  \gidx{encap}{\field{alias}{locationencap}}
  \gidxpl{multipleencap}{
    \field{text}{multiple encap}
    \field{seealso}{locationencap}
  }
  \gidx{locationformat}{%
   \name{location}
   \field{parent}{idx.format}%
   \field{text}{location format}
   \field{alias}{locationencap}%
  }
  \gidx{standardformat}
  {
     \name{standard location format}
     \field{text}{standard format}
  }
  \gidx{formatstandard}
  {
    \name{standard}
    \field{parent}{idx.format}%
    \field{alias}{idx.standardformat}
  }
  \gterm{locationcounter}{\name{location counter}
    \desc{the counter used to obtain the \idx{entrylocation}}
  }
  \gterm{entrylocation}{\common\name{entry location}%
    \desc{the location of the entry in the document (obtained from
    the \idx{locationcounter} or from the \glsopt{thevalue} option). This defaults to the page number
    on which the entry has been
    referenced with any of the \gls{glslike}, \gls{glstextlike} or \gls{glsadd}
    commands. An entry may have multiple locations that form a list.
    See also \sectionref{sec:locationsyntax}}
  }
  \gidx{numberlist}{\name{number list}\field{alias}{locationlist}}
  \gidx{pagelist}{\name{page list}\field{see}{locationlist}}
  \gterm{ignoredlocation}{\name{ignored location (or record)}%
   \field{text}{ignored location}
   \desc{a \location\ that uses \encap{glsignore} as the
    \idx{encap}. With \app{bib2gls}, this indicates that the entry
    needs to be selected but the \location\ isn't added to the
    \idx{locationlist}. With other methods, this will simply create
    an invisible \location, which can result in unwanted commas if
    the \idx{locationlist} has other items. With \app{bib2gls}
    v3.0+, \idxpl+{emptylocation} will be converted to ignored locations}
  }
  \gidx{locationignored}{\name{location, ignored\slash invisible}%
    \field{see}{ignoredlocation}}
  \gidx{emptylocation}{\name{location, empty (or invisible)}
    \field{text}{empty location}
    \field{seealso}{ignoredlocation}
  }
  \gidx{invisiblelocation}{\name{invisible location}
    \field{alias}{idx.emptylocation}
  }
  \gterm{ignoredglossary}{\name{ignored glossary}%
    \common
    \field{plural}{ignored glossaries}%
    \desc{a \idx{glossary} that has been defined using a command like
     \gls{newignoredglossary}. These \idxpl{glossary} are omitted by
     iterative commands, such as \gls{printglossaries} and
     \gls{printunsrtglossaries}. An ignored
     \idx{glossary} can only be displayed with \gls{printunsrtglossary}}
  }
  \gidx{glossaryignored}{\name{glossary, ignored}\field{see}{ignoredglossary}}
  \gterm{firstuseflag}{\name{first use flag}%
    \common
    \desc{a conditional that keeps track of whether or not an entry
     has been referenced by any of the \gls{glslike} commands (which
     can adjust their behaviour according to whether or not this flag is
     true). The conditional is true if the entry hasn't been used by
     one of these commands
     (or if the flag has been reset) and false if it has been used
     (or if the flag has been unset)}
  }
  \gterm{firstuse}{\name{first use}%
    \common
    \desc{the first time an entry is used by a command that unsets
     the \idx{firstuseflag} (or the first time since the flag was
     reset)}
  }
  \gterm{firstusetext}{\name{first use text}%
    \common
    \desc{the \idx{linktext} that is displayed on \idx{firstuse} of
    the \gls{glslike} commands}
  }
  \gterm{subsequentuse}{\name{subsequent use}
    \common
    \desc{using an entry that unsets the \idx{firstuseflag} when it
    has already been unset}
  }
  \gterm{glslike}{\common\name{\csfmt{gls}-like}
   \common
    \desc{commands like \gls{gls} and \gls{glsdisp} that change the
    \idx{firstuseflag}. These commands index the entry (if indexing
    is enabled), create a \idx{hyperlink} to the entry's \idx{glossary} listing (if enabled)
    and unset the \idx{firstuseflag}. These commands end with the
    \idx{postlinkhook}}
  }
  \gterm{glstextlike}{\common\name{\csfmt{glstext}-like}
   \common
    \desc{commands like \gls{glstext} and \gls{glslink} that don't change
    the \idx{firstuseflag}. These commands index the entry (if indexing
    is enabled) and create a \idx{hyperlink} to the entry's \idx{glossary} listing (if enabled). These commands end with the \idx{postlinkhook}}
  }
  \gterm{linktext}{\name{link text}%
   \common
    \desc{the text produced by \gls{glslike} and \gls{glstextlike}
     commands that have the potential to be a \idx+{hyperlink}}
  }
  \gterm{postlinkhook}{\name{post-link hook}
    \desc{a hook (command) that is used after \idx{linktext} to
    allow code to be automatically added. The base \sty{glossaries}
    package provides a general purpose hook \gls{glspostlinkhook}. The
    \sty{glossaries-extra} package modifies this command to provide
    additional hooks}
  }
  \gterm{postdeschook}{\name{post-description hook}%
    \desc{a hook (\gls{glspostdescription}) included in some \idxpl{glossarystyle} 
    that is used after the description is displayed. 
    The \sty{glossaries-extra} package modifies
    this command to provide additional hooks}
  }
  \gterm{resourceset}%
  {%
    \name{resource set}
    \desc{all the settings (\idxpl{resourceopt}) and entries associated with a particular
     instance of \gls{GlsXtrLoadResources}}
  }
  \gterm{resourcefile}%
  {%
    \name{resource file}
    \desc{the \ext+{glstex} file created by \app{bib2gls} and loaded by
     \gls{GlsXtrLoadResources}}
  }
  \gterm{smallcaps}%
  {%
    \name{small capitals (small caps)}
    \field{text}{small caps}
    \desc{The \LaTeX\ kernel provides \code{\gls{textsc}\margm{text}} 
    to produce small capitals. This uses a font where
    \idx{lowercase} letters have a small capital design.
    \Idx{uppercase} letters have the standard height and there's no
    noticeable difference with \idx{uppercase} characters in corresponding 
    non-small caps fonts.  This means that for a small caps appearance, 
    you need to use \idx{lowercase} letters in the
    \meta{text} argument. The \sty{relsize} package provides
    \code{\gls{textsmaller}\margm{text}} which simulates small caps 
    by reducing the size of the font, so in this case the contents of 
    \meta{text} should be \idx{uppercase} (otherwise the effect is simply 
    smaller \idx{lowercase} letters). Some fonts don't support small caps 
    combined with bold or slanted properties. In this case, there will be 
    a font substitution warning and one of the properties (such as 
    small caps or slanted) will be dropped}
  }
  \gterm{casechange}{\name{case change}
   \common
   \desc{there are four types of case-changing commands provided by the
    \sty{glossaries} package:
    \begin{deflist}
    \itemtitle{\idx{allcaps}}
    \begin{itemdesc}For example, \gls{GLS} and \gls{GLStext}.
     All letters in the given text are converted to
    \idx{uppercase} (capitals). The actual case-conversion is
     performed by \gls{glsuppercase}.\end{itemdesc}
    \itemtitle{\idx{sentencecase}}
    \begin{itemdesc}For example, \gls{Gls} and \gls{Glstext}.
     Only the first letter is converted to \idx{uppercase}.
     The case-conversion for the \gls{glslike} and \gls{glstextlike}
     commands is performed via \gls{glssentencecase}, which is
     simply defined to use the robust \gls{makefirstuc}.
     Commands such as \gls{Glsentrytext} also use
     \gls{glssentencecase} in the document but use the expandable 
     \gls{MFUsentencecase} in \idxpl{PDFbookmark}.\end{itemdesc}
    \itemtitle{\idx{titlecase}}
    \begin{itemdesc}For example, \gls{glsentrytitlecase}.
    The first letter of each word is converted to \idx{uppercase}.
    The case-conversion is performed using \gls{glscapitalisewords}
    in the document text, but commands designed for use in section
    headings, use the expandable \gls{MFUsentencecase} in 
    \idxpl{PDFbookmark}.\end{itemdesc}
    \itemtitle{\idx{lowercase}}
    \begin{itemdesc}The command \gls{glslowercase} is provided 
    to allow for the conversion of the short form of \idxpl{acronym} 
    or \idxpl{abbreviation} to \idx{lowercase} for \idx{smallcaps} styles.
    Note that \gls{glslowercase} isn't actually in the default
    definition any of the commands provided by \sty{glossaries} but
    is provided in the event that any of those commands need
    redefining with an expandable definition. Alternatives are to use the robust
    \gls{MakeLowercase} or switch to \LaTeX3 syntax.\end{itemdesc}
    \end{deflist}
    Ensure that you have at least \sty{mfirstuc} v2.08 for improved
    case-changing performed by new \LaTeX3 commands. See the
   \sty{mfirstuc} manual for further details.}
   \field{seealso}{idx.uppercase,idx.lowercase,idx.titlecase,idx.sentencecase,idx.allcaps}}
  \gterm{shellescape}
  {
     \name{shell escape}
     \desc{most \LaTeX\ formats have the ability to run \idx{cli} applications while
      it's typesetting a document. Whilst this is a convenient way
      of using tools to help build the document, it's a security
      risk. To help protect users from arbitrary\dash and
      potentially dangerous\dash code from being executed, \TeX\ has
      a restricted mode, where only trusted applications are allowed to
      run. This is usually the default mode, but your \TeX\
      installation may be set up so that the shell escape is disabled by
      default. The unrestricted mode allows you to run any
      application from the shell escape. Take care about
      enabling this option. If you receive a document or package
      from an untrusted source, first run \LaTeX\ with the shell escape
      disabled or in restricted mode and search the \ext{log} file for
      \qt{runsystem} before using the unrestricted mode}
  }
  \gterm{glossary}%
  {%
    \common
    \name{glossary}
    \field{plural}{glossaries}
    \desc{technically a glossary is an alphabetical list of words
    relating to a particular topic. For the purposes of describing
    the \styfmt{glossaries} and \sty{glossaries-extra} packages, a
    glossary is either the list produced by commands like
    \gls{printglossary} or \gls{printunsrtglossary} (which may or
    may not be ordered alphabetically) or a glossary is a set of
    \idx{entry} labels where the set is identified by the glossary label
    or type}
  }
  \gterm{entryline}
  {
     \name{entry line (or item)}
     \field{text}{entry line}
     \desc{the line in the \idx{glossary} where the \idx{entry} is
     shown. This may be a single row in a tabular-style or the start of a
     paragraph for list or index styles or mid-paragraph for the 
     \glostyle{inline} style. The exact formatting depends on the
     \idx{glossarystyle}, but usually includes the name and
      description. If \idxpl+{hyperlink} are enabled, the
     \gls{glslike} and \gls{glstextlike} commands will create a
     \idx{hyperlink} to this line}
  }
  \gidx{entryitem}{\name{entry item}\field{alias}{entryline}}
  % GLOSSARY TYPES
  % main
  \gglostype{main}{\common}
  % acronym
  \gglostype{acronym}{\common}
  % symbols
  \gglostype{symbols}{}
  % numbers
  \gglostype{numbers}{}
  % index
  \gglostype{index}{}
  % abbreviations
  \gglostype{abbreviations}{}
}

\newcommand*{\bibglsgallery}[2][\gallerytitle]{%
 \def\gallerytitle{#2}%
 \gallerypage{bib2gls-#2}{\appfmt{bib2gls} gallery: \gallerytitle}}

\newcommand*{\bibglsbegin}{%
 \ctansupportmirror{bib2gls/bib2gls-begin.pdf}{\styfmt{glossaries-extra} and \appfmt{bib2gls}: An Introductory Guide}}


\newcommand{\glsxtrnote}{\sidenote{\sty{glossaries-extra}}}
\newcommand{\bibglsnote}{\sidenote{\app{bib2gls}}}

\newenvironment{xtr}
{\begin{information}[title={\sty{glossaries-extra}}]}
{\end{information}}

\newenvironment{bib2gls}
{\begin{information}[title={\app{bib2gls}}]}
{\end{information}}

\title{User Manual for glossaries.sty v5.0}
\author{Nicola L.C. Talbot\\%
 \href{http://www.dickimaw-books.com/contact}{\nolinkurl{dickimaw-books.com/contact}}}

\date{2026-03-06}

\begin{document}
\maketitle

\htmlavailable

\begin{abstract}
The \sty+{glossaries} package provides a means to define terms or
\idxpl{acronym} or symbols that can be referenced within your document.
Sorted lists with collated \locations\ can be
generated either using \TeX\ or using a supplementary \idx{indexingapp}.
Sample documents are provided with the \sty{glossaries} package.
These are listed in \sectionref{sec:samples}.
\end{abstract}

\begin{xtr}
Additional features not provided here may be available through
the extension package \sty+{glossaries-extra} which, if required,
needs to be installed separately. New features will be added to
\sty{glossaries-extra}. Versions of the \sty{glossaries}
package after v4.21 will mostly be just bug fixes or minor
maintenance. The most significant updates to the \sty{glossaries}
package since then is version 4.50, which involved the integration of
\sty{mfirstuc} v2.08 and the phasing out the use of
the now deprecated \sty{textcase} package, and version 4.55, which
involved the integration of \sty{datatool-base} v3.0.

Note that \sty{glossaries-extra} provides an extra indexing option
(\app{bib2gls}) which isn't available with just the base \sty{glossaries} package.
\end{xtr}

If you require multilingual support you must also install
the relevant language module. Each language module is called
\file{glossaries-language}, where \meta{language} is the
root language name. For example, \file{glossaries-french}
or \file{glossaries-german}. If a language module is required,
the \sty{glossaries} package will automatically try to load it
and will give a warning if the module isn't found.  See
\sectionref{sec:languages} for further details.
If there isn't any support available for your language, use
the \opt{nolangwarn} package option to suppress the warning
and provide your own translations. (For example, use
the \printglossopt{title} key in \gls{printglossary}.)

\begin{important}
Documents have wide-ranging styles when it comes to presenting \idxpl{glossary}
or lists of terms or notation. People have their own preferences and
to a large extent this is determined by the kind of information that
needs to go in the \idx{glossary}. They may just have symbols with
terse descriptions or they may have long technical words with
complicated descriptions. The \sty{glossaries} package is
flexible enough to accommodate such varied requirements, but this
flexibility comes at a price: a~big manual.

\twemoji{1f631} If you're freaking out at the size of this manual, start with
\qtdocref{The \styfmt{glossaries} package: a guide
for beginners}{glossariesbegin}. You should find it in the same directory as this
document or try
\texdocref{glossariesbegin}
Once you've got to grips with the basics, then come back to this
manual to find out how to adjust the settings.
\end{important}

The \sty{glossaries} bundle includes the following documentation:
\begin{deflist}
\itemtitle{\docref{The \styfmt{glossaries} package: a guide
for beginners}{glossariesbegin}}
\begin{itemdesc}
If you want some brief information and examples to get you going,
start with the guide for beginners.
\end{itemdesc}

\itemtitle{User Manual for glossaries.sty (\filefmt{glossaries-user.pdf)}}

\begin{itemdesc}
This document is the manual for the \sty{glossaries}
package and is divided into two parts: Part~\ref{userguide} is the
user guide that describes all available commands and options with
examples. Part~\ref{summaries} has alphabetical summaries of those
commands and options for quick reference.
\end{itemdesc}

\itemtitle{Documented Code for glossaries (\url{glossaries-code.pdf})}

\begin{itemdesc}
Advanced users wishing to know more about the inner workings of all the
packages provided in the \styfmt{glossaries} bundle should read
\qt{Documented Code for glossaries v5.0}.
\end{itemdesc}

\itemtitle{\url{CHANGES}}
\begin{itemdesc}
Change log.
\end{itemdesc}

\itemtitle{\url{README.md}}

\begin{itemdesc}
Package summary.
\end{itemdesc}

\itemtitle{\url{Depends.txt}}

\begin{itemdesc}
List of all packages unconditionally required by \sty{glossaries}.
Other unlisted packages may be required under certain circumstances.
For help on installing packages see, for example,
\texseref{questions/55437}{How
do I update my \TeX\ distribution?} or (for Linux users)
\texseref{questions/14925}{Updating \TeX\ on Linux}.
\end{itemdesc}

\end{deflist}
Related resources:
\begin{itemize}
\item \bibglsbegin.

\item \faqspkg{glossaries}

\item \gallerytopic{glossaries}

\item
\galleryref{glossaries-styles/}{a summary of all glossary styles provided by \styfmt{glossaries} and
\styfmt{glossaries-extra}}

\item
\galleryref{glossaries-performance.shtml}{\styfmt{glossaries}
performance} (comparing document build times for the different
options provided by \styfmt{glossaries} and \styfmt{glossaries-extra}).

\item \dickimawhref{latex/thesis/}{Using LaTeX to Write a PhD Thesis}
(chapter 6).

\item
\dickimawhref{latex/buildglossaries/}{Incorporating
\appfmt{makeglossaries} or \appfmt{makeglossaries-lite} or 
\appfmt{bib2gls} into the document build}

\item The \ctanref{pkg/glossaries-extra}{\styfmt{glossaries-extra} package}

\item \ctanref{pkg/bib2gls}{\appfmt{bib2gls}}
\end{itemize}

\begin{important}
If you use \sty{hyperref} and \sty{glossaries}, you must load
\sty{hyperref} \emph{first} (although, in general, \sty{hyperref} should be
loaded after other packages).
\end{important}

\frontmatter
\tableofcontents
\listoftables
\listofexamples
\mainmatter

\renewrobustcmd{\texidxoptiondef}[1]{%
  \maintexidxoptiondef{#1}%
} 
\part{User Guide}
\label{userguide}

\chapter{Introduction}
\label{sec:intro}

\pkgdef{glossaries}

The \sty{glossaries} package is provided to assist generating lists
of terms, symbols or \idxpl{acronym}. For convenience, these lists
are all referred to as \idxpl+{glossary} in this manual. The terms,
symbols and \idxpl{acronym} are collectively referred to as
\inlineidxdef{glossaryentry}.

The package has a certain amount of flexibility, allowing the
user to customize the format of the \idx{glossary} and define multiple
\idxpl{glossary}. It also supports \idxpl{glossarystyle} that
include an associated symbol (in addition to a name and description)
for each \idx{glossaryentry}.

There is provision for loading a database of glossary entries. Only
those entries \indexed\ in the document will be displayed in the \idx{glossary}.
(Unless you use \option{unsrt}, which doesn't use any \idx{indexing} but will
instead list all defined entries in order of definition.)

It's not necessary to actually have a \idx{glossary} in the document. You may be
interested in using this package just as means to consistently
format certain types of terms, such as \idxpl{acronym}, or you may
prefer to have descriptions scattered about the document and be able
to easily link to the relevant description (\option{standalone}).

\mExampleref{ex:simplenogloss} demonstrates a basic document
without a glossary. For simplicity, the \clsfmt{article} class is
used and the only package loaded is \sty{glossaries}. Note that the
terms must be defined before they can be referenced in the document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[
  \opteqvalref{sort}{none} \comment{no sorting or \idx{indexing} required}
]
\marg{glossaries}
\codepar
\gls{newglossaryentry}
 \marg{cafe}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{caf\'e},
   \gloskeyval{description}{small restaurant selling
refreshments}
 }
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}
 \marg{html}\comment{label}
 \marg{HTML}\comment{short form}
 \marg{hypertext markup language}\comment{long form}
\codepar
\gls{newglossaryentry}
 \marg{pi}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},
   \gloskeyval{description}{Archimedes' Constant}
 }
\codepar
\gls{newglossaryentry}
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},
   \gloskeyval{description}{the length between two points},
   \gloskeyval{symbol}{m}
 }
\codepar
\cbeg{document}
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} 
(\gls{glsentrydesc}\marg{distance}) 
is measured in \gls{glssymbol}\marg{distance}.
\cend{document}
\end{codebox}
(This is a trivial example. For a real document I recommend you use
\sty{siunitx} for units.)
\begin{resultbox}
\createexample*[title={Simple document with no glossary},
 label={ex:simplenogloss},
 description={Example document that defines some glossary entries
and references them in the text.}]
{%
\cmd{usepackage}[\nlsp
  \opteqvalref{sort}{none} \comment{no sorting or indexing required}
]
\marg{glossaries}
\codepar
\gls{newglossaryentry}\nl
\marg{cafe}\comment{label}
\marg{\comment{definition:}
  \gloskeyval{name}{caf\'e},\nlsp
  \gloskeyval{description}{small restaurant selling
refreshments}\nl
}
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}\nl
\marg{html}\comment{label}
\marg{HTML}\comment{short form}
\marg{hypertext markup language}\comment{long form}
\codepar
\gls{newglossaryentry}\nl
\marg{pi}\comment{label}
\marg{\comment{definition:}
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},\nlsp
  \gloskeyval{description}{Archimedes' Constant}\nl
}
\codepar
\comment{This is a trivial example. For a real document I recommend 
you use siunitx for units}
\gls{newglossaryentry}\nlsp
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},\nlsp
   \gloskeyval{description}{the length between two points},\nlsp
   \gloskeyval{symbol}{m}\nl
 }
}
{%
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} (\gls{glsentrydesc}\marg{distance}) is measured in
\gls{glssymbol}\marg{distance}.
}
\end{resultbox}

\glsxtrnote
The \sty{glossaries-extra} package, which is distributed as a
separate bundle, extends the capabilities of the \sty{glossaries}
package. The simplest document with a \idx{glossary} can be created
with \sty{glossaries-extra} (which internally loads the
\sty{glossaries} package). \mExampleref{ex:simpleunsrt} demonstrates this:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[
 \optval{sort}{none},\comment{no sorting or indexing required}
 \opt{abbreviations},\comment{create list of \idxpl{abbreviation}}
 \opt{symbols},\comment{create list of symbols}
 \opt{postdot}, \comment{append a full stop after the descriptions}
 \opt{stylemods},\optval{style}{index} \comment{set the glossary style}
]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry} \combase
 \marg{cafe}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{caf\'e},
   \gloskeyval{description}{small restaurant selling
refreshments}
 }
\codepar
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}\comxr
\codepar
\gls{newabbreviation} \comxr
 \marg{html}\comment{label}
 \marg{HTML}\comment{short form}
 \marg{hypertext markup language}\comment{long form}
\codepar
\comxropt{symbols}
\gls{glsxtrnewsymbol} 
 \oarg{\gloskeyval{description}{Archimedes' constant}}\comment{options}
 \marg{pi}\comment{label}
 \marg{\gls{ensuremath}\marg{\cmd{pi}}}\comment{symbol}
\codepar
\gls{newglossaryentry} \combase
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},
   \gloskeyval{description}{the length between two points},
   \gloskeyval{symbol}{m}
 }
\codepar
\cbeg{document}
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} is measured in \gls{glssymbol}\marg{distance}.
\gls{printunsrtglossaries} \comment{list all defined entries}
\cend{document}
\end{codebox}

\begin{resultbox}
\createexample*[title={Simple document with unsorted glossaries},
 label={ex:simpleunsrt},
 description={Example document that defines some glossary entries,
references them in the text, and displays three simple unsorted glossaries.}]
{%
\cmd{usepackage}[
 \optval{sort}{none},\comment{no sorting or indexing required}
 \opt{abbreviations},\comment{create list of abbreviations}
 \opt{symbols},\comment{create list of symbols}
 \opt{postdot}, \comment{append a full stop after the descriptions}
 \opt{stylemods},\optval{style}{index} \comment{set the default glossary style}
]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry} \combase
\marg{cafe}\comment{label}
\marg{\comment{definition:}
 \gloskeyval{name}{caf\'e},\nlsp
 \gloskeyval{description}{small restaurant selling refreshments}\nl
}
\codepar
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}\comxr
\gls{newabbreviation} \comxr
 \marg{html}\comment{label}
 \marg{HTML}\comment{short form}
 \marg{hypertext markup language}\comment{long form}
\comxropt{symbols}
\gls{glsxtrnewsymbol} 
 \oarg{\gloskeyval{description}{Archimedes' constant}}\comment{options}
 \marg{pi}\comment{label}
 \marg{\gls{ensuremath}\marg{\cmd{pi}}}\comment{symbol}
\comment{This is a trivial example. For a real document I recommend 
you use siunitx for units}
\gls{newglossaryentry} \combase
 \marg{distance}\comment{label}
 \marg{\comment{definition:}
   \gloskeyval{name}{distance},
   \gloskeyval{description}{the length between two points},
   \gloskeyval{symbol}{m}
 }
}
{%
First use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
Next use: \gls{gls}\marg{cafe}, \gls{gls}\marg{html}, \gls{gls}\marg{pi}.
\codepar
\gls{Gls}\marg{distance} is measured in \gls{glssymbol}\marg{distance}.\nl
\gls{printunsrtglossaries} \comment{list all defined entries}
}
\end{resultbox}

Note the difference in the way the \idx{abbreviation} (HTML) and symbol
($\pi$) are defined in the two above examples. The
\opt{abbreviations}, \opt{postdot} and \opt{stylemods}
options are specific to \sty{glossaries-extra}. Other options are
passed to the base \sty{glossaries} package.

\begin{xtr}
In this user manual, commands and options displayed in \xtrfmt{tan}, such as
\gls{newabbreviation} and \opt{stylemods}, are only available with 
the \sty{glossaries-extra} package. There are also some commands and options (such
as \gls{makeglossaries} and \opt{symbols}) that are provided by the
base \sty{glossaries} package but are redefined by the
\sty{glossaries-extra} package. See the \sty{glossaries-extra} user
manual for further details of those commands.
\end{xtr}

One of the strengths of the \sty{glossaries} package is its flexibility, however
the drawback of this is the necessity of having a large manual
that covers all the various settings. If you are daunted by the
size of the manual, try starting off with the much shorter
\docref{guide for beginners}{glossariesbegin}.

\begin{important}
There's a~common misconception that you have to have Perl installed
in order to use the \sty{glossaries} package. Perl is \emph{not}
a~requirement (as demonstrated by the above examples). It's only
required if you want to use \app{xindy} or \app{makeglossaries}.
Perl is used by other \TeX-related applications, such as
\appfmt{latexmk}, so you may already have it installed.
If you want to use \app{bib2gls}, you will need to have the Java
runtime environment installed. Java is used by other \TeX-related
applications, such as \app{arara} and JabRef, so you may already have it installed.
\end{important}

This user manual uses the \sty{glossaries-extra} package with
\app{bib2gls} (\option{b2g}). For example, when viewing the
\idx{PDF} version of this document in a \idxc+{hyperlink}{hyperlinked-enabled}
\idx{PDF} viewer (such as Adobe Reader or Okular) if you click on
the word \qt{\idx{indexing}} you'll be taken to the \idx{entry} in
the \hyperref[glossary]{main glossary} where there's a brief
description of the term. This is the way that the \sty{glossaries}
mechanism works. An \idx{indexingapp} (\app{bib2gls} in this case)
is used to generate the sorted list of terms. The
\idxpl{indexingapp} are \idx{cli} tools, which means they can be run
directly from a command prompt or terminal, or can be integrated
into some text editors, or you can use a build tool such as
\app{arara} to run them.

In addition to standard \idxpl{glossary}, this document has
\qt{standalone} definitions (\option{standalone}). For example, if you click on the
command \gls{gls}, the \idx+{hyperlink} will take you to the main part of the
document where the command is described. The \hyperref[index]{index} 
and \hyperref[summaries]{summaries} are also glossaries. The
technique used is too complicated to describe in this manual, but an
example can be found in \tugboat{\appfmt{bib2gls}: Standalone
entries and repeated lists (a little book of
poisons)}{2022}{43}{1}{tb133talbot-bib2gls-reorder.pdf}.

Neither of the above two examples require an \idx{indexingapp}. The
first is just using the \sty{glossaries} package for consistent
formatting, and there is no list. The second has lists but they are
unsorted (see \option{unsrt}).

The remainder of this introductory section covers the following:
\begin{itemize}
\item \sectionref{sec:indexingoptions} lists the available indexing
options.

\item \sectionref{sec:lipsum} lists the files provided that contain dummy
glossary entries which may be used for testing.

\item \sectionref{sec:languages} provides information for users who
wish to write in a language other than English.

\item \sectionref{sec:makeglossaries} describes how to use an
\idx{indexingapp} to create the sorted glossaries for your document
(\optionsor{mkidx,xdy}).

\end{itemize}

In addition to the examples provided in this document, there are
some sample documents provided with the \sty{glossaries} package.
They are described in \sectionref{sec:samples}.

\section{Rollback}
\label{sec:rollback}

\begin{important}
Rollback provides a useful way of reverting back to an earlier
release if there's a problem with a new version. However,
the further away the rollback date is from the current LaTeX kernel,
the more likely that incompatibilities will occur.
If you have historic documents that you need to compile, consider
using the historic \TeXLive\ Docker images.
(See, for example,
\blog{legacy-documents-and-tex-live-docker-images}%
{Legacy Documents and \TeXLive\ Docker Images}.)
\end{important}

The following rollback releases are available: 

\begin{itemize}
\item Version 4.54 (2024-04-03):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.54}
\end{codebox}
This version is the last version that doesn't test for the newer
\sty{datatool-base} commands that may now be used to sort glossaries with
\gls{printnoidxglossary}. It will always use the older, slower
method.

\item Version 4.52 (2022-11-03):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.52}
\end{codebox}
This is the last version that uses an internal comma-separated list
for the hyper group information in \sty{glossary-hypernav}. Version
4.53 has switched to using a sequence.

\item Version 4.49 (2021-11-01):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.49}
\end{codebox}
Note that this should also rollback \sty{mfirstuc} to version 2.07
if you have a later version installed.

\item Version 4.46 (2020-03-19):
\begin{codebox}
\cmd{usepackage}\marg{glossaries}\oarg{=v4.46}
\end{codebox}

\end{itemize}

If you rollback using \sty{latexrelease} to an earlier date, then
you will need to specify v4.46 for \sty{glossaries} as there are no
earlier rollback versions available. You may want to consider using
one of the historic \TeXLive\ Docker images instead. See, for
example, \blog{legacy-documents-and-tex-live-docker-images}{Legacy
Documents and TeX Live Docker Images}.

\section{Integrating Other Packages and Known Issues}
\label{sec:pkgintegration}

If you use \sty{hyperref} and \sty{glossaries}, you must load
\sty{hyperref} \emph{first} (although, in general, \sty{hyperref} should be
loaded after other packages).

Occasionally you may find that certain packages need to be
loaded \emph{after} packages that are required by \sty{glossaries}
but need to also be loaded before \sty{glossaries}. For
example, a package \meta{X} might need to be loaded after
\sty{amsgen} but before \sty{hyperref} (which needs to be loaded
before \sty{glossaries}). In which case, load the required package
first (for example, \sty{amsgen}), then \meta{X}, and finally load
\sty{glossaries}.
\begin{compactcodebox}
\cmd{usepackage}\marg{amsgen}\comment{load before \meta{X}}
\cmd{usepackage}\margm{X}\comment{must be loaded after \sty{amsgen}}
\cmd{usepackage}\marg{hyperref}\comment{load after \meta{X}}
\cmd{usepackage}\marg{glossaries}\comment{load after \sty{hyperref}}
\end{compactcodebox}

Some packages don't work with some \idxpl{glossarystyle}. For
example, \sty{classicthesis} doesn't work with the styles that use
the \env{description} environment, such as the \glostyle{list}
style. Since this is the default style, the \sty{glossaries} package
checks for \sty{classicthesis} and will change the default to the
\glostyle{index} style if it has been loaded.

Some packages conflict with a package that's required by
a \idx{glossarystyle} style package. For example, \sty{xtab}
conflicts with \sty{supertabular}, which is required by
\sty{glossary-super}. In this case, ensure the problematic \idx{glossarystyle}
package isn't loaded. For example, use the \opt{nosuper} option and
(with \sty{glossaries-extra}) don't use \optval{stylemods}{super} or
\optval{stylemods}{all}. The \sty{glossaries} package now (v4.50+)
checks for \sty{xtab} and will automatically implement \opt{nosuper}
if it has been loaded.

The language-support is implemented using \sty{tracklang}. See
\sectionref{sec:languages} for further details.

\section{Indexing Options}
\label{sec:indexingoptions}

\glsadd{indexing}%
The basic idea behind the \sty{glossaries} package is that you first
define your \idxpl+{entry} (terms, symbols or \idxpl{acronym}). Then you can
reference these within your document (analogous to \gls{cite} or \gls{ref}).
You can also, optionally, display a~list of the \idxpl{entry} you have
referenced in your document (the \idx+{glossary}). This last part,
displaying the \idx{glossary}, is the part that most new users find
difficult. There are three options available with the base
\sty{glossaries} package (\optionsto{noidx}{xdy}). The
\sty{glossaries-extra} extension package provides two extra options
for lists (\options{b2g,unsrt}) as well as an option for standalone
descriptions within the document body (\option{standalone}).

An overview of \optionsto{noidx}{unsrt} is given in \tableref{tab:options}.
\option{standalone} is omitted from the table as it doesn't produce a list.  For a
more detailed comparison of the various methods, see the
\galleryref{glossaries-performance.shtml}{\styfmt{glossaries}
performance page}. If, for some reason, you want to know what
\idx{indexing} option is in effect, you can test the expansion of:
\cmddef*{glsindexingsetting}
The definition is initialised to:
\begin{compactcodebox}
\gls{ifglsxindy} xindy\cmd{else} makeindex\cmd{fi}
\end{compactcodebox}
If the \opteqvalref{sort}{none} or \opteqvalref{sort}{clear} options
are used, \gls{glsindexingsetting} will be redefined to \code{none}.
If \gls{makeglossaries} is used \gls{glsindexingsetting} will be
updated to either \code{makeindex} or \code{xindy} as appropriate
(that is, the conditional will no longer be part of the definition).
If \gls{makenoidxglossaries} is used then \gls{glsindexingsetting} will
be updated to \code{noidx}. This means that \gls{glsindexingsetting}
can't be fully relied on until the start of the \env{document}
environment. (If you are using \sty{glossaries-extra}
v1.49+, then this command will also be updated to take the
\opt{record} setting into account.)

\begin{important}
If you are developing a class or package that loads
\sty{glossaries}, I recommend that you don't force the user into
a particular \idx{indexing} method by adding an unconditional \gls{makeglossaries}
into your class or package code. Aside from forcing the user into a
particular indexing method, it means that they're unable to use any
commands that must come before \gls{makeglossaries} (such as
\gls{newglossary}) and they can't switch off the indexing whilst
working on a draft document. (If you are using a class or package
that has done this, pass the \opt{disablemakegloss} option to
\sty{glossaries}. For example, via the document class options.)
\end{important}

Strictly speaking, \options{unsrt,standalone} aren't actually
\idx{indexing} options as no
\idx{indexing} is performed. In the case of \option{unsrt}, all defined entries are
listed in order of definition. In the case of \option{standalone}, the entry
hypertargets and descriptions are manually inserted at appropriate
points in the document. These two options are included here for
completeness and for comparison with the actual \idx{indexing} options.

\begin{table}[htbp]
 \caption{Glossary Options: Pros and Cons}
 \label{tab:options}
 \settabcolsep{3pt}%
 \centering
 \begin{tabular}{@{}>{\raggedright\small}p{0.35\textwidth}ccccc@{}}
   \bfseries Option
   & \bfseries \optionnum{noidx} 
   & \bfseries \optionnum{mkidx} 
   & \bfseries \optionnum{xdy}
   & \bfseries \optionnum{b2g} 
   & \bfseries \optionnum{unsrt}\\
   Requires \sty{glossaries-extra}? &
   \conno & \conno & \conno & \conyes & \conyes\\
   Requires an external application? &
   \conno & \conyes & \conyes & \conyes & \conno\\
   Requires Perl? &
   \conno & \conno & \conyes & \conno & \conno\\
   Requires Java? &
   \conno & \conno & \conno & \conyes & \conno\\
   Designed for \styfmt{glossaries}[\styfmt{-extra}]? &
   \proyes & \prono\fnsym{3} & \prono\fnsym{3} & \proyes & \proyes\\
   Can sort \glspl{exlatinalph}
   or \glspl{nonlatinalph}? &
   \prono\fnsym{1} & \prono & \proyes & \proyes & N/A\\
   Efficient sort algorithm? &
   \prono & \proyes & \proyes & \proyes & N/A\\
   Can use a different sort method for each glossary? &
   \proyes
   & \prono\fnsym{2}
   & \prono\fnsym{2} & \proyes & N/A\\
   Any problematic sort values? &
   \conyes & \conyes & \conyes & \conno & N/A\\
   Are entries with identical sort values treated as separate unique
   entries? &
   \proyes & \proyes & \prono\fnsym{4} & \proyes & \proyes\\
   Can automatically form \idxpl{range} in the \idxpl{locationlist}? &
   \prono & \proyes & \proyes & \proyes & \prono\\
   Can have non-standard \locations\ in the \idxpl{locationlist}? &
   \proyes & \prono
    & \proyes\fnsym{5}
    & \proyes
    & \proyes\fnsym{6}\\
   Maximum hierarchical depth (style-dependent) &
   \unlimited\fnsym{7} & 3 & \unlimited & \unlimited & \unlimited\\
   \gls{glsdisplaynumberlist} reliable? &
   \proyes & \prono & \prono & \proyes & \prono\\
   \gls{newglossaryentry} allowed in \env{document} environment?
   (Not recommended.) &
   \no & \yes & \yes & \no\fnsym{8} & \yes\fnsym{9}\\
   Requires additional write registers? &
   \conno & \conyes & \conyes & \conno & \conno\fnsym{10}\\
   Default value of \opt{sanitizesort} package option &
   \optfmt{false} & \optfmt{true} & \optfmt{true}
    & \optfmt{true}\fnsym{11}
    & \optfmt{true}\fnsym{11}
 \end{tabular}
 \par
 \tablefns
 {%
   \fnsymtext{3}{Both \app{makeindex} and \app{xindy}
   are general purpose \idxpl{indexingapp} developed
   independently of \sty{glossaries} and \sty{glossaries-extra}.}
   \fnsymtext{1}{Localisation support may be available via \sty{datatool}.}
   \fnsymtext{2}{Only with the hybrid method provided with \sty{glossaries-extra}.}
   \fnsymtext{4}{Entries with the same sort value are merged.}
   \fnsymtext{5}{Requires some setting up.}
   \fnsymtext{6}{The locations must be set explicitly
  through the custom \gloskey{location} field provided by
  \sty{glossaries-extra}.}
   \fnsymtext{7}{Unlimited but unreliable.}
   \fnsymtext{8}{Entries are defined in \ext{bib}
  format. \gls{newglossaryentry} should not be used explicitly.}
   \fnsymtext{9}{Provided \optval{docdef}{true} or
    \optval{docdef}{restricted} but not recommended.}
   \fnsymtext{10}{Provided \optval{docdef}{false} or
   \optval{docdef}{restricted}.}
   \fnsymtext{11}{Irrelevant with \opteqvalref{sort}{none}. (The
   \optval{record}{only} option automatically switches this on.)}
 }
\end{table}

\subsection{\idxoptiondef{noidx}}\label{option1}

For alphabetical sorting, ensure you have at least version 3.0 of
\sty{datatool} and, where available, \sty{datatool} language
support. If an older version is detected, a slower, less efficient
sort method will be used.  Note that this method doesn't form
location ranges.

\mExampleref{ex:noidx} demonstrates this method:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}
\strong{\gls{makenoidxglossaries}} \comment{use TeX to sort}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha}},\gloskeyval{description}{a variable}}
\comment{an \idx{acronym}:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printnoidxglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{preamble/document} with \gls{loadglsentries} (\emph{after}
\gls{makenoidxglossaries}). Note that six entries have been
defined but only five are referenced (\indexed) in the document so
only those five appear in the \idx{glossary}.
\begin{resultbox}
\createexample*[arara={pdflatex,pdflatex,pdfcrop},
 label={ex:noidx},
 title={Simple document that uses \TeX\ to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
 There are three letter groups, headed A, D and P}
]
{%
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}\nl
\gls{makenoidxglossaries} \comment{use TeX to sort}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},\nlsp
  \gloskeyval{description}{a brightly coloured tropical bird}}\nl
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},\nlsp
  \gloskeyval{description}{a waterbird}}\nl
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},\nlsp
  \gloskeyval{description}{a seabird with a brightly coloured bill}}\nl
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},\nlsp
  \gloskeyval{description}{a flightless black and white seabird}}\nl
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},\nlsp
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}\nl
\comment{an acronym:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}\nlsp
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.\nl
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.\nl
 Next use: \gls{gls}\marg{arpanet}.\nl
 \gls{printnoidxglossary}
}
\end{resultbox}
This uses the \glostyle{indexgroup} style, which puts a heading at
the start of each \idx{lettergroup}. The \idx{lettergroup} is determined by
the first character of the sort value. For a preview of all available
styles, see \gallerypage{glossaries-styles}{Gallery: Predefined Styles}.
The number 1 after each description is the \idx{numberlist} (or
\idx{locationlist}). This is the list of \locations\ (page numbers,
in this case) where the entry was \indexed. In this example, all
entries were \indexed\ on page~1.

\begin{information}
As from version 4.55, the \sty{glossaries} package will check for
a new command added to \sty{datatool-base} v3.0, that provides
better sorting. The method is faster and works better with \idx{utf8}
characters. See the \sty{datatool} v3.0+ documentation, in
particular the sections on localisation and on sorting lists.
\end{information}

This option doesn't require an external \idx{indexingapp} but, with
the default alphabetic sorting and old versions of \sty{datatool}, 
it's very slow with severe limitations, particularly if the sort
value contains \idxpl{exlatinchar} or \idxpl{nonlatinchar}.
However, if you have both
\sty{datatool} v3.0+ and \styfmt{datatool-english}
installed, and at least \sty{glossaries} v4.56, then make sure you
specify the locale. For example:
\begin{codebox}
\cmd{usepackage}[locales=en]\marg{datatool-base}
\cmd{usepackage}\marg{glossaries}
\end{codebox}
Or: 
\begin{codebox}
\cmd{usepackage}[\optval{locales}{en}]\marg{glossaries}
\end{codebox}
Other languages will need to have the appropriate \sty{datatool}
localisation support provided. Examples are provided in the
\sty{datatool} manual. \strong{In general, it's best to use
\app{xindy} or \app{bib2gls} if you need to sort terms that use an
\idx{exlatinalph} or \idx{nonlatinalph}.}

If you have any commands that cause problems when
expanding, such as \gls{alpha}, then you must use
\optval{sanitizesort}{true} or change the sort method
(\opteqvalref{sort}{use} or \opteqvalref{sort}{def}) in the package options
or explicitly set the \gloskey{sort} key when you define the
relevant entries, as shown in the above example which has:
\begin{codebox}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha},}\gloskeyval{description}{a variable}
}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package has a modified \opt{symbols}
package option that provides \gls{glsxtrnewsymbol}, which automatically sets the
\gloskey{sort} key to the entry label (instead of the \gloskey{name}).
\end{xtr}

This option works best with \sty{datatool} v3.0+. If using a word or
letter sort, be sure to also install the applicable \sty{datatool}
language file, if available.  This option allows a mixture of sort
methods. (For example, sorting by word order for one glossary and
order of use for another.) This option can be problematic with
\hierarchical\ glossaries and does not form \idxpl{range} in the
\idxpl{locationlist}.

Summary:
 \begin{enumerate}
   \item Add 
\begin{codebox*}
\gls{makenoidxglossaries}
\end{codebox*}
   to your \idx{preamble/document} (before you start defining your 
   entries, as described in \sectionref{sec:newglosentry}).

   \item Put
\begin{codebox*}
\gls{printnoidxglossary}
\end{codebox*}
   where you want your list of entries to appear (described in
  \sectionref{sec:printglossary}). Alternatively, to display all
   glossaries use the iterative command:
\begin{codebox*}
\gls{printnoidxglossaries}
\end{codebox*}

   \item Run \LaTeX\ twice on your document. (As you would do to
   make a~table of contents appear.) For example, click twice on
   the \qt{typeset} or \qt{build} or \qt{\pdfLaTeX} button in your editor.
 \end{enumerate}

\subsection{\idxoptiondef{mkidx}}\label{option2}

\begin{information}
Since \app{makeindex} was designed for indexes, it doesn't fully
integrate with the \sty{glossaries} package, which has more complex
use cases than a simple index. A better solution is to use \app{bib2gls} 
which is developed alongside \sty{glossaries-extra} and so provides better integration.
\end{information}

\glsadd{app.makeindex}\mExampleref{ex:mkidx} demonstrates a simple
document that requires \app{makeindex}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}
\strong{\gls{makeglossaries}} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha}},\gloskeyval{description}{a variable}}
\comment{an \idx{acronym}:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{preamble/document} with \gls{loadglsentries} (\emph{after}
\gls{makeglossaries}). The result is the same as for
\exampleref{ex:noidx}.
\begin{resultbox}
\createexample*[arara={pdflatex,makeglossaries,pdflatex,pdfcrop},
 label={ex:mkidx},
 title={Simple document that uses \appfmt{makeindex} to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
 There are three letter groups, headed A, D and P}
]
{%
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}\nl
\gls{makeglossaries} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},\nlsp
  \gloskeyval{description}{a brightly coloured tropical bird}}\nl
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},\nlsp
  \gloskeyval{description}{a waterbird}}\nl
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},\nlsp
  \gloskeyval{description}{a seabird with a brightly coloured bill}}\nl
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},\nlsp
  \gloskeyval{description}{a flightless black and white seabird}}\nl
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},\nlsp
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}\nl
\comment{an acronym:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}\nlsp
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.\nl
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.\nl
  Next use: \gls{gls}\marg{arpanet}.\nl
 \gls{printglossary}
}
\end{resultbox}

This option uses a~\idx{cli} application called \app{makeindex} to sort 
the entries. This application comes with all modern \TeX\ distributions, 
but it's hard-coded for the non-extended \idx{latinalph}. It can't
correctly sort accent commands (such as \gls{cs.apos} or \gls{c}) and fails
with \idx{utf8} characters, especially for any sort values that start
with a \idx{utf8} character (as it separates the octets resulting in an
invalid file \idx{encoding}). This process involves making \LaTeX\ write
the \idx{glossary} information to a temporary file which \app{makeindex}
reads.  Then \app{makeindex} writes a~new file containing the code
to typeset the \idx{glossary}. Then \gls{printglossary} reads this file in
on the next run.

\begin{information}
There are other applications that can read \app{makeindex} files,
such as \app{texindy} and \app{xindex}, but the \sty{glossaries}
package uses a customized \ext+{ist} style file (created by
\gls{makeglossaries}) that adjusts the special characters and input
keyword and also ensures that the resulting file (which is input by
\gls{printglossary}) adheres to the \idx{glossary} style.
If you want to use an alternative, you will need to ensure that it
can honour the settings in the \ext{ist} file or find some way to
convert the \ext{ist} file into an equivalent set of instructions.
\end{information}

This option works best if you want to sort entries according to the
Basic Latin alphabet and you don't want to install Perl or Java. This
method can also work with the restricted \idx{shellescape} since
\app{makeindex} is considered a trusted application, which means you should
be able to use the \opteqvalref{automake}{immediate} or
\opteqvalref{automake}{true} package option provided the
\idx{shellescape} hasn't been completely disabled.

This method can form \idxpl{range} in the \idx{numberlist} but only
accepts limited number formats: \gls{arabic}, \gls{roman},
\gls{Roman}, \gls{alph} and \gls{Alph}. 

This option does not allow a mixture of sort methods. 
All \idxpl{glossary} must be sorted according to the same method: 
word\slash letter ordering or order of use or order of definition.
If you need word ordering for one \idx{glossary} and letter ordering
for another you'll have to explicitly call \app{makeindex} for 
each \idx{glossary} type.

\begin{xtr}
The \sty{glossaries-extra} package allows a hybrid mix of
\options{noidx,mkidx} to provide word\slash letter ordering with
\option{mkidx} and order of use\slash definition with
\option{noidx}.  See the \sty{glossaries-extra} documentation for
further details. See also the \sty{glossaries-extra} alternative to
\samplefile{Sort} in \sectionref{sec:samplessort}.
\end{xtr}

Summary:
   \begin{enumerate}
    \item If you want to use \app{makeindex}['s] \mkidxopt{g} option
    you must change the quote character using \gls{GlsSetQuote}. For example:
\begin{codebox}
\gls{GlsSetQuote}\marg{+}
\end{codebox}
    This must be used before \gls{makeglossaries}.
    Note that if you are using \sty{babel}, the shorthands aren't
    enabled until the start of the document, so you won't be able to use
    the shorthands in definitions that occur in the \idx+{preamble/document}.

    \item Add 
\begin{codebox*}
\gls{makeglossaries}
\end{codebox*}
to your \idx{preamble/document} (before you start
    defining your entries, as described in
    \sectionref{sec:newglosentry}).

    \item Put
\begin{codebox*}
\gls{printglossary}
\end{codebox*}
    where you want your list of entries to appear (described in
    \sectionref{sec:printglossary}). Alternatively, to display all
    glossaries use the iterative command:
\begin{codebox*}
\gls{printglossaries}
\end{codebox*}

    \item Run \LaTeX\ on your document. This creates files with the
    extensions \ext+{glo} and \ext+{ist} (for example, if your 
    \LaTeX\ document is called \filefmt{myDoc.tex}, then you'll have 
    two extra files called \filefmt{myDoc.glo} and \filefmt{myDoc.ist}).
    If you look at your document at this point, you won't see the 
    glossary as it hasn't been created yet. (If you use
    \sty{glossaries-extra} you'll see the section heading and some 
    boilerplate text.)

    If you have used package options such as \opt{symbols} there
    will also be other sets of files corresponding to the extra
    glossaries that were created by those options.

    \item\plabel{makeindex.run} Run \app{makeindex} with the \ext{glo} file as the
    input file and the \ext{ist} file as the style so that
    it creates an output file with the extension \ext+{gls}:
\begin{terminal}
makeindex \mkidxopt{s} myDoc.ist \mkidxopt{o} myDoc.gls myDoc.glo
\end{terminal}
   (Replace \code{myDoc} with the base name of your \LaTeX\
    document file. Avoid spaces in the file name if possible.)

\begin{important}
The file extensions vary according to the \idx{glossary} \gloskey{type}.
See \sectionref{sec:makeindexapp} for further details.
\app{makeindex} must be called for each set of files.
\end{important}

    If you don't know how to use the command prompt, then you can probably access
    \app{makeindex} via your text editor, but each editor has a
    different method of doing this. See \dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build} for some examples.

    Alternatively, run \app{makeindex} indirectly via the
\app{makeglossaries} script:
\begin{terminal}
makeglossaries myDoc
\end{terminal}
    Note that the file extension isn't supplied in this case.
    (Replace \app{makeglossaries} with \app{makeglossaries-lite} if
    you don't have Perl installed.)
    This will pick up all the file extensions from the
    \ext{aux} file and run \app{makeindex} the appropriate number
    of times with all the necessary switches.

    The simplest approach is to use \app{arara} and add the following
    comment lines to the start of your document:
\begin{codebox}
\araraline{pdflatex}
\araraline{makeglossaries}
\araraline{pdflatex}
\end{codebox}
    (Replace \code{makeglossaries} with \code{makeglossarieslite} in the 
     second line above if you don't have Perl installed. Note that
     there's no hyphen in this case.)

    The default sort is word order (\qt{sea lion} comes before \qt{seal}). 
    If you want letter ordering you need to add the \mkidxopt{l}
    switch:
\begin{terminal}
makeindex \mkidxopt{l} \mkidxopt{s} myDoc.ist -o myDoc.gls myDoc.glo
\end{terminal}
    (See \sectionref{sec:makeindexapp} for further details on using 
    \app{makeindex} explicitly.) If you use \app{makeglossaries}
    or \app{makeglossaries-lite} then use the \optval{order}{letter}
    package option and the \mkidxopt{l} option will be added
    automatically.

    \item\plabel{makeindex.relatex} Once you have successfully completed the previous step,
    you can now run \LaTeX\ on your document again.
   \end{enumerate}
You'll need to repeat the last step if you have used the \opt{toc}
option (unless you're using \sty{glossaries-extra}) to ensure the
section heading is added to the table of contents.  You'll also need
to repeat steps~\ref{makeindex.run} and~\ref{makeindex.relatex} if
you have any cross-references which can't be \indexed\ until the
\idx{indexingfile} has been created.

\subsection{\idxoptiondef{xdy}}\label{option3}

\begin{information}
Since \app{xindy} was designed for indexes, it doesn't fully
integrate with the \sty{glossaries} package, which has more complex
use cases than a simple index. A better solution is to use \app{bib2gls} 
which is developed alongside \sty{glossaries-extra} and so provides better integration.
See the \app{xindy} home page \url{http://www.xindy.org/} for
the \app{xindy} documentation, and links to the mailing list and
issue tracker.
\end{information}

\glsadd{app.xindy}\mExampleref{ex:xdy} demonstrates a simple document that
requires \app{xindy}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\strong{\opt{xindy}},\optval{style}{\glostyle{indexgroup}}]\marg{glossaries}
\strong{\gls{makeglossaries}} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha}},\gloskeyval{description}{a variable}}
\comment{an \idx{acronym}:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{preamble/document} with \gls{loadglsentries} (\emph{after}
\gls{makeglossaries}). The result is the same as for
\exampleref{ex:noidx} and \exampleref{ex:mkidx}.
\begin{resultbox}
\createexample*[arara={pdflatex,makeglossaries,pdflatex,pdfcrop},
 label={ex:xdy},
 title={Simple document that uses \appfmt{xindy} to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
 There are three letter groups, headed A, D and P}
]
{%
\cmd{usepackage}[xindy,style=indexgroup]\marg{glossaries}\nl
\gls{makeglossaries} \comment{open \idxpl{indexingfile}}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},\nlsp
  \gloskeyval{description}{a brightly coloured tropical bird}}\nl
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},\nlsp
  \gloskeyval{description}{a waterbird}}\nl
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},\nlsp
  \gloskeyval{description}{a seabird with a brightly coloured bill}}\nl
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},\nlsp
  \gloskeyval{description}{a flightless black and white seabird}}\nl
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},\nlsp
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}\nl
\comment{an acronym:}
\gls{setacronymstyle}\marg{\acrstyle{short-long}}\nlsp
\gls{newacronym}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.\nl
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.\nl
  Next use: \gls{gls}\marg{arpanet}.\nl
 \gls{printglossary}
}
\end{resultbox}

This option uses a~\idx{cli} application called
\app{xindy} to sort the entries. This application is more flexible than 
\app{makeindex} and is able to sort \idxpl{exlatinalph} or 
\idxpl{nonlatinalph}, however it does still have some limitations.
(See \Exampleref{ex:xindyutf8} for an example with \idx{utf8}
characters.)

The \app{xindy} application comes with both \TeXLive\ and
\MikTeX, but since \app{xindy} is a Perl script, you will also need
to install Perl, if you don't already have it.  In a~similar way to
\option{mkidx}, this option involves making \LaTeX\ write the
\idx{glossary} information to a~temporary file which \app{xindy} reads. Then
\app{xindy} writes a~new file containing the code to typeset the
glossary. Then \gls{printglossary} reads this file in on the next run.

This is the best option with just the base \sty{glossaries}
package if you want to sort according to a~language other than 
English or if you want non-standard \idxpl+{locationlist}, but it can 
require some setting up (see \sectionref{sec:xindy}). There are
some problems with certain sort values:
\begin{itemize}
   \item entries with the same sort value are merged by \app{xindy}
   into a single glossary line so you must make sure that each entry
   has a unique sort value;
   \item \app{xindy} forbids empty sort values;
   \item \app{xindy} automatically strips control sequences, the math-shift
   character \idx{dollar} and braces \idx{bg}\idx{eg} from the sort value,
   which is usually desired but this can cause the sort value to
   collapse to an empty string which \app{xindy} forbids.
\end{itemize}
In these problematic cases, you must set the \gloskey{sort} field
explicitly, as in the above example which has:
\begin{codebox}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \strong{\gloskeyval{sort}{alpha},}\gloskeyval{description}{a variable}
}
\end{codebox}
\begin{xtr}
The \sty{glossaries-extra} package has a modified \opt{symbols}
package option that provides \gls{glsxtrnewsymbol}, which automatically sets the
\gloskey{sort} key to the entry label (instead of the \gloskey{name}).
\end{xtr}

All \idxpl{glossary} must be sorted according to the same method 
(word\slash letter ordering, order of use, or order of definition).

\begin{xtr}
The \sty{glossaries-extra} package allows a hybrid mix of
\options{noidx,xdy} to provide word\slash letter ordering with
\option{xdy} and order of use\slash definition with \option{mkidx}.
See the \sty{glossaries-extra} documentation for further details.
\end{xtr}

Summary:
\begin{enumerate}
     \item Add the \opt{xindy} option to the \sty{glossaries}
package option list:
\begin{codebox}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
     If you are using a non-Latin script you'll also need to either
     switch off the creation of the number \idx{group}:
\begin{codebox}
\cmd{usepackage}[\optvalm{xindy}{\styoptxdyval{glsnumbers}{false}}]\marg{glossaries}
\end{codebox}
      or use either \code{\gls{GlsSetXdyFirstLetterAfterDigits}\margm{letter}} (to indicate the
first \idx{lettergroup} to follow the digits) or
     \code{\gls{GlsSetXdyNumberGroupOrder}\margm{spec}} to indicate where the number
     \idx{group} should be placed (see \sectionref{sec:xindy}).

     \item Add \gls{makeglossaries} to your \idx{preamble/document} (before you start
     defining your entries, as described in \sectionref{sec:newglosentry}).

    \item Run \LaTeX\ on your document. This creates files with the
    extensions \ext+{glo} and \ext+{xdy} (for example, if your 
    \LaTeX\ document is called \filefmt{myDoc.tex}, then you'll have 
    two extra files called \filefmt{myDoc.glo} and \filefmt{myDoc.xdy}).
    If you look at your document at this point, you won't see the 
    glossary as it hasn't been created yet. (If you're using the
    \sty{glossaries-extra} extension package, you'll see the section
    header and some boilerplate text.)

    If you have used package options such as \opt{symbols} there
    will also be other sets of files corresponding to the extra
    glossaries that were created by those options.

    \item Run \app{xindy} with the \ext{glo} file as the
    input file and the \ext{xdy} file as a~module so that
    it creates an output file with the extension \ext+{gls}. You 
    also need to set the language name and input \idx{encoding}, as follows (all on one
    line):
\begin{terminal}
xindy \xdyopt{L} english \xdyopt{C} utf8 \xdyopt{I} xindy \xdyopt{M} myDoc \xdyopt{t} myDoc.glg \xdyopt{o} myDoc.gls myDoc.glo
\end{terminal}
    (Replace \code{myDoc} with the base name of your \LaTeX\
    document file. Avoid spaces in the file name. If necessary, also replace
    \code{english} with the name of your language and \code{utf8}
    with your input \idx{encoding}, for example, 
    \code{\xdyopt{L} german \xdyopt{C} din5007-utf8}.)

\begin{important}
The file extensions vary according to the glossary \gloskey{type}.
See \sectionref{sec:xindyapp} for further details.
\app{xindy} must be called for each set of files.
\end{important}

    It's much simpler to use \app{makeglossaries} instead:
\begin{terminal}
makeglossaries myDoc
\end{terminal}
    Note that the file extension isn't supplied in this case.
    This will pick up all the file extensions from the
    \ext{aux} file and run \app{xindy} the appropriate number
    of times with all the necessary switches.

    There's no benefit in using \app{makeglossaries-lite} with \app{xindy}.
    (Remember that \app{xindy} is a Perl script so if you can use
    \app{xindy} then you can also use \app{makeglossaries}, and if
    you don't want to use \app{makeglossaries} because you don't
    want to install Perl, then you can't use \app{xindy} either.)
   
    If you don't know how to use the command prompt, then you can 
    probably access \app{xindy} or \app{makeglossaries} via your text editor,
    but each editor has a different method of doing this. See
\dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build} for some examples.

    Again, a convenient method is to use \app{arara} and add the follow comment
    lines to the start of your document:
\begin{codebox}
\araraline{pdflatex}
\araraline{makeglossaries}
\araraline{pdflatex}
\end{codebox}

    The default sort is word order (\qt{sea lion} comes before \qt{seal}). 
    If you want letter ordering you need to add the
    \optval{order}{letter} package option:
\begin{codebox}
\cmd{usepackage}[\opt{xindy},\optval{order}{letter}]\marg{glossaries}
\end{codebox}
    (and return to the previous step). This option is picked up
    by \app{makeglossaries}. If you are explicitly using \app{xindy}
    then you'll need to add \code{\xdyopt{M} ord/letorder} to the options list.
    See \sectionref{sec:xindyapp} for further details on using 
    \app{xindy} explicitly.

    \item Once you have successfully completed the previous step,
    you can now run \LaTeX\ on your document again. As with
    \app{makeindex} (\option{mkidx}), you may need to repeat the previous
    step and this step to ensure the table of contents and cross-references are resolved.

\end{enumerate}

\subsection{\idxoptiondef{b2g}}\label{option4}

\glsxtrnote
\glsadd{app.bib2gls}This option is only available with the
\sty{glossaries-extra} extension package.  This method uses
\app{bib2gls} to both fetch \idx{entry} definitions from \ext+{bib} files
and to hierarchically sort and collate. The \app{bib2gls}
application is designed specifically for, and developed alongside, the 
\sty{glossaries-extra} package.

\mExampleref{ex:b2g} demonstrates a simple document that requires \app{bib2gls}:
\begin{codebox*}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\strong{\opt{record}},\optval{style}{\glostyle{indexgroup}}]\marg{\strong{glossaries-extra}}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}
\comment{data in sample-entries.bib:}
\strong{\gls{GlsXtrLoadResources}}\oarg{\resourceoptvalm{src}{sample-entries}}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printunsrtglossary}}
\cend{document}
\end{codebox*}
Note that the \idx{abbrvstyle} must be set before \gls{GlsXtrLoadResources}.
The file \filefmt{sample-entries.bib} contains:
\begin{codebox}
\atentry{entry}\marg{parrot,
 \gloskeyval{name}{parrot}, 
 \gloskeyval{description}{a brightly coloured tropical bird}
}
\atentry{entry}\marg{duck,
 \gloskeyval{name}{duck}, 
 \gloskeyval{description}{a waterbird}
}
\atentry{entry}\marg{puffin,
 \gloskeyval{name}{puffin},
 \gloskeyval{description}{a seabird with a brightly
coloured bill}
}
\atentry{entry}\marg{penguin,
 \gloskeyval{name}{penguin}, 
 \gloskeyval{description}{a flightless black and white seabird}
}
\atentry{symbol}\marg{alpha,
 \gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \gloskeyval{description}{a variable}
}
\atentry{abbreviation}\marg{arpanet,
  \gloskeyval{short}{ARPANET},
  \gloskeyval{long}{Advanced Research Projects Agency Network}
}
\end{codebox}
The result is slightly different from the previous examples. Letter
groups aren't created by default with \app{bib2gls} so, even though
the \idx{glossarystyle} supports \idxpl{lettergroup}, there's no 
\idx{group} information. This can be added by invoking \app{bib2gls}
with the  \switch{group} switch.
\begin{resultbox}
\createexample*[arara={pdflatex,bib2gls,pdflatex,pdfcrop},
 label={ex:b2g},
 title={Simple document that uses \appfmt{bib2gls} to sort entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays a sorted list
 of the referenced entries: alpha, ARPANET, duck, parrot and puffin.
  There are no letter groups}
]
{%
\cbeg{filecontents*}\marg{sample-entries.bib}\nl
\atentry{entry}\marg{parrot,\nlsp
 \gloskeyval{name}{parrot}, \nlsp
 \gloskeyval{description}{a brightly coloured tropical bird}\nl
}\nl
\atentry{entry}\marg{duck,\nlsp
 \gloskeyval{name}{duck}, \nlsp
 \gloskeyval{description}{a waterbird}\nl
}\nl
\atentry{entry}\marg{puffin,\nlsp
 \gloskeyval{name}{puffin},\nlsp
 \gloskeyval{description}{a seabird with a brightly coloured bill}\nl
}\nl
\atentry{entry}\marg{penguin,\nlsp
 \gloskeyval{name}{penguin}, \nlsp
 \gloskeyval{description}{a flightless black and white seabird}\nl
}\nl
\atentry{symbol}\marg{alpha,\nlsp
 \gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},\nlsp
 \gloskeyval{description}{a variable}\nl
}\nl
\atentry{abbreviation}\marg{arpanet,\nlsp
  \gloskeyval{short}{ARPANET},\nlsp
  \gloskeyval{long}{Advanced Research Projects Agency Network}\nl
}\nl
\cend{filecontents*}\nl
\cmd{usepackage}[\opt{record},style=indexgroup]\marg{glossaries-extra}\nl
\gls{setabbreviationstyle}\marg{short-long}\nl
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{sample-entries}}\comment{data in sample-entries.bib}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.\nl
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.\nl
  Next use: \gls{gls}\marg{arpanet}.\nl
 \gls{printunsrtglossary}
}
\end{resultbox}

All entries must be provided in one or more \ext{bib} files.
(See the \app{bib2gls} user manual for the required format.)
In this example, the terms \qt{parrot}, \qt{duck}, \qt{puffin} and
\qt{penguin} are defined using \atentry{atentry}, the symbol alpha
($\alpha$) is defined using \atentry{symbol} and the \idx{abbreviation}
\qt{ARPANET} is defined using \atentry{abbreviation}.
See \Exampleref{ex:bib2glsutf8} for an example with \idx{utf8}
content.

\begin{important}
Note that the \gloskey{sort} key should not be used. Each entry type
(\atentry{entry}, \atentry{symbol}, \atentry{abbreviation}) has a
particular field that's used for the sort value by default
(\gloskey{name}, the label, \gloskey{short}). You will break this
mechanism if you explicitly use the \gloskey{sort} key. See
\bibglsgallery{sorting} for examples.
\end{important}

The \sty{glossaries-extra} package needs to be loaded with the
\opt{record} package option:
\begin{codebox}
\cmd{usepackage}[\opt{record}]\marg{glossaries-extra}
\end{codebox}
or (equivalently)
\begin{codebox}
\cmd{usepackage}[\optval{record}{only}]\marg{glossaries-extra}
\end{codebox}
or (with \sty{glossaries-extra} v1.37+ and \app{bib2gls} v1.8+):
\begin{codebox}
\cmd{usepackage}[\optval{record}{nameref}]\marg{glossaries-extra}
\end{codebox}
The \optval{record}{nameref} option is the best method if you are
using \sty{hyperref}.

Each resource set is loaded with \gls{GlsXtrLoadResources}.
For example:
\begin{codebox*}
\gls{GlsXtrLoadResources}
\oarg{\comment{definitions in entries1.bib and entries2.bib:}
 \resourceoptvalm{src}{entries1,entries2},
 \resourceoptvalm{sort}{de-CH-1996}\comment{sort according to this locale}
}
\end{codebox*}
The \ext{bib} files are identified as a comma-separated list in the
value of the \resourceopt{src} key. The \resourceopt{sort} option
identifies the sorting method. This may be a locale identifier for
alphabetic sorting, but there are other sort methods available, such
as character code or numeric. One resource set may cover multiple
\idxpl{glossary} or one \idx{glossary} may be split across multiple resource
sets, forming logical sub-blocks.

If you want to ensure that all entries are selected, even if
they haven't been referenced in the document, then add the option
\resourceoptval{selection}{all}. (There are also ways of filtering the
selection or you can even have a random selection by shuffling and
truncating the list. See the \app{bib2gls} user manual for further details.)

The \idx{glossary} is displayed using:
\begin{codebox*}
\gls{printunsrtglossary}
\end{codebox*}
Alternatively all glossaries can be displayed using the iterative
command:
\begin{codebox*}
\gls{printunsrtglossaries}
\end{codebox*}
The document is built using:
\begin{terminal}
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
\end{terminal}
If \idxpl{lettergroup} are required, you need the \switch{group} switch:
\begin{terminal}
bib2gls \switch{group} myDoc
\end{terminal}
or with \app{arara}:
\begin{codebox}
\araraline{bib2gls: \marg{ group: on }}
\end{codebox}
(You will also need an appropriate \idx{glossarystyle}.)

Unlike \options{mkidx,xdy}, this method doesn't create a file containing
the typeset \idx{glossary} but simply determines which entries are
needed for the document, their associated locations and (if
required) their associated \idx{lettergroup}. This option allows
a mixture of sort methods. For example, sorting by word order
for one glossary and order of use for another or even sorting
one block of the \idx{glossary} differently to another block in the
same \idx{glossary}. See \bibglsgallery{sorting}.

This method supports Unicode and uses the \gls{cldr}, which provides
more extensive language support than \app{xindy}. (Except for
Klingon, which is supported by \app{xindy}, but not by the
\gls{cldr}.) The locations in the \idx{numberlist} may be in any
format. If \app{bib2gls} can deduce a numerical value it will
attempt to form \idxpl{range} otherwise it will simply list the
\locations.

Summary:
\begin{enumerate}
  \item Use \sty{glossaries-extra} with the \opt{record} package
option:
\begin{codebox}
\cmd{usepackage}[\opt{record}]\marg{glossaries-extra}
\end{codebox}

  \item Use \gls{GlsXtrLoadResources} to identify the \ext{bib}
file(s) and \app{bib2gls} options. The \ext{bib} extension may be
omitted:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms.bib,abbreviations.bib},\resourceoptval{sort}{en}}
\end{codebox}

 \item Put
\begin{codebox*}
\gls{printunsrtglossary}
\end{codebox*}
where you want your list of entries to appear. Alternatively to
display all glossaries use the iterative command:
\begin{codebox*}
\gls{printunsrtglossaries}
\end{codebox*}

\item Run \LaTeX\ on your document.

\item Run \app{bib2gls} with just the document base name.

\item Run \LaTeX\ on your document.

\end{enumerate}

See \bibglsbegin\ or the \app{bib2gls} user manual for further
details of this method, and
also \dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}.

\subsection{\idxoptiondef{unsrt}}\label{option5}

\glsxtrnote
This option is only available with the extension package
\sty{glossaries-extra}. No \idx{indexingapp} is required. 

\mExampleref{ex:unsrt} demonstrates this method:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{style}{\glostyle{indexgroup}}]\marg{glossaries-extra}
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot}, 
  \gloskeyval{description}{a brightly coloured tropical bird}}
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck}, 
  \gloskeyval{description}{a waterbird}}
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},
  \gloskeyval{description}{a seabird with a brightly coloured bill}}
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin}, 
  \gloskeyval{description}{a flightless black and white seabird}}
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
 \gloskeyval{description}{a variable}}
\comment{an \idx{abbreviation}:}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}
\gls{newabbreviation}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
\cbeg{document}
\gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.
\gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.
Next use: \gls{gls}\marg{arpanet}.
\strong{\gls{printunsrtglossary}}
\cend{document}
\end{codebox}
You can place all your entry definitions in a separate file
and load it in the \idx{preamble/document} with \gls{loadglsentries}. 
There's no \qt{activation} command (such as \gls{makeglossaries} for
\options{mkidx,xdy}). 

The result is different from the previous examples. Now all entries
are listed in the \idx{glossary}, including \qt{penguin} which
hasn't been referenced in the document, and the list is in the order
that the entries were defined. There are no \idxpl{numberlist}.
\begin{resultbox}
\createexample*[arara={pdflatex,pdfcrop},
 label={ex:unsrt},
 title={Simple document with an unsorted list of all defined entries},
 description={Example document that defines some entries,
 references a subset of them in the document and displays an unsorted list
 of the defined entries: parrot, duck, puffin, penguin, alpha and
ARPANET. There are four letter groups with a repeated letter: P, D, P, A}
]
{%
\cmd{usepackage}[style=indexgroup]\marg{glossaries-extra}\nl
\gls{newglossaryentry}\marg{parrot}\marg{\gloskeyval{name}{parrot},\nlsp
  \gloskeyval{description}{a brightly coloured tropical bird}}\nl
\gls{newglossaryentry}\marg{duck}\marg{\gloskeyval{name}{duck},\nlsp
  \gloskeyval{description}{a waterbird}}\nl
\gls{newglossaryentry}\marg{puffin}\marg{\gloskeyval{name}{puffin},\nlsp
  \gloskeyval{description}{a seabird with a brightly coloured bill}}\nl
\gls{newglossaryentry}\marg{penguin}\marg{\gloskeyval{name}{penguin},\nlsp
  \gloskeyval{description}{a flightless black and white seabird}}\nl
\comment{a symbol:}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},\nlsp
 \gloskeyval{sort}{alpha},\gloskeyval{description}{a variable}}\nl
\comment{an abbreviation:}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-long}}\nl
\gls{newabbreviation}\marg{arpanet}\marg{ARPANET}\marg{Advanced Research Projects Agency Network}
}
{%
 \gls{Gls}\marg{puffin}, \gls{gls}\marg{duck} and \gls{gls}\marg{parrot}.\nl
 \gls{gls}\marg{arpanet} and \gls{gls}\marg{alpha}.\nl
 Next use: \gls{gls}\marg{arpanet}.\nl
 \comment{entries are listed in order of definition}
 \gls{printunsrtglossary}
}
\end{resultbox}
Note that the letter groups are fragmented because the list isn't in
alphabetical order, so there are two \qt{P} letter groups.

The \gls{printunsrtglossary} command simply iterates over the set
of all defined entries associated with the given \idx{glossary} and 
lists them in the order of definition. This means that child 
entries must be defined immediately after their parent entry 
if they must be kept together in the glossary. Some \idxpl{glossarystyle}
indent entries that have a parent but it's the \idx{indexingapp}
that ensures the child entries are listed immediately after the
parent. If you're opting to use this manual approach then it's your
responsibility to define the entries in the correct order.

The \sty{glossaries-extra} package requires entries to be defined in the
\idx+{preamble/document} by default. It's possible to remove this restriction, but
bear in mind that any entries defined after \gls{printunsrtglossary}
won't be listed.

The \idx{glossary} is displayed using:
\begin{codebox*}
\gls{printunsrtglossary}
\end{codebox*}
Alternatively all glossaries can be displayed using the iterative
command:
\begin{codebox*}
\gls{printunsrtglossaries}
\end{codebox*}

This method will display \emph{all} defined entries, regardless of
whether or not they have been used in the document. Note that this
uses the same command for displaying the \idx{glossary} as
\option{b2g}. This is because \app{bib2gls} takes advantage of this
method by defining the wanted entries in the required order and
setting the locations (and \idx{lettergroup} information, if required).
See the \sty{glossaries-extra} manual for further details.

Therefore, the above example document has a glossary containing the
entries: parrot, duck, puffin, penguin, $\alpha$ and ARPANET (in
that order). Note that the \qt{penguin} entry has been included even
though it wasn't referenced in the document.

This just requires a single \LaTeX\ call:
\begin{terminal}
pdflatex myDoc
\end{terminal}
unless the glossary needs to appear in the table of contents, in which case
a second run is required:
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
\end{terminal}
(Naturally if the document also contains citations, and so on, 
then additional steps are required. Similarly for all the other
options above.)

See the \sty{glossaries-extra} documentation for further details of this method.

\subsection{\idxoptiondef{standalone}}\label{option6}

\glsxtrnote
This option is only available with the \sty{glossaries-extra}
extension package. (You can just use the base
\sty{glossaries} package for the first case, but it's less
convenient. You'd have to manually insert the entry target before
the sectioning command and use \code{\gls{glsentryname}\margm{label}} or
\code{\gls{Glsentryname}\margm{label}} to display the entry name.) Instead
of creating a list, this has standalone definitions throughout the
document. The entry name may or may not be in a section heading.

You can either define entries in the \idx{preamble/document} (or in an
external file loaded with \gls{loadglsentries}), as with
\option{unsrt}, or use \app{bib2gls} if you want to manage a large 
database of terms.

\mExampleref{ex:standalone} demonstrates standalone definitions
without \app{bib2gls}:
\begin{codebox*}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\optval{sort}{none},
   \opt{nostyles}\comment{<- no glossary styles are required}
 ]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},
  \gloskeyval{description}{a collection of any kind of objects},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}
}
\codepar
\gls{newglossaryentry}\marg{function}\marg{\gloskeyval{name}{function},
  \gloskeyval{description}{a rule that assigns every element in the 
  domain \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}}
}
\cmd{newcommand}*\marg{\cmd{termdef}}[1]\marg{\comment{}
  \gls{section}\marg{\gls{Glsxtrglossentry}\marg{\#1} \gls{glsentrysymbol}\marg{\#1}}\comment{}
  \cbeg{quote}\cmd{em}\gls{Glsentrydesc}\marg{\#1}.\cend{quote}\comment{}
}
\cbeg{document}
\cmd{tableofcontents}
\codepar
\gls{section}\marg{Introduction}
Sample document about \gls{glspl}\marg{function} and \gls{glspl}\marg{set}.
\codepar
\cmd{termdef}\marg{set}
\codepar
More detailed information about \gls{glspl}\marg{set} with examples.
\codepar
\cmd{termdef}\marg{function}
\codepar
More detailed information about \gls{glspl}\marg{function} with examples.
\codepar
\cend{document}
\end{codebox*}
This allows the references to \idx+{hyperlink} to the standalone
definitions rather than to a \idx{glossary}.
\begin{resultbox}
\createexample*[arara={pdflatex,pdflatex,pdfcrop},
 label={ex:standalone},
 title={Simple document with standalone entries},
 description={Example document that defines entries and displays them in the
document.}
]
{%
\cmd{usepackage}[colorlinks]\marg{hyperref}\nl
\cmd{usepackage}[\optval{sort}{none},\nlsp
   \opt{nostyles}\comment{<- no glossary styles are required}
 ]\marg{glossaries-extra}
\codepar
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},\nlsp
  \gloskeyval{description}{a collection of any kind of objects},\nlsp
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}\nl
}
\codepar
\gls{newglossaryentry}\marg{function}\marg{\gloskeyval{name}{function},\nlsp
  \gloskeyval{description}{a rule that assigns every element in the \nlsp
  domain \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},\nlsp
  \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}}
}\nl
\cmd{newcommand}*\marg{\cmd{termdef}}[1]\marg{\comment{}
  \gls{section}\marg{\gls{Glsxtrglossentry}\marg{\#1} \gls{glsentrysymbol}\marg{\#1}}\comment{}
  \cbeg{quote}\cmd{em}\gls{Glsentrydesc}\marg{\#1}.\cend{quote}\comment{}%
}
}
{%
\cmd{tableofcontents}
\codepar
\gls{section}\marg{Introduction}\nl
Sample document about \gls{glspl}\marg{function} and \gls{glspl}\marg{set}.
\codepar
\cmd{termdef}\marg{set}
\codepar
More detailed information about \gls{glspl}\marg{set} with examples.
\codepar
\cmd{termdef}\marg{function}
\codepar
More detailed information about \gls{glspl}\marg{function} with examples.
}
\end{resultbox}

The above example can be modified to use \app{bib2gls} if the terms
are defined in one or more \ext{bib} files:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\opt{record},
   \opt{nostyles}\comment{<- no glossary styles are required}
  ]\marg{glossaries-extra}
\codepar
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},\resourceoptval{sort}{none},\resourceoptval{save-locations}{false}}
\codepar
\cmd{newcommand}*\marg{\cmd{termdef}}[1]\marg{\comment{}
  \gls{section}\marg{\gls{Glsxtrglossentry}\marg{\#1} \strong{\gls{glossentrysymbol}}\marg{\#1}}\comment{}
  \gls{glsadd}\marg{\#1}\comment{<- index this entry}
  \cbeg{quote}\cmd{em}\gls{Glsentrydesc}\marg{\#1}.\cend{quote}\comment{}
}
\cbeg{document}
\cmd{tableofcontents}
\codepar
\gls{section}\marg{Introduction}
Sample document about \gls{glspl}\marg{function} and \gls{glspl}\marg{set}.
\codepar
\cmd{termdef}\marg{set}
\codepar
More detailed information about \gls{glspl}\marg{set} with examples.
\codepar
\cmd{termdef}\marg{function}
\codepar
More detailed information about \gls{glspl}\marg{function} with examples.
\cend{document}
\end{codebox}
Where the file \filefmt{terms.bib} contains:
\begin{codebox}
\atentry{entry}\marg{set,
  \gloskeyval{name}{set},
  \gloskeyval{description}{a collection of any kind of objects},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}
}
\atentry{entry}\marg{function,
  \gloskeyval{name}{function},
  \gloskeyval{description}{a rule that assigns every element in the domain
  \gls{gls}\marg{set} to an element in the range \gls{gls}\marg{set}},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{f(x)}}
}
\end{codebox}
The advantage in this approach (with \gls{loadglsentries} or 
\app{bib2gls}) is that you can use an existing database of
entries shared across multiple documents, ensuring consistent
notation for all of them.

In both cases, there's no need to load all the \idxpl{glossarystyle}
packages, as they're not required, so I've used the
\opt{nostyles} package option to prevent them from being loaded.

In the first case, you just need to define the terms (preferably in
the \idx{preamble/document} or in a file that's input in the
\idx{preamble/document}). 
No external tool is required. Just run \LaTeX\ as normal. (Twice to ensure that the
table of contents is up to date.)
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
\end{terminal}

In the second case, you need the \opt{record} package
option (as in \option{b2g}) since \app{bib2gls} is needed to select the
required entries, but you don't need a sorted list:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},\strong{\resourceoptval{sort}{none}}}
\end{codebox*}
This will ensure that any entries \indexed\ in the document (through
commands like \gls{gls} or \gls{glsadd}) will be selected by 
\app{bib2gls}, but it will skip the sorting step. 
(The chances are you probably also won't need \idxpl{locationlist} either.
If so, you can add the option \resourceoptval{save-locations}{false}.)

Remember that for this second case you need to run \app{bib2gls} as
per \option{b2g}:
\begin{terminal}
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
pdflatex myDoc
\end{terminal}

For both cases (with or without \app{bib2gls}), instead of listing
all the entries using \gls{printunsrtglossary}, you use
\code{\gls{glsxtrglossentry}\margm{label}} where you want the name (and
anchor with \sty{hyperref}) to appear in the document.  This will
allow the \idx{linktext} created by commands like \gls{gls} to link
to that point in the document. The description can simply be
displayed with \code{\gls{glsentrydesc}\margm{label}} or
\code{\gls{Glsentrydesc}\marg{label}}, as in the above examples. In both
examples, I've defined a custom command \csfmt{termdef} to simplify the
code and ensure consistency.  Extra styling, such as placing the
description in a coloured frame, can be added to this custom
definition as required.

(Instead of using \gls{glsentrydesc} or \gls{Glsentrydesc}, you can use 
\code{\gls{glossentrydesc}\margm{label}}, which will obey
\idxpl{categoryattribute} such as
\catattr{glossdesc} and \catattr{glossdescfont}. See the \sty{glossaries-extra} 
manual for further details.)

The symbol (if required) can be displayed with either
\code{\gls{glsentrysymbol}\margm{label}} or
\code{\gls{glossentrysymbol}\margm{label}}.
In the first example, I've used \gls{glsentrysymbol}. In the
second I've used \gls{glossentrysymbol}. The latter is
necessary with \app{bib2gls} if the symbol needs to go in a
section title as the entries aren't defined on the first \LaTeX\ run.

In normal document text, \gls{glsentrysymbol} will silently do nothing
if the entry hasn't been defined, but when used in a section heading
it will expand to an undefined internal command when written to the
\ext{aux} file, which triggers an error. 

The \gls{glossentrysymbol} command performs an existence check,
which triggers a warning if the entry is undefined. (All entries
will be undefined before the first \app{bib2gls} call.) You need at
least \sty{glossaries-extra} v1.42 to use this command in a section
title. (\gls{glossentrysymbol} is defined by the base
\sty{glossaries} package but is redefined by
\sty{glossaries-extra}.) If \sty{hyperref} has been loaded, this
will use \gls{texorpdfstring} to allow a simple expansion for the
\idxpl{PDFbookmark} (see the \sty{glossaries-extra} user manual for
further details).

If you want to test if the \gloskey{symbol} field has been set, you
need to use \gls{ifglshassymbol} outside of the section title. For
example:
\begin{codebox}
\gls{ifglshassymbol}\marg{\#1}\comment{}
\marg{\gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1} \gls{glossentrysymbol}\marg{\#1}}}
\marg{\gls{section}\marg{\gls{glsxtrglossentry}\marg{\#1}}}
\end{codebox}

In both of the above examples, the section titles start with a \idx{lowercase}
character (because the \gloskey{name} value is all \idx{lowercase} in
entry definitions). You can apply automatic \idx{casechange} with the
\catattr{glossname} \idx{categoryattribute}. For example:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossname}}\marg{firstuc}
\end{codebox}
or (for title-case)
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossname}}\marg{title}
\end{codebox}
However, this won't apply the \idx{casechange} in the table of contents
or bookmarks. Instead you can use helper commands provided by
\sty{glossaries-extra} v1.49+ but make sure you have up-to-date
versions of \sty{glossaries} and \sty{mfirstuc}.

In the second example, you can instead use \app{bib2gls} to apply a
\idx{casechange}. For example, to apply \idx{sentencecase} to the
\gloskey{name} field:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},
 \resourceoptval{sort}{none},\resourceoptval{save-locations}{false}\strong{,
 \resourceoptvalm{replicate-fields}{name=text},
 \resourceoptval{name-case-change}{firstuc}}
}
\end{codebox*}
(Or \resourceoptval{name-case-change}{title} for \idx{titlecase}.)
This copies the \gloskey{name} value to the \gloskey{text} field and
then applies a \idx{casechange} to the \gloskey{name} field (leaving the
\gloskey{text} field unchanged). The name in the section titles now
starts with a capital but the \idx{linktext} produced by commands like
\gls{gls} is still \idx{lowercase}.

In the first example (without \app{bib2gls}) you can do this
manually. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{\strong{S}et},\strong{\gloskeyval{text}{set}},
  \gloskeyval{description}{a collection of any kind of objects},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}}
}
\end{codebox}
A more automated solution can be obtained with the standalone helper
commands for the \idx{PDFbookmark} and heading text (\sty{glossaries-extra} v1.49+).

Note that if you use the default \resourceoptval{save-locations}{true}
with \app{bib2gls}, it's possible to combine \options{b2g,standalone} 
to have both standalone
definitions and an index. In this case, a \idx{glossarystyle} is
required. In the example below, I've use \glostyle{bookindex}, which is provided in
the \sty{glossary-bookindex} package (bundled with
\sty{glossaries-extra}). I don't need any of the other style
packages, so I can still keep the \opt{nostyles} option and just
load \sty{glossary-bookindex}:
\begin{codebox}
\cmd{usepackage}[\optval{record}{nameref},\comment{<- using \app{bib2gls}}
 \opt{nostyles},\comment{<- don't load default style packages}
 \optval{stylemods}{bookindex},\comment{<- load glossary-bookindex.sty}
 \optval{style}{\glostyle{bookindex}}\comment{<- set the default style to 'bookindex'}
]\marg{glossaries-extra}
\end{codebox}
I also need to sort the entries, so the resource command is now:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{terms},\comment{definitions in terms.bib}
 \resourceoptval{sort}{en-GB},\comment{sort by this locale}
 \resourceoptvalm{replicate-fields}{name=text},
 \resourceoptval{name-case-change}{firstuc}
}
\end{codebox*}
At the end of the document, I can add the \idx{glossary}:
\begin{codebox}
\gls{printunsrtglossary}\oarg{\printglossoptval{title}{Index},\printglossoptval{target}{false}}
\end{codebox}
Note that I've had to switch off the hypertargets with
\printglossoptval{target}{false} (otherwise there would be duplicate
targets). If you want \idx{lettergroup} headings you need to use the
\switch{group} switch:
\begin{terminal}
bib2gls \switch{group} myDoc
\end{terminal}
or if you are using \app{arara}:
\begin{codebox}
\araraline{bib2gls: \marg{ group: on }}
\end{codebox}

The \glostyle{bookindex} style doesn't show the
description, so only the name and location is displayed. Remember
that the name has had a \idx{casechange} so it now starts with an
initial capital. If you feel this is inappropriate for the index,
you can adjust the \glostyle{bookindex} style so that it uses
the \gloskey{text} field instead. For example:
\begin{codebox*}
\cmd{renewcommand}*\marg{\gls{glsxtrbookindexname}}[1]\marg{\comment{}
  \gls{glossentrynameother}\marg{\#1}\marg{text}}
\end{codebox*}
See the \sty{glossaries-extra} user manual for further details about
this style.

Note that on the first \LaTeX\ run none of the entries will be
defined. Once they are defined, the page numbers may shift due to
the increased amount of document text. You may therefore need to
repeat the document build to ensure the page numbers are correct.

If there are extra terms that need to be included in the index that
don't have a description, you can define them with \atentry{index}
in the \ext{bib} file.  For example:
\begin{codebox}
\atentry{index}\marg{element}
\atentry{index}\marg{member,\gloskeyval{alias}{element}}
\end{codebox}
They can be used in the document as usual:
\begin{codebox}
The objects that make up a set are the \gls{glspl}\marg{element}
or \gls{glspl}\marg{member}.
\end{codebox}
See \bibglsbegin\ or the \app{bib2gls} user manual for further
details.

\section{Dummy Entries for Testing}
\label{sec:lipsum}

\nlctdownloadlinksfalse
In addition to the sample files described in \sectionref{sec:samples}, \sty{glossaries}
also provides some files containing lorum ipsum dummy \idxpl{entry}. These
are provided for testing purposes and are on \TeX's path (in
\filefmt{tex/latex/glossaries/test-entries}) so
they can be included via \gls{input} or \gls{loadglsentries}. The
\sty{glossaries-extra} package provides \ext{bib} versions of
all these files for use with \app{bib2gls}. The files are as
follows:

\filedef{example-glossaries-brief.tex}
These entries all have brief descriptions. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{lorem}\marg{\gloskeyval{name}{lorem},\gloskeyval{description}{ipsum}}
\end{codebox}

\filedef{example-glossaries-utf8.tex}
This file is based on \file{example-glossaries-brief.tex} but random
characters have been converted to accented characters to test
\idx{utf8} support.

\filedef{example-glossaries-long.tex}
These entries all have long descriptions. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{loremipsum}\marg{\gloskeyval{name}{lorem ipsum},
\gloskeyval{description}{dolor sit amet, consectetuer adipiscing 
elit. Ut purus elit, vestibulum ut, placerat ac, 
adipiscing vitae, felis. Curabitur dictum gravida 
mauris.}}
\end{codebox}

\filedef{example-glossaries-multipar.tex}
These entries all have multi-paragraph descriptions. For example:
\begin{codebox}
\gls{longnewglossaryentry}\marg{loremi-ii}\marg{\gloskeyval{name}{lorem 1--2}}\comment{}
\marg{\comment{}
Lorem ipsum ...
\codepar
Nam dui ligula...
}
\end{codebox}

\filedef{example-glossaries-symbols.tex}
These entries all use the \gloskey{symbol} key. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{alpha}\marg{\gloskeyval{name}{alpha},
\gloskeyval{symbol}{\gls{ensuremath}\marg{\gls{alpha}}},
\gloskeyval{description}{Quisque ullamcorper placerat ipsum.}}
\end{codebox}

\filedef{example-glossaries-symbolnames.tex}
Similar to the previous file but the \gloskey{symbol} key isn't
used. Instead the symbol is stored in the \gloskey{name} key. For
example:
\begin{codebox}
\gls{newglossaryentry}\marg{sym.alpha}\marg{\gloskeyval{sort}{alpha},
\gloskeyval{name}{\gls{ensuremath}\marg{\gls{alpha}}},
\gloskeyval{description}{Quisque ullamcorper placerat ipsum.}}
\end{codebox}

\filedef{example-glossaries-constants.tex}
Sample set of entries that represent mathematical constants. Some
commands are provided that are used in the \gloskey{name} field. 
For example:
\begin{codebox}
\cmd{providecommand}\marg{\cmd{constanti}}\marg{\gls{ensuremath}\marg{i}}
\cmd{providecommand}\marg{\cmd{constantpi}}\marg{\gls{ensuremath}\marg{\cmd{pi}}}
\end{codebox}
The \gloskey{symbol} may also be set (but not for all entries). 
The \gloskey{user1} key is set to the approximate numeric value
for most but not all entries. The symbols are of varying widths and
heights, which may be useful for style alignment tests.
One entry has a cross-reference with the \gloskey{see} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{i-constant}\marg{\gloskeyval{name}{\cmd{constanti}},
 \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{sqrt}\marg{-1}}},
 \gloskeyval{sort}{i},
 \gloskeyval{description}{imaginary unit}
}
\codepar
\gls{newglossaryentry}\marg{pi-constant}\marg{\gloskeyval{name}{\cmd{constantpi}},
 \gloskeyval{sort}{pi},
 \gloskeyval{description}{ratio of a circle's circumference to its diameter},
 \gloskeyval{user1}{3.14159265358979323846}
}
\codepar
\gls{newglossaryentry}\marg{tau-constant}\marg{\gloskeyval{name}{\cmd{constanttau}},
 \gloskeyval{sort}{tau},
 \gloskeyval{symbol}{\gls{ensuremath}\marg{2\cmd{constantpi}}},
 \gloskeyval{description}{ratio of a circle's circumference to its radius},
 \gloskeyval{user1}{6.28318530717958647692},
 \gloskeyval{see}{pi-constant}
}
\end{codebox}

\filedef{example-glossaries-user.tex}
The \toplevel\ entries have the \gloskey{symbol} key and all
\gloskey{user1}, \glsaddeach{opt.gloskey.user2,opt.gloskey.user3,opt.gloskey.user4,opt.gloskey.user5}\ldots, \gloskey{user6} keys set. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sample-a}
\marg{\gloskeyval{name}{a name},
\gloskeyval{description}{a description},
\gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{alpha}}},
\gloskeyval{user1}{A},
\gloskeyval{user2}{1},
\gloskeyval{user3}{i},
\gloskeyval{user4}{A-i},
\gloskeyval{user5}{25.2020788573521},
\gloskeyval{user6}{1585-11-06}}
\end{codebox}
There are also some \hierlevel{1} entries, which may or may not have
the \gloskey{symbol} and user keys set. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sample-b-0}
\marg{\gloskeyval{parent}{sample-b},
\gloskeyval{name}{b/0 name},
\gloskeyval{description}{child 0 of b},
\gloskeyval{symbol}{\cmd{ensuremath}\marg{\cmd{sigma}}},
\gloskeyval{user2}{0},
\gloskeyval{user4}{a-i}}
\end{codebox} 
There are no deeper \hierarchical\ entries. Where set, the
\gloskey{user1} key is an \idx{uppercase} letter (A--Z), the
\gloskey{user2} key is an integer, the \gloskey{user3} key is a
\idx{lowercase} Roman numeral, the \gloskey{user4} key is in the
form \meta{alpha}-\meta{roman} where \meta{alpha} is either an
upper or \idx{lowercase} letter (a--z or A--Z) and \meta{roman} is
either an upper or \idx{lowercase} Roman numeral. The
\gloskey{user5} key is a random number (in the range $(-50,+50)$ 
for \toplevel\ entries and $(-1,+1)$ for child entries).
The \gloskey{user6} key is a random date between 1000-01-01 and
2099-12-31.

\filedef{example-glossaries-images.tex}
These entries use the \gloskey{user1} key to store the name of an
image file. (The images are provided by the \sty{mwe} package and
should be on \TeX's path.) One entry doesn't have an associated
image to help test for a~missing key.  The descriptions are long to
allow for tests with the text wrapping around the image. For
example:
\begin{codebox}
\gls{longnewglossaryentry}\marg{sedfeugiat}\marg{\gloskeyval{name}{sed feugiat},
\gloskeyval{user1}{example-image}}\comment{}
\marg{\comment{}
Cum sociis natoque...
\codepar
Etiam...
}
\end{codebox}

\filedef{example-glossaries-acronym.tex}
These entries are all \idxpl+{acronym}.  For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}}}\marg{lid}\marg{LID}\marg{lorem ipsum 
dolor}
\end{codebox}
\begin{xtr}
If you use the \sty{glossaries-extra} extension package, then
\gls{newacronym} is redefined to use \gls{newabbreviation}
with the \gloskey{category} key set to \cat{acronym} (rather
than the default \cat{abbreviation}). This means that you need to
set the \idx{abbrvstyle} for the \cat{acronym} category. For
example:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{acronym}\marg{\abbrstyle{long-short}}
\end{codebox}
\end{xtr}

\filedef{example-glossaries-acronym-desc.tex}
This file contains entries that are all
\idxpl{acronym} that use the \gloskey{description} key.
For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}},
  \gloskeyval{description}{fringilla a, euismod sodales,
  sollicitudin vel, wisi}}\marg{ndl}\marg{NDL}\marg{nam dui ligula}
\end{codebox}
\begin{xtr}
If you use the \sty{glossaries-extra} extension package, then
\gls{newacronym} is redefined to use \gls{newabbreviation}
with the \gloskey{category} key set to \cat{acronym} (rather
than the default \cat{abbreviation}). This means that you need to
set the \idx{abbrvstyle} for the \cat{acronym} category. For
example:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-desc}}
\end{codebox*}
\end{xtr}

\filedef{example-glossaries-acronyms-lang.tex}
These entries are all \idxpl{acronym}, where some of them have 
a~translation supplied in the \gloskey{user1} key.
For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}},\gloskeyval{user1}{love itself}}
 \marg{li}\marg{LI}\marg{lorem ipsum}
\end{codebox}
\begin{xtr}
If you use the \sty{glossaries-extra} extension package, then
\gls{newacronym} is redefined to use \gls{newabbreviation}
with the \gloskey{category} key set to \cat{acronym} (rather
than the default \cat{abbreviation}). This means that you need to
set the \idx{abbrvstyle} for the \cat{acronym} category. For
example:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-user}}
\end{codebox*}
\end{xtr}

\filedef{example-glossaries-parent.tex}
These are hierarchical entries where the child entries 
use the \gloskey{name} key.  For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sedmattis}\marg{\gloskeyval{name}{sed mattis},
\gloskeyval{description}{erat sit amet}}
\codepar
\gls{newglossaryentry}\marg{gravida}\marg{\gloskeyval{parent}{sedmattis},
  \gloskeyval{name}{gravida},\gloskeyval{description}{malesuada}}
\end{codebox}

\filedef{example-glossaries-childnoname.tex}
These are hierarchical entries where the child entries 
don't use the \gloskey{name} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{scelerisque}\marg{\gloskeyval{name}{scelerisque},
  \gloskeyval{description}{at}}
\codepar
\gls{newglossaryentry}\marg{vestibulum}\marg{\gloskeyval{parent}{scelerisque},
  \gloskeyval{description}{eu, nulla}}
\end{codebox}

\filedef{example-glossaries-longchild.tex}
These entries all have long descriptions and there are some 
child entries. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{longsedmattis}\marg{\gloskeyval{name}{sed mattis},
 \gloskeyval{description}{erat sit amet dolor sit amet, consectetuer adipiscing elit. 
 Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
 Curabitur dictum gravida mauris.}}
\codepar
\gls{newglossaryentry}\marg{longgravida}\marg{\gloskeyval{parent}{longsedmattis},\gloskeyval{name}{gravida},
 \gloskeyval{description}{malesuada libero, nonummy eget, consectetuer id, vulputate a, 
 magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas. Mauris ut
leo.}}
\end{codebox}

\filedef{example-glossaries-childmultipar.tex}
This consists of parent entries with single paragraph descriptions and
child entries with multi-paragraph descriptions. Some entries have
the \gloskey{user1} key set to the name of an image file provided by
the \sty{mwe} package. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{hiersedmattis}\marg{\gloskeyval{name}{sed mattis},\gloskeyval{user1}{example-image},
 \gloskeyval{description}{Erat sit amet dolor sit amet, consectetuer adipiscing elit. 
 Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris. Ut pellentesque augue sed urna. Vestibulum
diam eros, fringilla et, consectetuer eu, nonummy id, sapien. Nullam
at lectus. In sagittis ultrices mauris. Curabitur malesuada erat sit
amet massa. Fusce blandit. Aliquam erat volutpat.}}
\codepar
\gls{longnewglossaryentry}\marg{hierloremi-ii}
\marg{\gloskeyval{name}{lorem 1--2},\gloskeyval{parent}{hiersedmattis}}\comment{}
\marg{\comment{}
Lorem ipsum ...
\codepar
Nam dui ligula...
}
\end{codebox}

\filedef{example-glossaries-cite.tex}
These entries use the
\gloskey{user1} key to store a citation key (or comma-separated list
of citation keys). The citations are defined in \filefmt{xampl.bib},
which should be available on all modern \TeX\ distributions.
One entry doesn't have an associated citation to help test for a~missing
key. 
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{fusce}\marg{\gloskeyval{name}{fusce},
\gloskeyval{description}{suscipit cursus sem},\gloskeyval{user1}{article-minimal}}
\end{codebox}

\filedef{example-glossaries-url.tex}
These entries use the \gloskey{user1} key to store an \idx{URL} associated
with the entry.  For example:
\begin{codebox}
\gls{newglossaryentry}\marg{aenean-url}\marg{\gloskeyval{name}{aenean},
 \gloskeyval{description}{adipiscing auctor est},
 \gloskeyval{user1}{http://uk.tug.org/}}
\end{codebox}

The sample file \mirrorsamplefile{glossary-lipsum-examples.tex} in the 
\filefmt{doc/latex/glossaries/samples} directory
uses all these files. See also \gallerytopic{glossaries}.

\glsxtrnote
The \sty{glossaries-extra} package provides the additional test file:
\filedef{example-glossaries-xr.tex}
These entries use the \gloskey{see} key provided by the base
\styfmt{glossaries} package and also the \gloskey{alias} and
\gloskey{seealso} keys that require \sty{glossaries-extra}. For
example:
\begin{codebox}
\gls{newglossaryentry}\marg{alias-lorem}\marg{\gloskeyval{name}{alias-lorem},
 \gloskeyval{description}{ipsum},\gloskeyval{alias}{lorem}}
\codepar
\gls{newglossaryentry}\marg{amet}\marg{\gloskeyval{name}{amet},\gloskeyval{description}{consectetuer},
 \gloskeyval{see}{dolor}}
\codepar
\gls{newglossaryentry}\marg{arcu}{\gloskeyval{name}{arcu},\gloskeyval{description}{libero},
 \gloskeyval{seealso}{placerat,vitae,curabitur}}
\end{codebox}
\nlctdownloadlinkstrue

\section{Multi-Lingual Support}
\label{sec:languages}

\begin{important}
The \sty{glossaries} package uses the \sty{tracklang} package
to determine the document languages. Unfortunately, because there
isn't a standard language identification framework provided with
\LaTeX, \sty{tracklang} isn't always able to detect the selected
languages either as a result of using an unknown interface or where
the interface doesn't provide a way of detecting the language.

You will needed at least version 1.6.4 of \sty{tracklang} to 
support \sty{babel}['s] \gls{babelprovide}. All instances of
\gls{babelprovide} need to occur before \sty{tracklang} is loaded.
In the event that \sty{tracklang} can't detect the language, use the \opt{languages}
or \opt{locales} package option.
See \sectionref{sec:pkgintegration} and also
\dickimawhref{latex/tracklang/}{Localisation
with \filefmt{tracklang.tex}} for further details.
\end{important}

For example (using \sty{babel}):
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[german]\marg{babel}
\cmd{usepackage}\marg{glossaries}
\end{codebox}
This can pick up the language setting but will also automatically
load \sty{translator}. Compare this with:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[german]\marg{babel}
\cmd{usepackage}\marg{glossaries-extra}
\end{codebox}
This will pick up the language setting but won't automatically load
\sty{translator}.

In both the above cases, \sty{tracklang} will automatically
be loaded and the language-sensitive commands provided by
\sty{glossaries} will use the definitions in
\file{glossaries-german.ldf} (which needs to be installed
separately).

Another example (no language package):
\begin{codebox}
\cmd{documentclass}[german]\marg{article}
\cmd{usepackage}[\optval{translate}{true}]\marg{glossaries}
\end{codebox}
The above document doesn't load \sty{babel} or \sty{polyglossia} or
\sty{translator}, but the \optval{translate}{true} setting will
ensure that \sty{tracklang} is loaded, which will pick up the
document class option.

Alternatively, using the \opt{locales} package option:
\begin{codebox}
\cmd{usepackage}[\optvalm{locales}{de-DE,en-GB}]\marg{glossaries}
\end{codebox}
This will required both \file{glossaries-german.ldf} and
\file{glossaries-english.ldf} to be installed.
Note that the \opt{locales} option is a synonym of the
\opt{languages} option, but semantically \opt{locales} makes more
sense when using language identifiers that include regions.

Note that if another package has already been loaded that uses
\sty{tracklang}, then the list of supported locales will be picked
up from that package. For example:
\begin{codebox}
\cmd{usepackage}[de-DE,en-GB]\marg{datetime2}
\cmd{usepackage}\marg{glossaries}
\end{codebox}

You may find that you get a warning from \sty{datatool}, such as
\qt{No `datatool' support for dialect `ngerman'}. This is because
the \sty{datatool-base} package, which is automatically loaded by
\sty{glossaries}, also provides localisation support. In the case of
\sty{datatool}, the localisation support is split into region (for
currency and number parsing) and language. Only the language part is
applicable to the \sty{glossaries} package, and that's specific to
the word or letter sorting with \gls{printnoidxglossary}
(\printglossoptval{sort}{word} or \printglossoptval{sort}{letter}).

If there is no \sty{datatool} localisation support, either because
none has been provided or your version of \sty{datatool} is too old,
then \gls{printnoidxglossary} will only be able to sort according to
the Basic Latin alphabet. Any \idx{exlatinalph} or \idx{nonlatinalph}
will be ordered by character code.

The absence of \sty{datatool} localisation support doesn't affect
the \sty{glossaries} package's own localisation support and is not
relevant with \gls{printglossary} or \gls{printunsrtglossary}. You
can suppress the warning either by loading \sty{datatool-base}
earlier with the option \optfmt{lang-warn=false}:
\begin{codebox}
\cmd{usepackage}[german]\marg{babel}
\cmd{usepackage}[lang-warn=false]\marg{datatool-base}
\cmd{usepackage}\marg{glossaries}
\end{codebox}
Or pass the option before \sty{datatool-base} is loaded:
\begin{codebox}
\cmd{PassOptionsToPackage}\marg{lang-warn=false}\marg{datatool-base}
\end{codebox}
See the \sty{datatool} documentation for further details.

The best method to sort terms that use an
\idx{exlatinalph} or \idx{nonlatinalph} is with
\sty{glossaries-extra} and \app{bib2gls}. This means using a
\ext{bib} file to store the entry data (see \option{b2g}). If you
prefer to only use the base \sty{glossaries} package, then \app{xindy}
(\option{xdy}) is the best option, but be aware that \app{xindy}
is a general purpose \idx{indexingapp} that's developed
independently of \sty{glossaries} (as opposed to \app{bib2gls},
which is specifically designed for, and developed alongside,
\sty{glossaries-extra} and therefore provides better integration).

Note also that \app{bib2gls} can support any language provided by
the \gls{cldr}, whereas \app{xindy} only has a limited number of
built-in languages (although more can be added).

\begin{information}
If you are using a non-Latin script with \app{xindy}, you may need the
\opt{xindynoglsnumbers} option or use
\gls{GlsSetXdyFirstLetterAfterDigits} to indicate the first 
\idx{lettergroup} that should follow the number \idx{group}.
\end{information}

\mExampleref{ex:xindyutf8} demonstrates a document with 
\idx{utf8} characters that requires \app{xindy}. 
If you try this example and encounter errors,
check that you have an up-to-date \TeX\ distribution.
Note that with the modern \LaTeX\ kernel, the default encoding is
assumed to be \idx{utf8} so I haven't bothered loading the
\sty{inputenc} package.

\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[main=english,brazilian]\marg{babel}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
Note the use of the \opt{xindy} package option, which ensures that
all the \idx{indexing} information is written in the correct format.

This example is a multilingual document so a second
\idx{glossary} is defined for the Brazilian terms:
\begin{codebox}
\gls{newglossary*}\marg{dictionary}\marg{\gls{glossaryname}}
\end{codebox}
I could just supply the actual title, but using the
language-sensitive \gls{glossaryname} (which is also the title
provided for the main \idx{glossary}) demonstrates the language
support.

This document will need to have both \filefmt{glossaries-english}
and \filefmt{glossaries-portuges} installed in addition to 
the base \sty{glossaries} package.

To ensure that the files required by \app{xindy} are opened:
\begin{codebox}
\gls{makeglossaries}
\end{codebox}
Now define some English terms:
\begin{codebox}
\gls{newglossaryentry}\marg{\'elite}\marg{\gloskeyval{name}{\'elite},
\gloskeyval{description}{select group or class}}
\gls{newglossaryentry}\marg{elephant}\marg{\gloskeyval{name}{elephant},
\gloskeyval{description}{large animal with trunk and tusks}}
\gls{newglossaryentry}\marg{elk}\marg{\gloskeyval{name}{elk}, \gloskeyval{description}{large deer}}
\end{codebox}
And here are the terms that need to go in the custom \qt{dictionary}
glossary:
\begin{codebox}
\gls{newglossaryentry}\marg{\'agua}\marg{\gloskeyval{name}{\'agua},
\gloskeyval{type}{dictionary},
\gloskeyval{description}{water}}
\gls{newglossaryentry}\marg{\'arvore}\marg{\gloskeyval{name}{\'arvore},
\gloskeyval{type}{dictionary},
\gloskeyval{description}{tree}}
\gls{newglossaryentry}\marg{ano}\marg{\gloskeyval{name}{ano},
\gloskeyval{type}{dictionary},
\gloskeyval{description}{year}}
\end{codebox}
The main body of the document contains references using the labels
provided in the first argument of \gls{newglossaryentry} and the
\idx{glossary} lists are placed at the desired location, at the end
of each section:
\begin{codebox}
\cbeg{document}
\cmd{section}\marg{English}
An \gls{gls}\marg{elk} and an \gls{gls}\marg{elephant} belonged to an 
\gls{gls}\marg{\'elite} group.
\codepar
\gls{printglossary}
\codepar
\cmd{selectlanguage}\marg{brazilian}
\cmd{section}\marg{Brasileiro}
A \gls{gls}\marg{\'arvore} tive \gls{gls}\marg{\'agua} este \gls{gls}\marg{ano}.
\codepar
\gls{printglossary}\oarg{type=dictionary}
\cend{document}
\end{codebox}
If the document is saved in the file \filefmt{myDoc.tex} then the
document build is:
\begin{terminal}
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}
\begin{resultbox}
\createexample*[title={UTF-8 and \appfmt{xindy}},
 label={ex:xindyutf8},
 arara={pdflatex,makeglossaries,pdflatex,pdfcrop},
 description={Example document that defines a term with a UTF-8
character}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[main=english,brazilian]\marg{babel}\nl
\cmd{usepackage}[xindy]\marg{glossaries}\nl
\gls{newglossary*}\marg{dictionary}\marg{\gls{glossaryname}}\nl
\gls{makeglossaries}\nl
\gls{newglossaryentry}\marg{\'elite}\marg{\gloskeyval{name}{\'elite},\nl
\gloskeyval{description}{select group or class}}\nl
\gls{newglossaryentry}\marg{elephant}\marg{\gloskeyval{name}{elephant},\nl
\gloskeyval{description}{large animal with trunk and tusks}}\nl
\gls{newglossaryentry}\marg{elk}\marg{\gloskeyval{name}{elk}, \gloskeyval{description}{large deer}}
\codepar
\gls{newglossaryentry}\marg{\'agua}\marg{\gloskeyval{name}{\'agua},\nl
\gloskeyval{type}{dictionary},\nl
\gloskeyval{description}{water}}\nl
\gls{newglossaryentry}\marg{\'arvore}\marg{\gloskeyval{name}{\'arvore},\nl
\gloskeyval{type}{dictionary},\nl
\gloskeyval{description}{tree}}\nl
\gls{newglossaryentry}\marg{ano}\marg{\gloskeyval{name}{ano},\nl
\gloskeyval{type}{dictionary},\nl
\gloskeyval{description}{year}}
}
{%
\cmd{section}\marg{English}\nl
An \gls{gls}\marg{elk} and an \gls{gls}\marg{elephant} belonged to an 
\gls{gls}\marg{\'elite} group.
\codepar
\gls{printglossary}
\codepar
\cmd{selectlanguage}\marg{brazilian}\nl
\cmd{section}\marg{Brasileiro}\nl
A \gls{gls}\marg{\'arvore} tive \gls{gls}\marg{\'agua} este \gls{gls}\marg{ano}.
\codepar
\gls{printglossary}\oarg{type=dictionary}
}
\end{resultbox}

Both the above \exampleref{ex:xindyutf8} and the following
\exampleref{ex:bib2glsutf8} may trigger the warning \qt{No `datatool' support for
dialect `brazilian'}. This warning comes from the \sty{datatool-base}
package that's internally loaded by \sty{glossaries}. The
\sty{datatool} localisation support is only applicable to
\gls{printnoidxglossary} when alphabetical sorting is required.
(The \sty{datatool-base} sorting function is used for localised
alphabetical sorting.)

The lack of \sty{datatool} localisation support doesn't affect the 
\sty{glossaries} package's own localisation
support and is not relevant with \gls{printglossary} or
\gls{printunsrtglossary}. You can suppress the warning either by loading
\sty{datatool-base} earlier with the option
\optfmt{lang-warn=false}:
\begin{codebox}
\cmd{usepackage}[main=english,brazilian]\marg{babel}
\cmd{usepackage}[lang-warn=false]\marg{datatool-base}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
Or pass the option before \sty{datatool-base} is loaded:
\begin{codebox}
\cmd{PassOptionsToPackage}\marg{lang-warn=false}\marg{datatool-base}
\cmd{usepackage}[main=english,brazilian]\marg{babel}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}

\glsxtrnote
\mExampleref{ex:bib2glsutf8} is a modification of
the previous example which uses \app{bib2gls} (and therefore
requires \sty{glossaries-extra}). The entry data must now be provided
in one or more \ext{bib} files. For example, the file
\filefmt{sample-utf8-en.bib} contains:
\begin{codebox}
\comment{Encoding: UTF-8}
\atentry{entry}\marg{\'elite,
 \gloskeyval{name}{\'elite},
 \gloskeyval{description}{select group or class}
}
\codepar
\atentry{entry}\marg{elephant,
 \gloskeyval{name}{elephant},
 \gloskeyval{description}{large animal with trunk and tusks}
}
\codepar
\atentry{entry}\marg{elk,
 \gloskeyval{name}{elk},
 \gloskeyval{description}{large deer}
}
\end{codebox}
and the file \filefmt{sample-utf8-pt.bib} contains:
\begin{codebox}
\comment{Encoding: UTF-8}
\atentry{entry}\marg{\'agua,
 \gloskeyval{name}{\'agua},
 \gloskeyval{description}{water}
}
\codepar
\atentry{entry}\marg{\'arvore,
 \gloskeyval{name}{\'arvore},
 \gloskeyval{description}{tree}
}
\codepar
\atentry{entry}\marg{ano,
 \gloskeyval{name}{ano},
 \gloskeyval{description}{year}
}
\end{codebox}

The document now requires \sty{glossaries-extra} with the
\opt{record} option:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[main=english,brazilian]\marg{babel}
\cmd{usepackage}[\opt{record}]\marg{glossaries-extra}
\end{codebox}
As before a custom glossary is defined:
\begin{codebox}
\gls{newglossary*}\marg{dictionary}\marg{\gls{glossaryname}}
\end{codebox}
Instead of using \gls{makeglossaries}, the document now needs:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{
 \resourceoptval{sort}{en},\comment{sort according to English language rules}
 \resourceoptvalm{src}{sample-utf8-en}\comment{data in sample-utf8-en.bib}
}\nl
\gls{GlsXtrLoadResources}\oarg{
 \resourceoptval{sort}{pt-BR},\comment{sort according to pt-BR language rules}
 \resourceoptvalm{src}{sample-utf8-pt},\comment{data in sample-utf8-pt.bib}
 \resourceoptval{type}{dictionary}
}
\end{codebox}
The main body of the document is similar to the previous example,
but a different command is needed to display the \idx{glossary}.
\begin{codebox}
\cbeg{document}
\cmd{section}\marg{English}
An \gls{gls}\marg{elk} and an \gls{gls}\marg{elephant} belonged to an 
\gls{gls}\marg{\'elite} group.
\codepar
\gls{printunsrtglossary}
\codepar
\cmd{selectlanguage}\marg{brazilian}
\cmd{section}\marg{Brasileiro}
A \gls{gls}\marg{\'arvore} tive \gls{gls}\marg{\'agua} este \gls{gls}\marg{ano}.
\codepar
\gls{printunsrtglossary}\oarg{type=dictionary}
\cend{document}
\end{codebox}
The document build is slightly different:
\begin{terminal}
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
\end{terminal}
\begin{resultbox}
\createexample*[title={UTF-8 and \appfmt{bib2gls}},
 label={ex:bib2glsutf8},
 arara={pdflatex,bib2gls,pdflatex,pdfcrop},
 description={Example UTF-8 document that defines terms in bib
files}]
{%
\cbeg{filecontents*}\marg{sample-utf8-en.bib}\nl
\comment{Encoding: UTF-8}%
\codepar
\atentry{entry}\marg{\'elite,\nlsp
 \gloskeyval{name}{\'elite},\nlsp
 \gloskeyval{description}{select group or class}\nl
}
\codepar
\atentry{entry}\marg{elephant,\nlsp
 \gloskeyval{name}{elephant},\nlsp
 \gloskeyval{description}{large animal with trunk and tusks}\nl
}
\codepar
\atentry{entry}\marg{elk,\nlsp
 \gloskeyval{name}{elk},\nlsp
 \gloskeyval{description}{large deer}\nl
}\nl
\cend{filecontents*}\nl
\cbeg{filecontents*}\marg{sample-utf8-pt.bib}\nl
\comment{Encoding: UTF-8}%
\codepar
\atentry{entry}\marg{\'agua,\nlsp
 \gloskeyval{name}{\'agua},\nlsp
 \gloskeyval{description}{water}\nl
}
\codepar
\atentry{entry}\marg{\'arvore,\nlsp
 \gloskeyval{name}{\'arvore},\nlsp
 \gloskeyval{description}{tree}\nl
}
\codepar
\atentry{entry}\marg{ano,\nlsp
 \gloskeyval{name}{ano},\nlsp
 \gloskeyval{description}{year}\nl
}\nl
\cend{filecontents*}\nl
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[main=english,brazilian]\marg{babel}\nl
\cmd{usepackage}[record]\marg{glossaries-extra}\nl
\gls{newglossary*}\marg{dictionary}\marg{\gls{glossaryname}}\nl
\gls{GlsXtrLoadResources}\oarg{\nlsp
 \resourceoptval{sort}{en},\comment{sort according to English language rules}
 \resourceoptvalm{src}{sample-utf8-en}\comment{data in sample-utf8-en.bib}%
}\nl
\gls{GlsXtrLoadResources}\oarg{\nlsp
 \resourceoptval{sort}{pt-BR},\comment{sort according to pt-BR language rules}
 \resourceoptvalm{src}{sample-utf8-pt},\comment{data in sample-utf8-pt.bib}
 \resourceoptval{type}{dictionary}\nl
}
}
{%
\cmd{section}\marg{English}\nl
An \gls{gls}\marg{elk} and an \gls{gls}\marg{elephant} belonged to an 
\gls{gls}\marg{\'elite} group.
\codepar
\gls{printunsrtglossary}
\codepar
\cmd{selectlanguage}\marg{brazilian}\nl
\cmd{section}\marg{Brasileiro}\nl
A \gls{gls}\marg{\'arvore} tive \gls{gls}\marg{\'agua} este \gls{gls}\marg{ano}.
\codepar
\gls{printunsrtglossary}\oarg{type=dictionary}
}
\end{resultbox}

\begin{important}
Note that although a~\idx{nonlatinchar}, such as \'e, looks like a
plain character in your \ext{tex} file, with \pdfLaTeX\ it's
actually a~macro and can therefore cause problems. (This issue
doesn't occur with \XeLaTeX\ or Lua\LaTeX\ which both natively
support \idx{utf8}.) Recent versions of the \LaTeX\ kernel have
made significant improvements in handling \idx{utf8}. To ensure you have the best
\idx{utf8} support, use at least \sty{mfirstuc} v2.08+ with
\sty{glossaries} v4.50+ (and, if required, \sty{glossaries-extra}
v1.49+). With old \TeX\ distributions, you can't use \idx{utf8}
characters in labels.
\end{important}

With old versions of \sty{mfirstuc} (pre v2.08), if you use a~\idx{utf8}
character at the start of an \idx{entry} name, you must place it in a
group, or it will cause a problem for \idx{sentencecase} commands
(e.g.\ \gls{Gls}). For example:
\begin{codebox}
\comment{\sty{mfirstuc} v2.07:}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\marg{\'e}lite},
\gloskeyval{description}{select group or class}}
\end{codebox}
This isn't necessary with \sty{glossaries} v4.50+ and \sty{mfirstuc}
v2.08+, and with a newer \LaTeX\ kernel the \idx{utf8} character may
occur in the label:
\begin{codebox}
\comment{\sty{mfirstuc} v2.08:}
\gls{newglossaryentry}\marg{\'elite}\marg{\gloskeyval{name}{\'elite},
\gloskeyval{description}{select group or class}}
\end{codebox}

If you are using \app{xindy} or \app{bib2gls}, the application needs
to know the \idx{encoding} of the \ext+{tex} file. This information
is added to the \ext{aux} file and can be picked up by
\app{makeglossaries} and \app{bib2gls}.

Note that \app{makeindex} doesn't support \idx{utf8} so, although it
can be used with some \idx{latinalph} languages, you will need to ensure
that the sort value doesn't contain any \idx{utf8}.
If you have the double-quote character (\sym{dblquote}) as an
active character (for example, a \sty{babel} shorthand) and you 
want to use \app{makeindex}['s] \mkidxopt{g} (German) option, you'll
need to change \app{makeindex}['s] quote character using:
\cmddef{GlsSetQuote}
Note that \meta{character} may not be one of \idx{questionmark}, 
\idx{pipe} or \idx{exclammark}.
For example:
\begin{codebox}
\gls{GlsSetQuote}\marg{+}
\end{codebox}
This must be done before \gls{makeglossaries} and any entry
definitions. It's only applicable for \app{makeindex}. This option
in conjunction with \optfmt{ngerman} will also cause
\app{makeglossaries} to use the \mkidxopt{g} switch when invoking
\app{makeindex}.
For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[ngerman]\marg{babel}
\cmd{usepackage}\marg{glossaries}
\codepar
\gls{GlsSetQuote}\marg{+}
\codepar
\gls{makeglossaries}
\codepar
\gls{newglossaryentry}\marg{rna}\marg{name={ribonukleins\"aure},
  \gloskeyval{sort}{ribonukleins"aure},
  \gloskeyval{description}{eine Nukleins\"aure}}
\codepar
\cbeg{document}
\gls{gls}\marg{rna}
\codepar
\gls{printglossaries}
\cend{document}
\end{codebox}

\subsection{Changing the Fixed Names}
\label{sec:fixednames}

The fixed names are produced using the commands listed in 
\tableref{tab:predefinednames}. If you aren't using a language
package such as \sty{babel} or \sty{polyglossia} that uses caption
hooks, you can just redefine these commands as appropriate. If you
are using \sty{babel} or \sty{polyglossia}, you need to use their
caption hooks to change the defaults. See \href{https://texfaq.org/FAQ-latexwords}{changing
the words babel uses} or read the \sty{babel} or \sty{polyglossia}
documentation. If you have loaded \sty{babel}, then \sty{glossaries}
will attempt to load \sty{translator}, unless you have used the
\opt{notranslate}, \optval{translate}{false} or
\optval{translate}{babel}
package options.

\begin{xtr}
The \sty{glossaries-extra} package defaults to
\optval{translate}{babel} if \sty{babel} has been loaded.
\end{xtr}

If the \sty{translator} package is loaded, the
translations are provided by dictionary files (for example, 
\filefmt{glossaries-dictionary-English.dict}). See the
\sty{translator} package for advice on changing translations provided by
\sty{translator} dictionaries. If you can't work out how to modify
these dictionary definitions, try switching to \sty{babel}'s
interface using \optval{translate}{babel}:
\begin{codebox}
\cmd{documentclass}[english,french]\marg{article}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\end{codebox}
and then use \sty{babel}'s caption hook mechanism. Note that if you
pass the language options directly to \sty{babel} rather that using
the document class options or otherwise passing the same options to
\sty{translator}, then \sty{translator} won't pick up the
language and no dictionaries will be loaded and \sty{babel}'s
caption hooks will be used instead.

\begin{table}[htbp]
\caption{Customised Text}
\label{tab:predefinednames}
\centering
\settabcolsep{3pt}
\begin{tabular}{@{}l>{\raggedright}p{0.3\linewidth}>{\raggedright}p{0.4\linewidth}@{}}
\bfseries Command Name & \bfseries Translator Key Word &
\bfseries Purpose\tabularnewline
\inlineglsdef{glossaryname} & \code{Glossary} & Title of the main
glossary.\tabularnewline
\inlineglsdef{acronymname} & \code{Acronyms} & Title of the list of acronyms
(when used with package option \opt{acronym}).\tabularnewline
\inlineglsdef{entryname} & \code{Notation (glossaries)} & 
Header for first column in the glossary (for 2, 3 or 4 column glossaries 
that support headers).\tabularnewline
\inlineglsdef{descriptionname} & \code{Description (glossaries)} &
Header for second column in the glossary (for 2, 3 or 4 column glossaries
that support headers).\tabularnewline
\inlineglsdef{symbolname} & \code{Symbol (glossaries)} & Header for symbol
column in the glossary for glossary styles that support this
option.\tabularnewline
\inlineglsdef{pagelistname} & \code{Page List (glossaries)} & 
Header for the \idx{pagelist} column in the glossary for glossaries that support 
this option.\tabularnewline
\inlineglsdef{glssymbolsgroupname} & \code{Symbols (glossaries)} & 
Header for symbols section of the glossary for glossary styles that 
support this option.\tabularnewline
\inlineglsdef{glsnumbersgroupname} & \code{Numbers (glossaries)} & Header for
numbers section of the glossary for glossary styles that support
this option.
\end{tabular}
\end{table}

As from version 4.12, multilingual support is provided by separate
language modules that need to be installed in addition to installing
the \sty{glossaries} package. You only need to install the
modules for the languages that you require. If the language module
has an unmaintained status, you can volunteer to take over the
maintenance by contacting me at
\url{https://www.dickimaw-books.com/contact}. The
\sty{translator} dictionary files for \sty{glossaries} are now
provided by the appropriate language module. For further details
about information specific to a given language, please see the
documentation for that language module.

Examples of use:
\begin{itemize}
\item Using \sty{babel} and \sty{translator}:
\begin{codebox}
\cmd{documentclass}[english,french]\marg{article}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}\marg{glossaries}
\end{codebox}
(\sty{translator} is automatically loaded).

\item Using \sty{babel}:
\begin{codebox}
\cmd{documentclass}[english,french]\marg{article}
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\end{codebox}
(\sty{translator} isn't loaded). The \sty{glossaries-extra} package
has \optval{translate}{babel} as the default if \sty{babel} has been
loaded.

\item Using \sty{polyglossia}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{polyglossia}
\cmd{setmainlanguage}\marg{english}
\cmd{usepackage}\marg{glossaries}
\end{codebox}

\end{itemize}

Due to the varied nature of \idxpl{glossary}, it's likely that the
predefined translations may not be appropriate. If you are using the
\sty{babel} package and the \sty{glossaries} package option
\optval{translate}{babel}, you need to be familiar with the advice given in
\href{https://texfaq.org/FAQ-latexwords}{changing
the words babel uses}. If you are using the \sty{translator}
package, then you can provide your own dictionary with the necessary
modifications (using \csfmt{deftranslation}) and load it using
\csfmt{usedictionary}. If you simply want to change the title of a
\idx{glossary}, you can use the \printglossopt{title} key in
commands like \gls{printglossary} (but not the iterative commands
like \gls{printglossaries}).

\begin{important}
Note that the \sty{translator} dictionaries are loaded at the beginning of the
document, so it won't have any effect if you put \csfmt{deftranslation}
in the \idx+{preamble/document}. It should be put in your personal dictionary
instead (as in the example below). See the \sty{translator}
documentation for further details.
\end{important}

Your custom dictionary doesn't have to be just a translation from
English to another language. You may prefer to have a dictionary for
a particular type of document. For example, suppose your
institution's in-house reports have to have the glossary labelled as
\qt{Nomenclature} and the \idx{locationlist} should be labelled
\qt{Location}, then you can create a file called, say,
\filefmt{myinstitute-glossaries-dictionary-English.dict}
that contains the following:
\begin{codebox}
\cmd{ProvidesDictionary}\marg{myinstitute-glossaries-dictionary}\marg{English}
\cmd{deftranslation}\marg{Glossary}\marg{Nomenclature}
\cmd{deftranslation}\marg{Page List (glossaries)}\marg{Location}
\end{codebox}
You can now load it using:
\begin{codebox}
\cmd{usedictionary}\marg{myinstitute-glossaries-dictionary}
\end{codebox}
(Make sure that \filefmt{myinstitute-glossaries-dictionary-English.dict}
can be found by \TeX.) If you want to share your custom dictionary,
you can upload it to \href{http://www.ctan.org/}{CTAN}.

If you are using \sty{babel} and don't want to use the
\sty{translator} interface, you can use the package
option \optval{translate}{babel}. For example:
\begin{codebox*}
\cmd{documentclass}[british]\marg{article}
\codepar
\cmd{usepackage}\marg{babel}
\cmd{usepackage}[\optval{translate}{babel}]\marg{glossaries}
\codepar
\cmd{addto}\captionslanguage{british}\marg{\comment{}
  \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{List of Terms}\comment{}
  \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{List of Acronyms}\comment{}
}
\end{codebox*}

Note that \app{xindy} and \app{bib2gls} provide much better
multi-lingual support than \app{makeindex}, so I~recommend that you
use \optionsor{mkidx,xdy} if you have \idx{glossary} entries that
contain \idxpl{nonlatinchar}. See \sectionref{sec:xindy} for further
details on \app{xindy}, and see the \app{bib2gls} user manual for
further details of that application.

\subsection{Creating a New Language Module}
\label{sec:newlang}

The \sty{glossaries} package now uses the \sty{tracklang} package
to determine which language modules need to be loaded. If you want
to create a new language module, you should first read the 
\sty{tracklang} documentation.

To create a new language module, you need to at least create two
files called: \file{glossaries-lang.ldf} and
\file{glossaries-dictionary-Lang.dict} where
\meta{lang} is the root language name (for example,
\code{english}) and \meta{Lang} is the language name used by
\sty{translator} (for example, \code{English}).

Here's an example of \file{glossaries-dictionary-English.dict}:
\begin{codebox}
\cmd{ProvidesDictionary}\marg{glossaries-dictionary}\marg{English}
\codepar
\cmd{providetranslation}\marg{Glossary}\marg{Glossary}
\cmd{providetranslation}\marg{Acronyms}\marg{Acronyms}
\cmd{providetranslation}\marg{Notation (glossaries)}\marg{Notation}
\cmd{providetranslation}\marg{Description (glossaries)}\marg{Description}
\cmd{providetranslation}\marg{Symbol (glossaries)}\marg{Symbol}
\cmd{providetranslation}\marg{Page List (glossaries)}\marg{Page List}
\cmd{providetranslation}\marg{Symbols (glossaries)}\marg{Symbols}
\cmd{providetranslation}\marg{Numbers (glossaries)}\marg{Numbers}
\end{codebox}
You can use this as a template for your dictionary file. Change
\code{English} to the \sty{translator} name for your language
(so that it matches the file name \file{glossaries-dictionary-Lang.dict})
and, for each \csfmt{providetranslation}, change the second argument to
the appropriate translation.

Here's an example of \file{glossaries-english.ldf}:
\begin{codebox*}
\gls{ProvidesGlossariesLang}\marg{english}
\codepar
\gls{glsifusedtranslatordict}\marg{English}
\marg{\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedLanguage}}\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedDialect}}\comment{}
}
\marg{\comment{}
  \cmd{@ifpackageloaded}\marg{polyglossia}\comment{}
  \marg{\comment{}
    \cmd{newcommand}*\marg{\cmd{glossariescaptionsenglish}}\marg{\comment{}
      \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{\cmd{textenglish}\marg{Glossary}}\comment{}
      \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{\cmd{textenglish}\marg{Acronyms}}\comment{}
      \cmd{renewcommand}*\marg{\gls{entryname}}\marg{\cmd{textenglish}\marg{Notation}}\comment{}
      \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{\cmd{textenglish}\marg{Description}}\comment{}
      \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{\cmd{textenglish}\marg{Symbol}}\comment{}
      \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{\cmd{textenglish}\marg{Page List}}\comment{}
      \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{\cmd{textenglish}\marg{Symbols}}\comment{}
      \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{\cmd{textenglish}\marg{Numbers}}\comment{}
    }\comment{}
  }\comment{}
  \marg{\comment{}
    \cmd{newcommand}*\marg{\cmd{glossariescaptionsenglish}}\marg{\comment{}
      \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{Glossary}\comment{}
      \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{Acronyms}\comment{}
      \cmd{renewcommand}*\marg{\gls{entryname}}\marg{Notation}\comment{}
      \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{Description}\comment{}
      \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{Symbol}\comment{}
      \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{Page List}\comment{}
      \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{Symbols}\comment{}
      \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{Numbers}\comment{}
    }\comment{}
  }\comment{}
  \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedDialect}}
  \marg{\comment{}
    \cmd{csappto}\marg{captions\gls{CurrentTrackedDialect}}\comment{}
    \marg{\comment{}
      \cmd{glossariescaptionsenglish}
    }\comment{}
  }\comment{}
  \marg{\comment{}
    \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedLanguage}}
    \marg{\comment{}
      \cmd{csappto}\marg{captions\gls{CurrentTrackedLanguage}}\comment{}
      \marg{\comment{}
        \cmd{glossariescaptionsenglish}
      }\comment{}
    }\comment{}
    {\comment{}
    }\comment{}
  }\comment{}
  \cmd{glossariescaptionsenglish}
}
\cmd{renewcommand}*\marg{\gls{glspluralsuffix}}\marg{s}
\cmd{renewcommand}*\marg{\gls{glsacrpluralsuffix}}\marg{\gls{glspluralsuffix}}
\cmd{renewcommand}*\marg{\gls{glsupacrpluralsuffix}}\marg{\gls{glstextup}\marg{\gls{glspluralsuffix}}}
\end{codebox*}
This is a somewhat longer file, but again you can use it as a
template. Replace \code{English} with the \sty{translator}
language label \meta{Lang} used for the dictionary file and
replace \code{english} with the root language name \meta{lang}. Within the
definition of \csfmt{glossariescaptions}\meta{lang}, replace the
English text (such as \qt{Glossaries}) with the appropriate
translation.

\plabel[plural suffix]{pluralsuffix}%
The suffixes used to generate the plural forms when the plural
hasn't been specified are given by \gls{glspluralsuffix} (for
general entries). For \idxpl{acronym} defined with the base
\gls{newacronym}, \gls{glsupacrpluralsuffix} is used for the
\idx{smallcaps} \idxpl{acronymstyle} where the suffix needs to be
set using \gls{glstextup} to counteract the effects of \gls{textsc}
and \gls{glsacrpluralsuffix} for other \idxpl{acronymstyle}.
There's no guarantee when these commands will be expanded. They may
be expanded on definition or they may be expanded on use, depending
on the \sty{glossaries} configuration.

\begin{important}
Therefore these plural suffix command definitions aren't included in
the \gls{captionslanguage} hook as that's typically not implemented
until the start of the document. \strong{This means that the suffix
in effect will be for the last loaded language that redefined these
commands.} It's best to initialise these commands to the most common
suffix required in your document and use the \gloskey{plural},
\gloskey{longplural}, \gloskey{shortplural} etc keys to override
exceptions.
\end{important}

If you want to add a regional variation, create a file called 
\file{glossaries-iso-lang-iso-region.ldf}, where \meta{iso-lang} is the ISO language
code and \meta{iso-region} is the ISO country code. For example,
\filefmt{glossaries-en-GB.ldf}. This file can load the root
language file and make the appropriate changes, for example:
\begin{codebox*}
 \gls{ProvidesGlossariesLang}\marg{en-GB}
 \gls{RequireGlossariesLang}\marg{english}
 \gls{glsifusedtranslatordict}\marg{British}
 \marg{\comment{}
   \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedLanguage}}\comment{}
   \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedDialect}}\comment{}
 }
 \marg{\comment{}
   \cmd{@ifpackageloaded}\marg{polyglossia}\comment{}
   \marg{\comment{}
     \comment{Modify \cmd{glossariescaptionsenglish} as appropriate for}
     \comment{polyglossia}
   }\comment{}
   \marg{\comment{}
     \comment{Modify \cmd{glossariescaptionsenglish} as appropriate for}
     \comment{non-polyglossia}
   }\comment{}
 }
\end{codebox*}

If the translations includes \idxpl{nonlatinchar}, it's a good idea to
provide code that's independent of the input \idx{encoding}. Remember that
while some users may use \idx{utf8} (and it's now the default
\idx{encoding} with modern \LaTeX\ kernels), others may use Latin-1 or any other
supported \idx{encoding}, but while users won't appreciate you enforcing
your preference on them, it's useful to provide a \idx{utf8} version.

The \file{glossaries-irish.ldf} file provides this as follows:
\begin{codebox*}
\gls{ProvidesGlossariesLang}\marg{irish}
\codepar
\gls{glsifusedtranslatordict}\marg{Irish}
\marg{\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedLanguage}}\comment{}
  \gls{addglossarytocaptions}\marg{\gls{CurrentTrackedDialect}}\comment{}
}
\marg{\comment{}
  \cmd{ifdefstring}\marg{\gls{inputencodingname}}\marg{utf8}
  \marg{\cmd{input}\marg{glossaries-irish-utf8.ldf}}\comment{}
  \marg{\comment{}
    \cmd{ifdef}{\cmd{XeTeXinputencoding}}\comment{XeTeX defaults to UTF-8}
    \marg{\cmd{input}\marg{glossaries-irish-utf8.ldf}}\comment{}
    \marg{\cmd{input}\marg{glossaries-irish-noenc.ldf}}
  }
  \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedDialect}}
  \marg{\comment{}
    \cmd{csappto}\marg{captions\gls{CurrentTrackedDialect}}\comment{}
    \marg{\comment{}
      \cmd{glossariescaptionsirish}
    }\comment{}
  }\comment{}
  \marg{\comment{}
    \cmd{ifcsdef}\marg{captions\gls{CurrentTrackedLanguage}}
    \marg{
      \cmd{csappto}\marg{captions\gls{CurrentTrackedLanguage}}\comment{}
      \marg{\comment{}
        \cmd{glossariescaptionsirish}
      }\comment{}
    }\comment{}
    \marg{\comment{}
    }\comment{}
  }\comment{}
  \cmd{glossariescaptionsirish}
}
\end{codebox*}
(Again you can use this as a template. Replace \code{irish} with
your root language label and \code{Irish} with the
\sty{translator} dictionary label.)

There are now two extra files: \filefmt{glossaries-irish-noenc.ldf}
(no \idx{encoding} information)
and \filefmt{glossaries-irish-utf8.ldf} (\idx{utf8}).

These both define \csfmt{glossariescaptionsirish} but the \filefmt{*-noenc.ldf}
file uses \LaTeX\ accent commands:
\begin{codebox}
\cmd{@ifpackageloaded}\marg{polyglossia}\comment{}
\marg{\comment{}
  \cmd{newcommand}*\marg{\cmd{glossariescaptionsirish}}\marg{\comment{}
    \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{\cmd{textirish}\marg{Gluais}}\comment{}
    \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{\cmd{textirish}\marg{Acrainmneacha}}\comment{}
    \cmd{renewcommand}*\marg{\gls{entryname}}\marg{\cmd{textirish}\marg{Ciall}}\comment{}
    \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{\cmd{textirish}\marg{Tuairisc}}\comment{}
    \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{\cmd{textirish}\marg{Comhartha}}\comment{}
    \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{\cmd{textirish}\marg{Comhartha\gls{cs.apos}{\cmd{i}}}}\comment{}
    \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{\cmd{textirish}\marg{Leathanaigh}}\comment{}
    \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{\cmd{textirish}\marg{Uimhreacha}}\comment{}
  }\comment{}
}\comment{}
\marg{\comment{}
  \cmd{newcommand}*\marg{\cmd{glossariescaptionsirish}}\marg{\comment{}
    \cmd{renewcommand}*\marg{\gls{glossaryname}}\marg{Gluais}\comment{}
    \cmd{renewcommand}*\marg{\gls{acronymname}}\marg{Acrainmneacha}\comment{}
    \cmd{renewcommand}*\marg{\gls{entryname}}\marg{Ciall}\comment{}
    \cmd{renewcommand}*\marg{\gls{descriptionname}}\marg{Tuairisc}\comment{}
    \cmd{renewcommand}*\marg{\gls{symbolname}}\marg{Comhartha}\comment{}
    \cmd{renewcommand}*\marg{\gls{glssymbolsgroupname}}\marg{Comhartha\gls{cs.apos}{\cmd{i}}}\comment{}
    \cmd{renewcommand}*\marg{\gls{pagelistname}}\marg{Leathanaigh}\comment{}
    \cmd{renewcommand}*\marg{\gls{glsnumbersgroupname}}\marg{Uimhreacha}\comment{}
  }\comment{}
}
\end{codebox}
whereas the \filefmt{*-utf8.ldf} file replaces the accent commands with
the appropriate \idx{utf8} characters.

\section{Generating the Associated Glossary Files}
\label{sec:makeglossaries}

\begin{important}
This section is only applicable if you have chosen \optionsor{mkidx,xdy}. You can
ignore this section if you have chosen any of the other options.
(For \option{b2g}, see the \app{bib2gls} manual for details.)
If you want to alphabetically sort your entries always remember to use the
\gloskey{sort} key if the \gloskey{name} contains any \LaTeX\
commands (except if you're using \app{bib2gls}).
\end{important}

If this section seriously confuses you, and you can't work out how
to run external tools like \app{makeglossaries} or \app{makeindex},
you can try using the \opt{automake} package option, described in
\sectionref{sec:pkgopts-sort}, but you will need \TeX's
\idx{shellescape} enabled. See also
\dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}.
Since \app{makeindex} is on the trusted list, the restricted 
\idx{shellescape} may be used, which is safer than the unrestricted
mode. For example:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{automake}}\marg{glossaries}
\gls{makeglossaries}
\end{codebox}
If the document source is in the file \filefmt{myDoc.tex} then this
requires:
\begin{terminal}
pdflatex -shell-restricted myDoc
pdflatex -shell-restricted myDoc
\end{terminal}
(you may find that \code{-shell-restricted} is the default for your
system, in which case it may be omitted).
Whereas:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy},\opt{automake}}\marg{glossaries}
\gls{makeglossaries}
\end{codebox}
requires:
\begin{terminal}
pdflatex -shell-escape myDoc
pdflatex -shell-escape myDoc
\end{terminal}
Be aware that this unrestricted mode is a security risk, so it's best
avoided.

In order to generate a sorted \idx{glossary} with compact
\idxpl{numberlist}, it is necessary to use an external
\idx{indexingapp} as an intermediate step (\option{noidx}, which
uses \TeX\ to do the sorting, can't compact \idxpl{numberlist}). It
is this application that creates the file containing the code
required to typeset the \idx{glossary}. \strong{If this step is
omitted, the \idxpl{glossary} will not appear in your document.}

The two oldest \idxpl{indexingapp} most commonly used with \LaTeX\
are \app{makeindex} and \app{xindy}. The \styfmt{glossaries} package
can be used with either of these applications. Any other application
that can support \app{makeindex}['s] syntax and style file may be
used instead of \app{makeindex}. Simply follow the \app{makeindex}
instructions and substitute the call to \app{makeindex} with the
appropriate call to the alternative. 

Commands that only have an effect when \app{xindy} is used are
described in \sectionref{sec:xindy}.

\begin{important}
This is a multi-stage process, but there are methods of automating
document compilation using applications such as \app{latexmk} and
\app{arara}. With \app{arara} you can just add special comments to
your document source:
\begin{codebox}
\araraline{pdflatex}
\araraline{makeglossaries}
\araraline{pdflatex}
\end{codebox}
With \app{latexmk} you need to set up the required dependencies.
\end{important}

The \sty{glossaries} package comes with the Perl script
\app{makeglossaries} which will run \app{makeindex} or \app{xindy}
on all the \idxpl{indexingfile} using a customized style file (which is
created by \gls{makeglossaries}). See
\sectionref{sec:makeglossariesapp} for further
details. Perl is stable, cross-platform, open source software that
is used by a number of \TeX-related applications (including
\app{xindy} and \app{latexmk}). Most Unix-like
operating systems come with a~Perl interpreter. \TeXLive\ also comes
with a~Perl interpreter. As far as I know, \MikTeX\ doesn't come with a~Perl
interpreter so if you are a~Windows \MikTeX\ user you will need to
install Perl if you want to use \app{makeglossaries} or \app{xindy}.
Further information is available at \url{http://www.perl.org/about.html}
and
\texseref{questions/158796}{MikTeX and Perl scripts (and one Python script)}.

The advantages of using \app{makeglossaries}:
\begin{itemize}
\item It automatically detects whether to use \app{makeindex} or
\app{xindy} and sets the relevant application switches.

\item One call of \app{makeglossaries} will run 
\app{makeindex}\slash\app{xindy} for each \idx{glossary} type.

\item If things go wrong, \app{makeglossaries} will scan the
messages from \app{makeindex} or \app{xindy} and attempt to diagnose
the problem in relation to the \sty{glossaries} package. This
will hopefully provide more helpful messages in some cases. If it
can't diagnose the problem, you will have to read the relevant transcript
file and see if you can work it out from the \app{makeindex} or
\app{xindy} messages.

\item If \app{makeindex} warns about \idx{multipleencap} values,
\app{makeglossaries} v2.18+ will detect this and attempt to correct the
problem. This correction is only provided by \app{makeglossaries} when
\app{makeindex} is used since \app{xindy} uses the order of the
\idxc{xindyattr}{attributes list} to determine which format should take precedence.
(see \sectionref{sec:xindyloc}.) This correction can be switched off with the \mkglsopt{e}
switch.

\item If \app{makeindex} warns about invalid or
\idxpl{emptylocation}, \app{makeglossaries} v4.50+ will detect this
and attempt to alter the location to fit \app{makeindex}['s] syntax.
This may or may not cause unexpected results in the
\idx{locationlist}, but it's useful if the \opt{nonumberlist} option
is used.

\item If \app{makeindex} has a warning that could be the result of a
command occurring within the \location, \app{makeglossaries} v4.50+
will attempt to repair it by moving the command out of the location
and into the \idx{encap}.

\item If the output directory has been set when running \LaTeX\
(which puts all the associated files in another directory),
\app{makeglossaries} has a \mkglsopt{d} switch that can be used to
identify the output directory. This means that \app{makeglossaries}
can change to that directory before running \app{makeindex}
or \app{xindy}.
\end{itemize}
The first two items also apply to \app{makeglossaries-lite}.

As from version 4.16, the \sty{glossaries} package also comes
with a~Lua script called \app{makeglossaries-lite}. This is a
\emph{trimmed-down} alternative to the \app{makeglossaries} Perl
script. It doesn't have some of the options that the Perl version
has and it doesn't attempt to diagnose any problems, but since
modern \TeX\ distributions come with \LuaTeX\ (and therefore have
a~Lua interpreter) you don't need to install anything else in order
to use \app{makeglossaries-lite} so it's an alternative to
\app{makeglossaries} if you want to use \option{mkidx} (\app{makeindex}).

If things go wrong and you can't work out why your \idxpl{glossary}
aren't being generated correctly, you can use
\app{makeglossariesgui} as a diagnostic tool. Once you've
fixed the problem, you can then go back to using
\app{makeglossaries} or \app{makeglossaries-lite}.

Whilst I strongly recommended that you use the \app{makeglossaries}
Perl script or the \app{makeglossaries-lite} Lua script, it is
possible to use the \sty{glossaries} package without using those
applications. However, note that some commands and package options
have no effect if you explicitly run \app{makeindex}\slash\app{xindy}.  
These are listed in \tableref{tab:makeglossariesCmds}.

\begin{important}
If you are choosing not to use \app{makeglossaries} because you
don't want to install Perl, you will only be able to use
\app{makeindex} as \app{xindy} also requires Perl. (Other useful
Perl scripts include \appfmt{epstopdf} and \app{latexmk}, so it's
well-worth the effort to install Perl.)
Alternatively, if you have Java installed, 
switch to \sty{glossaries-extra} and \app{bib2gls}.
\end{important}

Below, references to \app{makeglossaries} can usually be substituted
with \app{makeglossaries-lite}, except where noted otherwise.

If any of your entries use an entry that is not referenced outside
the \idx{glossary} (for example, the entry is only referenced in the
description of another entry), you will need to do an additional
\app{makeglossaries}, \app{makeindex} or \app{xindy} run, as
appropriate. For example, suppose you have defined the following
entries:
\begin{codebox}
\gls{newglossaryentry}\marg{citrusfruit}\marg{\gloskeyval{name}{citrus fruit},
\gloskeyval{description}{fruit of any citrus tree. (See also 
\gls{gls}\marg{orange})}}
\codepar
\gls{newglossaryentry}\marg{orange}\marg{\gloskeyval{name}{orange},
\gloskeyval{description}{an orange coloured fruit.}}
\end{codebox}
and suppose you have \code{\gls{gls}\marg{citrusfruit}} in your document
but don't reference the \qt{orange} entry, then the
orange entry won't appear in your \idx{glossary} until
you first create the \idx{glossary} and then do another run
of \app{makeglossaries}, \app{makeindex} or \app{xindy}.
For example, if the document is called \filefmt{myDoc.tex}, then
you must do:
\begin{terminal}
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}
(In the case of \option{b2g}, \app{bib2gls} will scan the description for
instances of commands like \gls{gls} to ensure they are selected but
an extra \app{bib2gls} call is required to ensure the \locations\ are
included, if \idxpl{locationlist} are required. See the
\app{bib2gls} manual for further details.)

Likewise, an additional \app{makeglossaries} and \LaTeX\ run
may be required if the document pages shift with re-runs. For
example, if the page numbering is not reset after the table of
contents, the insertion of the table of contents on the second
\LaTeX\ run may push glossary entries across page boundaries, which
means that the \idxpl{numberlist} in the glossary may 
need updating.

The examples in this document assume that you are accessing
\app{makeglossaries}, \app{xindy} or \app{makeindex} via a terminal.
Windows users can use the command prompt which is usually accessed via
the \menu{Start,All Programs} menu or
\menu{Start,All Programs,Accessories} menu or
\menu{Start,Windows System}.

Alternatively, your text editor may have the facility to create a
function that will call the required application. See
\dickimawhref{latex/buildglossaries/}{Incorporating
makeglossaries or makeglossaries-lite or bib2gls into the document
build}.

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

\begin{table}[htbp]
\caption{Commands and package options that have no effect when
using \apptext{xindy} or \apptext{makeindex} explicitly}
\label{tab:makeglossariesCmds}
\centering
\begin{tabular}{@{}lll@{}}
\bfseries Command or Package Option & 
\bfseries\app{makeindex} & 
\bfseries\app{xindy}\\
\optval{order}{letter} & use \mkidxopt{l} &
 use \code{\xdyopt{M} ord/letorder}\\
\optval{order}{word} & default & default\\
\optvalm{xindy}{\styoptxdyvalm{language}{lang},\styoptxdyvalm{codepage}{code}} &
N/A & use \code{\xdyopt{L} \meta{lang} \xdyopt{C} \meta{code}}\\
\code{\gls{GlsSetXdyLanguage}\margm{lang}} & N/A &
use \code{\xdyopt{L} \meta{lang}}\\
\code{\gls{GlsSetXdyCodePage}\margm{code}} & N/A &
use \code{\xdyopt{C} \meta{code}}
\end{tabular}
\par
\end{table}

\subsection{Using the \apptext{makeglossaries} Perl Script}
\label{sec:makeglossariesapp}

\appdef{makeglossaries}

The \app{makeglossaries} script picks up the relevant information
from the auxiliary (\ext+{aux}) file and will either call
\app{xindy} or \app{makeindex}, depending on the supplied
information. Therefore, you only need to pass the document's name
without the extension to \app{makeglossaries}. For example, if your
document is called \filefmt{myDoc.tex}, type the following in your
terminal:
\begin{terminal}
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}
As from version 4.7, you can include the \ext{aux} extension:
\begin{terminal}
pdflatex myDoc
makeglossaries myDoc.aux
pdflatex myDoc
\end{terminal}
This indicates that you want all \idxpl{glossary} processed.
If your filename includes non-extension dots then it's best to
include the \ext{aux} extension to avoid ambiguity. For example:
\begin{terminal}
pdflatex myDoc
makeglossaries my.dotty.Doc.aux
pdflatex myDoc
\end{terminal}

If you only want one \idx{glossary} processed (for example, if you
are working on a draft of a large document and want to concentrate on one specific
\idx{glossary}) then include the \meta{out-ext} extension supplied
to \gls{newglossary}, such as \ext{glo} for the \glostype{main}
glossary. Note that if you do specify the extension and your
document has multiple \idxpl{glossary} defined, then
\app{makeglossaries} will tell you how many \idxpl{glossary} have
been ignored unless the \mkglsopt{q} switch has been used.

Windows users: \TeXLive\ on Windows has its own internal Perl
interpreter and provides \filefmt{makeglossaries.exe} as a~convenient
wrapper for the \app{makeglossaries} Perl script. \MikTeX\ also
provides a~wrapper \filefmt{makeglossaries.exe} but doesn't provide
a~Perl interpreter (as far as I know), which is still required even if 
you run \MikTeX's \filefmt{makeglossaries.exe}, so with \MikTeX\ you'll need to install
Perl. There's more information about this at
\texseref{questions/158796}{MikTeX and Perl scripts (and one Python script)}. 

\begin{important}
When upgrading the \sty{glossaries} package, make sure you also
upgrade your version of \app{makeglossaries}. The current version is
4.7.
\end{important}

Some of the options are only applicable to \app{makeindex} and some
are only applicable to \app{xindy}.

\switchdef{mkgls.help}
Shows a summary of all available options.

\switchdef{mkgls.version}
Shows the version details.

\switchdef{mkgls.n}
Dry run mode. This doesn't actually run
\app{makeindex}\slash\app{xindy} but just prints the command it
would execute based on the information given in the \ext{aux} file
and the supplied options.

\switchdef{mkgls.d}
Instructs \app{makeglossaries} to change to the given directory,
which should be where the \ext+{aux}, 
\ext+{glo} etc files are located.
For example:
\begin{terminal}
pdflatex -output-directory myTmpDir myDoc
makeglossaries \mkglsopt{d} myTmpDir myDoc
\end{terminal}

\switchdef{mkgls.e}
Don't check for \idxpl{multipleencap} (only applicable with \app{makeindex}).
By default, if you are using
\app{makeindex}, \app{makeglossaries} will check the \app{makeindex}
transcript for \idx{multipleencap} warnings.  

The \idx{multipleencap} warning is where different \idx{locationencap}
values (location formats) are used on the same \location\ for the
same entry. For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{an example}}
\codepar
\cbeg{document}
\gls{gls}\marg{sample}, \gls{gls}\oarg{\glsoptval{format}{textbf}}\marg{sample}.
\gls{printglossaries}
\cend{document}
\end{codebox}
If you explicitly use \app{makeindex}, this will cause a warning and
the \idx{locationlist} will be \qt{1, \textbf{1}}. That is, the page
number will be repeated with each format. As from v2.18,
\app{makeglossaries} will check for this warning and, if found, will
attempt to correct the problem by removing duplicate locations and
retrying. If you actually want the duplicate location, you can
prevent \app{makeglossaries} from checking and correcting the
duplicates with \mkglsopt{e}.

There's no similar check for \app{xindy} as \app{xindy}
won't produce any warning and will simply discard duplicates.

\switchdef{mkgls.q}
Suppresses messages.
The \app{makeglossaries} script attempts to fork the
\app{makeindex}\slash\app{xindy} process using \code{open()} on the
piped redirection \code{2>\&1 |} and parses the processor output to
help diagnose problems.  If this method fails \app{makeglossaries}
will print an \qt{Unable to fork} warning and will retry without
redirection.  Without this redirection, the \mkglsopt{q} switch
doesn't work as well. Some operating systems don't support
redirection.

\switchdef{mkgls.Q}
Suppresses the \qt{Unable to fork} warning.

\switchdef{mkgls.k}
Don't attempt redirection.

\switchdef{mkgls.m}
The \app{makeindex} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

If you want to use an application that is capable of reading
\app{makeindex} files (including support for \app{makeindex} style
files via \mkidxopt{s}), then you can use \mkglsopt{m}
to specify the alternative application to use instead of
\app{makeindex}. Note that both \app{xindex} and \app{texindy} can
read \app{makeindex} files using the default \app{makeindex} syntax
but, as of the time of writing this, they don't support
\app{makeindex} style files.

\switchdef{mkgls.x}
The \app{xindy} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

\switchdef{mkgls.c}
Compress intermediate blanks. This will pass \mkidxopt{c} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkgls.r}
Disable implicit page \idx{range} formation. This will pass \mkidxopt{r} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkgls.p}
Set the starting page number. This will pass 
\code{\mkidxopt{p} \meta{num}} to \app{makeindex}. 
(Ignored if \app{xindy} should be called.)

The following switches may be used to override settings written to
the \ext{aux} file.

\switchdef{mkgls.l}
Use letter ordering. This will pass \mkidxopt{l} to \app{makeindex}
or \code{\xdyopt{M} ord/letorder} to \app{xindy}.

\switchdef{mkgls.L}
The language to pass to \app{xindy}. (Ignored if \app{makeindex}
should be called.)

\switchdef{mkgls.g}
Employ German word ordering. This will pass \mkidxopt{g} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkgls.s}
Set the style file. This will pass 
\code{\mkidxopt{s} \meta{filename}} to \app{makeindex}
or \code{\xdyopt{M} \meta{basename}} to \app{xindy} (where
\meta{basename} is \meta{filename} with the \ext+{xdy} extension
removed). This will generate an error if the extension is \ext{xdy}
when \app{makeindex} should be called, or if the extension isn't
\ext{xdy} when \app{xindy} should be called.

\switchdef{mkgls.o}
Sets the output file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the output filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{in-ext}
argument of \gls{newglossary}).

\switchdef{mkgls.t}
Sets the transcript file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the transcript filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{log-ext}
argument of \gls{newglossary}).

\subsection{Using the \apptext{makeglossaries-lite} Lua Script}
\label{sec:makeglossarieslua}

\appdef{makeglossaries-lite}

The Lua alternative to the \app{makeglossaries} Perl script requires
a~Lua interpreter, which should already be available if you have
a~modern \TeX\ distribution that includes \LuaTeX. Lua is 
a~light-weight, cross-platform scripting language, but because it's
light-weight it doesn't have the full-functionality of heavy-weight
scripting languages, such as Perl. The \app{makeglossaries-lite}
script is therefore limited by this and some of the options
available to the \app{makeglossaries} Perl script aren't available
here. (In particular the \mkglsopt{d} option.) Whilst it may be
possible to implement those features by requiring Lua packages, this
would defeat the purpose of providing this script for those don't
want the inconvenience of learning how to install interpreters or
their associated packages.

\begin{information}
The script is actually supplied as \filefmt{makeglossaries-lite.lua}
but \TeX\ distributions on Windows convert this to an executable
wrapper \filefmt{makeglossaries-lite.exe} and \TeXLive\ on Unix-like
systems provide a symbolic link without the extension.
\end{information}

The \app{makeglossaries-lite} script can be invoked in the same way
as \app{makeglossaries}. For example, if your document is called
\filefmt{myDoc.tex}, then do
\begin{terminal}
makeglossaries-lite myDoc
\end{terminal}
Note that the \app{arara} rule doesn't contain the hyphen:
\begin{codebox}
\araraline{makeglossarieslite}
\end{codebox}

You may also explicitly include the \ext+{aux} extension to indicate
all \idxpl{glossary} need to be processed. This is required if your
filename includes any dots that don't markup a file extension
(unlike \app{makeglossaries}).

Some of the options are only applicable to \app{makeindex} and some
are only applicable to \app{xindy}. There's no equivalent to 
the \mkglsopt{d} available to \app{makeglossaries} but it may work
if you prefix the basename with the path.

\switchdef{mkglslite.help}
Shows a summary of all available options.

\switchdef{mkglslite.version}
Shows the version details.

\switchdef{mkglslite.n}
Dry run mode. This doesn't actually run
\app{makeindex}\slash\app{xindy} but just prints the command it
would execute based on the information given in the \ext{aux} file
and the supplied options.

\switchdef{mkglslite.q}
Quiet mode. This suppresses some but not all messages.

\switchdef{mkglslite.m}
The \app{makeindex} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

\switchdef{mkglslite.x}
The \app{xindy} application. Only the name is required if it's
on the operating system's path, otherwise the full path name will be
needed.

\switchdef{mkglslite.c}
Compress intermediate blanks. This will pass \mkidxopt{c} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkglslite.r}
Disable implicit page \idx{range} formation. This will pass \mkidxopt{r} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkglslite.p}
Set the starting page number. This will pass 
\code{\mkidxopt{p} \meta{num}} to \app{makeindex}. 
(Ignored if \app{xindy} should be called.)

The following switches may be used to override settings written to
the \ext{aux} file.

\switchdef{mkglslite.l}
Use letter ordering. This will pass \mkidxopt{l} to \app{makeindex}
or \code{\xdyopt{M} ord/letorder} to \app{xindy}.

\switchdef{mkglslite.L}
The language to pass to \app{xindy}. (Ignored if \app{makeindex}
should be called.)

\switchdef{mkglslite.g}
Employ German word ordering. This will pass \mkidxopt{g} to
\app{makeindex}. (Ignored if \app{xindy} should be called.)

\switchdef{mkglslite.s}
Set the style file.

\switchdef{mkglslite.o}
Sets the output file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the output filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{in-ext}
argument of \gls{newglossary}).

\switchdef{mkglslite.t}
Sets the transcript file name. Note that this should only be used when
only one \idx{glossary} should be processed. The default is to set
the transcript filename to the basename supplied to \app{makeglossaries}
with the extension associated with the \idx{glossary} (the \meta{log-ext}
argument of \gls{newglossary}).

\subsection{Using \apptext{xindy} explicitly (Option \glsfmttext{idx.opt.xdy})}
\label{sec:xindyapp}

\app{xindy} comes with \TeXLive. It has also been added to \MikTeX,
but if you don't have it installed, see
\texseref{questions/71167}{How to use Xindy with MikTeX}.

If you want to use \app{xindy} to process the glossary
files, you must make sure you have used the 
\opt{xindy} package option:
\begin{codebox}
\cmd{usepackage}[\opt{xindy}]\marg{glossaries}
\end{codebox}
This is required regardless of whether you use \app{xindy}
explicitly or whether it's called implicitly via applications such
as \app{makeglossaries}. This causes the glossary 
entries to be written in raw \app{xindy} format, so you need to
use \code{\xdyopt{I} xindy} \emph{not} \code{\xdyopt{I} tex}.

To run \app{xindy} type the following in your terminal 
(all on one line):
\begin{terminal}
xindy \xdyopt{L} \meta{language} \xdyopt{C} \meta{encoding} \xdyopt{I} xindy \xdyopt{M} \meta{style} \xdyopt{t} \meta{base}.glg \xdyopt{o} \meta{base}.gls \meta{base}.glo
\end{terminal}
where \meta{language} is the required language name, \meta{encoding}
is the \idx{encoding}, \meta{base} is the name of the document without the
\ext{tex} extension and \meta{style} is the name of the
\app{xindy} style file without the \ext{xdy} extension.
The default name for this style file is \metafilefmt{}{base}{xdy}
but can be changed via \gls{setStyleFile}. As usual for command line
applications, if any of the file names contain spaces, you must
delimit them using double-quotes.

For example, if your document is called \filefmt{myDoc.tex} and
you are using \idx{utf8} \idx{encoding} in English, then type the
following in your terminal:
\begin{terminal}
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo
\end{terminal}

Note that this just creates the \glostype{main} \idx{glossary}. You need to do
the same for each of the other \idxpl{glossary} (including the
list of \idxpl{acronym} if you have used the \opt{acronym}
package option), substituting \ext+{glg}, \ext+{gls}
and \ext+{glo} with the relevant extensions. For example,
if you have used the \opt{acronym} package option, then 
you would need to do:
\begin{terminal}
xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.alg -o myDoc.acr myDoc.acn
\end{terminal}
For additional \idxpl{glossary}, the extensions are those supplied
when you created the \idx{glossary} with \gls{newglossary}.

Note that if you use \app{makeglossaries} instead, you can
replace all those calls to \app{xindy} with just one call
to \app{makeglossaries}:
\begin{terminal}
makeglossaries myDoc
\end{terminal}
Note also that some commands and package options have no effect if 
you use \app{xindy} explicitly instead of using 
\app{makeglossaries}. These are listed in 
\tableref{tab:makeglossariesCmds}.

\subsection{Using
\apptext{makeindex} explicitly (Option \glsfmttext{idx.opt.mkidx})}
\label{sec:makeindexapp}

If you want to use \app{makeindex} explicitly, you must
make sure that you haven't used the \opt{xindy} package
option or the \idxpl{glossaryentry} will be written in the wrong
format. To run \app{makeindex}, type the following in
your terminal:
\begin{terminal}
makeindex \mkidxopt{s} \meta{style}.ist \mkidxopt{t} \meta{base}.glg \mkidxopt{o} \meta{base}.gls \meta{base}.glo
\end{terminal}
where \meta{base} is the name of your document without the
\ext{tex} extension and \meta{style}\ext{ist} is the 
name of the \app{makeindex} style file. By default, this is
\metafilefmt{}{base}{ist}, but may be changed via
\gls{setStyleFile}. Note that there are other options, 
such as \mkidxopt{l} (letter ordering). See the \app{makeindex}
manual for further details.

For example, if your document is called \filefmt{myDoc.tex}, then
type the following at the terminal:
\begin{terminal}
makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo
\end{terminal}
Note that this only creates the \glostype{main} \idx{glossary}. If you have
additional \idxpl{glossary} (for example, if you have used the
\opt{acronym} package option) then you must call 
\app{makeindex} for each glossary, substituting 
\ext+{glg}, \ext+{gls} and \ext+{glo} with the
relevant extensions. For example, if you have used the
\opt{acronym} package option, then you need to type the
following in your terminal:
\begin{terminal}
makeindex -s myDoc.ist -t myDoc.alg -o myDoc.acr myDoc.acn
\end{terminal}
For additional glossaries, the extensions are those supplied
when you created the glossary with \gls{newglossary}.

Note that if you use \app{makeglossaries} instead, you can
replace all those calls to \app{makeindex} with just one call
to \app{makeglossaries}:
\begin{terminal}
makeglossaries myDoc
\end{terminal}
Note also that some commands and package options have no effect if 
you use \app{makeindex} explicitly instead of using 
\app{makeglossaries}. These are listed in 
\tableref{tab:makeglossariesCmds}.

\section{Note to Front-End and Script Developers}
\label{sec:notedev}

The information needed to determine whether to use \app{xindy},
\app{makeindex} or \app{bib2gls} is stored in the \ext+{aux}
file. This information can be gathered by a front-end, editor or
script to make the \idxpl{glossary} where appropriate. This section
describes how the information is stored in the auxiliary file.
See also
\qt{\dickimawhref{latex/auxglossaries}{Decyphering the Aux File Commands Provided by
glossaries.sty and glossaries-extra.sty}}.

\subsection{MakeIndex and Xindy}
\label{sec:notedev.makeindex.xindy}

The \idx{fileextension} of the \idxpl{indexingfile} used for each defined 
\idx{glossary} (not including any \idxpl{ignoredglossary}) are given by:
\cmddef{@newglossary}%{glossary-label}{log/glg}{out-ext/gls}{in-ext/glo}
where \meta{in-ext} is the extension of the
\emph{\idx{indexingapp}['s]} input file (the output file from the
\sty{glossaries} package's point of view), such as \ext+{glo},
\meta{out-ext} is the extension of the \emph{\idx{indexingapp}['s]}
output file (the input file from the \sty{glossaries} package's
point of view), such as \ext+{gls}, and \meta{log} is the extension
of the \idx{indexingapp}['s] transcript file, such as \ext+{glg}.
The label for the \idx{glossary} is also given. This isn't required
with \app{makeindex}, but with \app{xindy} it's needed to pick up
the associated language and \idx{encoding} (see below). For example, the
information for the default \glostype{main} \idx{glossary} is
written as:
\begin{codebox}
\gls{@newglossary}\marg{main}\marg{glg}\marg{gls}\marg{glo}
\end{codebox}
If \sty{glossaries-extra}['s] hybrid method has been used (with 
\gls{makeglossaries}\oargm{sub-list}), then the sub-list
of \idxpl{glossary} that need to be processed will be identified with:
\cmddef{glsxtr@makeglossaries}

The \idx{indexingapp}['s] style file is specified by:
\cmddef{@istfilename}
The file extension indicates whether to use \app{makeindex}
(\ext+{ist}) or \app{xindy} (\ext+{xdy}). Note that
the \idx{glossary} information has a different syntax depending on
which \idx{indexingapp} is supposed to be used, so it's 
important to call the correct one.

For example, with \app{arara} you can easily determine whether to
run \app{makeglossaries}:
\begin{codebox}
\araraline{makeglossaries if found("aux", "@istfilename")}
\end{codebox}
It's more complicated if you want to explicitly run \app{makeindex}
or \app{xindy}.

\begin{important}
Note that if you choose to explicitly call \app{makeindex} or
\app{xindy} then the user will miss out on the diagnostic
information and the \idx{encap}-clash fix 
that \app{makeglossaries} also provides.
\end{important}

Word or letter ordering is specified by:
\cmddef{@glsorder}
where \meta{order} can be either \code{word} or \code{letter}
(obtained from the \opt{order} package option).

If \app{xindy} should be used, the language for each \idx{glossary} is specified by:
\cmddef{@xdylanguage}
where \meta{glossary-label} identifies the \idx{glossary} and \meta{language} is
the root language (for example, \code{english}).

The \idx+{codepage} (file \idx+{encoding}) for all \idxpl{glossary} is specified by:
\cmddef{@gls@codepage}
where \meta{code} is the \idx{encoding} (for example, \code{utf8}). The above
two commands are omitted if \app{makeindex} should be used.

If \option{noidx} has been used, the \ext{aux} file will contain
\cmddef{@gls@reference}
for every time an entry has been referenced. 

\subsection{Entry Labels}
\label{sec:notedev.labels}

If you need to gather labels for \idx{auto-completion}, the
\opt{writeglslabels} package option will create a file containing
the labels of all defined \idxpl{entry} (regardless of whether or not the
\idx{entry} has been used in the document). As from v4.47, there is a
similar option \opt{writeglslabelnames} that writes both the
label and name (separated by a tab).

\begin{xtr}
The \sty{glossaries-extra}
package also provides \optval{docdef}{atom}, which will create the
\ext+{glsdefs} file but will act like \optval{docdef}{restricted}.
\end{xtr}

\subsection{Bib2Gls}
\label{sec:notedev.bib2gls}

\bibglsnote
If \option{b2g} has been used, the \ext{aux} file will contain one
or more instances of:
\cmddef{glsxtr@resource}
where \meta{basename} is the basename of the \ext+{glstex} file that
needs to be created by \app{bib2gls}. If
\resourceoptvalm{src}{\meta{bib list}} isn't present in
\meta{options} then \meta{basename} also indicates the name of the
associated \ext+{bib} file.

For example, with \app{arara} you can easily determine whether or
not to run \app{bib2gls}:
\begin{codebox}
\araraline{bib2gls if found("aux", "glsxtr@resource")}
\end{codebox}
(It gets more complicated if both \gls{glsxtr@resource} and
\gls{@istfilename} are present as that indicates the hybrid
\optval{record}{hybrid} option.)

Remember that with \app{bib2gls}, the \idxpl{glossaryentry} will never be defined
on the first \LaTeX\ call (because their definitions are contained
in the \ext{glstex} file created by \app{bib2gls}). You can
also pick up labels from the \records\ in \ext{aux} file, which
will be in the form:
\cmddef{glsxtr@record}
or (with \optval{record}{nameref}):
\cmddef{glsxtr@record@nameref}
or (with \gls{glssee}):
\cmddef{glsxtr@recordsee}
You can also pick up the commands defined with
\gls{glsxtrnewglslike}, which are added to the \ext{aux} file
for \app{bib2gls}['s] benefit:
\cmddef{@glsxtr@newglslike}
If \gls{GlsXtrSetAltModifier} is used, then the modifier is
identified with:
\cmddef{@glsxtr@altmodifier}
Label prefixes (for the \gls{dgls} set of commands) are identified
with:
\cmddef{@glsxtr@prefixlabellist}

\chapter{Package Options}
\label{sec:pkgopts}

This section describes the available \sty{glossaries} package
options. You may omit the \code{=true} for boolean options. (For
example, \opt{acronym} is equivalent to \optval{acronym}{true}).

\begin{xtr}
The \sty{glossaries-extra} package has additional options described
in the \sty{glossaries-extra} manual. The extension package also
has some different default settings to the base package. Those that
are available at the time of writing are included here. Future
versions of \sty{glossaries-extra} may have additional package
options or new values for existing settings that aren't listed here. 
\end{xtr}

\begin{important}
Note that \keyval\ package options can't be passed via the document
class options. (This includes options where the \meta{value} part
may be omitted, such as \opt{acronym}.) This is a general limitation
not restricted to the \sty{glossaries} package. Options that aren't
\keyval\ (such as \opt{makeindex}) may be passed via the document
class options.
\end{important}

\renewcommand{\cmddefbookmarkleveloffset}{2}

\section{General Options}
\label{sec:pkgopts-general}

\optiondef{nowarn}
This suppresses all warnings generated by
the \sty{glossaries} package. Don't use this option if you're new to using
\sty{glossaries} as the warnings are designed to help detect
common mistakes (such as forgetting to use \gls{makeglossaries}).
Note that if you use \opt{debug} with any value other than
\optfmt{false} it will override this option.

\optiondef{nolangwarn}
This suppresses the warning generated by a missing language module.

\optiondef{noredefwarn}
If you load \sty{glossaries} with
a~class or another package that already defines glossary related
commands, by default \sty{glossaries} will warn you that it's
redefining those commands. If you are aware of the consequences of
using \sty{glossaries} with that class or package and you don't
want to be warned about it, use this option to suppress those
warnings. Other warnings will still be issued unless you use the
\opt{nowarn} option described above. (This option is
automatically switched on by \sty{glossaries-extra}.)

\optiondef{debug}
Debugging mode may write information to the transcript file or 
add markers to the document.
The following values are available: 
\optionvaldef{debug}{false}
Switches off debugging mode.

\optionvaldef{debug}{true}
This will write the following line to the transcript file if any
attempt at indexing occurs before the associated files have been
opened by \gls{makeglossaries}:
\begin{compactcodebox}
wrglossary(\meta{glossary-type})(\meta{indexing info})
\end{compactcodebox}
Note that this setting will also cancel \opt{nowarn}.

\optionvaldef{debug}{showtargets}
As \opteqvalref{debug}{true} but also adds a marker where the
\idx{glossary}-related \idxpl{hyperlink} and targets occur in the document.

The \opteqvalref{debug}{showtargets} option will additionally use:
\cmddef{glsshowtarget}
to show the \idx{hypertarget} or \idx+{hyperlink} name when 
\gls{glsdohypertarget} is used by commands like \gls{glstarget}
and when \gls{glsdohyperlink} is used by commands like \gls{gls}.
In \idx{mathmode} or inner mode, this uses:
\cmddef{glsshowtargetinner}
which typesets the target name as:
\begin{compactcodebox}
\oarg{\gls{glsshowtargetfonttext}\margm{target name}}
\end{compactcodebox}
just before the link or anchor.  This uses the text-block command:
\cmddef{glsshowtargetfonttext}
which checks for math-mode before applying the font change.
In outer mode \gls{glsshowtarget} uses:
\cmddef{glsshowtargetouter}
which by default places the target name in the margin with a symbol
produced with: 
\cmddef{glsshowtargetsymbol}
which defaults to a small right facing triangle.

The font used by both \gls{glsshowtargetfonttext} and
\gls{glsshowtargetouter} is given by the declaration:
\cmddef{glsshowtargetfont}

\optionvaldef{debug}{showaccsupp}
As \opteqvalref{debug}{true} but also adds a marker where the
\idx{glossary}-related accessibility information occurs (see
\sty{glossaries-accsupp}) using:
\cmddef{glsshowaccsupp}

\begin{xtr}
The \sty{glossaries-extra} package provides extra values
\optval{debug}{showwrgloss}, that may be used to show where
the \idx{indexing} is occurring, and \optval{debug}{all}, which
switches on all debugging options. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}

The purpose of the debug mode can be demonstrated with
the following example document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\cmd{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},\gloskeyval{description}{example}}
\cmd{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},\gloskeyval{description}{example}}
\strong{\gls{glsadd}}\marg{sample2}\comment{<- does nothing here}
\strong{\gls{makeglossaries}}
\cbeg{document}
\gls{gls}\marg{sample1}.
\gls{printglossaries}
\cend{document}
\end{codebox}
In this case, only the \qt{sample1} entry has been \indexed, even
though \code{\gls{glsadd}\marg{sample2}} appears in the source code.
This is because \code{\gls{glsadd}\marg{sample2}} has been used before the
associated file is opened by \gls{makeglossaries}. Since the file
isn't open yet, the information can't be written to it, which is why
the \qt{sample2} entry doesn't appear in the \idx{glossary}.

Without \gls{makeglossaries} the \idx{indexing} is suppressed with
\options{mkidx,xdy} but, other than that, commands like \gls{gls}
behave as usual.

This situation doesn't cause any errors or warnings as it's
perfectly legitimate for a user to want to use \sty{glossaries} to
format the entries (for example, to show a different form on
\idx{firstuse}) but not display any \idxpl{glossary} (or the user
may prefer to use the unsorted \optionsor{unsrt,standalone}).  It's
also possible that the user may want to temporarily comment out
\gls{makeglossaries} in order to suppress the \idx{indexing} while
working on a draft version to speed compilation, or the user may
prefer to use \optionsor{noidx,b2g} for \idx{indexing}, which don't
use \gls{makeglossaries}.

Therefore \gls{makeglossaries} can't be used to enable
\gls{newglossaryentry} and commands like \gls{gls} and \gls{glsadd}.
These commands must be enabled by default. (It does, however, enable
the \gloskey{see} key as that's a more common problem. See below.)

The debug mode, enabled with the \opt{debug} option,
\begin{codebox}
\cmd{usepackage}[\opt{debug}]\marg{glossaries}
\end{codebox}
will write information to the log file when the \idx{indexing}
can't occur because the associated file isn't open.
The message is written in the form
\begin{transcript}
Package glossaries Info: wrglossary(\meta{type})(\meta{text}) on
input line \meta{line number}.
\end{transcript}
where \meta{type} is the glossary label and \meta{text} is the line
of text that would've been written to the associated file if
it had been open. So if any entries haven't appeared in the
glossary but you're sure you used commands like \gls{glsadd}
or \gls{glsaddall}, try switching on the \opt{debug} option
and see if any information has been written to the log file.

\optiondef{savewrites}
This is a boolean option to minimise the
number of write registers used by the \sty{glossaries} package.
The default is \optval{savewrites}{false}. With \options{mkidx,xdy}, one
write register is required per (non-ignored) \idx{glossary} and one for
the style file.

\begin{information}
In general, this package option is best avoided.
\end{information}

With all options except \options{noidx,b2g}, another write register is
required if the \ext{glsdefs} file is needed to save document
definitions. With both \options{noidx,b2g}, no write registers are required
(document definitions aren't permitted and \idx{indexing} information is
written to the \ext{aux} file). If you really need document
definitions but you want to minimise the number of write registers
then consider using \optval{docdef}{restricted} with
\sty{glossaries-extra}.

There are only a limited number of write registers, and if you have
a large number of \idxpl{glossary} or if you are using a class or other
packages that create a lot of external files, you may exceed the
maximum number of available registers. If \opt{savewrites} is
set, the \idx{glossary} information will be stored in token registers
until the end of the document when they will be written to the
external files.

\begin{important}
This option can significantly slow document compilation and may
cause the \idx{indexing} to fail.  Page numbers in the \idx{numberlist}
will be incorrect on page boundaries due to \TeX's asynchronous
output routine.  As an alternative, you can use the \sty{scrwfile}
package (part of the KOMA-Script bundle) and not use this option.
\end{important}

By way of comparison, \filefmt{sample-multi2.tex}
provided with \app{bib2gls} has a total of 15 \idxpl{glossary}. With
\optionsor{mkidx,xdy}, this would require 46 associated files and 16
write registers. (These figures don't include standard files
and registers provided by the kernel or \sty{hyperref}, such as
\ext{aux} and \filefmt{out}.) With
\app{bib2gls}, no write registers are required and there are only 10
associated files for that particular document (9 resource files and
1 transcript file).

\begin{important}
If you want to use \TeX's \idx{shellescape} to call
\app{makeindex} or \app{xindy} from your document and use
\opt{savewrites}, then use \opteqvalref{automake}{immediate} or
\opteqvalref{automake}{makegloss} or \opteqvalref{automake}{lite}.
\end{important}

\optiondef{translate}
This can take one of the values listed below. If no supported
language package has been loaded the default is
\opteqvalref{translate}{false} otherwise the default is
\opteqvalref{translate}{true} for the base \sty{glossaries} package
and  \opteqvalref{translate}{babel} for \sty{glossaries-extra}.

\optionvaldef{translate}{true}
If \sty{babel} has been loaded and the \sty{translator} package is
installed, \sty{translator} will be loaded and the translations will
be provided by the \sty{translator} package interface. You can
modify the translations by providing your own dictionary. If the
\sty{translator} package isn't installed and \sty{babel} is loaded,
the \sty{glossaries-babel} package will be loaded and the
translations will be provided using \sty{babel}['s]
\csfmt{addto}\gls{captionslanguage} mechanism. If
\sty{polyglossia} has been loaded, \sty{glossaries-polyglossia} will
be loaded.

\optionvaldef{translate}{false}
Don't provide translations, even if \sty{babel} or \sty{polyglossia}
has been loaded.  (Note that \sty{babel} provides the command
\gls{glossaryname} so that will still be translated if you have
loaded \sty{babel}.)

\optionvaldef{translate}{babel}
Don't load the \sty{translator} package. Instead load \sty{glossaries-babel}.

\begin{important}
I recommend you use \opteqvalref{translate}{babel} if you have any
problems with the translations or with \idxpl{PDFbookmark}, but to maintain backward
compatibility, if \sty{babel} has been loaded the default is
\opteqvalref{translate}{true}.
\end{important}

See \sectionref{sec:fixednames} for further details.

\optiondef{notranslate}
This is equivalent to \opteqvalref{translate}{false} and may be
passed via the document class options.

\optiondef{languages}
This automatically implements \opteqvalref{translate}{babel} (which
means that \sty{translator} won't automatically be loaded) but will
also add the list of languages to \sty{tracklang}['s] list of
tracked languages. Each element in the \meta{list} may be an ISO
language tag (such as \code{pt-BR}) or one of \sty{tracklang}['s]
known language labels (such as \code{british}).

\optiondef{locales}
Synonym of \opt{languages}.

\optiondef{hyperfirst}
If true, terms on \idx{firstuse} will have a \idx+{hyperlink}, if
supported, unless the \idx{hyperlink} is explicitly suppressed using
starred versions of commands such as \code{\gls{gls}*}.
If false, only \idx{subsequentuse} instances will have a \idx{hyperlink}
(if supported).

Note that \opt{nohypertypes} overrides \optval{hyperfirst}{true}.
This option only affects commands that check the \idx{firstuseflag}, such
as the \gls{glslike} commands (for example, \gls{gls} or
\gls{glsdisp}), but not the \gls{glstextlike} commands
(for example, \gls{glslink} or \gls{glstext}). 

The \opt{hyperfirst} setting applies to
all \idx{glossary} types (unless identified by \opt{nohypertypes} or
defined with \gls{newignoredglossary}). It can be overridden on an
individual basis by explicitly setting the \glsopt{hyper} key
when referencing an entry (or by using the plus or starred
version of the referencing command).

It may be that you only want to suppress \idxpl{hyperlink} for just the \idxpl{acronym}
(where the \idx{firstuse} explains the meaning of the \idx{acronym}) but not
for ordinary \idxpl{glossaryentry} (where the \idx{firstuse} is identical to
\idx{subsequentuse}). In this case, you can use \optval{hyperfirst}{false} and
apply \gls{glsunsetall} to all the regular (non-\idx{acronym})
\idxpl{glossary}.
For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optval{hyperfirst}{false}]\marg{glossaries}
\comment{\idx{acronym} and \idx{glossaryentry} definitions}
\codepar
\comment{at the end of the preamble}
\gls{glsunsetall}\oarg{\glostype{main}}
\end{codebox}

Alternatively you can redefine the hook
\cmddef{glslinkcheckfirsthyperhook}
which is used by the commands that check the \idx{firstuseflag}, such
as \gls{gls}. Within the definition of this command, you can use
\gls{glslabel} to reference the \idx{entry} label and \gls{glstype} to
reference the \idx{glossary} type. You can also use \gls{ifglsused}
to determine if the \idx{entry} has been used. You can test if an
\idx{entry} is an \idx{acronym} by checking if it has the \gloskey{long} key set using
\gls{ifglshaslong} (or if the \gloskey{short} key has been set using
\gls{ifglshasshort}). For example, to switch off the \idx+{hyperlink} on
\idx{firstuse} just for \idxpl{acronym}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkcheckfirsthyperhook}}\marg{\comment{}
 \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\comment{}
 \marg{\comment{}
   \gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}}{}\comment{}
 }\comment{}
}
\end{codebox}

Note that this hook isn't used by the commands that don't check the
\idx{firstuseflag}, such as \gls{glstext}. (You can, instead, redefine
\gls{glslinkpostsetkeys}, which is used by both the \gls{glslike} and
\gls{glstextlike} commands.)

\begin{xtr}
The \sty{glossaries-extra} package provides a method of disabling
the \idx{firstuse} \idx+{hyperlink} according to the \idx{entry}['s] associated
\gloskey{category}. For example, if you only want to switch off the \idx{firstuse}
hyperlink for \idxpl{abbreviation} then you simply need to set
the \catattr{nohyperfirst} \idxc{categoryattribute}{attribute} for the \cat{abbreviation}
and, if appropriate, \cat{acronym} categories. (Instead of using the
\opt{hyperfirst} package option.) See the
\sty{glossaries-extra} manual for further details.
\end{xtr}

\optiondef{writeglslabels}
This option will create a file called
\code{\gls{jobname}.\ext{glslabels}} at the end of the document.
This file simply contains a list of all defined entry labels
(including those in any \idxpl{ignoredglossary}). It's provided for
the benefit of text editors that need to know labels for
\idx{auto-completion}. If you also want the name, use
\opt{writeglslabelnames}. (See also \sty{glossaries-extra}['s]
\optval{docdef}{atom} package option.)

\begin{bib2gls}
Note that with \app{bib2gls} the file will only contain the entries
that \app{bib2gls} has selected from the \ext{bib} files.
\end{bib2gls}

\optiondef{writeglslabelnames}
Similar to \opt{writeglslabels} but writes both
the label and name (separated by a tab).

\optiondef{undefaction}

Only available with \sty{glossaries-extra}, the value for this
option may be one of:

\optionvaldef{undefaction}{error}
Generates an error if a referenced entry is
undefined (default, and the only available setting with just
the base \sty{glossaries} package).

\optionvaldef{undefaction}{warn}
Only warns if a referenced entry is undefined (automatically
activated with \option{b2g}).

\optiondef{docdef}

Only available with \sty{glossaries-extra}, this
option governs the use of \gls{newglossaryentry}. Available
values:

\optionvaldef{docdef}{false}
This setting means that \gls{newglossaryentry} is not permitted in
the \env{document} environment (default with \sty{glossaries-extra}
and for \option{noidx} with just the base \sty{glossaries} package).

\optionvaldef{docdef}{restricted}
This setting means that \gls{newglossaryentry} is only permitted in
the \env{document} environment if it occurs before
\gls{printglossary} (not available for some indexing options, such
as \options{b2g}).

\optionvaldef{docdef}{atom}
This setting is as \opteqvalref{docdef}{restricted} but creates the
\ext+{glsdefs} file for use by \app{atom} (without the
limitations of \opteqvalref{docdef}{true}).

\optionvaldef{docdef}{true}
This setting means that \gls{newglossaryentry} is permitted in the
\env{document} environment where it would normally be permitted by
the base \sty{glossaries} package. This will create the
\ext+{glsdefs} file if \gls{newglossaryentry} is found in the
\env{document} environment.

\section{Sectioning, Headings and TOC Options}
\label{sec:pkgopts-sec}

\optiondef{toc}
Adds the \idxpl{glossary} to the \idx+{tableofcontents} (\ext+{toc} file).
Note that an extra \LaTeX\ run is required with this option.
Alternatively, you can switch this function on and off using
\cmddef{glstoctrue}
and
\cmddef{glstocfalse}
You can test whether or not this option is set using:
\cmddef{ifglstoc}
The default value is \optval{toc}{false} for the base
\sty{glossaries} package and \optval{toc}{true} for
\sty{glossaries-extra}.
This option has no effect if \opt{numberedsection} has been used to switch to
a numbered (unstarred) sectioning command.

\begin{information}
This option simply governs whether or not \gls{glossarysection}
should use \gls{addcontentsline} after the applicable starred section
command. The document class you are using may have its own behaviour
for starred sections, such as adding the title to the PDF bookmarks.
\end{information}

\optiondef{numberline}
When used with \optval{toc}{true} option, this will add
\code{\gls{numberline}\marg{}} in the final argument of
\gls{addcontentsline}. This will align the \idx{tableofcontents}
entry with the numbered section titles. Note that this option has no
effect with \optval{toc}{false}. If \optval{toc}{true} is used
without \opt{numberline}, the \idx{glossary} title will be aligned
with the section numbers rather than the section titles.

\optiondef{section} 

This option indicates the sectional unit to use for the \idx{glossary}.
The value \meta{name} should be the control sequence \emph{name} without the
leading backslash or following star (for example, just \code{chapter}
not \gls{chapter} or \code{chapter*}). As from version 4.9, the
value may also be \optfmt{none}, which means the glossary heading
should be omitted.

The default behaviour is for the glossary heading to use
\gls{chapter}, if that command exists, or \gls{section} otherwise. The
starred or unstarred form is determined by the \opt{numberedsection} option.

Example:
\begin{codebox}
\cmd{usepackage}\oarg{\optval{section}{subsection}}\marg{glossaries}
\end{codebox}
You can omit the value if you want to use \gls{section}:
\begin{codebox}
\cmd{usepackage}[\opt{section}]\marg{glossaries}
\end{codebox}
is equivalent to
\begin{codebox}
\cmd{usepackage}[\optval{section}{section}]\marg{glossaries}
\end{codebox}
You can change this value later in the document using:
\cmddef{setglossarysection}
where \meta{name} is the sectional unit or (v4.9+) \optfmt{none}
if no sectional unit is required.

The start of each \idx{glossary} adds information to the page header via
\gls{glsglossarymark} (see \sectionref{sec:glossmarkup}).

\optiondef{ucmark}
If \optval{ucmark}{true}, this will make \gls{glsglossarymark} use
\idx+{allcaps} in the header, otherwise no \idx{casechange} will be
applied.
The default is
\optval{ucmark}{false}, unless \cls{memoir} has been loaded, in
which case the default is \optval{ucmark}{true}.

You can test if this option has been set using:
\cmddef{ifglsucmark}
For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsglossarymark}}[1]\marg{\comment{}
  \gls{ifglsucmark}
    \gls{markright}\marg{\gls{glsuppercase}\marg{\#1}}\comment{}
  \cmd{else}
    \gls{markright}\marg{\#1}\comment{}
  \cmd{fi}}
\end{codebox}

\optiondef{numberedsection}
The \idxpl{glossary} are placed in unnumbered sectional units by default,
but this can be changed using \opt{numberedsection}. This option can take
one of the following values:

\optionvaldef{numberedsection}{false}
No number, that is, use the starred form
of sectioning command (for example, \starredcs{chapter} or
\starredcs{section}).

\optionvaldef{numberedsection}{nolabel}
Use a numbered section, that is, the unstarred form of sectioning
command (for example, \gls{chapter} or \gls{section}), but 
no label is automatically added.

\optionvaldef{numberedsection}{autolabel}
Use numbered sections with automatic
labelling. Each \idx{glossary} uses the unstarred form of a sectioning
command (for example, \gls{chapter} or \gls{section}) and is assigned a label
(via \gls{label}). The label is formed from the \idx{glossary}['s]
label prefixed with:
\cmddef{glsautoprefix}
The default value of \gls{glsautoprefix} is empty.  For example, 
if you load \sty{glossaries} using:
\begin{codebox}
\cmd{usepackage}[\opt{section},\optval{numberedsection}{autolabel}]
  \marg{glossaries}
\end{codebox}
then each \idx{glossary} will appear in a numbered section, and can
be referenced using something like:
\begin{codebox}
The main glossary is in section\sym{nbsp}\gls{ref}\marg{main} and 
the list of acronyms is in section\sym{nbsp}\gls{ref}\marg{acronym}.
\end{codebox}
If you can't decide whether to have the acronyms in the main
glossary or a separate list of acronyms, you can use
\gls{acronymtype} which is set to \glostype{main} if the
\opt{acronym} option is not used and is set to \glostype{acronym}
if the \opt{acronym} option is used. For example:
\begin{codebox}
The list of acronyms is in section\sym{nbsp}\gls{ref}\marg{\gls{acronymtype}}.
\end{codebox}
You can redefine the prefix if the default label clashes with
another label in your document.
For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsautoprefix}}\marg{glo:}
\end{codebox}
will add \code{glo:} to the automatically generated label, so
you can then, for example, refer to the list of acronyms as follows:
\begin{codebox}
The list of acronyms is in 
section\sym{nbsp}\gls{ref}\marg{glo:\gls{acronymtype}}.
\end{codebox}
Or, if you are undecided on a prefix:
\begin{codebox}
The list of acronyms is in 
section\sym{nbsp}\gls{ref}\marg{\gls{glsautoprefix}\gls{acronymtype}}.
\end{codebox}

\optionvaldef{numberedsection}{nameref}
This setting is like
\optval{numberedsection}{autolabel} but uses an unnumbered
sectioning command (for example, \starredcs{chapter} or \starredcs{section}). It's
designed for use with the \sty{nameref} package. For example:
\begin{codebox}
\cmd{usepackage}\marg{nameref}
\cmd{usepackage}[\optval{numberedsection}{nameref}]\marg{glossaries}
\end{codebox}
Alternatively, since \sty{nameref} is automatically loaded by
\sty{hyperref}:
\begin{codebox}
\cmd{usepackage}\marg{hyperref}
\cmd{usepackage}[\optval{numberedsection}{nameref}]\marg{glossaries}
\end{codebox}
Now \code{\gls{nameref}\marg{main}} will display the
(\idx{tableofcontents}) section title
associated with the \glostype{main} glossary. As above, you can
redefine \gls{glsautoprefix} to provide a prefix for the label.

\section{Glossary Appearance Options}
\label{sec:pkgopts-printglos}

\optiondef{savenumberlist}
This is a boolean option that specifies whether or not to gather and
store the \idx{numberlist} for each entry. The default is
\optval{savenumberlist}{false} with \options{mkidx,xdy}. (See
\gls{glsentrynumberlist} and \gls{glsdisplaynumberlist} in
\sectionref{sec:glsnolink}.) This setting is always true if you use
\option{noidx} as a by-product of the way that \idx{indexing} method works.

\begin{bib2gls}
If you use the \opt{record} option (with either no value or
\optval{record}{only} or \optval{record}{nameref}) then this
package option has no effect. With \app{bib2gls}, the
\idxpl{numberlist} are automatically saved with the default
\resourceoptval{save-locations}{true} and
\resourceoptval{save-loclist}{true} resource settings.
\end{bib2gls}

\optiondef{entrycounter}
If set, this will create the counter:
\ctrdef{glossaryentry}
Each \toplevel\ entry will increment and display that counter
at the start of the \idx{entryline} when using
\idxpl{glossarystyle} that support this setting.
Note that if you also use \opt{subentrycounter} the option order
makes a difference. If \opt{entrycounter} is specified first, 
the sub-entry counter will be dependent on the \ctr{glossaryentry}
counter.

If you use this option (and are using a \idx{glossarystyle} that
supports this option) then you can reference the \idx{entry} number
within the document using:
\cmddef{glsrefentry}
where \meta{label} is the label associated with that glossary entry.
This will use \gls{ref} if either \optval{entrycounter}{true} or
\optval{subentrycounter}{true}, with the label \meta{prefix}\meta{label}, where
\meta{label} is the entry's label and \meta{prefix} is given by:
\cmddef{GlsEntryCounterLabelPrefix}
If both \optval{entrycounter}{false} and
\optval{subentrycounter}{false}, \code{\gls{gls}\margm{label}} will
be used instead.

\begin{important}
If you use \gls{glsrefentry}, you must run \LaTeX\ twice after
creating the \idxpl{indexingfile} using \app{makeglossaries},
\app{makeindex} or \app{xindy} (or after creating the \ext{glstex}
file with \app{bib2gls}) to ensure the cross-references are
up-to-date. This is because the counter can't be incremented and
labelled until the \idx{glossary} is typeset.
\end{important}

The \ctr{glossaryentry} counter can be reset back to zero with:
\cmddef{glsresetentrycounter}
This does nothing if \optval{entrycounter}{false}.
The \ctr{glossaryentry} counter can be simultaneously incremented and labelled (using
\gls{refstepcounter} and \gls{label}) with:
\cmddef{glsstepentry}
This command is within the definition of \gls{glsentryitem}, which is
typically used in \idxpl{glossarystyle} at the start of
\toplevel\ entries. The argument is the entry label.

The value of the \ctr{glossaryentry} counter can be displayed with:
\cmddef{theglossaryentry}
This command is defined when the \ctr{glossaryentry} counter is
defined, so won't be available otherwise. The formatted value is
more usually displayed with:
\cmddef{glsentrycounterlabel} 
This will do \code{\gls{theglossaryentry}.\gls{space}} if 
\optval{entrycounter}{true}, otherwise does nothing. This is
therefore more generally useful in \idxpl{glossarystyle} as it will
silently do nothing if the setting isn't on. This command is used
within the definition of \gls{glsentryitem}.

If you want to test whether or not this option is currently enabled,
use the conditional:
\cmddef{ifglsentrycounter}
You can later switch it off using:
\cmddef{glsentrycounterfalse}
and switch it back on with:
\cmddef{glsentrycountertrue}
but note that this won't define \ctr{glossaryentry} if
\optval{entrycounter}{true} wasn't used initially.
You can also locally enable or disable this option for a specific
\idx{glossary} using the \printglossopt{entrycounter}
\idx{printglossopt}.

\optiondef{counterwithin}
If used, this option will automatically set \opt{entrycounter}{true} and the
\ctr{glossaryentry} counter will be reset every time
\meta{parent-counter} is incremented. An empty value indicates that
\ctr{glossaryentry} has no parent counter (but \ctr{glossaryentry}
will still be defined).


\begin{important}
The \ctr{glossaryentry} counter isn't automatically reset at the
start of each glossary, except when glossary section numbering is on
and the counter used by \opt{counterwithin} is the same as the
counter used in the glossary's sectioning command.
\end{important}

If you want the counter reset at the start of each \idx{glossary}, you can
modify the \idxf{preamble/glossary} (\gls{glossarypreamble}) to use
\gls{glsresetentrycounter}. For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{\comment{}
  \gls{glsresetentrycounter}
}
\end{codebox}
or if you are using \gls{setglossarypreamble}, add it to each
\idxf{preamble/glossary}, as required. For example:
\begin{codebox}
\gls{setglossarypreamble}\oarg{\glostype{acronym}}\marg{\comment{}
  \gls{glsresetentrycounter}
  The preamble text here for the list of acronyms.
}
\gls{setglossarypreamble}\marg{\comment{}
  \gls{glsresetentrycounter}
  The preamble text here for the \glostype{main} glossary.
}
\end{codebox}

\optiondef{subentrycounter} 
If set, each \hierlevel{1} glossary \idx{entry} will be numbered at the
start of its \idx{entryline} when using \idxpl{glossarystyle}
that support this option. This option creates the counter
\ctrdef{glossarysubentry}
If the \opt{entrycounter} option is used before
\opt{subentrycounter}, then \ctr{glossarysubentry} will be added to
the reset list for \ctr{glossaryentry}. If \opt{subentrycounter} is
used without \opt{entrycounter} then the \ctr{glossarysubentry}
counter will be reset by \gls{glsentryitem}.  If
\opt{subentrycounter} is used before \opt{entrycounter} then the two
counters are independent.

\begin{information}
There's no support for deeper \idxpl{hierarchicallevel}. Some
styles, such as those that don't support any hierarchy,
may not support this setting or, for those that only support level~0
and level~1, may use this setting for all child entries.
\end{information}

As with the \opt{entrycounter} option, you can
reference the number within the document using
\gls{glsrefentry}. There are analogous commands to those for
\opt{entrycounter}.

The \ctr{glossarysubentry} counter can be reset back to zero with:
\cmddef{glsresetsubentrycounter}
This does nothing if \optval{subentrycounter}{false}.
This command is used within the definition of \gls{glsentryitem} if
\optval{entrycounter}{false}.

The \ctr{glossarysubentry} counter can be simultaneously incremented and labelled (using
\gls{refstepcounter} and \gls{label}) with:
\cmddef{glsstepsubentry}
This command is used in \gls{glssubentryitem} if
\optval{subentrycounter}{true}, otherwise it does nothing.  The
argument is the entry label and is passed to \gls{label} is as for
\gls{glsrefentry}.

The value of the \ctr{glossarysubentry} counter can be displayed with:
\cmddef{theglossarysubentry}
This command is defined when the \ctr{glossarysubentry} counter is
defined, so won't be available otherwise. The formatted value is
more usually displayed with:
\cmddef{glssubentrycounterlabel} 
This will do \code{\gls{theglossarysubentry})\gls{space}} if 
\optval{subentrycounter}{true}, otherwise does nothing. This is
therefore more generally useful in \idxpl{glossarystyle} as it will
silently do nothing if the setting isn't on. This command is used in 
\gls{glssubentryitem}.

If you want to test whether or not this option is currently enabled,
use the conditional:
\cmddef{ifglssubentrycounter}
You can later switch it off using:
\cmddef{glssubentrycounterfalse}
and switch it back on with:
\cmddef{glssubentrycountertrue}
but note that this won't define \ctr{glossarysubentry} if
\optval{subentrycounter}{true} wasn't used initially.
You can also locally enable or disable this option for a specific
\idx{glossary} using the \printglossopt{subentrycounter}
\idx{printglossopt}.

\optiondef{style}
This option sets the default \idx+{glossarystyle} to
\meta{style-name}. This is initialised to
\optval{style}{\glostyle{list}} unless \sty{classicthesis}
has been loaded, in which case the default is
\optval{style}{\glostyle{index}}. (The styles that use the
\env{description} environment, such as the \glostyle{list} style, are incompatible
with \sty{classicthesis}.)

This setting may only be used for styles that are defined when the
\sty{glossaries} package is loaded. This will usually be the styles
in the packages \sty{glossary-list}, \sty{glossary-long},
\sty{glossary-super} or \sty{glossary-tree}, unless they have been
suppressed through options such as \opt{nostyles}. Style packages
can also be loaded by the \opt{stylemods} option provided by
\sty{glossaries-extra}.

Alternatively, you can set the style later using:
\cmddef{setglossarystyle}
or use the \printglossopt{style} \idx{printglossopt}.
(See \sectionref{sec:styles} for further details.)

\optiondef{style-options}
The newer predefined \idxpl{glossarystyle}, such as \glostyle{tree*} and
\glostyle{mcoltree*}, can be adjusted using \keyval\ options.
This is different from the older styles that are mostly modified by
redefining commands provided with the style. The  
\opt{style-options} value should be a \keyval\ list where each key
is the style name. Unsupported styles will trigger an error.
For example:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{group-headings},
      \treestaroptval{pre-location}{\cmd{dotfill}}
    },
    \glostyleoptvalm{mcoltree*}{
      \mcoltreestaropt{balance},
      \mcoltreestaroptvalm{columns}{3}
    }
  }
}
\end{codebox}
See \sectionref{sec:tree*style} for the \glostyleopt{tree*} options
and \sectionref{sec:mcolstyles} for the \glostyleopt{mcoltree*} options.

\begin{important}
The style options will only be available once the applicable style package has
been loaded.
\end{important}

\optiondef{nolong}
This prevents the \sty{glossaries} package
from automatically loading \sty{glossary-long} (which means that
the \sty{longtable} package also won't be loaded). This reduces
overhead by not defining unwanted styles and commands. Note that if
you use this option, you won't be able to use any of the
\idxpl{glossarystyle} defined in the \sty{glossary-long} package (unless
you explicitly load \sty{glossary-long}).

\begin{information}
Some style packages implicitly load \sty{glossary-long}, so this
package may still end up being loaded even if you use \opt{nolong}.
\end{information}

\optiondef{nosuper}
This prevents the \sty{glossaries} package
from automatically loading \sty{glossary-super} (which means that
the \sty{supertabular} package also won't be loaded). This reduces
overhead by not defining unwanted styles and commands. Note that if
you use this option, you won't be able to use any of the
\idxpl{glossarystyle} defined in the \sty{glossary-super} package
(unless you explicitly load \sty{glossary-super}).

\begin{information}
This option is automatically implemented if \sty{xtab} has been
loaded as it's incompatible with \sty{supertabular}. This option is
also automatically implemented if \sty{supertabular} isn't installed.
\end{information}

\optiondef{nolist}
This prevents the \sty{glossaries} package
from automatically loading \sty{glossary-list}. This reduces
overhead by not defining unwanted styles. Note that if
you use this option, you won't be able to use any of the
\idxpl{glossarystyle} defined in the \sty{glossary-list} package
(unless you explicitly load \sty{glossary-list}).
Note that since the default style is \glostyle{list} (unless
\sty{classicthesis} has been loaded), you will 
also need to use the \opt{style} option to set the style to
something else.

\optiondef{notree}
This prevents the \sty{glossaries} package
from automatically loading \sty{glossary-tree}. This reduces
overhead by not defining unwanted styles. Note that if
you use this option, you won't be able to use any of the
\idxpl{glossarystyle} defined in the \sty{glossary-tree} package
(unless you explicitly load \sty{glossary-tree}). Note that if
\sty{classicthesis} has been loaded, the default style is
\glostyle{index}, which is provided by \sty{glossary-tree}.

\begin{information}
Some style packages implicitly load \sty{glossary-tree}, so this
package may still end up being loaded even if you use \opt{notree}.
\end{information}

\optiondef{nostyles}
This prevents all the predefined styles
from being loaded. If you use this option, you need to load a
\idx{glossarystyle} package (such as \sty{glossary-mcols}). Also if you
use this option, you can't use the \opt{style} package option
(unless you use \opt{stylemods} with \sty{glossaries-extra}).
Instead you must either use \gls{setglossarystyle} or the
\printglossopt{style} \idx{printglossopt}. Example:
\begin{codebox}
\cmd{usepackage}[\opt{nostyles}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-mcols}
\gls{setglossarystyle}\marg{\glostyle{mcoltree}}
\end{codebox}
Alternatively:
\begin{codebox}
\cmd{usepackage}[\opt{nostyles},\optval{stylemods}{mcols},\optval{style}{\glostyle{mcoltree}}]\marg{glossaries-extra}
\end{codebox}

\optiondef{nonumberlist}
This option will suppress the associated \idxpl{numberlist} in the
\idxpl{glossary} (see also \sectionref{sec:numberlists}).
This option can also be locally switched on or off for a specific
\idx{glossary} with the \printglossopt{nonumberlist}
\idxpl{printglossopt}.

\begin{warning}
Note that if you use \optionsor{mkidx,xdy} (\app{makeindex} or \app{xindy})
then the \locations\ must still be valid even if this
setting is on. This package option merely
prevents the \idx{numberlist} from being displayed, but both
\app{makeindex} and \app{xindy} still require a \location\ or
cross-reference for each term that's \indexed.
\end{warning}

Remember that \idx{numberlist} includes any cross-references, so
suppressing the \idx{numberlist} will also hide the cross-references
(in which case, you may want to use \opt{seeautonumberlist}).

\begin{bib2gls}
With \app{bib2gls}, it's more efficient to use
\resourceoptval{save-locations}{false} in the resource options if no
\locations\ are required.
\end{bib2gls}

\optiondef{seeautonumberlist}
If you suppress the
\idxpl{numberlist} with \opt{nonumberlist}, described above, this
will also suppress any cross-referencing information supplied by the
\gloskey{see} key in \gls{newglossaryentry} or \gls{glssee}. If you
use \opt{seeautonumberlist}, the \gloskey{see} key will
automatically implement \optval{nonumberlist}{false} for that entry.
(Note this doesn't affect \gls{glssee}.) For further details see
\sectionref{sec:crossref}.

\optiondef{counter}
This setting indicates that \meta{counter-name} should be the
default counter to use in the \idxpl{numberlist} (see
\sectionref{sec:numberlists}). This option can be overridden for a
specific \idx{glossary} by the \meta{counter} optional argument of
\gls{newglossary} or the \gloskey{counter} key when defining an
entry or by the \glsopt{counter} option when referencing an entry.

This option will redefine:
\cmddef{glscounter}
to \meta{counter-name}.

\optiondef{nopostdot}
If true, this option suppresses the default terminating
\idx{fullstop} in \idxpl{glossarystyle} that use the
post-description hook \gls{glspostdescription}.

The default setting is \optval{nopostdot}{false} for the base
\sty{glossaries} package and \optval{nopostdot}{true} for
\sty{glossaries-extra}.

\begin{xtr}
The \sty{glossaries-extra} package provides \opt{postdot}, which
is equivalent to \optval{nopostdot}{false}, and also
\opt{postpunc}, which allows you to choose a different
punctuation character.
\end{xtr}

\optiondef{nogroupskip}
If true, this option suppresses the default vertical gap between 
letter groups used by some of the predefined \idxpl{glossarystyle}. 
This option can also be locally switched on or off for a specific
\idx{glossary} with the \printglossopt{nogroupskip}
\idxpl{printglossopt}.

This option is only relevant for \idxpl{glossarystyle} that use the
conditional:
\cmddef{ifglsnogroupskip}
to test for this setting.

\begin{bib2gls}
If you are using \app{bib2gls} without the \switch{group} (or
\bibglsopt{g}) switch then this option is irrelevant as 
there won't be any letter groups.
\end{bib2gls}

\optiondef{stylemods}

Loads the \sty{glossaries-extra-stylemods} package, which patches the
predefined \idxpl{glossarystyle}. The \meta{list} argument is optional. If present,
this will also load \styfmt{glossary-\meta{element}.sty} for each
\meta{element} in the comma-separated \meta{list}. See the
\sty{glossaries-extra} manual for further details.

\section{Indexing Options}
\label{sec:pkgopts-indexing}

\glsstartrange{indexing}%
\optiondef{seenoindex}
(This option is only relevant with \app{makeindex} and \app{xindy}.)
The \gloskey{see} key automatically \idxc{indexing}{indexes} the
cross-referenced entry using \gls{glssee}. This means that if this
key is used in an entry definition before the relevant
\idx{indexingfile} has been opened, the \idx{indexing} can't be performed.
Since this is easy to miss, the \sty{glossaries} package by
default issues an error message if the \gloskey{see} key is used
before \gls{makeglossaries}. 

This option may take one of the following values:
\optionvaldef{seenoindex}{error}
This is the default setting that issues an error message.

\optionvaldef{seenoindex}{warn}
This setting will trigger a warning rather than an error.

\optionvaldef{seenoindex}{ignore}
This setting will do nothing. 

For example, if you want to temporarily comment out
\gls{makeglossaries} to speed up the compilation of a draft document
by omitting the \idx{indexing}, you can use
\optval{seenoindex}{warn} or \optval{seenoindex}{ignore}.

\optiondef{esclocations}

Only applicable to \app{makeindex} and \app{xindy}.
As from v4.50, the initial setting is now
\optval{esclocations}{false}. Previously it was
\optval{esclocations}{true}.

Both \app{makeindex} and \app{xindy} are fussy about the \location\
syntax (\app{makeindex} more so than \app{xindy}) so, if
\optval{esclocations}{true}, the \sty{glossaries} package will try
to ensure that special characters are escaped, which allows for the
\location\ to be substituted for a format that's more acceptable to
the \idx{indexingapp}. This requires a bit of trickery to circumvent
the problem posed by \TeX's asynchronous output routine, which can
go wrong and also adds to the complexity of the document build.

If you're sure that your locations will always expand to an
acceptable format (or you're prepared to post-process the \idx{glossary}
file before passing it to the relevant indexing application) then
use \optval{esclocations}{false} to avoid the complex escaping of
location values. This is now the default. 

If, however, your \locations\ (for example, \gls{thepage} with the
default \optval{counter}{\ctr{page}}) expand to a robust command
then you may need to use \optval{esclocations}{true}. You may
additionally need to set the following conditional to true:
\cmddef{ifglswrallowprimitivemods}
which will locally redefine some primitives in order to escape
special characters without prematurely expanding \gls{thepage}.
Since this hack may cause some issues and isn't necessary for the
majority of documents, this is off by default.

This conditional can be switched on with:
\cmddef{glswrallowprimitivemodstrue}
but remember that it will have no effect with
\optval{esclocations}{false}.
If can be switched off with:
\cmddef{glswrallowprimitivemodsfalse}

If you are using \app{makeindex} and your \location\ expands to
content in the form \code{\meta{cs} \margm{num}}, where \meta{cs} is
a command (optionally preceded by \gls{protect}) and \meta{num} is a
location acceptable to \app{makeindex}, then you can use
\app{makeglossaries} to make a suitable adjustment without
\optval{esclocations}{true}. See \sectionref{sec:problemlocations}
for furthe details.

This isn't an issue for \optionsor{noidx,b2g} as the \locations\ are written to
the \ext{aux} file and both methods use \LaTeX\ syntax, so no conversion is required.

\optiondef{indexonlyfirst}
If true, this setting will only \idxc{indexing}{index} on \idx{firstuse}.
The default setting \optval{indexonlyfirst}{false}, 
will \idxc{indexing}{index} the entry every time one of the 
\gls{glslike} or \gls{glstextlike} commands are used. Note that \gls{glsadd}
will always add information to the external \idx{glossary}
file (since that's the purpose of that command).

You can test if this setting is on using the conditional:
\cmddef{ifglsindexonlyfirst}
This setting can also be switched on with:
\cmddef{glsindexonlyfirsttrue}
and off with:
\cmddef{glsindexonlyfirstfalse}

\begin{important}
Resetting the \idx{firstuseflag} with commands like
\gls{glsreset} after an entry has been \indexed\ will cause that entry to be 
indexed multiple times if it's used again after the reset.
Likewise unsetting the \idx{firstuseflag} before an entry has been
indexed will prevent it from being indexed (unless specifically
indexed with \gls{glsadd}).
\end{important}

You can customise the default behaviour by redefining
\cmddef{glswriteentry}
where \meta{label} is the entry's label and \meta{indexing code} is the
code that writes the entry's information to the external file.
The default definition of \gls{glswriteentry} is:
\begin{compactcodebox}
\cmd{newcommand}*\marg{\gls{glswriteentry}}[2]\marg{\comment{}
  \gls{ifglsindexonlyfirst}
    \gls{ifglsused}\marg{\#1}\marg{}\marg{\#2}\comment{}
  \cmd{else}
    \#2\comment{}
  \cmd{fi}
}
\end{compactcodebox}
This does \meta{indexing code} unless
\optval{indexonlyfirst}{true} and the entry identified by
\meta{label} has been marked as \glslink{firstuseflag}{used}

For example, suppose you only want to index the \idx{firstuse} for
entries in the \glostype{acronym} glossary and not in the
\glostype{main} (or any other) \idx{glossary}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glswriteentry}}[2]\marg{\comment{}
 \cmd{ifthenelse}{\cmd{equal}\marg{\gls{glsentrytype}\marg{\#1}}\marg{acronym}}
 \marg{\gls{ifglsused}\marg{\#1}\marg{}\marg{\#2}}\comment{}
 \marg{\#2}\comment{}
}
\end{codebox}
Here I've used \csfmt{ifthenelse} to ensure the arguments of
\csfmt{equal} are fully expanded before the comparison is made.
There are other methods of performing an expanded string comparison,
which you may prefer to use.

With the \sty{glossaries-extra} package it's possible to only index
\idx{firstuse} for particular categories. For example, if you only
want this enabled for \idxpl{abbreviation} then you can set
the \catattr{indexonlyfirst} \idxc{categoryattribute}{attribute} 
for the \cat{abbreviation}
and, if appropriate, \cat{acronym} categories. (Instead of using the
\opt{indexonlyfirst} package option.) See the
\sty{glossaries-extra} manual for further details.

\optiondef{indexcrossrefs}

This option is only available with \sty{glossaries-extra}.
If true, this will automatically index (\gls{glsadd}) any
cross-referenced entries that haven't been marked as used at the end
of the document. Note that this increases the document build time. See
\sty{glossaries-extra} manual for further details.

\begin{bib2gls}
Note that \app{bib2gls} can automatically find dependent entries
when it parses the \ext{bib} file. Use the \resourceopt{selection} option 
to determine the selection of dependencies.
\end{bib2gls}

\optiondef{autoseeindex}

This option is only available with \sty{glossaries-extra}.
The base \sty{glossaries} package always implements
\optval{autoseeindex}{true}.

If true, this makes the \gloskey{see} and
\gloskey{seealso} keys automatically index the entry
(with \gls{glssee}) when the entry is defined. This means that any
entry with the \gloskey{see} (or \gloskey{seealso}) key will
automatically be added to the \idx{glossary}. See the
\sty{glossaries-extra} manual for further details.

\begin{bib2gls}
With \app{bib2gls}, use the \resourceopt{selection} resource option 
to determine the selection of dependencies.
\end{bib2gls}

\optiondef{record}

This option is only available with \sty{glossaries-extra}.
See \sty{glossaries-extra} manual for further details. A brief
summary of available values:

\optionvaldef{record}{off} 
This default setting indicates that \app{bib2gls} isn't being used.

\optionvaldef{record}{only}
This setting indicates that \app{bib2gls} is being used to fetch entries
from one or more \ext{bib} files, to sort the entries and collate the
\idxpl{numberlist}, where the \location\ information is the same as
for \options{noidx,mkidx,xdy}.

\optionvaldef{record}{nameref}
This setting is like \optval{record}{only} but provides extra
information that allows the associated title to be used instead of
the location number and provides better support for hyperlinked
locations.

\optionvaldef{record}{hybrid}
This setting indicates a hybrid approach where \app{bib2gls}
is used to fetch entries from one or more \ext{bib} files but
\app{makeindex} or \app{xindy} are used for the \idx{indexing}. This
requires a more complicated document build and isn't recommended.

\optiondef{equations}

This option is only available with \sty{glossaries-extra}.
If true, this option will cause the default 
\idx{locationcounter} to automatically switch to \ctr{equation} when inside a
numbered equation environment.

\optiondef{floats}

This option is only available with \sty{glossaries-extra}.
If true, this option will cause the default \idx{locationcounter} 
to automatically switch to the corresponding counter when inside a
float. (Remember that with floats it's the \gls{caption} command that
increments the counter so the location will be incorrect if an entry
is \indexed\ within the float before the caption.)

\optiondef{indexcounter}

This option is only available with \sty{glossaries-extra}.
This valueless option is primarily intended for use with
\app{bib2gls} and \sty{hyperref} allowing the page location
\idx{hyperlink} target to be set to the relevant point within the page
(rather than the top of the page). Unexpected results will occur
with other indexing methods. See \sty{glossaries-extra} manual for
further details.
\glsendrange{indexing}%

\section{Sorting Options}
\label{sec:pkgopts-sort}

This section is mostly for \options{mkidx,xdy}. Only the \opt{sort} and
\opt{order} options are applicable for \option{noidx}.

\begin{xtr}
With \options{b2g,unsrt,standalone}, only \optval{sort}{none} is applicable 
(and this is automatically implemented by \opteqvalref{record}{only} and
\opteqvalref{record}{nameref}). With \app{bib2gls}, the sort method 
is provided in the optional argument of \gls{GlsXtrLoadResources} 
not with the \opt{sort} package option. There's no sorting
with \options{unsrt,standalone}.
\end{xtr}

\optiondef{sanitizesort}
This option determines whether or not to \idx{sanitize} the sort value when
writing to the external \idx{indexingfile}. For example, suppose you
define an entry as follows:
\begin{codebox*}
\gls{newglossaryentry}\marg{hash}\marg{\gloskeyval{name}{\gls{cs.hash}},\gloskeyval{sort}{\sym{hash}},
 \gloskeyval{description}{hash symbol}}
\end{codebox*}
The sort value (\sym{hash}) must be sanitized before writing it to the
\idx{indexingfile}, otherwise \LaTeX\ will try to interpret it as a
parameter reference. If, on the other hand, you want the sort value
expanded, you need to switch off the sanitization. For example,
suppose you do:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{mysortvalue}}\marg{AAA}
\gls{newglossaryentry}\marg{sample}\marg{\comment{}
  \gloskeyval{name}{sample},
  \gloskeyval{sort}{\cmd{mysortvalue}},
  \gloskeyval{description}{an example}}
\end{codebox}
and you actually want \csfmt{mysortvalue} expanded, so that the entry
is sorted according to \code{AAA}, then use the package option
\opt{sanitizesort}{false}.

The default for \options{mkidx,xdy} is \optval{sanitizesort}{true}, and the
default for \option{noidx} is \optval{sanitizesort}{false}.

\optiondef{preprocess-sort}
This option is designed for use with \option{noidx}. Regardless of
the value, this option will switch off sanitization of the sort
value but will also inhibit the initial field expansion for
\gloskey{sort} (unlike \optval{sanitizesort}{false}).

The next part only affects \option{noidx} with
\optval{sort}{standard}:
If true, the sort value will be processed using the
\sty{datatool-base} sort preprocessing function when the entry is
defined (default). If false, the sort value won't be processed until
just before the list is sorted.
The preprocessing function requires \sty{datatool} v3.0+ (ideally
v3.2+).

\begin{information}
If you switch off preprocessing before the entries are defined and
then switch it on after they have been defined, the value won't be
expanded when the localisation support is implemented (for word or
letter sort).
This may prevent the localisation support from working correctly.
\end{information}

\optiondef{sort}
If you use \optionsor{mkidx,xdy}, this package option is
the only way of specifying how to sort the glossaries. Only 
\option{noidx} allows you to specify sort methods for individual glossaries
via the \printglossopt{sort} key in the optional
argument of \gls{printnoidxglossary}. If you have multiple
\idxpl{glossary} in your document and you are using \option{noidx}, only use
the package options
\opteqvalref{sort}{def} or \opteqvalref{sort}{use} if you want to set this
sort method for \emph{all} your \idxpl{glossary}.

\optionvaldef{sort}{none}
This setting is only for documents that don't use
\gls{makeglossaries} (\optionsor{mkidx,xdy}) or
\gls{makenoidxglossaries} (\option{noidx}). It omits the code used
to sanitize or escape the sort value, since it's not required. This
can help to improve the document build speed, especially if there
are a large number of entries. This setting may be used if no
\idx{glossary} is required or if \gls{printunsrtglossary} is used
(\option{unsrt}). If you want an unsorted \idx{glossary} with
\app{bib2gls}, use the resource option \resourceoptval{sort}{none}
instead. This option will redefine \gls{glsindexingsetting} to
\code{none}.

\begin{information}
This option will still assign the \gloskey{sort} key to its default
value. It simply doesn't process it. If you want the \gloskey{sort}
key set to an empty value instead, use \opteqvalref{sort}{clear}
instead.
\end{information}

\optionvaldef{sort}{clear}
As \opteqvalref{sort}{none} but sets the \gloskey{sort} key to an
empty value. This will affect \idx{lettergroup} formations in
\gls{printunsrtglossary} with \option{unsrt}. See the
\sty{glossaries-extra} manual for further details. This option will
redefine \gls{glsindexingsetting} to \code{none}. The remaining
\opt{sort} options listed below don't change \gls{glsindexingsetting}.

\optionvaldef{sort}{def}
Entries are sorted in the order in
which they were defined. With \option{noidx}, this is implemented by
simply iterating over all defined entries so there's no actual
sorting. With \options{mkidx,xdy}, sorting is always performed
(since that's the purpose of \app{makeindex} and \app{xindy}). This
means that to obtain a list in order of definition, the
\gloskey{sort} key is assigned a numeric value that's incremented
whenever a new entry is defined.

\optionvaldef{sort}{use}
Entries are sorted according to the order in which they are used in
the document. With \option{noidx}, this order is obtained by
iterating over a list that's formed with the \ext{aux} file is input
at the start of the document. With \options{mkidx,xdy}, again the
\gloskey{sort} key is assigned a numeric value, but in this case the
value is incremented, and the \gloskey{sort} key is assigned, 
the first time an entry is \indexed.

Both \opteqvalref{sort}{def} and \opteqvalref{sort}{use} zero-pad the sort key to a
six digit number using:
\cmddef{glssortnumberfmt}
This can be redefined, if required, before the entries are defined (in the
case of \opteqvalref{sort}{def}) or before the entries are used
(in the case of \opteqvalref{sort}{use}).

Note that the \idx{group} styles (such as \glostyle{listgroup}) are
incompatible with the \opteqvalref{sort}{use} and \opteqvalref{sort}{def}
options.

\optionvaldef{sort}{standard}
Entries are sorted according to the value of the \gloskey{sort} key
used in \gls{newglossaryentry} (if present) or the \gloskey{name}
key (if \gloskey{sort} key is missing).

When the standard sort option is in use, you can hook into the sort mechanism by
redefining:
\cmddef{glsprestandardsort}
where \meta{sort cs} is a temporary control sequence that stores the
sort value (which was either explicitly set via the \gloskey{sort}
key or implicitly set via the \gloskey{name} key) before any escaping of the
\app{makeindex}\slash\app{xindy} special characters is performed.
By default \gls{glsprestandardsort} just does:
\cmddef{glsdosanitizesort}
which \idx{sanitize}[s] \meta{sort cs} if \optval{sanitizesort}{true} 
(or does nothing if \optval{sanitizesort}{false}).

The other arguments, \meta{type} and \meta{entry-label}, are the 
\idx{glossary} type and the entry label for the current entry. Note that
\meta{type} will always be a control sequence, but \meta{label} will
be in the form used in the first argument of \gls{newglossaryentry}.

\begin{important}
Redefining \gls{glsprestandardsort} won't affect any entries that 
have already been defined and will have no effect at all if you 
use another \opt{sort} setting.
\end{important}

\begin{example}{Mixing Alphabetical and Order of Definition Sorting}{ex:diffsorts}
Suppose I have three \idxpl{glossary}: \glostype{main},
\glostype{acronym} and \glostypefmt{notation}, and let's suppose
I want the \glostype{main} and \glostype{acronym} glossaries to be
sorted alphabetically, but the \glostypefmt{notation} type should be
sorted in order of definition. 

For \option{noidx}, the \printglossopt{sort} option can be
used in \gls{printnoidxglossary}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{word}}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\printglossoptval{sort}{word}}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{notation},\printglossoptval{sort}{def}}
\end{codebox}

For \optionsor{mkidx,xdy}, I can set \opteqvalref{sort}{standard}
(which is the default), and I can either define
all my \glostype{main} and \glostype{acronym} entries, then
redefine \gls{glsprestandardsort} to set \meta{sort cs} to
an incremented integer, and then define all my
\glostypefmt{notation} entries. Alternatively, I can redefine
\gls{glsprestandardsort} to check for the glossary type and only
modify \meta{sort cs} if \meta{type} is \glostypefmt{notation}.

The first method can be achieved as follows:
\begin{codebox}
\cmd{newcounter}\marg{sortcount}
\codepar
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
  \cmd{stepcounter}\marg{sortcount}\comment{}
  \cmd{edef}\#1\marg{\gls{glssortnumberfmt}\marg{\gls{arabic}\marg{sortcount}}}\comment{}
}
\end{codebox}
The second method can be achieved as follows:
\begin{codebox}
\cmd{newcounter}\marg{sortcount}
\codepar
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
  \cmd{ifdefstring}\marg{\#2}\marg{notation}\comment{}
  \marg{\comment{}
     \cmd{stepcounter}\marg{sortcount}\comment{}
     \cmd{edef}\#1\marg{\gls{glssortnumberfmt}\marg{\gls{arabic}\marg{sortcount}}}\comment{}
  }\comment{}
  \marg{\comment{}
     \gls{glsdosanitizesort}
  }\comment{}
}
\end{codebox}
(\csfmt{ifdefstring} is defined by the \sty{etoolbox} package, which
is automatically loaded by \sty{glossaries}.)
For a complete document, see the sample file \samplefile{Sort}.
\end{example}

\begin{example}{Customizing Standard Sort (Options
\glsfmttext{idx.opt.mkidx} or \glsfmttext{idx.opt.xdy})}{ex:customsort}
Suppose you want a \idx{glossary} of people and you want the names listed
as \meta{first-name} \meta{surname} in the glossary, but you want the names
sorted by \meta{surname}, \meta{first-name}. You can do this by
defining a command called, say,
\csfmt{name}\marg{first-name}\marg{surname} that you can use in the
\gloskey{name} key when you define the entry, but hook into the
standard sort mechanism to temporarily redefine \csfmt{name} while the
sort value is being set.

First, define two commands to set the person's name:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{sortname}}[2]\marg{\#2, \#1}
\cmd{newcommand}\marg{\cmd{textname}}[2]\marg{\#1 \#2}
\end{codebox}
and \csfmt{name} needs to be initialised to \csfmt{textname}:
\begin{codebox}
\cmd{let}\cmd{name}\cmd{textname}
\end{codebox}
Now redefine \gls{glsprestandardsort} so that it temporarily sets
\csfmt{name} to \csfmt{sortname} and expands the sort value, then sets
\csfmt{name} to \csfmt{textname} so that the person's name appears as
\meta{first-name} \meta{surname} in the text:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
 \cmd{let}\cmd{name}\cmd{sortname}
 \cmd{edef}\#1\marg{\cmd{expandafter}\cmd{expandonce}\cmd{expandafter}\marg{\#1}}\comment{}
 \cmd{let}\cmd{name}\cmd{textname}
 \gls{glsdosanitizesort}
}
\end{codebox}
(The somewhat complicate use of \csfmt{expandafter} etc helps to
protect fragile commands, but care is still needed.)

Now the entries can be defined:
\begin{codebox}
\gls{newglossaryentry}\marg{joebloggs}{\gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}},
  \gloskeyval{description}{some information about Joe Bloggs}}
\codepar
\gls{newglossaryentry}\marg{johnsmith}\marg{\gloskeyval{name}{\cmd{name}\marg{John}\marg{Smith}},
  \gloskeyval{description}{some information about John Smith}}
\end{codebox}
For a complete document, see the sample file \samplefile{People}.
\end{example}

\optiondef{order} 
This may take two values: 

\optionvaldef{order}{word}
Word order (\qt{sea lion} before \qt{seal}).

\optionvaldef{order}{letter}
Letter order (\qt{seal} before \qt{sea lion}).

\begin{important}
Note that with \options{mkidx,xdy}, the \opt{order} option has 
no effect if you explicitly call \app{makeindex} or \app{xindy}.
\end{important}

If you use \option{noidx}, this setting will be used if you use 
\printglossoptval{sort}{standard} in 
the optional argument of \gls{printnoidxglossary}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{standard}}
\end{codebox}
Alternatively, you can specify the order for individual
\idxpl{glossary}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{sort}{word}}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\printglossoptval{sort}{letter}}
\end{codebox}

\begin{bib2gls}
With \app{bib2gls}, use the \resourceopt{break-at} option
in \gls{GlsXtrLoadResources} instead of \opt{order}.
\end{bib2gls}

\optiondef{makeindex}
The \idx{glossary} information and \idx{indexing} style file will be
written in \app{makeindex} format. If you use \app{makeglossaries}
or \app{makeglossaries-lite}, it will automatically detect that it
needs to call \app{makeindex}. If you don't use
\app{makeglossaries}, you need to remember to use \app{makeindex}
not \app{xindy}. The indexing style file will been given a~\ext{ist}
extension.

You may omit this package option if you are using \option{mkidx} as this is the
default. It's available in case you need to override the effect of an earlier
occurrence of \opt{xindy} in the package option list.

\optiondef{xindy} 
The \idx{glossary} information and \idx{indexing} style
file will be written in \app{xindy} format. If you use
\app{makeglossaries}, it will automatically detect that it needs to
call \app{xindy}. If you don't use \app{makeglossaries}, you need to
remember to use \app{xindy} not \app{makeindex}. The indexing style
file will been given a \ext{xdy} extension.

This package option may additionally have a value that is a \keyval\
comma-separated list to override some default options.  Note that
these options are irrelevant if you explicitly call \app{xindy}.
See \sectionref{sec:xindy} for further details on using \app{xindy}
with the \sty{glossaries} package.

You can test if this option has been set using the conditional:
\cmddef{ifglsxindy}
Note that this conditional should not be changed after
\gls{makeglossaries} otherwise the syntax in the \idx{glossary}
files will be incorrect. If this conditional is false, it means that
any option other than \option{xdy} is in effect. (If you need to
know which indexing option is in effect, check the definition of
\gls{glsindexingsetting} instead.)

The \meta{options} value may be omitted. If set, it should be a
\keyval\ list, where the following three options may be used:

\optiondef*{xindy.language}
The language module to use, which is passed to \app{xindy} with the
\xdyopt{L} switch. The default is obtained from \gls{languagename}
but note that this may not be correct as \app{xindy} has a different
labelling system to \sty{babel} and \sty{polyglossia}. 

The \app{makeglossaries} script has a set of mappings of known
\sty{babel} language names to \app{xindy} language names, but new
\sty{babel} dialect names may not be included. The
\app{makeglossaries-lite} script doesn't have this feature (but
there's no benefit in use \app{makeglossaries-lite} instead of
\app{makeglossaries} when using \app{xindy}). The \optval{automake}
option that calls \app{xindy} explicitly also doesn't use any
mapping.

However, even if the appropriate mapping is available,
\gls{languagename} may still not expand to the language required for
the \idx{glossary}.  In which case, you need to specify the correct
\app{xindy} language. For example:
\begin{codebox}
\cmd{usepackage}[brazilian,english]\marg{babel}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{language}{portuguese}}]\marg{glossaries}
\end{codebox}
If you have multiple \idxpl{glossary} in different languages, use
\gls{GlsSetXdyLanguage} to set the language for each glossary.

\optiondef*{xindy.codepage}
The \idx{codepage} is the file \idx{encoding} for the \app{xindy} files and is
passed to \app{xindy} with the \xdyopt{C} switch. The default
\idx{codepage} is obtained from \gls{inputencodingname}. As from v4.50, if
\gls{inputencodingname} isn't defined, \idx{utf8} is assumed (which is
identified by the label \code{utf8}). If this is incorrect, you will
need to use the \opt{xindy.codepage} option but make sure you
use the \app{xindy} \idx{codepage} label (for example, \code{cp1252} or
\code{latin9}). See the \app{xindy} documentation for further
details.

\begin{important}
The \idx{codepage} may not simply be the \idx{encoding} but may
include a sorting rule, such as \code{ij-as-y-utf8} or
\code{din5007-utf8}. See \sectionref{sec:langenc}.
\end{important}

For example:
\begin{codebox}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{language}{english},\styoptxdyval{codepage}{cp1252}}]
  \marg{glossaries}
\end{codebox}

\optiondef*{xindy.glsnumbers}
If true, this option will define the number \idx{group} in the \app{xindy}
style file, which by default will be placed before the \qt{A} 
\idx{lettergroup}. If you don't want this \idx{lettergroup}, set this option to
false. Note that the \qt{A} \idx{lettergroup} is only available with
\idxpl{latinalph}, so if you are using a \idx{nonlatinalph}, you
will either need to switch off the number \idx{group} or identify the
\idx{lettergroup} that it should come before with
\gls{GlsSetXdyNumberGroupOrder}.

\optiondef{xindygloss}
This is equivalent to \opt{xindy} without any value supplied
and may be used as a document class option. The language
and code page can be set via \gls{GlsSetXdyLanguage} and
\gls{GlsSetXdyCodePage} if the defaults are inappropriate 
(see \sectionref{sec:langenc}.)

\optiondef{xindynoglsnumbers}
This is equivalent to
\optvalm{xindy}{\styoptxdyval{glsnumbers}{false}}
and may be used as a document class option.

\optiondef{automake} 
This option will attempt to use the \idx{shellescape} to run the
appropriate \idx{indexingapp}. You will still need to run \LaTeX\
twice. For example, if the document in the file \filefmt{myDoc.tex}
contains:
\begin{codebox}
\cmd{usepackage}[\opt{automake}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{an example}}
\cbeg{document}
\gls{gls}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
Then the document build is now:
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
\end{terminal}
This will run \app{makeindex} on every \LaTeX\ run. If you have a
large \idx{glossary} with a complex document build, this can end 
up being more time-consuming that simply running \app{makeindex}
(either explicitly or via \app{makeglossaries}) the minimum number
of required times.

\begin{important}
Note that you will need to have the
\idx{shellescape} enabled (restricted mode for a direct call to
\app{makeindex} and unrestricted mode for \app{xindy},
\app{makeglossaries} or \app{makeglossaries-lite}). If you switch
this option on and you are using \LuaLaTeX, then the \sty{shellesc}
package will be loaded.
\end{important}

If this option doesn't seem to work, open the \ext+{log} file in
your text editor and search for \qtt{runsystem}. For example, if the
document is in a file called \filefmt{myDoc.tex} and it has:
\begin{codebox}
\cmd{usepackage}[\opt{automake}]\marg{glossaries}
\end{codebox}
and you run \LaTeX\ in restricted mode, then if call was
successful, you should find the following line in the file
\filefmt{myDoc.log}:
\begin{transcript}
runsystem(makeindex -s myDoc.ist -t myDoc.glg -o myDoc.gls myDoc.glo)...executed safely (allowed).
\end{transcript}
The parentheses immediately after \qtt{runsystem} show how the
command was called. The bit after the three dots \code{...}
indicates whether or not the command was run and, if so, whether it
was successful. In the above case, it has \qt{executed safely
(allowed)}. This means that it was allowed to run in restricted
mode because \app{makeindex} is on the list of trusted applications.

If you change the package option to:
\begin{codebox}
\cmd{usepackage}[\opteqvalref{automake}{makegloss}]\marg{glossaries}
\end{codebox}
and rerun \LaTeX\ in restricted mode, then the line in
\filefmt{myDoc.log} will now be:
\begin{transcript}
runsystem(makeglossaries myDoc)...disabled (restricted).
\end{transcript}
This indicates that an attempt was made to run \app{makeglossaries}
(rather than a direct call to \app{makeindex}), which isn't
permitted in restricted mode. There will be a similar message with
\opteqvalref{automake}{lite} or if the \opt{xindy} option is used.
These cases require the unrestricted \idx{shellescape}. 

\begin{important}
Think carefully before enabling unrestricted mode. Do you trust all
the packages your document is loading (either explicitly or
implicitly via another package)? Do you trust any code that you have
copied and pasted from some third party? First compile your document
in restricted mode (or with the \idx{shellescape} disabled) and
search the \ext{log} file for \qtt{runsystem} to find out exactly
what system calls are being attempted.
\end{important}

If the document is compiled in unrestricted mode, the corresponding
line in the \ext{log} file should now be:
\begin{transcript}
runsystem(makeglossaries myDoc)...executed.
\end{transcript}
This means that \app{makeglossaries} was run. If it has \qt{failed}
instead of \qt{executed}, then it means there was a fatal error.
Note that just because the \ext{log} file has \qt{executed} doesn't
mean that the application ran without a problem as there may have been
some warnings or non-fatal errors. If you get any unexpected
results, check the \idx{indexingapp}['s] transcript file (for
example, the \ext+{glg} file, \filefmt{myDoc.glg} in the above, for
the \glostype{main} glossary).

\optionvaldef{automake}{false}
No attempt is made to use the \idx{shellescape}.

\optionvaldef{automake}{true}
This is now a deprecated synonym for
\opteqvalref{automake}{delayed}. This used to be the default if the
value to \opt{automake} wasn't supplied, but the default switched to
the less problematic \opteqvalref{automake}{immediate} in version 4.50.

\optionvaldef{automake}{delayed}
A direct call to \app{makeindex} or \app{xindy} (as appropriate) for
each non-empty \idx{glossary} will be made at the end of the
document using a delayed write to ensure that the \idx{glossary}
files are complete. (It's necessary to delay writing to the
\idxpl{indexingfile} in order to ensure that \gls{thepage} is
correct.) Unfortunately, there are situations where the delayed
write never occurs, for example, if there are floats on the final
page. In those cases, it's better to use an immediate write (any of
the following options).

\optionvaldef{automake}{immediate}
A direct call to \app{makeindex} or \app{xindy} (as appropriate) for
each non-empty \idx{glossary} will be made at the start of
\gls{makeglossaries} using an immediate write. This ensures that the
\idxpl{indexingfile} are read by the \idx{indexingapp} before they
are opened (which will clear their content).

If you are using \app{xindy}, then \opteqvalref{automake}{makegloss}
is a better option that this one. Either way, you will need Perl and
the unrestricted mode, but with \app{makeglossaries} you get the
benefit of the language mappings and diagnostics.

\optionvaldef{automake}{makegloss}
A call to \app{makeglossaries} will be made at the start of
\gls{makeglossaries} using an immediate write if the \ext+{aux} file
exists. On the one hand, it's better to use \app{makeglossaries} as
it has some extra diagnostic functions, but on the other hand it
both requires Perl and the unrestricted \idx{shellescape}.

\optionvaldef{automake}{lite}
A call to \app{makeglossaries-lite} will be made at the start of
\gls{makeglossaries} using an immediate write if the \ext+{aux} file
exists. There's little benefit in this option over
\opteqvalref{automake}{immediate} and it has the added disadvantage
of requiring the unrestricted mode.

\optiondef{automakegloss}
This valueless option is equivalent to \opteqvalref{automake}{makegloss}.

\optiondef{automakeglosslite}
This valueless option is equivalent to \opteqvalref{automake}{lite}.

\optiondef{disablemakegloss}
This valueless option indicates that \gls{makeglossaries} and
\gls{makenoidxglossaries} should be disabled. This option is
provided in the event that you have to use a class or package that
disregards the advice in \sectionref{sec:indexingoptions} and
automatically performs \gls{makeglossaries} or
\gls{makenoidxglossaries} but you don't want this.  (For example,
you want to use a different \idx{indexing} method or you want to
disable \idx{indexing} while working on a draft document.)

Naturally, if there's a particular reason why the class or package
insists on a specific \idx{indexing} method, for example, it's an
editorial requirement, then you will need to abide by that
decision.

This option may be passed in the standard document class option list
or passed using \gls{PassOptionsToPackage} before \sty{glossaries} is
loaded. Note that this does nothing if
\gls{makeglossaries} or \gls{makenoidxglossaries} has already 
been used whilst enabled.

\optiondef{restoremakegloss}
Cancels the effect of \opt{disablemakegloss}. This option may be used in
\gls{setupglossaries}. It issues a warning if \gls{makeglossaries} or
\gls{makenoidxglossaries} has already been used whilst enabled. 
Note that this option removes the check for \gls{nofiles}, as this
option is an indication that the output files are actually required.

For example, suppose the class \clsfmt{customclass.cls}
automatically loads \sty{glossaries} and does \gls{makeglossaries}
but you need an extra \idx{glossary}, which has to be defined before
\gls{makeglossaries}, then you can do:
\begin{codebox}
\cmd{documentclass}[\opt{disablemakegloss}]\marg{customclass}
\gls{newglossary*}\marg{functions}\marg{Functions}
\gls{setupglossaries}\marg{restoremakegloss}
\gls{makeglossaries}
\end{codebox}
or
\begin{codebox}
\gls{PassOptionsToPackage}\marg{\opt{disablemakegloss}}\marg{glossaries}
\cmd{documentclass}\marg{customclass}
\gls{newglossary*}\marg{functions}\marg{Functions}
\gls{setupglossaries}\marg{restoremakegloss}
\gls{makeglossaries}
\end{codebox}

Note that restoring these commands doesn't necessarily mean that they can be
used. It just means that their normal behaviour given the current
settings will apply. For example, if you use the \optval{record}{only}
or \optval{record}{nameref} options with \sty{glossaries-extra}
then you can't use \gls{makeglossaries} or \gls{makenoidxglossaries}
regardless of \opt{restoremakegloss}.

\section{Glossary Type Options}
\label{sec:pkgopts-type}

\optiondef{nohypertypes}
Use this option if you have multiple
\idxpl{glossary} and you want to suppress the entry \idxpl{hyperlink} for a
particular \idx{glossary} or \idxpl{glossary}. The value of this option should
be a comma-separated list of \idx{glossary} types where \gls{gls} etc
shouldn't have \idxpl{hyperlink} by default. Make sure you enclose the
value in braces if it contains any commas. Example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optvalm{nohypertypes}{\glostype{acronym},notation}]
  \marg{glossaries}
\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation}
\end{codebox}
As illustrated above, the \idx{glossary} doesn't need to exist when
you identify it in \opt{nohypertypes}.

\begin{important}
The values must be fully expanded, so \strong{don't} try, for
example, \optval{nohypertypes}{\gls{acronymtype}}.
\end{important}

You may also use:
\cmddef{GlsDeclareNoHyperList}
instead or additionally.
See \sectionref{sec:glslink} for further details.

\begin{xtr}
The \sty{glossaries-extra} package has the \catattr{nohyper}
\idx{categoryattribute} which will suppress the \idx+{hyperlink} for entries
with the given category, which can be used as an alternative to
suppressing the \idx{hyperlink} on a per-\idx{glossary} basis.
\end{xtr}

\optiondef{nomain}
This suppresses the creation of the \glostype+{main}
glossary and associated \ext{glo} file, if unrequired. Note that
if you use this option, you must create another \idx{glossary} in which to
put all your entries (either via the \opt{acronym} (or
\opt{acronyms}) package option described in
\sectionref{sec:pkgopts-acronym} or via the \opt{symbols},
\opt{numbers} or \opt{index} options described in
\sectionref{sec:pkgopts-other} or via \gls{newglossary} described in
\sectionref{sec:newglossary}). Even if you don't intend to display
the \idx{glossary}, a default \idx{glossary} is still required.

If you don't use the \glostype{main} glossary and you don't use this
option to suppress its creation, \app{makeglossaries} will produce a warning:
\begin{transcript}
Warning: File '\meta{filename}.glo' is empty.
Have you used any entries defined in glossary '\glostype{main}'?
Remember to use package option '\opt{nomain}' if 
you don't want to use the \glostype{main} glossary.
\end{transcript}
If you did actually want to use the \glostype{main} glossary and you see this
warning, check that you have referenced the entries in that \idx{glossary}
via commands such as \gls{gls}.

\optiondef{symbols}
This valueless option defines a new \idx{glossary} type with
the label \glostypedef{symbols} via
\begin{compactcodebox}
\gls{newglossary}\oarg{slg}\marg{\glostype{symbols}}\marg{sls}\marg{slo}\marg{\gls{glssymbolsgroupname}}
\end{compactcodebox}
It also defines
\cmddef{printsymbols}
which is a synonym for
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{symbols}},\meta{options}}
\end{compactcodebox}

If you use \option{noidx}, you need to use:
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{symbols}},\meta{options}}
\end{compactcodebox}
to display the list of symbols.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{symbols} glossary and don't intend
to use the \glostype{main} glossary.
\end{important}

\begin{xtr}
The \sty{glossaries-extra} package has a slightly modified
version of this option which additionally provides \gls{glsxtrnewsymbol}
as a convenient shortcut method for defining symbols. See the
\sty{glossaries-extra} manual for further details.
\end{xtr}

\optiondef{numbers}
This valueless option defines a new \idx{glossary} type with
the label \glostypedef{numbers} via
\begin{compactcodebox}
\gls{newglossary}\oarg{nlg}\marg{\glostype{numbers}}\marg{nls}\marg{nlo}\marg{\gls{glsnumbersgroupname}}
\end{compactcodebox}
It also defines
\cmddef{printnumbers}
which is a synonym for
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{numbers}},\meta{options}}
\end{compactcodebox}

If you use \option{noidx}, you need to use:
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{numbers}},\meta{options}}
\end{compactcodebox}
to display the list of numbers.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{numbers} glossary and don't intend
to use the \glostype{main} glossary.
\end{important}

\begin{xtr}
The \sty{glossaries-extra} package has a slightly modified
version of this option which additionally provides \gls{glsxtrnewnumber}
as a convenient shortcut method for defining numbers. See the
\sty{glossaries-extra} manual for further details.
\end{xtr}

\optiondef{index}
This valueless option defines a new \idx{glossary} type with
the label \glostypedef{index} via
\begin{compactcodebox}
\gls{newglossary}\oarg{ilg}\marg{\glostype{index}}\marg{ind}\marg{idx}\marg{\gls{indexname}}
\end{compactcodebox}
It also defines
\cmddef{newterm}
which is a synonym for
\begin{compactcodebox}
\gls{newglossaryentry}\margm{entry-label}\marg{\gloskeyval{type}{\glostype{index}},\gloskeyval{name}{entry-label},
\gloskeyval{description}{\gls{nopostdesc}},\meta{options}}
\end{compactcodebox}
and
\cmddef{printindex}
which is a synonym for
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{index}},\meta{options}}
\end{compactcodebox}

If you use \option{noidx}, you need to use:
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{index}},\meta{options}}
\end{compactcodebox}
to display this \idx{glossary}.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{index} glossary and don't intend to
use the \glostype{main} glossary. Note that you
can't mix this option with \gls{index}. Either use
\sty{glossaries} for the \idx{indexing} or use a~custom \idx{indexing}
package, such as \sty{makeidx}, \sty{imakeidx}.
(You can, of course, load one of those packages and 
load \sty{glossaries} without the \opt{index} package option.)
\end{important}

Since the index isn't designed for terms with descriptions, you
might also want to disable the \idxpl{hyperlink} for this \idx{glossary} using
the package option \optval{nohypertypes}{index} or the command
\begin{compactcodebox}
\gls{GlsDeclareNoHyperList}\marg{\glostype{index}}
\end{compactcodebox}
However, it can also be useful to link to the index in order to look
up the term's \idx{locationlist} to find other parts of the document
where it might be used. For example, this manual will have a
\idx{hyperlink} to the \hyperref[index]{index} for general terms, such as
\qt{\idx{tableofcontents}}, or general commands, such as
\gls{index}, that aren't defined anywhere in the document.

The example file \samplefile{-index} illustrates the use of the
\opt{index} package option.

\optiondef{noglossaryindex}
This valueless option switches off \opt{index} if \opt{index} has
been passed implicitly (for example, through global document
options). This option can't be used in \gls{setupglossaries}.

\section{Acronym and Abbreviation Options}
\label{sec:pkgopts-acronym}

\glsaddeach{idx.acronym,idx.abbreviation}%
\optiondef{acronym}
If true, this creates a new \idx{glossary} with the
label \glostypedef{acronym}. This is equivalent to:
\begin{compactcodebox}
\gls{newglossary}\oarg{alg}\marg{\glostype{acronym}}\marg{acr}\marg{acn}\marg{\gls{acronymname}}
\end{compactcodebox}
It will also provide (if not already defined)
\cmddef{printacronyms}
that's equivalent to
\begin{compactcodebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\meta{options}}
\end{compactcodebox}

If you are using \option{noidx}, you need to use
\begin{compactcodebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\glostype{acronym}},\meta{options}}
\end{compactcodebox}
to display the list of acronyms.

If the \opt{acronym} package option is used, \gls+{acronymtype} is
set to \glostype{acronym} otherwise it is set to
\gls{glsdefaulttype} (which is normally the \glostype{main}
glossary.) Entries that are defined using \gls{newacronym} are
placed in the \idx{glossary} whose label is given by \gls{acronymtype},
unless another \idx{glossary} is explicitly specified with the
\gloskey{type} key.

\begin{important}
Remember to use the \opt{nomain} package option if you're only
interested in using this \glostype{acronym} glossary. (That is, you
don't intend to use the \glostype{main} glossary.)
\end{important}

\begin{xtr}
The \sty{glossaries-extra} extension package comes with an analogous
\opt{abbreviations} option, which creates a new \idx{glossary} with
the label \glostype{abbreviations} and sets the command
\gls{glsxtrabbrvtype} to this. If the \opt{acronym} option hasn't
also been used, then \gls{acronymtype} will be set to
\gls{glsxtrabbrvtype}. This enables both \gls{newacronym} and
\gls{newabbreviation} to use the same \idx{glossary}.

Make sure you have at least v1.42 of \sty{glossaries-extra} if you
use the \opt{acronym} (or \opt{acronyms}) package option with
the extension package to avoid a bug that interferes with the
\idx{abbrvstyle}.
\end{xtr}

\optiondef{acronyms}
This is equivalent to \optval{acronym}{true} and may be used in the
document class option list.

\optiondef{abbreviations}

This valueless option provided by \sty{glossaries-extra} creates a new 
\idx{glossary} type with the label 
\inlineglsdef[optdef]{opt.glostype.abbreviations} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{glg-abr}\marg{\glostype{abbreviations}}\marg{gls-abr}\marg{glo-abr}\marg{\gls{abbreviationsname}}
\end{compactcodebox}
The label can be accessed with \gls{glsxtrabbrvtype}, which is
analogous to \gls{acronymtype}. See \sty{glossaries-extra} manual for
further details.

\optiondef{acronymlists}
This option is used to identify the \idxpl{glossary} that contain
\idxpl{acronym} so that they can have their \idx{entryformat}
adjusted by \gls{setacronymstyle}. (It also enables \gls{forallacronyms} to 
work.)

By default, if the list is empty when \gls{setacronymstyle} is used
then it will automatically add \gls{acronymtype} to the list. 

If you have other lists of \idxpl{acronym}, you can specify them as
a comma-separated list in the value of \opt{acronymlists}. For
example, if you use the \opt{acronym} package option but you also
want the \glostype{main} glossary to also contain a list of
\idxpl{acronym}, you can do:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optval{acronymlists}{\glostype{main}}]\marg{glossaries}
\end{codebox}
No check is performed to determine if the listed \idxpl{glossary} exist,
so you can add \idxpl{glossary} you haven't defined yet. For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\optvalm{acronymlists}{\glostype{main},acronym2}]
  \marg{glossaries}
\gls{newglossary}\oarg{alg2}\marg{acronym2}\marg{acr2}\marg{acn2}\comment{}
  \marg{Statistical Acronyms}
\end{codebox}
You can use
\cmddef{DeclareAcronymList}
instead of or in addition to the \opt{acronymlists} option.
This will add the \idxpl{glossary} given in \meta{list} to the list of 
\idxpl{glossary} that are identified as lists of \idxpl{acronym}. 
To replace the list of \idx{acronym} lists with a new list use:
\cmddef{SetAcronymLists}

If the list is changed after \gls{setacronymstyle}
then it will result in inconsistencies in the formatting. If this does
happen, and is for some reason unavoidable (such as
\gls{setacronymstyle} occurring in a package that loads
\sty{glossaries}), you will need to set the \idx{entryformat} to
match the style:
\begin{compactcodebox}
\gls{DeclareAcronymList}\margm{glossary-label}
\gls{defglsentryfmt}\oargm{glossary-label}\marg{\gls{GlsUseAcrEntryDispStyle}}\margm{style-name}
\end{compactcodebox}

You can determine if a \idx{glossary} has been identified as being a list
of \idxpl{acronym} using:
\cmddef{glsIfListOfAcronyms}

\begin{xtr}
This option and associated commands are incompatible with \sty{glossaries-extra}['s]
\idx{abbreviation} mechanism. Lists of \idxpl{abbreviation} don't need identifying.
\end{xtr}

\optiondef{shortcuts}
This option provides shortcut commands
for \idxpl{acronym}.  See \sectionref{sec:acronyms} for further details.
Alternatively you can use:
\cmddef{DefineAcronymSynonyms}

\begin{xtr}
The \sty{glossaries-extra} package provides additional shortcuts.
\end{xtr}

\section{Deprecated Acronym Style Options}
\label{sec:pkgopts-old-acronym}

The package options listed in this section were deprecated in
version 4.02 (2013-12-05) and have now been removed. You will need to use
rollback with them (see \sectionref{sec:rollback}). These options
started generating warnings in version 4.47 (2021-09-20) and as from
version 4.50 will now generate an error unless you use rollback.

If you want to change the \idx{acronymstyle}, use \gls{setacronymstyle}
instead. See \sectionref{sec:acronyms} for further details.

\optiondef{description}
This option changed the definition of \gls{newacronym} to allow a description.
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short-desc}}
\end{codebox}
or (with \opt{smallcaps})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short-desc}}
\end{codebox}
or (with \opt{smaller})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sm-short-desc}}
\end{codebox}
or (with \opt{footnote})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-desc}}
\end{codebox}
or (with \opt{footnote} and \opt{smallcaps})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}
or (with \opt{footnote} and \opt{smaller})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm-desc}}
\end{codebox}
or (with \opt{dua})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{dua-desc}}
\end{codebox}

\optiondef{smallcaps}
This option changed the definition of
\gls{newacronym} and the way that acronyms are displayed. 
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short-desc}}
\end{codebox}
or (with \opt{description} and \opt{footnote})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}

\optiondef{smaller}
This option changed the definition of
\gls{newacronym} and the way that acronyms are displayed.
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sm-short}}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sm-short-desc}}
\end{codebox}
or (with \opt{description} and \opt{footnote})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm-desc}}
\end{codebox}

\optiondef{footnote}
This option changed the definition of
\gls{newacronym} and the way that acronyms are displayed.
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote}}
\end{codebox}
or (with \opt{smallcaps})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc}}
\end{codebox}
or (with \opt{smaller})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm}}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-desc}}
\end{codebox}
or (with \opt{smallcaps} and \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}
or (with \opt{smaller} and \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sm-desc}}
\end{codebox}

\optiondef{dua}
This option changed the definition of
\gls{newacronym} so that acronyms are always expanded. 
This option may be replaced by:
\begin{codebox}
\gls{setacronymstyle}\marg{dua}
\end{codebox}
or (with \opt{description})
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{dua-desc}}
\end{codebox}

\section{Other Options}
\label{sec:pkgopts-other}

Other available options that don't fit any of the above categories
are described below.

\optiondef{accsupp}

Only available with \sty{glossaries-extra}, this option
loads the \sty{glossaries-accsupp} package, which needs to be loaded
either before \sty{glossaries-extra} or while \sty{glossaries-extra}
is loaded to ensure both packages are properly integrated.

\optiondef{prefix}

Only available with \sty{glossaries-extra}, this option
loads the \sty{glossaries-prefix} package.

\optiondef{nomissingglstext}

This option may be used to suppress the boilerplate text generated
by \gls{printglossary} if the \idx{indexingfile} is missing.

\optiondef{mfirstuc}

The value may be either \optfmt{expanded} or \optfmt{unexpanded} and
performs the same function as \sty{mfirstuc}['s] \optfmt{expanded}
and \optfmt{unexpanded} package options. Note that there's no value
corresponding to \sty{mfirstuc}['s] other package option.

The default is \optval{mfirstuc}{unexpanded} to safeguard against
\idxpl{glossarystyle} that convert the description to
\idx{sentencecase}. With older versions of \sty{mfirstuc} 
(pre v2.08), fragile commands in the description would not have been
affected by the \idx{casechange}, but now, if the entire description is passed
to \gls{MFUsentencecase}, it will be expanded, which could break
existing documents.

\begin{information}
As from \sty{glossaries} v4.58, the \opt{mfirstuc} option will 
redefine \gls{glsmakefirstuc} as a long command to allow paragraph
breaks.
\end{information}

\optiondef{compatible-2.07}

Compatibility mode for old documents created using version 2.07 or
below. This option is now only available with rollback (see
\sectionref{sec:rollback}).

\optiondef{compatible-3.07}
Compatibility mode for old documents created using version 3.07 or
below.  This option is now only available with rollback (see
\sectionref{sec:rollback}).

\optiondef{kernelglossredefs}
As a legacy from the precursor \sty{glossary} package, the standard
glossary commands provided by the \LaTeX\ kernel (\gls{makeglossary}
and \gls{cs.glossary}) are redefined in terms of the \sty{glossaries}
package's commands.  However, they were never documented in this
user manual, and the conversion guide (\qtdocref{Upgrading from the
\styfmt{glossary} package to the \styfmt{glossaries} package}{glossary2glossaries})
explicitly discourages their use.

The redefinitions of these commands was removed in v4.10,
but unfortunately it turned out that some packages had hacked
the internal commands provided by \sty{glossaries} and no longer
worked when they were removed, so they were restored in v4.41 with
this option to undo the effect with \optval{kernelglossredefs}{true}
as the default. As from v4.50, the default is now
\optval{kernelglossredefs}{false}.

\optionvaldef{kernelglossredefs}{false}
Don't redefine \gls{cs.glossary} and \gls{makeglossary}. If they have
been previously redefined by \opt{kernelglossredefs} their original
definitions (at the time \sty{glossaries} was loaded) will be
restored.

\optionvaldef{kernelglossredefs}{true}
Redefine \gls{cs.glossary} and \gls{makeglossary}, but their use will
trigger warnings.

\optionvaldef{kernelglossredefs}{nowarn}
Redefine \gls{cs.glossary} and \gls{makeglossary} without any warnings.

The only glossary-related commands provided by the \LaTeX\
kernel are \gls{makeglossary} and \gls{cs.glossary}. Other packages
or classes may provide additional glossary-related commands or
environments that conflict with \sty{glossaries} (such as
\gls{printglossary} and \env{theglossary}). These non-kernel commands
aren't affected by this package option, and you will have to find
some way to resolve the conflict if you require both glossary
mechanisms. (The \sty{glossaries} package will override the existing
definitions of \gls{printglossary} and \env{theglossary}.)

In general, if possible, it's best to stick with just one package that
provides a glossary mechanism. (The \sty{glossaries} package does
check for the \sty{doc} package and patches \gls{PrintChanges}.)

\section{Setting Options After the Package is Loaded}
\label{sec:setupglossaries}

Some of the options described above may also be set after the
\sty{glossaries} package has been loaded using
\cmddef{setupglossaries}
The following package options \strong{can't} be used in
\gls{setupglossaries}: \opt{xindy}, \opt{xindygloss},
\opt{xindynoglsnumbers}, \opt{makeindex},
\opt{nolong}, \opt{nosuper}, \opt{nolist},
\opt{notree}, \opt{nostyles}, \opt{nomain},
\opt{compatible-2.07}, \opt{translate}, \opt{notranslate}, 
\opt{languages}, \opt{acronym}. These options have to be set while the package is
loading, except for the \opt{xindy} sub-options which can be set
using commands like \gls{GlsSetXdyLanguage} (see
\sectionref{sec:xindy} for further details).

\begin{important}
If you need to use this command, use it as soon as
possible after loading \sty{glossaries} otherwise you might 
end up using it too late for the change to take effect. If you 
try changing the sort option after you have 
started to define entries, you may get unexpected results.
\end{important}

\begin{xtr}
With \sty{glossaries-extra}, use \gls{glossariesextrasetup}
instead.
\end{xtr}
\renewcommand{\cmddefbookmarkleveloffset}{1}

\chapter{Setting Up}
\label{sec:setup}

In the \idx+{preamble/document} you need to indicate which method you want to use to
generate the \idx{glossary} (or \idxpl{glossary}). The available options with
both \sty{glossaries} and \sty{glossaries-extra} are
summarized in \sectionref{sec:indexingoptions}. This chapter
documents \options{noidx,mkidx,xdy}, which are provided by the base package. See the
\sty{glossaries-extra} and \app{bib2gls} manuals for the full
documentation of the other options.

If you don't need to display any \idxpl{glossary}, for example, if you are
just using the \sty{glossaries} package to enable consistent
formatting, then skip ahead to \sectionref{sec:newglosentry}.

\section{Option \glsfmttext{idx.opt.noidx}}
\label{sec:setupopt1}

The command
\cmddef{makenoidxglossaries}
must be placed in the \idxf{preamble/document}. This sets up the internal commands
required to make \option{noidx} work.
\strong{If you omit \gls{makenoidxglossaries} none of
the \idxpl{glossary} will be displayed.}

\section{Options \glsfmttext{idx.opt.mkidx} and \glsfmttext{idx.opt.xdy}}
\label{sec:setupopt23}

The command
\cmddef{makeglossaries}
must be placed in the \idxf{preamble/document} in order to create the customised
\app+{makeindex} (\ext+{ist}) or \app+{xindy} (\ext+{xdy})
style file (for \optionsor{mkidx,xdy}, respectively) and to ensure that 
\idx{glossary} entries are written to the appropriate output files. 
\strong{If you omit \gls{makeglossaries} none of
the \idxpl{indexingfile} will be created.}

\begin{xtr}
If you are using \sty{glossaries-extra}, \gls{makeglossaries} has an
optional argument that allows you to have a hybrid of \optionsor{noidx,mkidx} or
\optionsor{noidx,xdy}. See \sty{glossaries-extra} manual for further details.
\end{xtr}

\begin{important}
Note that some of the commands provided by the \sty{glossaries}
package must not be used after \gls{makeglossaries} as they are
required when creating the customised style file. If you attempt
to use those commands after \gls{makeglossaries} you will generate
an error.
Similarly, there are some commands that must not be used before
\gls{makeglossaries} because they require the associated
\idxpl{indexingfile} to be open, if those files should be created.
These may not necessarily generate an error or warning as a
different \idx{indexing} option may be chosen that doesn't require
those files (such as \optionsor{unsrt,standalone}).
\end{important}

The \gls{makeglossaries} command internally uses:
\cmddef{writeist}
to create the custom \app{makeindex}\slash\app{xindy} style file.
This command disables itself by setting itself to \gls{relax} so
that it can only be used once. In general, there should be no reason 
to use or alter this command.

The default name for the customised style file is given by
\code{\gls{jobname}.\ext+{ist}} (\option{mkidx}) or 
\code{\gls{jobname}.\ext+{xdy}} (\option{xdy}). This name may be
changed using:
\cmddef{setStyleFile}
where \meta{name} is the name of the style file without the 
extension.

\plabel{sec:isthook}%
There is a hook near the end of \gls{writeist} that can be set with:
\cmddef{GlsSetWriteIstHook}
The \meta{code} will be performed while the style file is still
open, which allows additional content to be added to it. 
The associated write register is:
\cmddef{glswrite}
Note that this register is defined by \gls{writeist} to prevent an
unnecessary write register from being created in the event that neither \app{makeindex}
nor \app{xindy} is required.

If you use the \gls{GlsSetWriteIstHook} hook to write extra
information to the style file, make sure you use the appropriate
syntax for the desired \idx{indexingapp}. For example, with
\app{makeindex}:
\begin{codebox*}
\gls{GlsSetWriteIstHook}\marg{\comment{}
 \gls{write}\gls{glswrite}\marg{page\_precedence "arnAR"}\comment{}
 \gls{write}\gls{glswrite}\marg{line\_max 80}\comment{}
}
\end{codebox*}
This changes the \idx{pageprecedence} and the maximum line length
used by \app{makeindex}.

Remember that if you switch to \app{xindy}, this will no longer be
valid code.

You can suppress the creation of the customised \app{xindy}
or \app{makeindex} style file using:
\cmddef{noist}
This is provided in the event that you want to supply your own
customized style file that can't be replicated with the available
options and commands provided by the \sty{glossaries} package.
This command sets \gls{writeist} to \gls{relax} (making it do
nothing) but will also update the \app{xindy} 
\idxc{xindyattr}{attribute list} if applicable.

If you have a custom \ext{xdy} file created when using 
\sty{glossaries} version 2.07 (2010-0710) or below, you will need to use
rollback and the \opt{compatible-2.07} package option with it.
However, that is now so dated and the \LaTeX\ kernel has changed
significantly since that time that you may need to use a legacy
distribution (see
\blog{legacy-documents-and-tex-live-docker-images}{Legacy Documents
and TeX Live Docker Images}).

Each \idx{glossaryentry} is assigned a \idx{numberlist} that lists all 
the \locations\ in the document where that \idx{entry} was used. By default,
the \location\ refers to the page number but this may be overridden
using the \opt{counter} package option. The default form of
the \location\ number assumes a full stop \idx{compositor} (for example, 1.2),
but if your \location\ numbers use a different \idx{compositor} (for
example, 1-2) you need to set this using
\cmddef{glsSetCompositor}\marg{symbol}
For example:
\begin{codebox}
\gls{glsSetCompositor}\marg{-}
\end{codebox}
This command must not be used after \gls{makeglossaries}. Note that
with \app{makeindex}, any \locations\ with the wrong \idx{compositor} 
(or one that hasn't been correctly identified with
\gls{glsSetCompositor}) will cause \app{makeindex} to reject the
\location\ with an invalid number\slash digit message. As from
v4.50, \app{makeglossaries} will check for this message and attempt
a correction, but this can result in an incorrectly formatted
\location\ in the \idx{numberlist}. See the information about
\app{makeglossaries}['s] \mkglsopt{e} switch
in \sectionref{sec:makeglossariesapp} for further details.

An invalid page number will also cause \app{xindy} to fail with a
\qt{did not match any location-class} warning. This is also
something that \app{makeglossaries} will check for and will provided
diagnostic information, but it won't attempt to make any correction.

If you use \option{xdy}, you can have a different \idx{compositor} for page
numbers starting with an upper case alphabetical character using:
\cmddef{glsSetAlphaCompositor}
This command is only available with \app{xindy}. For example, if you want 
\idxpl{numberlist} containing a mixture of A-1 and 2.3 style
formats, then do:
\begin{codebox}
\gls{glsSetCompositor}\marg{.}\gls{glsSetAlphaCompositor}\marg{-}
\end{codebox}
See \sectionref{sec:numberlists} for further information about
\idxpl{numberlist}.

\chapter{Defining Glossary Entries}
\label{sec:newglosentry}

\begin{bib2gls}
If you want to use \app{bib2gls}, entries must be defined in
\ext{bib} files using the syntax described in the \app{bib2gls}
user manual.
\end{bib2gls}

\Idxpl{acronym} are covered in \sectionref{sec:acronyms} but they use the
same underlying mechanism as all the other \idxpl{glossaryentry}, so it's a good
idea to read this chapter first. The keys provided for
\gls{newglossaryentry} can also be used in the optional argument of
\gls{newacronym}, although some of them, such as \gloskey{first} and
\gloskey{plural}, interfere with the \idxpl{acronymstyle}.

All \idxpl{glossaryentry} must be defined before they are used, so it is
better to define them in the \idxf{preamble/document} to ensure this. In fact, some
commands such as \gls{longnewglossaryentry}
may only be used in the \idx{preamble/document}. See \sectionref{sec:docdefs} for
a discussion of the problems with defining \idxpl{entry} within the
document instead of in the \idx{preamble/document}. (The \sty{glossaries-extra}
package has an option that provides a restricted form of document 
definitions that avoids some of the issues discussed in 
\sectionref{sec:docdefs}.)
\begin{important}
\option{noidx} enforces the \idx+{preamble/document}-only restriction on
\gls{newglossaryentry}. \option{b2g} requires that definitions are provided
in \ext{bib} format. \options{unsrt,standalone} work best with either 
\idx{preamble/document}-only
definitions or the use of the \sty{glossaries-extra} package option
\optval{docdef}{restricted}.
\end{important}

Bear in mind that with \optval{docdef}{restricted}, the
\idxpl{entry} must be defined before any \idxpl{entry} are used, 
including when they are displayed in the \idx{glossary} (for example, with
\gls{printunsrtglossary}) or where they appear in the
\idx+{tableofcontents} or list of floats. This is essentially the
same problem as defining a robust command mid-document and using it
in a section title or caption.

Only those \idxpl{entry} that are \indexed\ in the document 
(using any of the commands described in
\sectionref{sec:glslink}, \sectionref{sec:glsadd} or
\sectionref{sec:crossref}) will appear in the \idx{glossary}. See
\sectionref{sec:printglossary} to find out how to display the
\idx{glossary}.

New \idxpl+{glossaryentry} are defined using the command:
\cmddef{newglossaryentry}
This is a short command, so values in \keyvallist\ can't
contain any paragraph breaks. Take care to enclose values containing
any commas (\sym{comma}) or equal signs (\sym{equals}) with braces to hide them
from the \keyval\ list parser.

If you have a long description that
needs to span multiple paragraphs, use the following instead:
\cmddef{longnewglossaryentry}
Note that this command may only be used in the
\idx+{preamble/document} (regardless of \opt{docdef}).

\begin{warning}
Be careful of unwanted spaces.
\end{warning}

\gls{longnewglossaryentry} will remove trailing spaces in the
description (via \gls{unskip}) but won't remove leading spaces. This
command also appends \gls{nopostdesc} to the end of the description,
which suppresses the post-description hook (since the terminating
punctuation is more likely to be included in a multi-paragraph
description).  The \sty{glossaries-extra} package provides a starred
version of \gls{longnewglossaryentry} that doesn't append either
\gls{unskip} or \gls{nopostdesc}.

There are also commands that will only define the \idx{entry} if it
hasn't already been defined:
\cmddef{provideglossaryentry}
and
\cmddef{longprovideglossaryentry}
(These are both \idx+{preamble/document}-only commands.)

For all the above commands, the first argument, \meta{entry-label}, must be 
a~unique label with which to identify this \idx{entry}. \strong{This can't contain
any non-expandable or fragile commands.} The reason for
this restriction is that the label is used to construct internal commands
that store the associated information (similarly to commands
like \gls{label}) and therefore must be able to expand to a valid
control sequence name. With modern \LaTeX\ kernels, you should now
be able to use \idx{utf8} characters in the label.

\begin{important}
Be careful of \sty{babel}['s] options that change certain
punctuation characters, such as colon (\sym{colon}) or double-quote
(\sym{dblquote}), to active characters.
\end{important}

The second argument, \keyvallist, is
a \keyval\ list that supplies the relevant
information about this entry. There are two required fields:
\gloskey{description} and either \gloskey{name} or \gloskey{parent}.
The description is set in the third argument of
\gls{longnewglossaryentry} and \gls{longprovideglossaryentry}. With
the other commands it's set via the \gloskey{description} key.

As is typical with \keyval\ lists, values that contain 
a comma (\sym{comma}) or equal sign (\sym{equals}) must be 
enclosed in braces. Available fields
are listed below. Additional fields are provided by the
supplementary packages \sty{glossaries-prefix}
(\sectionref{sec:prefix}) and \sty{glossaries-accsupp}
(\sectionref{sec:accsupp}) and also by \sty{glossaries-extra}.
You can also define your own custom keys (see
\sectionref{sec:addkey}).

\begin{information}
Aside from the required keys, if you don't explicitly set a key it
will be set to its default value. The default value varies depending
on the key and the calling command (for example,
\gls{newglossaryentry}, \gls{newterm} or \gls{newacronym}).
\end{information}

\optiondef{gloskey.name}
The name of the \idx{entry} (as it will appear in 
the \idx+{glossary}). If this key is omitted and the \gloskey{parent}
key is supplied, this value will be the same as the parent's name.

\begin{important}
If the \gloskey{name} key contains any commands, you must also
use the \gloskey{sort} key (described below) if you intend sorting
the \idxpl{entry} alphabetically with \optionsor{noidx,mkidx,xdy}, 
otherwise the entries can't be sorted correctly.
\end{important}

\optiondef{gloskey.description}
A brief description of this term (to appear in the \idx+{glossary}). 
Within this value, you can use:
\cmddef*{nopostdesc}
to suppress the description terminator for this entry. For example, if this
entry is a parent entry that doesn't require a description, you
can do \gloskeyval{description}{\gls{nopostdesc}}. If you want a paragraph
break in the description use:
\cmddef*{glspar}
or, better, use \gls{longnewglossaryentry}.
However, note that not all \idxpl{glossarystyle} support multi-line
descriptions. If you are using one of the tabular-like 
\idxpl{glossarystyle} that permit multi-line descriptions and you
really need an explicit line break, use \gls{newline} not \gls{cs.bsl}
(but in general, avoid \gls{cs.bsl} outside of tabular contexts anyway
and use a ragged \idxc{glossary}{style} if you are having problems
with line breaks in a narrow column).

\begin{xtr}
With \sty{glossaries-extra}, use \gls{glsxtrnopostpunc} instead of
\gls{nopostdesc} to suppress the post-description punctuation.
\end{xtr}

\optiondef{gloskey.parent}
This key establishes the \idx{entry}['s] \idx+{hierarchicallevel}.
The value must be the \emph{label} of the parent \idx{entry} 
(not the \gloskey{name}, although they may be the same). 
The \meta{parent-label} value must match the
\meta{entry-label} used when the parent \idx{entry} was defined.
See \sectionref{sec:subentries} for further details.

\begin{important}
The parent \idx{entry} must be defined before it's referenced in
the \gloskey{parent} key of another \idx{entry}.
\end{important}

\optiondef{gloskey.descriptionplural}
The plural form of the description, if required. If omitted, the
value is set to the same as the \gloskey{description} key.

\optiondef{gloskey.text}
How this entry will appear in the document text
when using \gls+{gls} on \idx+{subsequentuse}. If this
field is omitted, the value of the \gloskey{name} key is used.

This key is automatically set by \gls{newacronym}. Although it is
possible to override it by using \gloskey{text} in the optional
argument of \gls{newacronym}, it will interfere with the 
\idx{acronymstyle} and cause unexpected results.

\optiondef{gloskey.first}
How the \idx{entry} will appear in the document text on \idx+{firstuse}
with \gls+{gls}. If this field is omitted, the value of the
\gloskey{text} key is used. Note that if you use \gls{glspl},
\gls{Glspl}, \gls{GLSpl}, \gls{glsdisp} before using \gls{gls}, the
\gloskey{first} value won't be used with \gls{gls}.

You may prefer to use \idxpl{acronym} (\sectionref{sec:acronyms}) or the
\idxpl{abbreviation} or the category post-link hook (\gls{glsdefpostlink}) provided by
\sty{glossaries-extra} if you would like to automatically append
content on \idx{firstuse} in a consistent manner. See, for example,
\gallerypage{sample-units}{Gallery: Units (\styfmt{glossaries-extra.sty})}.

Although it is possible to use \gloskey{first} in the optional
argument of \gls{newacronym}, it can interfere with the 
\idx{acronymstyle} and cause unexpected results.

\optiondef{gloskey.plural}
How the entry will appear in the document text
when using \gls+{glspl} on \idx{subsequentuse}.  If this
field is omitted, the value is obtained by appending
\gls{glspluralsuffix} to the value of the \gloskey{text} field.

Although it is possible to use \gloskey{plural} in the optional
argument of \gls{newacronym}, it can interfere with the 
\idx{acronymstyle} and cause unexpected results. Use \gloskey{shortplural}
instead, if the default value is inappropriate.

\optiondef{gloskey.firstplural}
How the \idx{entry} will appear in the
document text on \idx+{firstuse} with \gls{glspl}. 
If this field is omitted, the value is obtained
from the \gloskey{plural} key, if the \gloskey{first} key is omitted,
or by appending \gls{glspluralsuffix} to the value of the
\gloskey{first} field, if the \gloskey{first} field is present. Note
that if you use \gls{gls}, \gls{Gls}, \gls{GLS}, \gls{glsdisp} before
using \gls{glspl}, the \gloskey{firstplural} value won't be used
with \gls{glspl}.

Although it is possible to use \gloskey{firstplural} in the optional
argument of \gls{newacronym}, it can interfere with the 
\idx{acronymstyle} and cause unexpected results. Use \gloskey{shortplural}
and \gloskey{longplural} instead, if the default value is inappropriate.

\begin{information}
Prior to version 1.13, the default value of 
\gloskey{firstplural} was always taken by appending \qt{s} to the
\gloskey{first} key, which meant that you had to specify both
\gloskey{plural} and \gloskey{firstplural}, even if you hadn't
used the \gloskey{first} key.
\end{information}

\optiondef{gloskey.symbol}
This field is provided to allow the user
to specify an associated symbol. If omitted, the value is set to
\gls{relax}. Note that not all \idxpl{glossarystyle} display the symbol.

\optiondef{gloskey.symbolplural}
This is the plural form of the symbol. If omitted, the value 
is set to the same as the \gloskey{symbol} key.

\optiondef{gloskey.sort}
This value indicates the text to be used by the sort comparator when
ordering all the \idxpl{glossaryentry}.  If omitted, the value is given by the
\gloskey{name} field unless one of the package options
\opteqvalref{sort}{def} and \opteqvalref{sort}{use} have been
used.  With \option{mkidx} it's best to use the \gloskey{sort} key
if the \gloskey{name} contains commands (for example,
\code{\gls{ensuremath}\marg{\cmd{alpha}}}) and with
\options{mkidx,xdy}, it's strongly recommended as the \idx{indexing}
may fail if you don't (see below).

You can also override the \gloskey{sort} key by redefining
\gls{glsprestandardsort} (see \sectionref{sec:pkgopts-sort}).

\begin{bib2gls}
The \gloskey{sort} key shouldn't be used with \app{bib2gls}. It has
a system of fallbacks that allow different types of \idxpl{entry} to
obtain the sort value from the most relevant field. See the
\app{bib2gls} manual for further details, and see also
\bibglsgallery{sorting}.
\end{bib2gls}

\option{noidx} by default strips the \glslink{latexexlatinchar}{standard
\LaTeX\ accents} (that is, accents generated by core \LaTeX\ commands) from the
\gloskey{name} key when it sets the \gloskey{sort} key. So with
\option{noidx}:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{
  \gloskeyval{name}{\gls{cs.apos}elite},
  \gloskeyval{description}{select group of people}
}
\end{codebox}
This is equivalent to:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{
  \gloskeyval{name}{\gls{cs.apos}elite},
  \gloskeyval{description}{select group of people}
  \gloskeyval{sort}{elite}
}
\end{codebox}
Unless you use the package option \optval{sanitizesort}{true}, in
which case it's equivalent to:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{
  \gloskeyval{name}{\gls{cs.apos}elite},
  \gloskeyval{description}{select group of people}
  \gloskeyval{sort}{\sym{bksl}\sym+{apos}elite},
}
\end{codebox}
This will place the \idx{entry} before the \qt{A} \idx{lettergroup} since the
sort value starts with a symbol (a literal backslash \sym{bksl}).
Note that \option{noidx} shouldn't be used with \idx{utf8}
characters. With old \LaTeX\ kernels, it was able to convert a
\idx{utf8} character, such as \code{\'e}, to an \idx{ascii}
equivalent but this is no longer possible.

With \options{mkidx,xdy}, the default value of \gloskey{sort} will either be
set to the \gloskey{name} key (if \optval{sanitizesort}{true}) or it
will set it to the expansion of the \gloskey{name} key (if
\optval{sanitizesort}{false}).

\begin{important}
Take care with \app{xindy} (\option{xdy}): if you have \idxpl{entry} with the same
\gloskey{sort} value they will be treated as the
same entry. If you use \app{xindy} and aren't using the
\optvalref{sort}{def}
or \optvalref{sort}{use} sort methods, \strong{always} use the \gloskey{sort}
key for entries where the name just consists of commands
(for example \gloskeyval{name}{\csfmt{alpha}}).

Take care if you use \option{noidx} and the \gloskey{name} contains fragile
commands. You will either need to explicitly set the \gloskey{sort}
key or use the \optval{sanitizesort}{true} package option (unless
you use the \optvalref{sort}{def} or \optvalref{sort}{use} sort methods).
\end{important}

\optiondef{gloskey.type}
This specifies the label of the \idx{glossary} in which this entry
belongs. If omitted, the default \idx{glossary} identified by
\gls{glsdefaulttype} is assumed unless \gls{newacronym} is used (see
\sectionref{sec:acronyms}).

Six keys are provided for any additional information the user may want
to specify.  (For example, an associated dimension or an alternative
plural or some other grammatical construct.) Alternatively, you can
add new keys using \gls{glsaddkey} or \gls{glsaddstoragekey} 
(see \sectionref{sec:addkey}).

\optiondef{gloskey.user1}
The first user key.

\optiondef{gloskey.user2}
The second user key.

\optiondef{gloskey.user3}
The third user key.

\optiondef{gloskey.user4}
The fourth user key.

\optiondef{gloskey.user5}
The fifth user key.

\optiondef{gloskey.user6}
The sixth user key.

\optiondef{gloskey.nonumberlist}
If the value is missing or is \optfmt{true}, this will suppress 
the \idx+{numberlist} just for
this \idx{entry}. Conversely, if you have used the package option
\optval{nonumberlist}{true}, you can activate the \idx{numberlist} just
for this entry with \gloskeyval{nonumberlist}{false}.
(See \sectionref{sec:numberlists}.)

This key works by adding \gls{glsnonextpages}
(\gloskeyval{nonumberlist}{true}) or \gls{glsnextpages}
(\gloskeyval{nonumberlist}{false}) to the \idx{indexing} information
for \options{mkidx,xdy}. Note that this means that if the entry is
added to the \idx{glossary} simply because it has an \indexed\
descendent (and has not been \indexed\ itself) then the first
\indexed\ sub-entry that follows will have its \idx{numberlist} suppressed
instead.

With \option{noidx}, this key saves the appropriate command in the
\glosfield{prenumberlist} internal field, which is used by
\gls{glsnoidxprenumberlist}.

\optiondef{gloskey.see}
This key essentially provides a convenient shortcut that performs
\begin{compactcodebox*}
\gls{glssee}\oargm{tag}\margm{entry-label}\margm{xr-list}
\end{compactcodebox*}
after the \idx{entry} has been defined. (See \sectionref{sec:crossref}.) 
It was originally designed for synonyms that may not occur in the
document text but needed to be included in the \idx{glossary} in order to
redirect the reader. Note that it doesn't \idxc{indexing}{index} the cross-referenced
\idx{entry} (or \idxpl{entry}) as that would interfere with their \idxpl{numberlist}.

\begin{important}
Using the \gloskey{see} key will \emph{automatically add this \idx{entry}
to the \idx{glossary}}, but will not automatically add the
cross-referenced \idx{entry}.
\end{important}

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{courgette}\marg{\gloskeyval{name}{courgette},
  \gloskeyval{description}{variety of small marrow}}
\gls{newglossaryentry}\marg{zucchini}\marg{\gloskeyval{name}{zucchini},
  \gloskeyval{description}{(North American)},
  \gloskeyval{see}{courgette}}
\end{codebox}
This defines two entries (courgette and zucchini) and automatically
adds a cross-reference from zucchini to courgette. (That is, it adds
\qt{\emph{see} courgette} to zucchini's \idx{numberlist}.) This
doesn't automatically \idxc{indexing}{index} courgette since this would create an
unwanted \location\ in courgette's \idx{numberlist}. (Page~1, if the
definitions occur in the \idx{preamble/document}.)

Note that while it's possible to put the cross-reference in the
description instead, for example:
\begin{codebox}
\gls{newglossaryentry}\marg{zucchini}\marg{\gloskeyval{name}{zucchini},
  \gloskeyval{description}{(North American) see \gls{gls}\marg{courgette}}}
\end{codebox}
this won't \idxc{indexing}{index} the zucchini entry, so if zucchini
isn't \indexed\ elsewhere (with commands like \gls{gls} or \gls{glsadd}) then it won't
appear in the \idx{glossary} even if courgette does.

The referenced \idx{entry} should be supplied as the value to this key.
If you want to override the \qt{see} tag, you can supply the new
tag in square brackets before the label. For example
\gloskeyval{see}{[see also]\marg{anotherlabel}}.

\begin{warning}
If you have suppressed the \idx+{numberlist}, the cross-referencing
information won't appear in the \idx{glossary}, as it forms part of
the \idx{numberlist}.
\end{warning}

You can override this for individual \idxpl{glossaryentry} using
\gloskeyval{nonumberlist}{false}.  Alternatively, you can use the
\opt{seeautonumberlist} package option.  For further details, see
\sectionref{sec:crossref}.

\begin{important}
For \options{mkidx,xdy}, \gls{makeglossaries} must be used before any occurrence of
\gls{newglossaryentry} that contains the \gloskey{see} key.
\end{important}

Since it's useful to suppress the \idx{indexing} while working on a draft
document, consider using the \opt{seenoindex} package option to
warn about or ignore the \gloskey{see} key while \gls{makeglossaries} is
commented out.

If you use the \gloskey{see} key, you may want to consider using the
\sty{glossaries-extra} package which additionally
provides a \gloskey+{seealso} and \gloskey+{alias} key. If you want to
avoid the automatic \idx{indexing} triggered by the \gloskey{see} key,
consider using \option{b2g}. See also the FAQ item 
\faqitem{whyseekeyautoindex}{Why does the see key automatically index the entry?}

\begin{bib2gls}
The analogous \app{bib2gls} \gloskey{see}, \gloskey{seealso} and
\gloskey{alias} fields have a slightly different meaning. The
\resourceopt{selection} resource option determines the behaviour.
\end{bib2gls}

\optiondef{gloskey.seealso}
This key is only available with \sty{glossaries-extra} and is
similar to \gloskey{see} but it doesn't allow for the optional tag.
The \sty{glossaries-extra} package provides \gls{seealsoname} and
\gloskeyval{seealso}{xr-list} is essentially like
\gloskeyval{see}{[\gls{seealsoname}]\meta{xr-list}}
(\options{xdy,b2g} may treat these differently).

\optiondef{gloskey.alias}
This key is only available with \sty{glossaries-extra} and is
another form of cross-referencing.  An entry can be aliased to
another entry with \gloskeyval{alias}{other-label}. This behaves like
\gloskeyval{see}{other-label} but also alters the behaviour of commands
like \gls{gls} so that they \idxc{indexing}{index} the \idx{entry} 
given by \meta{label} instead of the original \idx{entry}. (See, for example,
\gallerypage{aliases}{Gallery: Aliases}.)

\begin{bib2gls}
More variations with the \gloskey{alias} key are available with \app{bib2gls}.
\end{bib2gls}

\optiondef{gloskey.counter}
This key will set the default \idx{locationcounter} for the given
\idx{entry}. This will override the \idxc{locationcounter}{counter}
assigned to the entry's \idx{glossary} in the final optional
argument of \gls{newglossary} (if provided) and the counter
identified by the \opt{counter} package option. The
\idx{locationcounter} can be overridden by the \glsopt{counter}
option when using the \gls{glslike} and \gls{glstextlike} commands.

\optiondef{gloskey.category}
This key is only available with \sty{glossaries-extra} and is used
to assign a category to the \idx{entry}. The value should be a label that
can be used to identify the category. See
\sty{glossaries-extra} manual for further details.

The following keys are reserved for \gls{newacronym} (see
\sectionref{sec:acronyms}) and also for \gls{newabbreviation} (see the
\sty{glossaries-extra} manual): \inlineglsdef[optdef]{opt.gloskey.long}, 
\inlineglsdef[optdef]{opt.gloskey.longplural},
\inlineglsdef[optdef]{opt.gloskey.short} and
\inlineglsdef[optdef]{opt.gloskey.shortplural}.
You can use \gloskey{longplural} and \gloskey{shortplural} in the
optional argument of \gls{newacronym} (or \gls{newabbreviation}) to
override the defaults, but don't explicitly use the \gloskey{long}
or \gloskey{short} keys as that may interfere with
\idx{acronymstyle} (or \idx{abbrvstyle}).

\begin{bib2gls}
There are also special internal field names used by \app{bib2gls}.
See the \app{bib2gls} manual for further details.
\end{bib2gls}

The supplementary packages \sty{glossaries-prefix} (\sectionref{sec:prefix}) and
\sty{glossaries-accsupp} (\sectionref{sec:accsupp}) provide additional keys.

\begin{important}
Avoid using any of the \gls{glslike} or \gls{glstextlike} commands within
the \gloskey{text}, \gloskey{first}, \gloskey{short} or
\gloskey{long} keys (or their plural equivalent) or any
other key that you plan to access through those commands.
(For example, the \gloskey{symbol} key if you intend to use
\gls{glssymbol}.) Otherwise you can up with nested links, which
can cause complications. You can use them within the value of keys 
that won't be accessed through those commands. For example,
the \gloskey{description} key if you don't use \gls{glsdesc}.
Additionally, they'll confuse the formatting placeholder commands, such as
\gls{glslabel}. The \sty{glossaries-extra} package provides
\gls{glsxtrp} for this type of situation.
\end{important}

With older \LaTeX\ kernels and pre-2.08 versions of \sty{mfirstuc}, 
if the name starts with \idx{nonlatinchar}, you need to group the character, 
otherwise it will cause a problem for commands like \gls{Gls} and \gls{Glspl}. 
For example:
\begin{codebox}
\comment{\sty{mfirstuc} v2.07}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\marg{\gls{cs.apos}e}lite},
\gloskeyval{description}{select group or class}}
\end{codebox}
Note that the same applies with \sty{inputenc}:
\begin{codebox}
\comment{\sty{mfirstuc} v2.07}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\marg{\'e}lite},
\gloskeyval{description}{select group or class}}
\end{codebox}
This doesn't apply for \XeLaTeX\ or \LuaLaTeX\ documents or with
\sty{mfirstuc} v2.08+.
\begin{codebox}
\comment{\sty{mfirstuc} v2.08}
\gls{newglossaryentry}\marg{elite}\marg{\gloskeyval{name}{\'elite},
\gloskeyval{description}{select group or class}}
\end{codebox}
See the \sty{mfirstuc} manual for further details.

Note that in the above \idx{utf8} examples, you will also need to
supply the \gloskey{sort} key if you are using \optionsor{noidx,mkidx}
whereas \app{xindy} (\option{xdy}) is usually able to sort
\idxpl{nonlatinchar} correctly.

\section{Plurals}
\label{sec:plurals}

You may have noticed from above that you can specify the plural form
when you define an \idx{entry}. If you omit this, the plural will be 
obtained by appending: 
\cmddef{glspluralsuffix}
to the singular form.  
This command may expand when the \idx{entry} is defined, if expansion is
on for the relevant keys, or may not expand until the \idx{entry} is
referenced, if expansion is off or if the suffix has been hidden
inside non-expanding context (which can happen when defining
\idxpl{acronym} or \idxpl{abbreviation}).

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},\gloskeyval{description}{a fully grown
female of any bovine animal}}
\end{codebox}
defines a new \idx{entry} whose singular form is \qt{cow} and plural form
is \qt{cows}. However, if you are writing in archaic English, you
may want to use \qt{kine} as the plural form, in which case you
would have to do:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},\gloskeyval{plural}{kine},
\gloskeyval{description}{a fully grown female of any bovine animal}}
\end{codebox}

If you are writing in a language that supports
multiple plurals (for a given term) then use the \gloskey{plural} key
for one of them and one of the user keys to specify the
other plural form. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{
  \gloskeyval{name}{cow},
  \gloskeyval{description}{a fully grown female of any bovine animal 
               (plural cows, archaic plural kine)},
  \gloskeyval{user1}{kine}}
\end{codebox}
You can then use \code{\gls{glspl}\marg{cow}} to produce \qt{cows} and 
\code{\gls{glsuseri}\marg{cow}} to produce \qt{kine}. You can, of course,
define an easy to remember synonym. For example:
\begin{codebox}
\cmd{let}\cmd{glsaltpl}\gls{glsuseri}
\end{codebox}
Then you don't have to remember which key you used to store the
second plural. (Be careful with using \csfmt{let} as it doesn't
check if the command already exists.)

Alternatively, you can define your own keys using
\gls{glsaddkey}, described in \sectionref{sec:addkey} (or simply use
\gls{glsdisp} or \gls{glslink} with the appropriate text).

If you are using a language that usually forms plurals
by appending a different letter, or sequence of letters, you can
redefine \gls{glspluralsuffix} as required. However, this must be
done \emph{before} the entries are defined and is unreliable for
multilingual documents. For languages that don't
form plurals by simply appending a suffix, all the plural forms must be 
specified using the \gloskey{plural} key (and the \gloskey{firstplural}
key where necessary). 

\section{Other Grammatical Constructs}
\label{sec:grammar}

You can use the six user keys to provide alternatives, such as
participles. For example:
\begin{codebox}
\cmd{let}\cmd{glsing}\gls{glsuseri}
\cmd{let}\cmd{glsd}\gls{glsuserii}
\codepar
\cmd{newcommand}*\marg{\cmd{ingkey}}\marg{\gloskey{user1}}
\cmd{newcommand}*\marg{\cmd{edkey}}\marg{\gloskey{user2}}
\codepar
\cmd{newcommand}*\marg{\cmd{newword}}[3][]\marg{\comment{}
  \gls{newglossaryentry}\marg{\#2}\marg{\comment{}
   \gloskeyval{name}{\#2},\comment{}
   \gloskeyval{description}{\#3},\comment{}
   \cmd{edkey}=\marg{\#2ed},\comment{}
   \cmd{ingkey}=\marg{\#2ing},\#1\comment{}
  }%
}
\end{codebox}
With the above definitions, I can now define terms like this:
\begin{codebox}
\cmd{newword}\marg{play}\marg{to take part in activities for enjoyment}
\cmd{newword}[\cmd{edkey}=\marg{ran},\cmd{ingkey}=\marg{running}]\marg{run}\marg{to move fast using 
the legs}
\end{codebox}
and use them in the text:
\begin{codebox}
Peter is \cmd{glsing}\marg{play} in the park today.
\codepar
Jane \cmd{glsd}\marg{play} in the park yesterday.
\codepar
Peter and Jane \cmd{glsd}\marg{run} in the park last week.
\end{codebox}

Alternatively, you can define your own keys using
\gls{glsaddkey}, described below in \sectionref{sec:addkey}.
It may, however, be simpler just to use \gls{glslink} or
\gls{glsdisp} with the appropriate \idx{linktext}.

\section{Additional Keys}
\label{sec:addkey}

You can define your own custom keys using the
commands described in this section. There are two types of keys:
those for use within the document and those to store information
used behind the scenes by other commands.

For example, if you want to add a key that indicates the associated
unit for a~term, you might want to reference this unit in your
document. In this case use \gls{glsaddkey} described in 
\sectionref{sec:glsaddkey}. If, on the other hand, you want to add a
key to indicate to a \idx{glossarystyle} or \idx{acronymstyle} that
this \idx{entry} should be formatted differently to other
\idxpl{entry}, then you can use \gls{glsaddstoragekey} described in
\sectionref{sec:glsaddstoragekey}.

In both cases, a new command \meta{no link cs} will be defined that
can be used to access the value of this key (analogous to commands
such as \gls{glsentrytext}). This can be used in an expandable
context (provided any fragile commands stored in the key have been
protected). The new keys must be added using \gls{glsaddkey} or
\gls{glsaddstoragekey} before \idxpl{glossaryentry} are defined.

\subsection{Document Keys}
\label{sec:glsaddkey}

A custom key that can be used in the document is defined using:
\cmddef{glsaddkey}
where the arguments are as follows:
\begin{description}
\item[\meta{key}] is the new key to use in \gls{newglossaryentry}
(or similar commands such as \gls{longnewglossaryentry});
\item[\meta{default value}] is the default value to use if this key
isn't used in an entry definition (this may reference the current
entry label via \gls{glslabel}, but you will have to switch on
expansion via the starred version of \gls{glsaddkey} and protect
fragile commands);
\item[\meta{no link cs}] is the control sequence to use analogous
to commands like \gls{glsentrytext};
\item[\meta{no link ucfirst cs}] is the control sequence to use analogous
to commands like \gls{Glsentrytext};
\item[\meta{link cs}] is the control sequence to use analogous
to commands like \gls{glstext};
\item[\meta{link ucfirst cs}] is the control sequence to use analogous
to commands like \gls{Glstext};
\item[\meta{link allcaps cs}] is the control sequence to use analogous
to commands like \gls{GLStext}.
\end{description}
The starred version of \gls{glsaddkey} switches on expansion for this
key. The unstarred version doesn't override the current expansion
setting.

\begin{example}{Defining Custom Keys}{ex:addkey}
Suppose I want to define two new keys, \optfmt{ed} and \optfmt{ing},
that default to the entry text followed by \qt{ed} and \qt{ing},
respectively. The default value will need expanding in both cases, so 
I need to use the starred form:
\begin{codebox}
\comment{Define "ed" key:}
 \gls{glsaddkey}*
  \marg{ed}\comment{key}
  \marg{\gls{glsentrytext}\marg{\gls{glslabel}}ed}\comment{default value}
  \marg{\cmd{glsentryed}}\comment{command analogous to \gls{glsentrytext}}
  \marg{\cmd{Glsentryed}}\comment{command analogous to \gls{Glsentrytext}}
  \marg{\cmd{glsed}}\comment{command analogous to \gls{glstext}}
  \marg{\cmd{Glsed}}\comment{command analogous to \gls{Glstext}}
  \marg{\cmd{GLSed}}\comment{command analogous to \gls{GLStext}}
\codepar
\comment{Define "ing" key:}
 \gls{glsaddkey}*
  \marg{ing}\comment{key}
  \marg{\gls{glsentrytext}\marg{\gls{glslabel}}ing}\comment{default value}
  \marg{\cmd{glsentrying}}\comment{command analogous to \gls{glsentrytext}}
  \marg{\cmd{Glsentrying}}\comment{command analogous to \gls{Glsentrytext}}
  \marg{\cmd{glsing}}\comment{command analogous to \gls{glstext}}
  \marg{\cmd{Glsing}}\comment{command analogous to \gls{Glstext}}
  \marg{\cmd{GLSing}}\comment{command analogous to \gls{GLStext}}
\end{codebox}
Now I can define some \idxpl{entry}:
\begin{codebox}
\comment{No need to override defaults for this entry:}
\gls{newglossaryentry}\marg{jump}\marg{\gloskeyval{name}{jump},\gloskeyval{description}{}}
\codepar
\comment{Need to override defaults on these entries:}
\gls{newglossaryentry}\marg{run}\marg{\gloskeyval{name}{run},
  ed=\marg{ran},
  ing=\marg{running},
  \gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{waddle}\marg{\gloskeyval{name}{waddle},
  ed=\marg{waddled},
  ing=\marg{waddling},
  \gloskeyval{description}{}}
\end{codebox}

These \idxpl{entry} can later be used in the document:
\begin{codebox}
The dog \cmd{glsed}\marg{jump} over the duck.
\codepar
The duck was \cmd{glsing}\marg{waddle} round the dog.
\codepar
The dog \cmd{glsed}\marg{run} away from the duck.
\end{codebox}
For a complete document, see the sample file \samplefile{-newkeys}.
\end{example}

\subsection{Storage Keys}
\label{sec:glsaddstoragekey}

A custom key that can be used for simply storing information is 
defined using:
\cmddef{glsaddstoragekey}
where the arguments are as the first three arguments of
\gls{glsaddkey}, described above in \sectionref{sec:glsaddkey}.

This is essentially the same as \gls{glsaddkey} except that it
doesn't define the additional commands. You can access or update
the value of your new field using the commands described in 
\sectionref{sec:fetchset}.

\begin{example}{Defining Custom Storage Key (Acronyms and Initialisms)}{ex:addstoragekey}
Suppose I want to define acronyms (an abbreviation that is
pronounced as a word) and other forms of abbreviations, such as
initialisms, but I want them all in the same \idx{glossary} and I
want the acronyms on \idx{firstuse} to be displayed with the short
form followed by the long form in parentheses, but the opposite way
round for other forms of abbreviations. (The \sty{glossaries-extra}
package provides a simpler way of achieving this.)

Here I can define a new key that determines whether the term is
actually an acronym rather than some other form of abbreviation. I'm
going to call this key \optfmt{abbrtype} (since \gloskey{type}
already exists):
\begin{codebox}
\gls{glsaddstoragekey}
 \marg{abbrtype}\comment{key/field name}
 \marg{word}\comment{default value if not explicitly set}
 \marg{\cmd{abbrtype}}\comment{custom command to access the value if required}
\end{codebox}

Now I can define a \idxc{acronymstyle}{style} that looks up the value of 
this new key to determine how to display the full form:
\begin{codebox}
\gls{newacronymstyle}
 \marg{mystyle}\comment{style name}
 \marg{\comment{Use the generic display}
   \gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}\comment{}
 }\comment{}
 \marg{\comment{Put the long form in the description}
   \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
       \gloskeyval{description}{\cmd{the}\gls{glslongtok}}}\comment{}
   \comment{For the full format, test the value of the "abbrtype" key.}
   \comment{If it's set to "word" put the short form first with}
   \comment{the long form in brackets.}
   \cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }\comment{}
    \marg{\comment{is another form of abbreviation}
     \gls{glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
   }\comment{}
   \comment{\idx{sentencecase} version:}
   \cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{Glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }
    \marg{\comment{is another form of abbreviation}
     \gls{Glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
   }\comment{}
   \comment{plural}
   \cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}\comment{}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }\comment{}
    \marg{\comment{is another form of abbreviation}
     \gls{glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
  }\comment{}
  \comment{plural and \idx{sentencecase}}
  \cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}\comment{}
    \marg{\comment{is a proper acronym}
      \cmd{protect}\gls{firstacronymfont}\marg{\gls{Glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\gls{space}
       (\gls{glsentrylong}\marg{\idx{hashhash}1})\comment{}
    }\comment{}
    \marg{\comment{is another form of abbreviation}
     \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
      (\cmd{protect}\gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
    }\comment{}
  }\comment{}
  \comment{Just use the short form as the name part in the \idx{glossary}:}
  \cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{}
     \gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}}\comment{}
  \comment{Sort by the short form:}
  \cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}1}\comment{}
  \comment{Just use the surrounding font for the short form:}
  \cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\idx{hashhash}1}\comment{}
  \comment{Same for \idx{firstuse}:}
  \cmd{renewcommand}*\marg{\gls{firstacronymfont}}[1]\marg{\gls{acronymfont}\marg{\idx{hashhash}1}}\comment{}
  \comment{Default plural suffix if the plural isn't explicitly set}
  \cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glspluralsuffix}}\comment{}
 }
\end{codebox}
Remember that the new style needs to be set before defining any
terms:
\begin{codebox}
\gls{setacronymstyle}\marg{mystyle}
\end{codebox}

Since it may be a bit confusing to use \gls{newacronym} for something
that's not technically an acronym, let's define a new command for
initialisms:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newinitialism}}[4][]\marg{\comment{}
  \gls{newacronym}\oarg{abbrtype=initialism,\#1}\marg{\#2}\marg{\#3}\marg{\#4}\comment{}
}
\end{codebox}
Now the \idxpl{entry} can all be defined:
\begin{codebox}
\gls{newacronym}\marg{radar}\marg{radar}\marg{radio detecting and ranging}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\gls{newacronym}\marg{scuba}\marg{scuba}\marg{self-contained underwater breathing
apparatus}
\cmd{newinitialism}\marg{dsp}\marg{DSP}\marg{digital signal processing}
\cmd{newinitialism}\marg{atm}\marg{ATM}\marg{automated teller machine}
\end{codebox}
On \idx{firstuse}, \code{\gls{gls}\marg{radar}} will produce \qt{radar (radio
detecting and ranging)} but \code{\gls{gls}\marg{dsp}} will produce \qt{DSP
(digital signal processing)}.

For a complete document, see the sample file
\samplefile{-storage-abbr}.
\end{example}

In the above example, if \gls{newglossaryentry} is explicitly used
(instead of through \gls{newacronym}) the \optfmt{abbrtype} key will
be set to its default value of \qt{word} but the \gls{ifglshaslong}
test in the custom \idx{acronymstyle} will be false (since the
\gloskey{long} key hasn't been set) so the \idx{displaystyle} will switch
to that given by \gls{glsgenentryfmt} and they'll be no test
performed on the \optfmt{abbrtype} field.

\begin{example}{Defining Custom Storage Key (Acronyms and
Non-Acronyms with Descriptions)}{ex:addstoragekey2}
The previous example can be modified if the \gloskey{description}
also needs to be provided. Here I've changed \qt{word} to
\qt{acronym}:
\begin{codebox}
\gls{glsaddstoragekey}
 \marg{abbrtype}\comment{key/field name}
 \marg{acronym}\comment{default value if not explicitly set}
 \marg{\cmd{abbrtype}}\comment{custom command to access the value if required}
\end{codebox}
This may seem a little odd for non-abbreviated \idxpl{entry} that are defined using
\gls{newglossaryentry} directly, but \gls{ifglshaslong} can be used
to determine whether or not to reference the value of this new
\optfmt{abbrtype} field.

The new \idx{acronymstyle} has a~minor modification that forces the user
to specify a description. In the previous example, the line:
\begin{codebox}
   \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
     \gloskeyval{description}{\cmd{the}\gls{glslongtok}}}\comment{}
\end{codebox}
needs to be changed to:
\begin{codebox}
   \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{}
\end{codebox}
Additionally, to accommodate the change in the default value of the
\optfmt{abbrtype} key, all instances of 
\begin{codebox}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{word}
\end{codebox}
need to be changed to:
\begin{codebox}
    \gls{ifglsfieldeq}\marg{\idx{hashhash}1}\marg{abbrtype}\marg{acronym}
\end{codebox}

Once this new \idxc{acronymstyle}{style} has been set, the new acronyms can be defined
using the optional argument to set the description:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{system for detecting the position and
speed of aircraft, ships, etc}}\marg{radar}\marg{radar}\marg{radio detecting
and ranging}
\end{codebox}

No change is required for the definition of \cmd{newinitialism} but
again the optional argument is required to set the description:
\begin{codebox}
\cmd{newinitialism}\oarg{\gloskeyval{description}{mathematical manipulation of an
information signal}}\marg{dsp}\marg{DSP}\marg{digital signal processing}
\end{codebox}

We can also accommodate contractions in a similar manner to the
initialisms:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newcontraction}}[4][]\marg{\comment{}
  \gls{newacronym}\oarg{abbrtype=contraction,\#1}\marg{\#2}\marg{\#3}\marg{\#4}\comment{}
}
\end{codebox}
The contractions can similarly been defined using this new command:
\begin{codebox}
\cmd{newcontraction}[\gloskeyval{description}{front part of a ship below the
deck}]\marg{focsle}\marg{fo'c's'le}\marg{forecastle}
\end{codebox}

Since the custom \idx{acronymstyle} just checks if \optfmt{abbrtype} is
\qt{acronym}, the contractions will be treated the same as the
initialisms, but the \idxc{acronymstyle}{style} could be modified by a further test of
the \optfmt{abbrtype} value if required.

To test regular non-abbreviated entries, I've also defined a simple
word:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{a fruit}}
\end{codebox}

Now for a new \idx{glossarystyle} that provides information about the
abbreviation (in addition to the description):
\begin{codebox}
\gls{newglossarystyle}
 \marg{mystyle}\comment{style name}
 \marg{\comment{base it on the "list" style}
   \gls{setglossarystyle}\marg{list}\comment{}
   \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
     \gls{item}\oarg{\gls{glsentryitem}\marg{\idx{hashhash}1}\comment{}
          \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}}
       \gls{ifglshaslong}\marg{\idx{hashhash}1}\comment{}
       \marg{ (\cmd{abbrtype}\marg{\idx{hashhash}1}: \gls{glsentrylong}\marg{\idx{hashhash}1})\gls{space}}\marg{}\comment{}
       \gls{glossentrydesc}\marg{\idx{hashhash}1}\gls{glspostdescription}\gls{space} \idx{hashhash}2}\comment{}
 }
\end{codebox}
This uses \gls{ifglshaslong} to determine whether or not the term is
an abbreviation. (An alternative is to use \gls{ifglshasshort}. The
\gloskey{long} and \gloskey{short} keys are only set for
\idxpl{acronym}\slash\idxpl{abbreviation}.) 

If the entry has an \gloskey{short}\slash\gloskey{long} value, the full form is
supplied in parentheses and \csfmt{abbrtype} (defined by
\gls{glsaddstoragekey} earlier) is used to indicate the type of
abbreviation.

With this style set, the \qt{apple} entry is simply displayed in
the glossary as:
\begin{description}
\item[apple] a fruit.
\end{description}
but the abbreviations are displayed in the form
\begin{description}
\item[laser] (acronym: light amplification by
stimulated emission of radiation) device that creates a narrow beam
of intense light.
\end{description}
(for acronyms) or
\begin{description}
\item[DSP] (initialism: digital signal processing) mathematical
manipulation of an information signal.
\end{description}
(for initalisms) or
\begin{description}
\item[fo'c's'le] (contraction: forecastle) front part of a ship
below the deck.
\end{description}
(for contractions).

For a complete document, see \samplefile{-storage-abbr-desc}.
\end{example}

\section{Expansion}
\label{sec:expansion}

When you define new \idxpl{glossaryentry} expansion is performed by
default, except for the \gloskey{name}, \gloskey{description},
\gloskey{descriptionplural}, \gloskey{symbol}, \gloskey{symbolplural}
and \gloskey{sort} keys (these keys all have expansion suppressed via
\gls{glssetnoexpandfield}).

You can switch expansion on or off for individual keys using:
\cmddef{glssetexpandfield}
or
\cmddef{glssetnoexpandfield}
respectively, where \meta{field} is the \idx{internalfieldlabel} corresponding to
the key. In most cases, this is the same as the name of the key
except for those listed in \tableref{tab:fieldmap}.

\begin{table}[htbp]
\caption{Key to Field Mappings}
\label{tab:fieldmap}
\centering
\begin{tabular}{ll}
\bfseries Key & \bfseries Field\\
\gloskey+{sort} & \glosfielddef{sortvalue}\\
\gloskey+{firstplural} & \glosfielddef{firstpl}\\
\gloskey+{description} & \glosfielddef{desc}\\
\gloskey+{descriptionplural} & \glosfielddef{descplural}\\
\gloskey+{user1} & \glosfielddef{useri}\\
\gloskey+{user2} & \glosfielddef{userii}\\
\gloskey+{user3} & \glosfielddef{useriii}\\
\gloskey+{user4} & \glosfielddef{useriv}\\
\gloskey+{user5} & \glosfielddef{userv}\\
\gloskey+{user6} & \glosfielddef{uservi}\\
\gloskey+{longplural} & \glosfielddef{longpl}\\
\gloskey+{shortplural} & \glosfielddef{shortpl}
\end{tabular}
\end{table}

Any keys that haven't had the expansion explicitly set using
\gls{glssetexpandfield} or \gls{glssetnoexpandfield} are governed by
\cmddef{glsexpandfields}
and
\cmddef{glsnoexpandfields}

If your entries contain any fragile commands, I recommend you switch
off expansion via \gls{glsnoexpandfields}. (This should be used
before you define the entries.)

\begin{information}
Both \gls{newacronym} and \gls{newabbreviation} partially suppress
expansion of some keys regardless of the above expansion settings.
\end{information}

\section{Sub-Entries}
\label{sec:subentries}

A \inlineidxdef{sub-entry} is created by setting the \gloskey+{parent} key. These
will normally be sorted so that they are placed immediately after
their parent \idx{entry}. However, some sort methods aren't suitable when
there are \idxpl{sub-entry}. In particular, \idxpl{sub-entry} are problematic
with \option{noidx}, and with \option{unsrt} the \idxpl{sub-entry} must
be defined immediately after their parent \idx{entry} (rather than at any
point after the parent \idx{entry} has been defined).

The \idx+{hierarchicallevel} indicates the \idx{sub-entry} level. An
\idx{entry} with no parent (a top level entry) is a \idx{hierarchicallevel}[~0]
entry. An \idx{entry} with a parent has a \idx{hierarchicallevel} that's
one more than its parent's level. The level is calculated when an
\idx{entry} is defined. 

\begin{information}
The \idx{hierarchicallevel} is stored in the \glosfield{level}
internal field. It can be accessed using commands like
\gls{glsfieldfetch} or (with \sty{glossaries-extra})
\gls{glsxtrusefield}, but neither the \glosfield{level} nor the
\gloskey{parent} values should be altered as it can cause
inconsistencies in the sorting and \idx{glossary} formatting.  The
\idx{indexing} syntax for \options{mkidx,xdy} is generated when the
entry is first defined, so it's too late to change the hierarchy
after that, and \app{bib2gls} obtains the hierarchical
information from the \ext{bib} files and the resource options.
Note, however, that \sty{glossaries-extra} does allow the ability to
locally alter the level with the \printglossopt{leveloffset} option,
which is mainly intended for nested \idx{glossary}. See the
\sty{glossaries-extra} manual for further details and also
\gallerypage{bib2gls-inner}{Gallery: Inner or Nested Glossaries}.
\end{information}

There are two different types of \idxpl{sub-entry}: those that have the
same name as their parent (\idxpl{homograph}, see
\sectionref{sec:homographs}) and those that establish a hierarchy
(see \sectionref{sec:hierarchical}). Both types are considered
\hierarchical\ entries from the point of view of the \sty{glossaries}
package and the \idxpl{indexingapp}, but typically \idxpl{homograph}
will have the \gloskey{name} key obtained from the parent, rather
than have it explicitly set, and have a maximum \idx{hierarchicallevel} of~1.

Not all \idxpl+{glossarystyle} support \hierarchical\ entries and
may display all the \idxpl{entry} in a flat format. Of the
\idxc{glossarystyle}{styles} that support \idxpl{sub-entry}, some
display the \idx{sub-entry}['s] name whilst others don't. Therefore
you need to ensure that you use a suitable
\idxc{glossarystyle}{style}. (See \sectionref{sec:styles} for a list
of predefined \idxpl{glossarystyle}.) If you want \hierlevel{1}
\idxpl{sub-entry} automatically numbered (in \idxpl{glossarystyle} that
support it) use the \opt{subentrycounter} package option (see
\sectionref{sec:pkgopts-printglos} for further details).

Note that the parent \idx{entry} will automatically be added to the
\idx{glossary} if any of its child \idxpl{entry} are used in the document.
If the parent \idx{entry} is not referenced in the document, it will not
have a \idx{numberlist}. Note also that \app{makeindex} has a
restriction on the maximum \hierarchical\ depth.

\subsection{Hierarchy}
\label{sec:hierarchical}

To create a \idx{glossary} with \hierarchical\ divisions, you need
to first define the division, which will be a \toplevel\ entry, and
then define the \idxpl{sub-entry} using the relevant higher level
entry as the value of the \gloskey+{parent} key. (In a
\hierarchical\ context, a higher level indicates a numerically
smaller level number, so level~0 is one level higher than level~1.)
The top level entry may represent, for example, a topic or
classification.  A level~1 entry may represent, for example, a
sub-topic or sub-classification.

\begin{example}{Hierarchical Divisions\dash Greek and Roman 
Mathematical Symbols}{ex:hierarchical}

Suppose I want a \idx{glossary} of mathematical symbols that
are divided into Greek letters and Roman letters. Then I can define
the divisions as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{greekletter}\marg{\gloskeyval{name}{Greek letters},
\gloskeyval{description}{\gls{nopostdesc}}}
\codepar
\gls{newglossaryentry}{romanletter}\marg{\gloskeyval{name}{Roman letters},
\gloskeyval{description}{\gls{nopostdesc}}}
\end{codebox}

Note that in this example, the top level entries don't need a
description so I have set the descriptions to \gls{nopostdesc}.
This gives a blank description and suppresses the
description terminator.

I can now define my \idxpl{sub-entry} as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{pi}{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{pi}}},\gloskeyval{sort}{pi},
\gloskeyval{description}{ratio of the circumference of a circle to 
the diameter},
\gloskeyval{parent}{greekletter}}
\codepar
\gls{newglossaryentry}\marg{C}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{C}},\gloskeyval{sort}{C},
\gloskeyval{description}{Euler's constant},
\gloskeyval{parent}{romanletter}}
\end{codebox}
For a complete document, see the sample file \samplefile{tree}.

\begin{xtr}
If you want to switch to \option{unsrt}, you will need to move the
definitions of the \idxpl{sub-entry} to immediately after the definition
of their parent \idx{entry}. So, in this case, \qt{pi} needs to be defined
after \qt{greekletter} and before \qt{romanletter}.
\end{xtr}
\end{example}

\subsection{Homographs}
\label{sec:homographs}

\glsadd{homograph}%
\Idxpl{sub-entry} that have the same name as the parent \idx{entry} don't need
to have the \gloskey+{name} key explicitly set. For example, the word \qt{glossary}
can mean a list of technical words or a collection of glosses. In
both cases the plural is \qt{glossaries}. So first define the parent
entry:
\begin{codebox}
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
\gloskeyval{description}{\gls{nopostdesc}},
\gloskeyval{plural}{glossaries}}
\end{codebox}
As in the previous example, the parent entry has no description, so the description
terminator needs to be suppressed using \gls{nopostdesc}.

Now define the two different meanings of the word with the
\gloskey+{parent} key set to the above parent \idx{entry} label:
\begin{codebox}
\gls{newglossaryentry}\marg{glossarylist}\marg{
\gloskeyval{description}{list of technical words},
\gloskeyval{sort}{1},
\gloskeyval{parent}{glossary}}
\codepar
\gls{newglossaryentry}\marg{glossarycol}\marg{
\gloskeyval{description}{collection of glosses},
\gloskeyval{sort}{2},
\gloskeyval{parent}{glossary}}
\end{codebox}
Note that if I reference the parent \idx{entry} (for example,
\code{\gls{gls}\marg{glossary}}), the \location\ will be added to
the parent's \idx{numberlist}, whereas if I reference any of the
child entries (for example, \code{\gls{gls}\marg{glossarylist}}),
the \location\ will be added to the child entry's \idx{numberlist}.
Note also that since the \idxpl{sub-entry} have the same name, the
\gloskey{sort} key is required with \option{xdy} (\app{xindy}) and recommended
with \option{mkidx} (\app{makeindex}). You can use the \opt{subentrycounter} package
option to automatically number the \hierlevel{1} child entries in the
\idx{glossary} (if you use a \idx{glossarystyle} that supports it).
See \sectionref{sec:pkgopts-printglos} for further details.

In the above example, the plural form for both of the child entries
is the same as the parent entry, so the \gloskey{plural} key was
not required for the child entries. However, if the \idxpl{sub-entry}
have different plurals, they will need to be specified. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{bravo}\marg{\gloskeyval{name}{bravo},
\gloskeyval{description}{\gls{nopostdesc}}}
\codepar
\gls{newglossaryentry}\marg{bravocry}\marg{\gloskeyval{description}{cry of approval 
(pl.\ bravos)},
\gloskeyval{sort}{1},
\gloskeyval{plural}{bravos},
\gloskeyval{parent}{bravo}}
\codepar
\gls{newglossaryentry}\marg{bravoruffian}\marg{\gloskeyval{description}{hired 
ruffian or killer (pl.\ bravoes)},
\gloskeyval{sort}{2},
\gloskeyval{plural}{bravoes},
\gloskeyval{parent}{bravo}}
\end{codebox}
For a complete document, see the sample file \file{sample.tex}.

\section{Loading Entries From a File}
\label{sec:loadglsentries}

You can store all your \idx{glossaryentry} definitions in another
file and use:
\cmddef{loadglsentries}
where \meta{filename} is the name of the file containing all the
\gls{newglossaryentry}, \gls{longnewglossaryentry}, \gls{newacronym}
etc commands.  The optional argument \meta{type} is the name of the
\idx{glossary} to which those \idxpl{entry} should belong, for those
\idxpl{entry} where the \gloskey+{type} key has been omitted (or, more
specifically, for those entries whose \gloskey{type} has been set to
\gls{glsdefaulttype}, which is what \gls{newglossaryentry} uses by
default). See \samplefile{DB} for a complete example document.

\begin{information}
Commands like \gls{newacronym}, \gls{newabbreviation},
\gls{newterm}, \gls{glsxtrnewsymbol} and \gls{glsxtrnewnumber} all
set the \gloskey{type} key to the appropriate \idx{glossary}.  This
means that the \meta{type} optional argument won't apply to those
commands, unless they have \gloskeyval{type}{\gls{glsdefaulttype}}.
\end{information}

This is a~\idx+{preamble/document}-only command. You may also use \gls{input} to load
the file but don't use \gls{include}. If you find that your file is
becoming unmanageably large, you may want to consider switching to
\app{bib2gls} and use an application such as JabRef to manage the
entry definitions.

\begin{important}
If you want to use \gls{AtBeginDocument} to \gls{input} all your
\idxpl{entry} automatically at the start of the document, add the
\gls{AtBeginDocument} command \emph{before} you load the
\sty{glossaries} package (and \sty{babel}, if you are also loading
that) to avoid the creation of the
\ext+{glsdefs} file and any associated problems that are caused
by defining commands in the \env{document} environment.
(See \sectionref{sec:docdefs}.) Alternatively, if you are using
\sty{glossaries-extra}, use the \opteqvalref{docdef}{restricted}
package option.
\end{important}

\begin{example}{Loading Entries from Another File}{ex:loadgls}
Suppose I have a file called \filefmt{myentries.tex} which contains:
\begin{codebox}
\gls{newglossaryentry}\marg{perl}\marg{\gloskeyval{type}{\glostype{main}},
\gloskeyval{name}{Perl},
\gloskeyval{description}{A scripting language}}
\codepar
\gls{newglossaryentry}\marg{tex}\marg{\gloskeyval{name}{\cmd{TeX}},
\gloskeyval{description}{A typesetting language},\gloskeyval{sort}{TeX}}
\codepar
\gls{newglossaryentry}\marg{html}\marg{\gloskeyval{type}{\gls{glsdefaulttype}},
\gloskeyval{name}{html},
\gloskeyval{description}{A mark up language}}
\end{codebox}
and suppose in my \idx{preamble/document} I use the command:
\begin{codebox}
\gls{loadglsentries}\oarg{languages}\marg{myentries}
\end{codebox}
then this will add the entries \qt{tex} and \qt{html}
to the \idx{glossary} whose type is given by \optfmt{languages}, but
the entry \qt{perl} will be added to the \glostype{main} glossary, since
it explicitly sets the \gloskey{type} to \glostype{main}.
\end{example}

Now suppose I have a file \filefmt{myacronyms.tex} that contains:
\begin{codebox}
\gls{newacronym}\marg{aca}\marg{aca}\marg{a contrived acronym}
\end{codebox}
then (supposing I have defined a new \idx{glossary} type called
\optfmt{altacronym})
\begin{codebox}
\gls{loadglsentries}\oarg{altacronym}\marg{myacronyms}
\end{codebox}
will add \qt{aca} to the glossary type \glostype{acronym}, if the
package option \opt{acronym} has been specified, or will add
\qt{aca} to the glossary type \optfmt{altacronym}, if the
package option \opt{acronym} is not specified. This is
because \gls{acronymtype} is set to \gls{glsdefaulttype} if the
\opt{acronym} package option is not used so the optional argument of
\gls{loadglsentries} will work in that case, but if the
\opt{acronym} option is used then \gls{acronymtype} will be
redefined to \glostype{acronym}.

If you want to use \gls{loadglsentries} with the \opt{acronym}
package option set, there are two possible solutions to this problem:
\begin{enumerate}
\item Change \filefmt{myacronyms.tex} so that entries are defined in
the form:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{type}{\gls{glsdefaulttype}}}\marg{aca}\marg{aca}\marg{a 
contrived acronym}
\end{codebox}
and do:
\begin{codebox}
\gls{loadglsentries}\oarg{altacronym}\marg{myacronyms}
\end{codebox}

\item Temporarily change \gls{acronymtype} to the target \idx{glossary}:
\begin{codebox}
\cmd{let}\cmd{orgacronymtype}\gls{acronymtype}
\cmd{renewcommand}\marg{\gls{acronymtype}}\marg{altacronym}
\gls{loadglsentries}{myacronyms}
\cmd{let}\gls{acronymtype}\cmd{orgacronymtype}
\end{codebox}
\end{enumerate}

Note that only those entries that have been \indexed\
in the text will appear in the relevant \idxpl{glossary}.
Note also that \gls{loadglsentries} may only be used in the 
\idx{preamble/document}.

\begin{warning}
Don't use the \gloskey{see} key in a large file of entries that may
or may not be \indexed\ in the document. Similarly for
\gloskey{seealso} and \gloskey{alias} with \sty{glossaries-extra}.
If you need them and you need a large database of entries, consider
switching to \app{bib2gls}.
\end{warning}

Remember that you can use \gls{provideglossaryentry} rather than
\gls{newglossaryentry}. Suppose you want to maintain a large database
of \idxpl{acronym} or terms that you're likely to use in your documents,
but you may want to use a modified version of some of those \idxpl{entry}.
(Suppose, for example, one document may require a more detailed
description.) Then if you define the \idxpl{entry} using
\gls{provideglossaryentry} in your database file, you can override
the definition by simply using \gls{newglossaryentry} before loading
the file. For example, suppose your file (called, say,
\filefmt{terms.tex}) contains:
\begin{codebox}
\gls{provideglossaryentry}\marg{mallard}\marg{\gloskeyval{name}{mallard},
 \gloskeyval{description}{a type of duck}}
\end{codebox}
but suppose your document requires a more detailed description, you
can do:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{newglossaryentry}\marg{mallard}\marg{\gloskeyval{name}{mallard},
 \gloskeyval{description}{a dabbling duck where the male has a green head}}
\codepar
\gls{loadglsentries}\marg{terms}
\end{codebox}
Now the \qt{mallard} definition in the \filefmt{terms.tex} file
will be ignored.

\section{Moving Entries to Another Glossary}
\label{sec:moveentry}

You can move an entry from one \idx+{glossary} to another using:
\cmddef{glsmoveentry}
where \meta{entry-label} is the unique label identifying the required
\idx{entry} and \meta{target glossary label} is the unique label
identifying the \idx{glossary} in which to put the \idx{entry}. If you are
using \optionsor{mkidx,xdy}, \idxpl{entry} shouldn't be moved after the
\idxpl{indexingfile} have been opened by \gls{makeglossaries}.

\begin{warning}
Simply changing the value of the \gloskey{type} field using a
command like \gls{glsfielddef} won't correctly move the entry, since the label
needs to be removed from the old \idx{glossary}['s] internal list
and added to the new \idx{glossary}['s] internal list to allow
commands such as \gls{glsaddall} and \gls{glsunsetall} to work.
\end{warning}

Note that no check is performed to determine the existence of
the target \idx{glossary}. If you want to move an entry to a \idx{glossary}
that's skipped by \gls{printglossaries}, then define an 
\idx{ignoredglossary} with \gls{newignoredglossary}. (See
\sectionref{sec:newglossary}.) With \options{b2g,unsrt}, it's also
possible to copy an entry to another \idx{glossary} with
\gls{glsxtrcopytoglossary}. See the \sty{glossaries-extra} manual
for further details.

\begin{important}
Unpredictable results may occur if you move an entry to a different
\idx{glossary} from its parent or children.
\end{important}

\section{Drawbacks With Defining Entries in the Document Environment}
\label{sec:docdefs}

Originally, \gls{newglossaryentry} (and \gls{newacronym}) could only
be used in the \idx+{preamble/document}. I reluctantly removed this
restriction in version 1.13, but there are issues with defining
commands in the \env{document} environment instead of the
\idx{preamble/document}, which is why the restriction is maintained
for newer commands. This restriction is also reimposed for
\gls{newglossaryentry} by \option{noidx} because in that case the
\idxpl{entry} must be defined before the \ext+{aux} file is input.
(The \sty{glossaries-extra} package automatically reimposes the
\idx{preamble/document}-only restriction but provides the
\opt{docdef} package option to allow document definitions for
\options{mkidx,xdy} if necessary.)

\begin{bib2gls}
With \option{b2g}, all \idx{entry} data should be supplied in \ext{bib} files. 
From \app{bib2gls}['s] point of view, the \idxpl{entry} are defined in the
\ext{bib} files. From \TeX's point of view, the \idxpl{entry} are defined
in the \ext{glstex} files that are input by
\gls{GlsXtrLoadResources}, which is a \idx{preamble/document}-only command.
\end{bib2gls}

\subsection{Technical Issues}
\label{sec:techissues}

\begin{enumerate}
 \item If you define an \idx{entry} mid-way through your document, but
subsequently shuffle sections around, you could end up using an
\idx{entry} before it has been defined. This is essentially the same
problem as defining a command with \cmd{newcommand} in the middle of
the document and then moving things around so that the command is
used before it has been defined.

 \item \Idx{entry} information is required when displaying the \idx{glossary}.
If this occurs at the start of the document, but the \idxpl{entry} aren't
defined until later, then the \idx{entry} details are
being looked up before the \idx{entry} has been defined. This means that
it's not possible to display the content of the \idx{glossary} unless the
\idx{entry} definitions are saved on the previous \LaTeX\ run and can be
picked up at the start of the \env{document} environment on the next run
(in a similar way that \gls{label} and \gls{ref} work).

 \item If you use a package, such as \sty{babel}, that makes
certain characters active at the start of the \env{document}
environment, there can be a~problem if those characters have
a~special significance when defining \idxpl{glossaryentry}.
These characters include \idx{dblquote}, \idx{exclammark}, 
\idx{questionmark}, and \idx{pipe}. They
must not be active when defining a~\idx{glossaryentry} where they occur
in the \gloskey{sort} key (and they should be avoided in the label
if they may be active at any point in the document). Additionally, 
the comma (\sym{comma}) character and the equals (\sym{equals}) character
should not be active when using commands that have
\keyval\ arguments.

\end{enumerate}

To overcome the first two problems, as from version 4.0 the
\sty{glossaries} package modifies the definition of
\gls{newglossaryentry} at the beginning of the \env{document}
environment so that the definitions are written to an external file
(\filefmt{\gls+{jobname}.\ext+{glsdefs}}) which is then read in at the start
of the document on the next run. This means that the entry can now
be looked up in the \idx{glossary}, even if the \idx{glossary} occurs at the
beginning of the document.

There are drawbacks to this mechanism: if you modify an entry
definition, you need a second run to see the effect of your
modification in \gls{printglossary} (if it occurs at the start of the
document); this method requires an extra \gls{newwrite}, which may
exceed \TeX's maximum allocation; unexpected expansion issues could
occur.

Version 4.47 has introduced changes that have removed some of
the issues involved, and there are now warning messages if there is an
attempt to multiply define the same \idx{entry} label.

The \sty{glossaries-extra} package provides a setting 
that allows \gls{newglossaryentry} to occur in the
document environment but doesn't create the \ext{glsdefs}
file. This circumvents some problems but it means that you can't
display any of the \idxpl{glossary} before all the \idxpl{entry} have been
defined (so it's all right if all the \idxpl{glossary} are at the end of
the document but not if any occur in the front matter).
This isn't applicable with \option{b2g} as the entry data is
provided in \ext{bib} files.

\subsection{Good Practice Issues}
\label{sec:goodpractice}

\sectionref{sec:techissues} above covers technical issues that can
cause your document to have compilation errors or produce incorrect
output. This section focuses on good writing practice. The main
reason cited by users wanting to define \idxpl{entry} within the
\env{document} environment rather than in the \idx{preamble/document} is that they
want to write the definition as they type in their document text.
This suggests a \qt{stream of consciousness} style of writing that
may be acceptable in certain literary genres but is inappropriate
for factual documents.

When you write technical documents, regardless of whether it's a PhD
thesis or an article for a~journal or proceedings, you must plan what you write
in advance. If you plan in advance, you should have a fairly good
idea of the type of terminology that your document will contain,
so while you are planning, create a new file with all your \idx{entry}
definitions. If, while you're writing your document, you remember
another term you need, then you can switch over to your definition file and
add it. Most text editors have the ability to have more than one
file open at a time. The other advantage to this approach is that if
you forget the label, you can look it up in the definition file
rather than searching through your document text to find the
definition.

\section{Debugging}
\label{sec:debugging}

There are a number of commands available for use in debugging. These
show the value of an entry's field to double-check how how it has
been set. These simply use \gls{show} to show the value of the
underlying variable.

\cmddef{showgloname}

Shows the value of the \gloskey{name} field for the
entry given by \meta{entry-label}.

\cmddef{showglodesc}

Shows the value of the \gloskey{description} field for the
entry given by \meta{entry-label}.

\cmddef{showglodescplural}

Shows the value of the \gloskey{descriptionplural} field for the
entry given by \meta{entry-label}.

\cmddef{showglotext}

Shows the value of the \gloskey{text} field for the
entry given by \meta{entry-label}.

\cmddef{showgloplural}

Shows the value of the \gloskey{plural} field for the
entry given by \meta{entry-label}.

\cmddef{showglofirst}

Shows the value of the \gloskey{first} field for the
entry given by \meta{entry-label}.

\cmddef{showglofirstpl}

Shows the value of the \gloskey{firstplural} field for the
entry given by \meta{entry-label}.

\cmddef{showglosymbol}

Shows the value of the \gloskey{symbol} field for the
entry given by \meta{entry-label}.

\cmddef{showglosymbolplural}

Shows the value of the \gloskey{symbolplural} field for the
entry given by \meta{entry-label}.

\cmddef{showgloshort}

Shows the value of the \gloskey{short} field for the
entry given by \meta{entry-label}.

\cmddef{showgloshortplural}

Shows the value of the \gloskey{shortplural} field for the
entry given by \meta{entry-label}.

\cmddef{showglolong}

Shows the value of the \gloskey{long} field for the
entry given by \meta{entry-label}.

\cmddef{showglolongplural}

Shows the value of the \gloskey{longplural} field for the
entry given by \meta{entry-label}.

\cmddef{showglotype}

Shows the value of the \gloskey{type} field for the
entry given by \meta{entry-label}.

\cmddef{showglouseri}

Shows the value of the \gloskey{user1} field for the
entry given by \meta{entry-label}.

\cmddef{showglouserii}

Shows the value of the \gloskey{user2} field for the
entry given by \meta{entry-label}.

\cmddef{showglouseriii}

Shows the value of the \gloskey{user3} field for the
entry given by \meta{entry-label}.

\cmddef{showglouseriv}

Shows the value of the \gloskey{user4} field for the
entry given by \meta{entry-label}.

\cmddef{showglouserv}

Shows the value of the \gloskey{user5} field for the
entry given by \meta{entry-label}.

\cmddef{showglouservi}

Shows the value of the \gloskey{user6} field for the
entry given by \meta{entry-label}.

\cmddef{showglocounter}

Shows the value of the \gloskey{counter} field for the
entry given by \meta{entry-label}.

\cmddef{showgloparent}

Shows the value of the \gloskey{parent} field for the
entry given by \meta{entry-label}.

\cmddef{showglolevel}

Shows the hierarchical level of the entry given by
\meta{entry-label}. This is calculated when the entry is first
defined and is set to one more that the parent entry's hierarchical
level, if the \gloskey{parent} field was set.

\cmddef{showglosort}

Shows the value of the \gloskey{sort} field for the
entry given by \meta{entry-label}.

\begin{important}
The value of the \gloskey{sort} field may not match the value of the
internal \glosfield{sortvalue} field.
\end{important}

\chapter{Referencing Entries in the Document}
\label{sec:usingentries}

Once you have defined a \idx+{glossaryentry} using a command such as
\gls{newglossaryentry} (\sectionref{sec:newglosentry}) or
\gls{newacronym} (\sectionref{sec:acronyms}), you can refer to that
\idx{entry} in the document with one of the provided commands that are
describe in this manual. (There are some additional commands
provided by \sty{glossaries-extra}.) The text produced at that point
in the document (the \idx+{linktext}) is determined by the command and can also be
governed by whether or not the entry has been
\idxc{firstuseflag}{marked as used}.

Some of these commands are more complicated than others. Many of
them are robust and can't be used in fully expandable contexts, such
as in \idxpl{PDFbookmark}.

The commands are broadly divided into:
\begin{enumerate}
\item Those that display text in the document (where the formatting
can be adjusted by a style or hook) and also \idxc+{indexing}{index} the
\idx{entry} (so that it's added to the \idx{glossary}) are described in
\sectionref{sec:glslink}. This set of commands can
be further sub-divided into those that mark the entry as having been
\idxc{firstuseflag}{used} (the \gls{glslike} commands, 
\sectionref{sec:gls-like}) and those that don't
(the \gls{glstextlike} commands, \sectionref{sec:glstext-like}).

\item Those that display text in the document without \idx{indexing} or applying any
additional formatting (\sectionref{sec:glsnolink}). These typically
aren't robust or can partially expand so that they can be used in
\idxpl{PDFbookmark} (with a few exceptions).
\end{enumerate}
There are additional commands specific to entries defined with
\gls{newacronym} that are described in \sectionref{sec:longshortfull}.

\section{Links to Glossary Entries}
\label{sec:glslink}

The text which appears at the point in the document when using any
of the commands described in \sectionref{sec:gls-like} or
\sectionref{sec:glstext-like} is referred to as the \idx+{linktext}
(even if there are no \idxpl{hyperlink}). These commands also add
content to an external \idx{indexingfile} that is used to generate the relevant
\idx{entryline} in the \idx{glossary}. This information includes an associated
\location\ that is added to the \idx{numberlist} for that \idx{entry}. By
default, the \location\ refers to the page number. For further
information on \idxpl{numberlist}, see \sectionref{sec:numberlists}.
These external \idx{indexingfile} need to be post-processed by
\app{makeindex} or \app{xindy} if you have chosen
\optionsor{mkidx,xdy}. If you don't use \gls{makeglossaries} these
external files won't be created.  (\options{noidx,b2g} write the
information to the \ext{aux} file instead.)

\begin{important}
The \idx{linktext} isn't scoped by default as grouping can interfere
with spacing in \idx{mathmode}. Any unscoped declarations in the
\idx{linktext} may affect subsequent text.
\end{important}

Note that repeated use of these commands for the same \idx{entry} can
cause the \idx{numberlist} to become quite long, which may not be
particular helpful to the reader. In this case, you can use the
non-indexing commands described in \sectionref{sec:glsnolink} or
you can use the \sty{glossaries-extra} package, which
provides a means to suppress the automated \idx{indexing} of the commands listed
in this chapter. (For example, in this manual, common terms such as
\idx{glossary} have too many references in the document to list them
all in their \idx{numberlist} in the \hyperref[index]{index}. They have a custom
key created with \gls{glsaddstoragekey} that's used
to set their default \idx{indexing} option.)

\begin{important}
I strongly recommend that you don't use the commands
defined in this chapter in the arguments of sectioning or caption
commands, such as \gls+{chapter} or \gls+{caption}.

Aside from problems with expansion issues, \idxpl{PDFbookmark} and
possible nested \idxpl{hyperlink} in the \idx+{tableofcontents} (or list of
whatever) any use of the commands described in \sectionref{sec:gls-like}
will have their \idx{firstuseflag} unset when they appear in the 
\idx{tableofcontents} (or list of whatever) which is usually too soon
and will not match the actual heading or caption in the document if
there is a different \idxc{firstuse}{first}\slash\idxc{subsequentuse}{subsequent} use.
\end{important}

The above warning is particularly important if you are using the
\sty{glossaries} package in conjunction with the \sty{hyperref}
package. Instead, use one of the \emph{expandable} commands listed in
\sectionref{sec:glsnolink} (such as \gls{glsentrytext}). Alternatively, provide an
alternative via the optional argument to the sectioning\slash caption
command or use \sty{hyperref}'s \gls{texorpdfstring}. Examples:
\begin{codebox}
\gls+{chapter}{An overview of \gls{glsentrytext}\marg{perl}}
\gls{chapter}\oarg{An overview of Perl}{An overview of \gls{gls}\marg{perl}}
\gls{chapter}\marg{An overview of \gls{texorpdfstring}\marg{\gls{gls}\marg{perl}}\marg{Perl}}
\end{codebox}
(You can use \gls{glstexorpdfstring} instead of \gls{texorpdfstring}
if you don't know whether or not \sty{hyperref} will be needed.)
\begin{xtr}
The \sty{glossaries-extra} package provides commands
for use in captions and section headings, such as \gls{glsfmttext},
that overcome some of the problems.
\end{xtr}

If you want the \idx+{linktext} to produce a \idx{hyperlink} to the
corresponding \idx{entryline} in the \idx{glossary}, you should load the
\sty{hyperref} package \emph{before} the \sty{glossaries}
package. That's what I've done in this manual, so if you encounter a
hyperlinked term, such as \idx{linktext}, you can click on the word
or phrase and it will take you to a brief description in this
document's \idx{glossary} or you can click on a command name, such
as \gls{gls}, and it will take you to the relevant part of the
document where the command is described or you can click on a
general word or phrase, such as \idx{tableofcontents}, and it will
take you to the relevant line in the \hyperref[index]{index} where
you can find the \idx+{numberlist} to navigate to other parts of the
document that are pertinent. If, however, you click on
\qt{\idx{numberlist}}, you'll find it leads you to the
\idx{locationlist} entry in the index instead. This is because
\idx{numberlist} has been aliased to \idx{locationlist} using the
\gloskey{alias} key. Whereas if you click on \qt{\idx{pagelist}}
it will take you to the corresponding \idx{pagelist} entry in the \idx{glossary}
that has a cross-reference to \idx{locationlist}, because the
\gloskey{see} key was used instead.

\begin{important}
If you use the \sty{hyperref} package, I strongly recommend you use
\app{pdflatex} rather than \app{latex} to compile your document, if
possible. The \idx{DVI} format of \LaTeX\ has limitations with the
\idxpl+{hyperlink} that can cause a problem when used with the
\sty{glossaries} package. Firstly, the \idx{DVI} format can't break a
\idx{hyperlink} across a line whereas \pdfLaTeX\ can. This means that long
\idxpl{glossaryentry} (for example, the full form of an acronym) won't be
able to break across a line with the \idx{DVI} format. Secondly, the 
\idx{DVI} format doesn't correctly size \idxpl{hyperlink} in subscripts or
superscripts. This means that if you define a term that may be used
as a subscript or superscript, if you use the \idx{DVI} format, it won't
come out the correct size.

These are limitations of the \idx{DVI} format not of the \sty{glossaries}
package.
\end{important}

It may be that you only want terms in certain \idxpl{glossary} to have
\idxpl{hyperlink}, but not for other \idxpl{glossary}. In this case, you can use the
package option \opt{nohypertypes} to identify the \idx{glossary} lists
that shouldn't have hyperlinked \idx{linktext}. See 
\sectionref{sec:pkgopts-general} for further details.

The way the \idx{linktext} is displayed depends on 
\cmddef{glstextformat}
For example, to make all \idx{linktext} appear in a sans-serif
font, do:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glstextformat}}[1]\marg{\cmd{textsf}\marg{\#1}}
\end{codebox}
Further customisation can be done via \gls{defglsentryfmt} or by
redefining \gls{glsentryfmt}. See \sectionref{sec:glsdisplay} for
further details.

Each entry has an associated conditional referred to as the
\idx+{firstuseflag}. Some of the commands described in this chapter
automatically unset this flag and can also use it
to determine what text should be displayed. These types of commands
are the \idx+{glslike} commands and are described in
\sectionref{sec:gls-like}. The commands that don't reference or change
the \idx{firstuseflag} are \idx+{glstextlike} commands and are described
in \sectionref{sec:glstext-like}.  See \sectionref{sec:glsunset} for 
commands that unset (mark the entry as having been used) or reset
(mark the entry as not used) the \idx{firstuseflag} without referencing
the \idxpl{entry}.

The \gls{glslike} and \gls{glstextlike} commands all take a first
optional argument that is a comma-separated list of \keyval\
options, described below. They also have a \idx{starmod}-variant,
which inserts \glsoptval{hyper}{false} at the start of the list of
options and a \idx{plusmod}-variant, which inserts
\glsoptval{hyper}{true} at the start of the list of options. For
example \code{\gls{gls}\sym{starmod}\marg{sample}} is the same as
\code{\gls{gls}\oarg{\glsoptval{hyper}{false}}\marg{sample}} and
\code{\gls{gls}\sym{plusmod}\marg{sample}} is the same as
\code{\gls{gls}\oarg{\glsoptval{hyper}{true}}\marg{sample}}, whereas
just \code{\gls{gls}\marg{sample}} will use the default
\idx+{hyperlink} setting which depends on a number of factors (such
as whether the entry is in a \idx{glossary} that has been identified
in the \opt{nohypertypes} list).  You can override the
\glsopt{hyper} key in the variant's optional argument, for example,
\code{\gls{gls}\sym{starmod}\oarg{\glsoptval{hyper}{true}}\marg{sample}}
but this creates redundancy and is best avoided. The
\sty{glossaries-extra} package provides the option to add a third
custom variant and commands to override the behaviour of the
\idx{starmod} and \idx{plusmod} variants.

\begin{important}
Avoid nesting these commands. For example don't do
\code{\gls{glslink}\margm{label}\marg{\gls{gls}\margm{label2}}}
as this is likely to cause problems. By implication, this
means that you should avoid using any of these commands within
the \gloskey{text}, \gloskey{first}, \gloskey{short} or
\gloskey{long} keys (or their plural equivalent) or any
other key that you plan to access through these commands.
(For example, the \gloskey{symbol} key if you intend to use
\gls{glssymbol}.) The \sty{glossaries-extra} package provides
\gls{glsxtrp} to use instead, which helps to mitigate against
nesting problems.
\end{important}

\subsection{Options}
\label{sec:glslinkoptions}

The keys listed below are available for the optional first argument
of the \gls{glslike} and \gls{glstextlike} commands.
The \sty{glossaries-extra} package provides additional keys.
(See the \sty{glossaries-extra} manual for further details.)

\optiondef{glsopt.hyper}
If true, this option can be used to enable\slash disable the
\idx+{hyperlink} to the relevant \idx{entryline} in the
\idx{glossary}. If this key is omitted, the value is determined by
the current settings. For example, when used with a \gls{glslike}
command, if this is the \idx{firstuse} and the \optval{hyperfirst}{false}
package option has been used, then the default value is
\glsoptval{hyper}{false}. The \idx{hyperlink} can be forced on using
\glsoptval{hyper}{true} unless the \idxpl{hyperlink} have been
suppressed using \gls{glsdisablehyper}. You must load the
\sty{hyperref} package before the \sty{glossaries} package to ensure
the \idxpl{hyperlink} work.

\optiondef{glsopt.format}
This specifies how to \idxc+{locationencap}{format} the
associated \location\ number within the \idx{locationlist} 
(see \sectionref{sec:encap}).

\begin{information}
There is a special format \encap{glsignore} which simply ignores its
argument to create an \idx{invisiblelocation}.
\end{information}

\optiondef{glsopt.counter}
This specifies which \idxc{locationcounter}{counter}
to use for this \location. This overrides the default
\gloskey{counter} used by the \idx{entry}, the default counter
associated with the \idx{glossary} (supplied in the final optional
argument of \gls{newglossary}) and the default counter identified by
the \opt{counter} package option. See also \sectionref{sec:numberlists}.
The \sty{glossaries-extra} package has additional options that
affect the counter used, such as \opt{floats} and \opt{equations}.
This manual uses the \opt{floats} option to automatically switch the
counter to \ctr{table} for any entries \indexed\ in tables (such as
those in \tableref{tab:hyperxx}).

\optiondef{glsopt.local}
This is a boolean key that only makes a difference when used with
\gls{glslike} commands that change the entry's \idx+{firstuseflag}.
If \glsoptval{local}{true}, the change to the \idx{firstuseflag}
will be localised to the current scope.

\optiondef{glsopt.noindex}
If true, this option will suppress the \idx+{indexing}. 
Only available with \sty{glossaries-extra}. This manual doesn't use
\glsopt{noindex} for common entries. Instead it uses
\glsoptval{format}{\encap{glsignore}}, which is preferable with
\app{bib2gls}.

\optiondef{glsopt.hyperoutside}
If true, this will put the \idx+{hyperlink} outside of \gls{glstextformat}. 
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.wrgloss}
This key determines whether to \idxc+{indexing}{index} before
(\glsoptval{wrgloss}{before}) or after (\glsoptval{wrgloss}{after})
the \idx{linktext}, which alters where the \idx{whatsit} occurs. 
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.textformat}
The value is the name of the control sequence (without the leading
backslash) to encapsulate the \idx{linktext} instead of the default
\gls{glstextformat}.  Only available with \sty{glossaries-extra}.

\optiondef{glsopt.prefix}
This key locally redefines \gls{glolinkprefix} to the given value.
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.thevalue}
This key explicitly sets the \location\ value instead of obtaining it from
the \idx+{locationcounter}.
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.theHvalue}
This key explicitly sets the \idx{hyperlink} location value instead
of obtaining it from the \idx{locationcounter}.
Only available with \sty{glossaries-extra}.

\optiondef{glsopt.prereset}
Determines whether or not to reset the \idx+{firstuseflag} before the
\idx{linktext}.  Only available with \sty{glossaries-extra}.

\optiondef{glsopt.preunset}
Determines whether or not to unset the \idx+{firstuseflag} before the
\idx{linktext}.  Only available with \sty{glossaries-extra}.

\optiondef{glsopt.postunset}
Determines whether or not to unset the \idx+{firstuseflag} after the
\idx{linktext}.  Only available with \sty{glossaries-extra}.

\subsection{The \glsfmttext{gls}-Like Commands (First Use Flag Queried)}
\label{sec:gls-like}

This section describes the \idx+{glslike} commands that unset (mark
as used) the \idx+{firstuseflag} after the \idx+{linktext}, and in
most cases they use the current state of the flag to determine the
text to be \idxc{entryformat}{displayed}. As described above, these
commands all have a \idx{starmod}-variant (\glsoptval{hyper}{false})
and a \idx{plusmod}-variant (\glsoptval{hyper}{true}) and have an
optional first argument that is a \keyval\ list.  These commands use
\gls{glsentryfmt} or the equivalent definition provided by
\gls{defglsentryfmt} to determine the automatically generated text
and its \idxc{entryformat}{format} (see
\sectionref{sec:glsdisplay}).

Apart from \gls{glsdisp}, the commands described in this section
also have a \emph{final} optional argument \meta{insert} which may
be used to insert material into the automatically generated text.

\begin{important}
Since the commands have a final optional argument, take care if
you actually want to display an open square bracket after the command
when the final optional argument is absent. Insert an empty optional
argument or \gls+{relax} or an empty set of
braces \code{\marg{}} immediately before the opening square bracket to
prevent it from being interpreted as the final argument. For
example:
\begin{codebox}
\gls{gls}\marg{sample}\oarg{} [Editor's comment]
\gls{gls}\marg{sample}\marg{} [Editor's comment]
\gls{gls}\marg{sample} \gls{relax}\oarg{Editor's comment}
\end{codebox}
Use of a semantic command can also help avoid this problem. For
example:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{edcom}}[1]{[\#1]}
\comment{later:}
\gls{gls}\marg{sample} \cmd{edcom}\marg{Editor's comment}
\end{codebox}

Don't use any of the \gls{glslike} or \gls{glstextlike} commands in the 
\meta{insert} argument.
\end{important}

Take care using these commands within commands or environments that
are processed multiple times as this can confuse the \idx{firstuseflag}
query and state change. This includes frames with overlays in
\cls{beamer} and the \env{tabularx} environment provided by \sty{tabularx}. 
The \sty{glossaries} package automatically deals with this issue
in \sty{amsmath}'s \env{align} environment. You can apply a patch
to \sty{tabularx} by placing the command \gls{glspatchtabularx} in the
\idx{preamble/document}.
This does nothing if \sty{tabularx} hasn't been loaded. There's no
patch available for \cls{beamer}. See \sectionref{sec:glsunset} for
more details and also \sectionref{sec:measuring}.

Most of the commands below have \casechanging\ variants to convert
the \idx+{linktext} to \idx+{sentencecase} or \idx+{allcaps}. The
\idx{sentencecase} conversion is performed by \gls{glssentencecase}
and the \idx{allcaps} is performed by \gls{glsuppercase}.
Ensure you have at least version 2.08 of \sty{mfirstuc} to use the
modern \LaTeX3 \casechanging\ commands instead of the now deprecated
\sty{textcase} package. See the \sty{mfirstuc} manual for further
details.

\cmddef{gls}
This command typically determines the \idx{linktext} from the values
of the \gloskey{text} or \gloskey{first} keys supplied when the
\idx{entry} was defined using \gls{newglossaryentry}. However, if the
entry was defined using \gls{newacronym} and \gls{setacronymstyle} was 
used, then the \idx{linktext} will usually be determined from the \gloskey{long} or
\gloskey{short} keys (similarly for \gls{newabbreviation}).

The \casechanging\ variants:
\cmddef{Gls}
(\idx{sentencecase})
and
\cmddef{GLS}
(\idx{allcaps}).

There are plural forms that are analogous to \gls{gls}:
\cmddef{glspl}
\Idx{sentencecase}:
\cmddef{Glspl}
\Idx{allcaps}:
\cmddef{GLSpl}
These typically determine the \idx{linktext} from the \gloskey{plural} or
\gloskey{firstplural} keys supplied when the \idx{entry} was 
defined using \gls{newglossaryentry} or, if the \idx{entry} was defined
with \gls{newacronym} and \gls{setacronymstyle} was used, from the 
\gloskey{longplural} or \gloskey{shortplural} keys. (Similarly for
\gls{newabbreviation}.)

\begin{important}
Be careful when you use \idxpl{glossaryentry} in \idx{mathmode} especially if you 
are using \sty+{hyperref} as it can affect the spacing of subscripts and
superscripts in \idx{mathmode}. For example, suppose you have defined the following
entry:
\begin{codebox}
\gls{newglossaryentry}\marg{Falpha}\marg{\gloskeyval{name}{F\sym+{sb}\gls+{alpha}},
\gloskeyval{description}{sample}}
\end{codebox}
and later you use it in \idx{mathmode}:
\begin{codebox}
\$\gls{gls}\marg{Falpha}\sym+{sp}2\$
\end{codebox}
This will result in $F_\alpha{}^2$ instead of $F_\alpha^2$. In this
situation it's best to bring the superscript into the \idx+{hyperlink} using
the final \meta{insert} optional argument:
\begin{codebox}
\$\gls{gls}\marg{Falpha}\oarg{\idx{sp}2}\$
\end{codebox}
\end{important}

\cmddef{glsdisp}
This behaves in the same way as \gls{gls}, except
that the \meta{link text} is explicitly set. There's no final
optional argument as any inserted material can be added to the
\meta{link text} argument. Even though the
\idx{firstuseflag} doesn't influence the \idx{linktext}, it's still
unset after the \idx{linktext} and so may influence the \idx{postlinkhook}.

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{locationcounter}\marg{
  \gloskeyval{name}{location counter},
  \gloskeyval{description}{...}
}
\comment{later in the document:}
The \gls{glsdisp}\marg{locationcounter}\marg{counter} identifying the location.
\end{codebox}
This ensures that the \idx{entry} is \indexed\ and, if enabled,
creates a \idx{hyperlink} to the \idx{entryline} in the \idx{glossary}.
It will also follow the \idx{displaystyle} and have the
\idx{linktext} encapsulated with \gls{glstextformat}.

Since the actual text is being supplied,
any \casechanging\ can be placed in the argument. For example:
\begin{codebox}
\gls{glsdisp}\marg{locationcounter}\marg{Counters} associated with locations 
\end{codebox}
However, a \idx{sentencecase} variant is provided:
\cmddef{Glsdisp}
This essentially does:
\begin{compactcodebox}
\gls{glsdisp}\oargm{options}\margm{entry-label}\marg{\gls{glssentencecase}\margm{text}}
\end{compactcodebox}
The main reason for providing this command is to set up a mapping
for \gls{makefirstuc}. See the \sty{mfirstuc} manual for further
details about mappings.

\begin{important}
Don't use any of the \gls{glslike} or \gls{glstextlike} commands in the 
\meta{link text} argument of \gls{glsdisp}.
\end{important}

\subsection{The \glsfmttext{glstext}-Like Commands (First Use Flag Not Queried)}
\label{sec:glstext-like}

This section describes the commands that don't change or reference
the \idx{firstuseflag}. As described above, these commands all have a
\idx{starmod}-variant (\glsoptval{hyper}{false}) and a \idx{plusmod}-variant
(\glsoptval{hyper}{true}) and have an optional first argument
that is a \keyval\ list. These commands also don't
use \gls{glsentryfmt} or the equivalent definition provided by
\gls{defglsentryfmt} (see \sectionref{sec:glsdisplay}). 
They do, however, have their \idx{linktext} encapsulated with
\gls{glstextformat}.

Additional commands for \idxpl{acronym} are described in
\sectionref{sec:acronyms}. (Additional commands for
\idxpl{abbreviation} are described in the \sty{glossaries-extra}
manual.)

Apart from \gls{glslink}, the commands described in this section
also have a \emph{final} optional argument \meta{insert} which may
be used to insert material into the automatically generated text.
See the caveat above in \sectionref{sec:gls-like}. As with the
\gls{glslike} commands described in \sectionref{sec:gls-like}, these
commands also have \casechanging\ variants.

\cmddef{glslink}
This command explicitly sets the \idx{linktext} as given in the
final argument. As with \gls{glsdisp}, there's a \idx{sentencecase}
variant to allow a \idx{sentencecase} mapping to be established:
\cmddef{Glslink}
See the \sty{mfirstuc} package for further details.

\begin{important}
Don't use any of the \gls{glslike} or \gls{glstextlike} commands in the 
argument of \gls{glslink}. By extension, this means that you can't
use them in the value of fields that are used to form \idx{linktext}.
\end{important}

\cmddef{glstext}
This command always uses the value of the \gloskey+{text} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glstext}
(\idx{sentencecase}) and
\cmddef{GLStext}
(\idx{allcaps}).

There's no equivalent command for \idx+{titlecase}, but you
can use the more generic command \gls{glsentrytitlecase}
in combination with \gls{glslink}. For example:
\begin{codebox}
\gls{glslink}\marg{sample}\marg{\gls{glsentrytitlecase}\marg{sample}\marg{text}}
\end{codebox}
(See \sectionref{sec:glsnolink}.)

\cmddef{glsfirst}
This command always uses the value of the \gloskey+{first} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsfirst}
(\idx{sentencecase}) and
\cmddef{GLSfirst}
(\idx{allcaps}).

\begin{important}
The value of the \gloskey{first} key (and \gloskey{firstplural} key)
doesn't necessarily match the \idx{linktext} produced by \gls{gls} (or
\gls{glspl}) on \idx{firstuse} as the \idx{linktext} used by
\gls{gls} may be modified through \idxc+{entryformat}{entry
formatting} commands like \gls{defglsentryfmt}. (Similarly, the value
of the \gloskey{text} and \gloskey{plural} keys don't necessarily
match the \idx{linktext} used by \gls{gls} or \gls{glspl} on
\idx{subsequentuse}.)
\end{important}

\cmddef{glsplural}
This command always uses the value of the \gloskey+{plural} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsplural}
(\idx{sentencecase}) and
\cmddef{GLSplural}
(\idx{allcaps}).

\cmddef{glsfirstplural}
This command always uses the value of the \gloskey+{firstplural} key as the
\idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsfirstplural}
(\idx{sentencecase}) and
\cmddef{GLSfirstplural}
(\idx{allcaps}).

\cmddef{glsname}
This command always uses the value of the \gloskey+{name} key as the
\idx{linktext}. Note that this may be different from the values of
the \gloskey{text} or \gloskey{first} keys. In general it's better
to use \gls{glstext} or \gls{glsfirst} instead of \gls{glsname},
unless you have a particular need for the actual name.

\begin{information}
The name is displayed in the \idx{glossary} using
\gls{glossentryname} not \gls{glsname}. 
\end{information}

The \casechanging\ variants are:
\cmddef{Glsname}
(\idx{sentencecase}) and
\cmddef{GLSname}
(\idx{allcaps}).

\begin{important}
In general it's best to avoid \gls{glsname} with \idxpl{acronym}. Instead,
consider using \gls{acrlong}, \gls{acrshort} or \gls{acrfull}.
Alternatively, for \idxpl{abbreviation} defined with
\sty{glossaries-extra}, use \gls{glsxtrlong}, \gls{glsxtrshort} or
\gls{glsxtrfull}.
\end{important}

\cmddef{glssymbol}
This command always uses the value of the \gloskey+{symbol} key as the
\idx{linktext}.

\begin{information}
The symbol is displayed in the \idx{glossary} using
\gls{glossentrysymbol} not \gls{glssymbol}. 
\end{information}

The \casechanging\ variants are:
\cmddef{Glssymbol}
(\idx{sentencecase}) and
\cmddef{GLSsymbol}
(\idx{allcaps}).

\cmddef{glsdesc}
This command always uses the value of the \gloskey+{description} key as the
\idx{linktext}.

\begin{information}
The description is displayed in the \idx{glossary} using
\gls{glossentrydesc} not \gls{glsdesc}. 
\end{information}

The \casechanging\ variants are:
\cmddef{Glsdesc}
(\idx{sentencecase}) and
\cmddef{GLSdesc}
(\idx{allcaps}).

\cmddef{glsuseri}
This command always uses the value of the 
\gloskey+{user1} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuseri}
(\idx{sentencecase}) and
\cmddef{GLSuseri}
(\idx{allcaps}).

\cmddef{glsuserii}
This command always uses the value of the 
\gloskey+{user2} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuserii}
(\idx{sentencecase}) and
\cmddef{GLSuserii}
(\idx{allcaps}).

\cmddef{glsuseriii}
This command always uses the value of the 
\gloskey+{user3} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuseriii}
(\idx{sentencecase}) and
\cmddef{GLSuseriii}
(\idx{allcaps}).

\cmddef{glsuseriv}
This command always uses the value of the 
\gloskey+{user4} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuseriv}
(\idx{sentencecase}) and
\cmddef{GLSuseriv}
(\idx{allcaps}).

\cmddef{glsuserv}
This command always uses the value of the 
\gloskey+{user5} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuserv}
(\idx{sentencecase}) and
\cmddef{GLSuserv}
(\idx{allcaps}).

\cmddef{glsuservi}
This command always uses the value of the 
\gloskey+{user6} key as the \idx{linktext}.

The \casechanging\ variants are:
\cmddef{Glsuservi}
(\idx{sentencecase}) and
\cmddef{GLSuservi}
(\idx{allcaps}).

\subsection{Changing the Format of the \glsfmttext{glslike} Link Text}
\label{sec:glsdisplay}

\begin{xtr}
The \sty{glossaries-extra} package provides ways of altering the
\idx{displaystyle} according to the \gloskey{category}. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}

The default \inlineidxdef{entryformat} (display style) of the \idx{linktext} for the 
\gls{glslike} commands is governed by:
\cmddef{glsentryfmt}
The \sty{glossaries} package defines this to simply use
\gls{glsgenentryfmt}. The \sty{glossaries-extra} package redefines
\gls{glsentryfmt} to allow it to integrated with the
\idxpl{abbrvstyle}.

\begin{information}
The \idx{entryformat} is only applicable to the \gls{glslike}
commands, not the \gls{glstextlike} commands. However, both sets of
commands use \gls{glstextformat} for the font.
\end{information}

You can redefine \gls{glsentryfmt} (but beware of breaking
\idxpl{abbreviation} with \sty{glossaries-extra}), but if you only want the
change the \idx{displaystyle} for a given \idx{glossary}, use:
\cmddef{defglsentryfmt}
instead of redefining \gls{glsentryfmt}. The optional first argument 
\meta{glossary-type} is the \idx{glossary} type. This defaults to
\gls{glsdefaulttype} if omitted. The second argument is the
\idx{entryformat} definition, which needs to use the placeholder commands
described in this section.

In the remainder of this section, \meta{definition} refers to the
argument of \gls{defglsentryfmt} or to the definition of
\gls{glsentryfmt}.

\begin{important}
Note that \gls{glsentryfmt} is the default \idx{displaystyle} for
\idxpl{glossaryentry}. Once the \idx{displaystyle} has been changed for an individual
\idx{glossary} using \gls{defglsentryfmt}, redefining \gls{glsentryfmt}
won't have an effect on that \idx{glossary}, you must instead use
\gls{defglsentryfmt} again. Note that \idxpl{glossary} that have
been identified as lists of \idxpl{acronym} (via the package option
\opt{acronymlists} or the command \gls{DeclareAcronymList}, 
see \sectionref{sec:pkgopts-acronym}) use 
\gls{defglsentryfmt} to set their \idx{displaystyle}.
(The \sty{glossaries-extra} package provides \idx{abbreviation}
support within its redefinition of \gls{glsentryfmt}.)
\end{important}

Within \meta{definition} you may use the following commands:
\cmddef{glslabel}
This expands to the label of the \idx{entry} being referenced.

You can also access the entry's \idx{glossary} type using:
\cmddef{glstype}
This is defined using \gls{protected@edef} so the replacement text is the
actual \idx{glossary} type rather than
\code{\gls{glsentrytype}\marg{\gls{glslabel}}}.

\cmddef{glsinsert}
Expands to the final \meta{insert} optional argument to \gls{gls},
\gls{glspl} and their \casechanging\ variants (or empty if
\meta{insert} was omitted).

\cmddef{glsifplural}
If the plural commands \gls+{glspl}, \gls+{Glspl} or \gls+{GLSpl}
was used, this command expands to \meta{true} otherwise it expands
to \meta{false}.

\cmddef{glscapscase}
If \gls{gls}, \gls{glspl} or \gls{glsdisp} were used, this expands
to \meta{no change}. If the \idx+{sentencecase} commands \gls{Gls} or \gls{Glspl} 
were used, this expands to \meta{sentence}. If the \idx+{allcaps}
commands \gls{GLS} or \gls{GLSpl} were used, this expands to \meta{all caps}.

\cmddef{glscustomtext}
Expands to the custom text supplied in \gls{glsdisp}. It's always empty
for \gls{gls}, \gls{glspl} and their \casechanging\ variants. (You can 
use \sty{etoolbox}'s \csfmt{ifdefempty} to determine if
\gls{glscustomtext} is empty.)

\begin{important}
If \gls{Glsdisp} is used, \gls{glscustomtext} will include the
\idx+{sentencecase} command (\gls{glssentencecase}), but
\gls{glscapscase} will expand to \meta{no change} (since
\gls{Glsdisp} simply uses \gls{glsdisp} without modifying the
placeholder commands).  However, the generic \gls{glsgenentryfmt}
doesn't use \gls{glscapscase} (or \gls{glsifplural}) if
\gls{glscustomtext} isn't empty.
\end{important}

\cmddef{glsifhyperon}
This will do \meta{true} if the \idxpl+{hyperlink} are on for the
current reference, otherwise it will do \meta{false}. The
\idx{hyperlink} may be off even if it wasn't explicitly switched off with
\glsoptval{hyper}{false} key or the use of a starred (\sym{starmod}) command.
It may be off because the \sty{hyperref} package hasn't been loaded
or because \gls{glsdisablehyper} has been used or because the entry
is in a \idx{glossary} type that's had the \idxpl{hyperlink} switched off (using
\opt{nohypertypes}) or because it's the \idx{firstuse} and the
hyperlinks have been suppressed on \idx{firstuse}.

If you want to know if the calling command used to reference
the \idx{entry} was used with the star (\sym+{starmod}) or plus
(\sym+{plusmod}) variant, you can use:
\cmddef{glslinkvar}
This will do \meta{unmodified} if the unmodified version was used,
or will do \meta{star case} if the starred version was used, or
will do \meta{plus case} if the plus version was used. The
custom modifier provided by \sty{glossaries-extra}['s]
\gls{GlsXtrSetAltModifier} will make \gls{glslinkvar} expand to
\meta{unmodified}.

Note that this doesn't take into account if the 
\glsopt{hyper} key was used to override the default
setting, so this command shouldn't be used to guess whether or not
the \idx{hyperlink} is on for this reference. This command is
therefore of limited use. If you want to make the \idx{starmod} or
\idx{plusmod} behave differently, you can try
\gls{GlsXtrSetStarModifier} or \gls{GlsXtrSetPlusModifier} instead,
if you are using \sty{glossaries-extra}.

Note that you can also use commands such as \gls{ifglsused} within
\meta{definition} (see \sectionref{sec:glsunset}), but don't use
\gls{ifglsused} in the \idx{postlinkhook}.

\begin{xtr}
The \sty{glossaries-extra} package has additional commands that may
be used within \meta{definition} to obtain information about the
calling command.
\end{xtr}

The commands \gls{glslabel}, \gls{glstype}, \gls{glsifplural},
\gls{glscapscase}, \gls{glsinsert} and \gls{glscustomtext} are
typically updated at the start of the \gls{glslike} and
\gls{glstextlike}
commands so they can usually be accessed in the hook user commands,
such as \gls{glspostlinkhook} and \gls{glslinkpostsetkeys}.

\begin{warning}
This means that using commands like \gls{gls} within the fields
that are accessed using the \gls{glslike} or \gls{glstextlike} commands
(such as the \gloskey{first}, \gloskey{text}, \gloskey{long}
or \gloskey{short} keys) will cause a problem. The definitions of
the placeholder commands can't be scoped otherwise they won't be
available for the \idx{postlinkhook}, and grouping can also cause
unwanted spacing issues in \idx{mathmode}.
\end{warning}

If you only want to make minor modifications to \gls{glsentryfmt},
you can use the generic \idxc{entryformat}{entry formatting} command:
\cmddef{glsgenentryfmt}
This uses the above commands to display just the \gloskey{first}, 
\gloskey{text}, \gloskey{plural} or \gloskey{firstplural} keys 
(or the custom text) with the insert text appended. For example, to
make the symbol appear in parentheses for the \glostype{symbols}
glossary:
\begin{codebox}
\gls{defglsentryfmt}\oarg{\glostype{symbols}}\marg{\gls{glsgenentryfmt} (\gls{glsentrysymbol}\marg{\gls{glslabel}})}
\end{codebox}

The \idxpl+{acronymstyle} use a similar method to adjust the formatting.
For example, the \acrstyle{long-short} style implements:
\begin{codebox}
\gls{defglsentryfmt}\oargm{type}\marg{\gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}}
\end{codebox}
For each \idx{glossary} that has been identified as a list of
acronyms. This uses the generic \idx{entryformat} command \gls{glsgenentryfmt}
for general \idxpl{entry} (that don't have the \gloskey{long} key set),
otherwise it uses the generic \idx{acronymformat}:
\cmddef{glsgenacfmt}
This uses the values from the \gloskey{long}, \gloskey{short},
\gloskey{longplural} and \gloskey{shortplural} keys, rather than
using the \gloskey{text}, \gloskey{plural}, \gloskey{first} 
and \gloskey{firstplural} keys. The \idx+{firstuse} singular text is obtained via:
\cmddef{genacrfullformat}
instead of from the \gloskey{first} key, and the \idx{firstuse} plural
text is obtained via:
\cmddef{genplacrfullformat}
instead of from the \gloskey{firstplural} key.
In both cases, \meta{label} is the \idx{entry}['s] label and \meta{insert}
is the insert text provided in the final optional argument of
commands like \gls{gls}. The default behaviour is to do the long
form (or plural long form) followed by \meta{insert} and a~space and 
the short form (or plural
short form) in parentheses, where the short form is in the argument
of \gls{firstacronymfont}. There are also \idx{sentencecase}
versions:
\cmddef{Genacrfullformat}
and
\cmddef{Genplacrfullformat}
See \sectionref{sec:acronyms} for details on changing the style of \idxpl{acronym}.

\begin{important}
Note that \gls{glsentryfmt} (or the formatting given by \gls{defglsentryfmt}) 
is not used by the \gls{glstextlike} commands.
\end{important}

\begin{example}{Custom Entry Display in Text}{ex:customfmt}
Suppose you want a \idx{glossary} of measurements and
units, you can use the \gloskey{symbol} key to store the unit:
\begin{codebox}
\gls{newglossaryentry}\marg{distance}\marg{\gloskeyval{name}{distance},
\gloskeyval{description}{The length between two points},
\gloskeyval{symbol}{km}}
\end{codebox}
and now suppose you want \code{\gls{gls}\marg{distance}} to produce
\qt{distance (km)} on \idx{firstuse}, then you can redefine
\gls{glsentryfmt} as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space} (\gls{glsentrysymbol}\marg{\gls{glslabel}})}\comment{}
}
\end{codebox}

(Note that I've used \gls{glsentrysymbol} rather than \gls{glssymbol}
to avoid nested \idxpl{hyperlink}.)

All of the \idx{linktext} will be formatted according
to \gls{glstextformat} (described earlier). So if you do, say:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstextformat}}[1]\marg{\gls{textbf}\marg{\#1}}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space}(\gls{glsentrysymbol}\marg{\gls{glslabel}})}\comment{}
}
\end{codebox}
then \code{\gls{gls}\marg{distance}} will produce \qt{\textbf{distance (km)}}.
This is different from using the \idx{postlinkhook} which is
outside of \gls{glstextformat}.

For a complete document, see the sample file \samplefile{-entryfmt}.
\end{example}

\begin{example}{Custom Format for Particular Glossary}{ex:defglsentryfmt}
Suppose you have created a new \idx{glossary} called
\optfmt{notation} and you want to change the way the entry is
displayed on \idx{firstuse} so that it includes the symbol, you can do:
\begin{codebox}
\gls{defglsentryfmt}\oarg{notation}\marg{\gls{glsgenentryfmt}
 \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space}
   (denoted \gls{glsentrysymbol}\marg{\gls{glslabel}})}}
\end{codebox}
Now suppose you have defined an entry as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{type}{notation},
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of objects},
  \gloskeyval{symbol}{\gls{ensuremath}{S}}
}
\end{codebox}
The \idxc{firstuse}{first time} you reference this entry it will be displayed as:
\qt{set (denoted $S$)} (assuming \gls{gls} was used).

Remember that if you use the \gloskey{symbol} key, you need to use a
\idx{glossarystyle} that displays the symbol, as many of the styles
ignore it.
\end{example}

\subsection{Hooks}
\label{sec:glshooks}

Both the \gls{glslike} and \gls{glstextlike} commands use:
\cmddef{glslinkpostsetkeys}
after the \meta{options} are set. This macro does nothing by default
but can be redefined. (For example, to switch off the \idx{hyperlink}
under certain conditions.) The \sty{glossaries-extra} package
additionally provides \gls{glslinkpresetkeys}.

There is also a hook (the
\idx+{postlinkhook}) that's implemented at the end:
\cmddef{glspostlinkhook}
This is done after the \idx{linktext} has been displayed and also
\emph{after} the \idx{firstuseflag} has been unset (see
example~\ref{ex:dotabbr}). This means that it's too late to use
\gls{ifglsused} in the definition of \gls{glspostlinkhook}. The
\sty{glossaries-extra} package provides \gls{glsxtrifwasfirstuse}
for use in the \idx{postlinkhook}.

\begin{xtr}
The \sty{glossaries-extra} package redefines \gls{glspostlinkhook}
to allow for additional hooks that can vary according to the entry's
\gloskey{category}. If you migrate over from only using the base
\sty{glossaries} package to \sty{glossaries-extra} and
you have redefined \gls{glspostlinkhook}, consider moving your
modifications to the category post-link hook to avoid breaking the
extended \idx{postlinkhook} features. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}


\subsection{Enabling and Disabling Hyperlinks to Glossary Entries}
\label{sec:disablehyperlinks}

If you load \sty{hyperref} prior to loading the \sty{glossaries}
package, the \gls{glslike} and \gls{glstextlike} commands will
automatically have \idxpl+{hyperlink} to the relevant 
\idx{glossaryentry}, unless the \glsopt{hyper} option has been switched off
(either explicitly or through implicit means, such as via the
\opt{nohypertypes} package option).

You can disable or enable \idxpl{hyperlink} using
\gls{glsdisablehyper} and \gls{glsenablehyper}
respectively. The effect can be localised by placing the commands
within a group. Note that you should only use \gls{glsenablehyper}
if the commands \gls{hyperlink} and \gls{hypertarget} have been
defined, otherwise you will get undefined control sequence errors.
If the \sty{hyperref} package is loaded before \sty{glossaries},
\gls{glsenablehyper} will be use automatically.

You can disable just the \idx{firstuse} links using the package
option \optval{hyperfirst}{false}. Note that this option only
affects the \gls{glslike} commands that recognise the
\idx{firstuseflag}.

\begin{example}{First Use With Hyperlinked Footnote Description}{ex:hyperdesc}
Suppose I want the \idx+{firstuse} to have a \idx{hyperlink} to the
description in a footnote instead of hyperlinking to the relevant
place in the \idx{glossary}. First I need to disable the
\idxpl{hyperlink} on \idx{firstuse} via the package option 
\optval{hyperfirst}{false}:
\begin{codebox}
\cmd{usepackage}[\optval{hyperfirst}{false}]\marg{glossaries}
\end{codebox}
Now I need to redefine \gls{glsentryfmt} (see
\sectionref{sec:glsdisplay}):
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls+{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}\comment{}
}
\end{codebox}

Now the \idx{firstuse} won't have hyperlinked text, but will be followed
by a footnote.
See the sample file \samplefile{-FnDesc} for a complete document.
\end{example}

Note that the \opt{hyperfirst} option applies to all defined
\idxpl{glossary}.  It may be that you only want to disable the
\idxpl{hyperlink} on \idx{firstuse} for \idxpl{glossary} that have a
different form on \idx{firstuse} (such as list of \idxpl{acronym}). This
can be achieved by noting that since the \idxpl{entry} that require
hyperlinking for all instances have identical \idxc{firstuse}{first} 
and \idxc{subsequentuse}{subsequent} text, they can be unset via \gls{glsunsetall} (see
\sectionref{sec:glsunset}) so that the \opt{hyperfirst} option
doesn't get applied.

\begin{example}{Suppressing Hyperlinks on First Use Just For
Acronyms}{ex:hyperfirst}
Suppose I want to suppress the \idx{hyperlink} on \idx{firstuse} for
\idxpl{acronym} but not for \idxpl{entry} in the \glostype{main} glossary.  I~can load
the \sty{glossaries} package using:
\begin{codebox}
\cmd{usepackage}[\optval{hyperfirst}{false},\opt{acronym}]\marg{glossaries}
\end{codebox}
Once all \idxpl{glossaryentry} have been defined I~then do:
\begin{codebox}
\gls{glsunsetall}\oarg{\glostype{main}}
\end{codebox}
(Alternatively use the \catattr{nohyperfirst} \idx{categoryattribute} with
\sty{glossaries-extra}.)
\end{example}

For more complex requirements, you might find it easier to switch
off all \idxpl{hyperlink} via \gls{glsdisablehyper} and put the
\idxpl{hyperlink} (where required) within the definition of
\gls{glsentryfmt} (see \sectionref{sec:glsdisplay}) via
\gls{glshyperlink} (see \sectionref{sec:glsnolink}).

\begin{example}{Only Hyperlink in Text Mode Not Math
Mode}{ex:nomathhyper}
This is a bit of a contrived example, but suppose, for some reason,
I only want the \gls{glslike} commands to have
hyperlinks when used in text mode, but not in \idx{mathmode}. I~can do
this by adding the \idx{glossary} to the list of \opt{nohypertypes} and redefining 
\gls{glsentryfmt}:
\begin{codebox}
\gls{GlsDeclareNoHyperList}\marg{\glostype{main}}
\codepar
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \cmd{ifmmode}
    \gls{glsgenentryfmt}
  \cmd{else}
    \gls{glsifhyperon}
    \marg{\gls{glsgenentryfmt}}\comment{hyperlink already on}
    \marg{\gls{glshyperlink}\oarg{\gls{glsgenentryfmt}}\marg{\gls{glslabel}}}\comment{}
  \cmd{fi}
}
\end{codebox}
Note that this doesn't affect the \gls{glstextlike} commands, which will
have the hyperlinks off unless they're forced on using the 
\idx{plusmod} variant or with an explicit use of \glsopt{hyper}{true}.

See the sample file \samplefile{-nomathhyper} for a complete
document.
\end{example}

\begin{example}{One Hyper Link Per Entry Per Chapter}{ex:chap-hyperfirst}
Here's a more complicated example that will only have the
\idx{hyperlink} on the first time an entry is used per chapter. This
doesn't involve resetting the \idx{firstuseflag}. Instead it adds
a~new key using \gls{glsaddstoragekey} (see
\sectionref{sec:glsaddstoragekey}) that keeps track of the chapter
number that the entry was last used in:
\begin{codebox}
\gls{glsaddstoragekey}\marg{chapter}\marg{0}\marg{\cmd{glschapnum}}
\end{codebox}
This creates a new user command called \csfmt{glschapnum} that's
analogous to \gls{glsentrytext}. The default value for this key is~0.
I~then define my \idxpl{glossaryentry} as usual.

Next I redefine the hook \gls{glslinkpostsetkeys}
(see \sectionref{sec:glsdisplay}) so that it determines the current
chapter number (which is stored in \csfmt{currentchap} using
\csfmt{edef}). This value is then compared with the value of the
\idx{entry}['s] \optfmt{chapter} key that I defined earlier. If they're the
same, this \idx{entry} has already been used in this chapter so the
\idx{hyperlink} is switched off using \sty{xkeyval}'s \csfmt{setkeys}
command. If the chapter number isn't the same, then this \idx{entry}
hasn't been used in the current chapter. The \optfmt{chapter} field
is updated using \gls{glsfieldxdef} (\sectionref{sec:fetchset})
provided the user hasn't switched off the \idx{hyperlink}.
(This test is performed using \gls{glsifhyperon}.)
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkpostsetkeys}}\marg{\comment{}
 \cmd{edef}\cmd{currentchap}\marg{\gls{arabic}\marg{\ctr{chapter}}}\comment{}
 \cmd{ifnum}\cmd{currentchap}=\cmd{glschapnum}\marg{\gls{glslabel}}\gls{relax}
  \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\comment{}
 \cmd{else}
  \gls{glsifhyperon}\marg{\gls{glsfieldxdef}\marg{\gls{glslabel}}\marg{chapter}\marg{\cmd{currentchap}}}{}\comment{}
 \cmd{fi}
}
\end{codebox}
Note that this will be confused if you use \gls{gls} etc when the
chapter counter is~0. (That is, before the first \gls{chapter}.)

See the sample file \samplefile{-chap-hyperfirst} for a complete
document.
\end{example}

\section{Using Glossary Terms Without Indexing}
\label{sec:glsnolink}

The commands described in this section display \idx{entry} details without
adding any information to the \idx{glossary}. They don't use
\gls{glstextformat} or the \idx{entryformat}, they don't have any
optional arguments, they don't affect the \idx{firstuseflag} and,
apart from \gls{glshyperlink} and the \idx{numberlist} commands,
they don't produce \idxpl{hyperlink}.

\begin{important}
If you want to use the \idx+{sentencecase} commands in
\idxpl+{PDFbookmark}, such as
\gls{Glsentrytext}, ensure you have at least version 2.08 of
\sty{mfirstuc}. Inside \idxpl{PDFbookmark}, those commands will expand
with the \idx{sentencecase} applied using the expandable 
\gls{MFUsentencecase}. Outside of \idxpl{PDFbookmark} those commands will expand
to an internal robust command that applies the \idx{sentencecase}
with \gls{glssentencecase} (which defaults to \gls{makefirstuc}).
\end{important}

If you want to \idx+{titlecase} a field, you can use:
\cmddef{glsentrytitlecase}
where \meta{entry-label} is the label identifying the \idx{glossaryentry},
\meta{field} is the \idx{internalfieldlabel} (see \tableref{tab:fieldmap}).
This internally uses \gls{glscapitalisewords}. Within \idxpl{PDFbookmark}, 
this command will expand to \idx{sentencecase} using the expandable
\gls{MFUsentencecase}.  (The \idx{titlecase} command
\gls{capitalisewords} isn't expandable.)

\begin{warning}
If your field contains formatting commands, you will need to
redefine \gls{glscapitalisewords} to use \gls{capitalisefmtwords}
instead of \gls{capitalisewords}.  See the \sty{mfirstuc} manual for
further details.
\end{warning}

For example, to convert the description to \idx{titlecase} for the
entry identified by the label \qt{sample}:
\begin{codebox}
\gls{glsentrytitlecase}\marg{sample}\marg{\glosfield{desc}}
\end{codebox}
(If you want \idxc{titlecase}{title-casing} in your
\idx{glossarystyle}, you might want to
investigate the \sty{glossaries-extra} package.) This command will
trigger an error if the entry is undefined.

If you want a \idx+{hyperlink} to an \idx{entry}['s] line in the
\idx{glossary} but don't want the \idx{indexing} or
formatting associated with the \gls{glslike} and \gls{glstextlike}
commands, you can use:
\cmddef{glshyperlink}
This command provides a \idx{hyperlink} \strong{but does not add any
information to the \idx{glossaryfile}}. The \idx{hyperlink} text is
given by the optional argument, which defaults to
\code{\gls{glsentrytext}\margm{label}}.  Note that the \idx{hyperlink} will
be suppressed if you have used \gls{glsdisablehyper} or if you
haven't loaded the \sty{hyperref} package.

\begin{important}
If you use \gls{glshyperlink}, you need to ensure that the relevant
entry has been added to the \idx{glossary} using any of the commands
described in \sectionref{sec:glslink} or \sectionref{sec:glsadd}
otherwise you will end up with an undefined \idx{hyperlink} target.
\end{important}

The following commands in form form \csmetafmt{glsentry}{field}{} 
expand to the associated field value for the
entry identified by \meta{entry-label} for the non-\casechanging\
versions. Those commands don't check if the \idx{entry} has been defined.
The \idx{sentencecase} versions \csmetafmt{Glsentry}{field}{} only
expand in \idxpl{PDFbookmark}. In both cases, any fragile commands within the field
values will need to be protected or made robust if the field values
are required in a moving argument.

There are also commands in the form \csmetafmt{glossentry}{field}{}
for the \gloskey{name}, \gloskey{description} and \gloskey{symbol}
that are used by the \idxpl{glossarystyle}. Those commands will 
issue a warning if the \idx{entry} hasn't been defined. See
\sectionref{sec:styles} for further information.

\cmddef{glsentryname}
Expands to the value of the \gloskey{name} field. Note that within
\idxpl{glossarystyle}, the name is displayed using
\gls{glossentryname}.
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryname}

\begin{important}
In general it's best to avoid \gls{Glsentryname} with \idxpl{acronym}
or \idxpl{abbreviation}. Instead,
consider using \gls{Glsentrylong}, \gls{Glsentryshort} or \gls{Glsentryfull}.
\end{important}

\cmddef{glsentrytext}
Expands to the value of the \gloskey{text} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrytext}

\cmddef{glsentryplural}
Expands to the value of the \gloskey{plural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryplural}

\cmddef{glsentryfirst}
Expands to the value of the \gloskey{first} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryfirst}

\cmddef{glsentryfirstplural}
Expands to the value of the \gloskey{firstplural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryfirstplural}

\cmddef{glsentrydesc}
Expands to the value of the \gloskey{description} field. Note that within
\idxpl{glossarystyle}, the description is displayed using
\gls{glossentrydesc}.
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrydesc}

\cmddef{glsentrydescplural}
Expands to the value of the \gloskey{descriptionplural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrydescplural}

\cmddef{glsentrysymbol}
Expands to the value of the \gloskey{symbol} field. Note that within
\idxpl{glossarystyle}, the description is displayed using
\gls{glossentrysymbol}.
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrysymbol}

\cmddef{glsentrysymbolplural}
Expands to the value of the \gloskey{symbolplural} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrysymbolplural}

\cmddef{glsentryuseri}
Expands to the value of the \gloskey{user1} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuseri}

\cmddef{glsentryuserii}
Expands to the value of the \gloskey{user2} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuserii}

\cmddef{glsentryuseriii}
Expands to the value of the \gloskey{user3} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuseriii}

\cmddef{glsentryuseriv}
Expands to the value of the \gloskey{user4} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuseriv}

\cmddef{glsentryuserv}
Expands to the value of the \gloskey{user5} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuserv}

\cmddef{glsentryuservi}
Expands to the value of the \gloskey{user6} field. 
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryuservi}

The next two commands, \gls{glsentrynumberlist} and
\gls{glsdisplaynumberlist}, display the \idx{entry}['s] \idx{numberlist}. This 
information is readily available with \options{noidx,b2g} (where the
\idx{numberlist} is stored in the \glosfield{loclist} or
\gloskey{location} internal fields) but not for
\options{mkidx,xdy} (where the \idx{numberlist} is simply part of
the code to typeset the \idx{glossary} written in the \idx{glossaryfile}).

If you need to parse the \idx{numberlist}, split it into groups
based on the \idx{locationcounter}, or extract a primary \location\
then \option{b2g} (\app{bib2gls}) is your best option.

\cmddef{glsentrynumberlist}
Displays the \idx{numberlist} for the given \idx{entry} in the same format
as it's shown by default in the \idx{glossary}. The \locations\ will
have \idxpl{hyperlink} if supported.

This command is at its simplest with \option{b2g}, where it just
displays the value of the \gloskey{location} internal field that's
set by \app{bib2gls} in the \ext{glstex} file. This will use the
delimiters supplied by \app{bib2gls} (\gls{bibglsdelimN} and
\gls{bibglslastDelimN}) for individual \locations\ as well as \gls{delimR}
for \idxpl{range}, as used in the \idx{glossary}.

With \option{noidx}, \gls{glsentrynumberlist} passes the value of
the \idx{entry}['s] \glosfield{loclist} internal field (that's created when
the \ext+{aux} file is input) to \gls{glsnoidxloclist} (which is
also used by \gls{printnoidxglossary}). This will result in a simple
list with each \location\ separated with \gls{delimN}, as used in
the \idx{glossary}.  Note that this doesn't allow for \idxpl{range} (as with
\gls{printnoidxglossary}).

With \options{mkidx,xdy}, you will need the \opt{savenumberlist}
package option, which will attempt to gather the \idx{numberlist}
information when the \idxc{indexingfile}{glossary file} is input by
\gls{printglossary}. Since \idxpl{glossary} often occur at the end
of the document, this means that the information has to be saved in
the \ext+{aux} file for the next \LaTeX\ run. Therefore an extra
\LaTeX\ call is required if \gls{glsentrynumberlist} is needed with
\app{makeindex} or \app{xindy}. This will use the same \gls{delimN}
and \gls{delimR} as used in the \idx{glossary}.

\cmddef{glsdisplaynumberlist}
This attempts to display the \idx{numberlist} with the separators:
\cmddef{glsnumlistsep}
between each \location\ except for the last pair and
\cmddef{glsnumlistlastsep}
between the last pair.

As with \gls{glsentrynumberlist}, this is again at its simplest with
\option{b2g}. This works by locally setting \gls{bibglsdelimN} to
\gls{glsnumlistsep} and \gls{bibglslastDelimN} to
\gls{glsnumlistlastsep} and then displaying the value of the
\gloskey{location} field. You can instead simply redefine
\gls{bibglsdelimN} and \gls{bibglslastDelimN} as desired and use
\gls{glsentrynumberlist}.

With \option{noidx}, the \idx{numberlist} information is stored in
the \glosfield{loclist} internal field, which is in the format of an
\sty{etoolbox} internal list. So with \option{noidx},
\gls{glsdisplaynumberlist} uses \sty{etoolbox}['s] \gls{forlistloop}
to iterate over the field value using the handler macro:
\cmddef{glsnoidxdisplayloclisthandler}
Note that this doesn't allow for \idxpl{range}.

If \sty{hyperref} has been loaded, \gls{glsdisplaynumberlist}
doesn't work with \options{mkidx,xdy}. In which case, a warning will
be triggered and \gls{glsentrynumberlist} will be used instead.
Without \sty{hyperref}, the \opt{savenumberlist} package option is
still required, and an attempt will be made to parse the formatted
\idx{numberlist} created by \app{makeindex}\slash\app{xindy} in
order to obtain the desired result.

\begin{warning}
\gls{glsdisplaynumberlist} is fairly experimental. It works best with
\option{b2g}, works with limited results with \options{noidx}, but
for \optionsor{mkidx,xdy} it only works when the default 
\idx{locationformat} is used (that is, with the default
\glsopt{format}{glsnumberformat}).  This command will only work with
\sty{hyperref} if you choose \optionsor{noidx,b2g}.
\end{warning}

\chapter{Acronyms and Other Abbreviations}
\label{sec:acronyms}

\begin{information}
The term \qt{\inlineidxdef{acronym}} is used here to describe the
base \sty{glossary} package's mechanism for dealing with acronyms,
initialisms, contractions and anything else that may have a
shortened form for brevity. The term
\qt{\inlineidxdef{abbreviation}} is used to describe the enhanced
mechanism provided by the \sty{glossaries-extra} package, which is
incompatible with the base \idx{acronym} mechanism.
\end{information}

\Idxpl{acronym} internally use \gls{newglossaryentry}, so you can
reference them with \gls{gls} and \gls{glspl} as with other
\idxpl{entry}. Whilst it is possible to simply use
\gls{newglossaryentry} explicitly with the
\gloskey{first} and \gloskey{text} keys set to provide a full form on
\idx{firstuse} and a shortened form on \idx{subsequentuse}, using
\gls{newacronym} establishes a consistent format. It also makes it
possible to shift the \meta{insert} optional argument of the
\gls{glslike} commands inside the full form, so that it is placed
before the parentheses.

The way the \idx{acronym} is displayed on \idx{firstuse} is
governed by the \idx{acronymstyle} that's identified with
\gls{setacronymstyle}.  This should be set before you define
your \idxpl{acronym}. \mExampleref{ex:simpleacronyms} demonstrates the
use of \gls{newacronym}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup language}
\cbeg{document}
First use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
\codepar
Next use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
\cend{document}
\end{codebox}
\begin{resultbox}
\createexample*[title={Simple document with acronyms},
 label={ex:simpleacronyms},
 description={Example document that defines some acronym entries
and references them in the text.}]
{%
\cmd{usepackage}\marg{glossaries}\nl
\gls{setacronymstyle}\marg{long-short}\nl
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}\nl
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup language}
}%
{%
First use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
\codepar
Next use: \gls{gls}\marg{html} and \gls{gls}\marg{xml}.
}
\end{resultbox}

\Idxpl{acronym} are defined using:
\cmddef{newacronym}
This creates a \idx+{glossaryentry} with the given label. This automatically sets
\gloskeyval{type}{\gls{acronymtype}} but if the \idx{acronym} should go in 
another \idx{glossary} you can set the \gloskey{type} in the
optional argument \keyvallist, which is added to the end of
the \keyvallist\ in \gls{newglossaryentry}.

The \gls{newacronym} command also uses the \gloskey{long},
\gloskey{longplural}, \gloskey{short} and \gloskey{shortplural} keys
in \gls{newglossaryentry} to store the long and short forms and
their plurals. 

\begin{xtr}
If you use \gls{newacronym} with \sty{glossaries-extra}, you need to
first set the \idx{abbrvstyle} for the \cat{acronym} category with:
\begin{compactcodebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\margm{style-name}
\end{compactcodebox}
\end{xtr}

Note that the same restrictions on \meta{entry-label} in
\gls{newglossaryentry} also apply to \gls{newacronym} (see
\sectionref{sec:newglosentry}).  Since \gls{newacronym} is defining
the \idx{entry} with \gls{newglossaryentry}, you can use \gls{glsreset} to
reset the \idx{firstuseflag}.

\begin{warning}
Remember to declare the specified \idx{glossary} type as a
list of \idxpl{acronym} (via the package option \opt{acronymlists} or the
command \gls{DeclareAcronymList}) if you have multiple lists of
\idxpl{acronym}. See \sectionref{sec:pkgopts-acronym}.
Alternatively, use \sty{glossaries-extra} to have better support for
a mixed \idxpl{glossary}.
\end{warning}

The optional argument \keyvallist\ allows you to specify
additional information. Any key that can be used in the second
argument of \gls{newglossaryentry} can also be used here in
\keyvallist, but be careful about overriding any keys that are set
by the \idx{acronymstyle}, such as \gloskey{name}, \gloskey{short}
and \gloskey{long}.

For example, you may need to supply \gloskey{description} (when used
with one of the \idxc{acronymstyle}{styles} that require a description, described in
\sectionref{sec:setacronymstyle}) or you can override plural forms
of \meta{short} or \meta{long} using the \gloskey{shortplural} or
\gloskey{longplural} keys.  For example:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{longplural}{diagonal matrices}}
  \marg{dm}\marg{DM}\marg{diagonal matrix}
\end{codebox}
If the \idx{firstuse} uses the plural form, \code{\gls{glspl}\marg{dm}} will
display: diagonal matrices (DMs).

As with \gloskey{plural}, if \gloskey{longplural} is missing, it's
obtained by appending \gls{glspluralsuffix} to the singular form. The
short plural \gloskey{shortplural} is obtained (if not explicitly
set in \keyvallist) by appending: 
\cmddef{glsacrpluralsuffix}
to the short form. These commands may be changed by the associated
language files, but they can't be added to the usual caption hooks
as there's no guarantee when they'll be expanded (as
\hyperref[pluralsuffix]{discussed earlier} in \sectionref{sec:newlang}). 

\begin{xtr}
A different approach is used by \sty{glossaries-extra}, which has
\idxpl{categoryattribute} to determine whether or not to append a
suffix when forming the default value of \gloskey{shortplural}.
\end{xtr}

\begin{important}
Since \gls{newacronym} implicitly sets
\gloskeyval{type}{\gls{acronymtype}}, if you want to load a
file containing \idx{acronym} definitions using \gls{loadglsentries}, the
optional argument that specifies the \idx{glossary} will not have an
effect unless you explicitly set
\gloskeyval{type}{\gls{glsdefaulttype}} in the optional argument to
\gls{newacronym}. See \sectionref{sec:loadglsentries}.
\end{important}

\mExampleref{ex:newacronym} defines the \idx{acronym} IDN and then uses it in the
document text. It then resets the \idx{firstuseflag} and uses it
again.
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
\cbeg{document}
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.
Next use:
the \gls{gls}\marg{idn}['s] prefix is a capital letter.
\cend{document}
\end{codebox}
The reset (\gls{glsreset}) makes the next instance of \gls{gls}
behave as \idx{firstuse}. Note also the way the final \meta{insert}
optional argument is treated.
\begin{resultbox}
\createexample*[title={Defining and Using an Acronym},
 label={ex:newacronym},
 description={Example document that defines an acronym
and references it in the text.}]
{%
\cmd{usepackage}\marg{glossaries}\nl
\gls{setacronymstyle}\marg{long-short}\nl
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
}
{%
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.\nl
Next use: the \gls{gls}\marg{idn}['s] prefix is a capital letter.
}
\end{resultbox}
If the \idx{acronym} had simply been defined with:
\begin{codebox}
\gls{newglossaryentry}\marg{idn}\marg{
  \gloskey{name}{IDN},
  \gloskey{first}{identification number (IDN)},
  \gloskey{description}{identification number}
}
\end{codebox}
then the \idx{firstuse} of \code{\gls{gls}\marg{idn}['s]} would have placed in the
\meta{insert} after the parentheses:
\begin{resultbox}
The identification number (IDN)'s prefix is a capital letter.
\end{resultbox}

If you want to use one of the \idx{smallcaps} \idxpl{acronymstyle},
described in \sectionref{sec:setacronymstyle}, you need to use
\idx{lowercase} characters for the shortened form:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\gls{newacronym}\marg{idn}\marg{idn}\marg{identification number}
\end{codebox}

\begin{important}
Avoid nested definitions.
\end{important}

Recall from the warning in \sectionref{sec:newglosentry} that you
should avoid using the \gls{glslike} and \gls{glstextlike} commands
within the value of keys like \gloskey{text} and \gloskey{first} due
to complications arising from nested links. The same applies to
acronyms defined using \gls{newacronym}.

For example, suppose you have defined:
\begin{codebox}
\gls{newacronym}\marg{ssi}\marg{SSI}\marg{server side includes}
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}
\end{codebox}
you may be tempted to do:
\begin{codebox}
\gls{newacronym}\marg{shtml}\marg{S\gls{gls}\marg{html}}\marg{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}
\end{codebox}
\strong{Don't!} This will break the \casechanging\ commands, such
as \gls{Gls}, it will cause inconsistencies on \idx+{firstuse}, and,
if \idxpl+{hyperlink} are enabled, will cause nested
\idxpl{hyperlink}, and it will \idxc{indexing}{index} the nested
\idxpl{entry} every time the dependent \idx{entry} is \indexed,
which creates unnecessary \locations. It will
also confuse the commands used by the \idxc{entryformat}{entry formatting} (such as
\gls{glslabel}).

Instead, consider doing:
\begin{codebox}
\gls{newacronym}
 \oarg{\gloskeyval{description}{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}}
 \marg{shtml}\marg{SHTML}\marg{SSI enabled HTML}
\end{codebox}
or if the font needs to match the style:
\begin{codebox}
\gls{newacronym}
 \oarg{\gloskeyval{description}{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}}
 \marg{shtml}\marg{SHTML}\marg{\gls{acronymfont}\marg{SSI} enabled \gls{acronymfont}\marg{HTML}}
\end{codebox}
Alternatively:
\begin{codebox}
\gls{newacronym}
 \oarg{\gloskeyval{description}{\gls{gls}\marg{ssi} enabled \gls{gls}\marg{html}}}
 \marg{shtml}\marg{SHTML}
 \marg{server side includes enabled hypertext markup language}
\end{codebox}
Similarly for the \gls{glstextlike} commands.

\begin{xtr}
Other approaches are available with \sty{glossaries-extra}.
See the sections \qt{Nested Links} and \qt{Multi (or Compound)
Entries} in the \sty{glossaries-extra} user manual.
\end{xtr}

\section{Displaying the Long, Short and Full Forms (Independent of
First Use)}
\label{sec:longshortfull}

It may be that you want the long, short or full form
regardless of whether or not the \idx{acronym} has already been 
\idxc{firstuse}{used} in the document. You can do so with the
commands described in this section.

The \csfmt{acr\ldots} commands described below are part of the set
of \gls{glstextlike} commands. That is, they \idxc+{indexing}{index}
and can form \idxpl+{hyperlink}, and they don't modify or test the
\idx+{firstuseflag}.  However, unlike the other \gls{glstextlike}
commands, their \idxc{displaystyle}{display} is governed by
\gls{defglsentryfmt} with \gls{glscustomtext} set to the appropriate
\idx{linktext}. So, for example, 
\begin{compactcodebox}
\gls{acrshort}\margm{label}\oargm{insert}
\end{compactcodebox}
is similar to:
\begin{compactcodebox}
\gls{glsdisp}\marg{\comment{}
 \gls{acronymfont}\marg{\gls{glsentryshort}\margm{label}}\meta{insert}}
\end{compactcodebox}
except that the \idx{firstuseflag} isn't unset.

All caveats that apply to the \gls{glstextlike} commands also apply
to the following commands.  (Including the above warning about
nested links.)

\begin{xtr}
If you are using \sty{glossaries-extra}, don't use the commands
described in this section. The \sty{glossaries-extra} package
provides analogous \csfmt{glsxtr\ldots} or \csfmt{glsfmt\ldots}
commands.  For example, \gls{glsxtrshort} instead of \gls{acrshort}
or, if needed in a heading, \gls{glsfmtshort}. (Similarly for the
\casechanging\ variants.)
\end{xtr}

The optional arguments are the same as those for the \gls{glstextlike}
commands, and there are similar star (\sym{starmod}) and plus
(\sym{plusmod}) variants that switch
off or on the \idxpl{hyperlink}. As with the \gls{glstextlike} commands, the
\idx{linktext} is placed in the argument of \gls{glstextformat}.

\cmddef{acrshort}
This sets the \idx{linktext} to the short form (within the argument
of \gls{acronymfont}) for the \idx{acronym} given by \meta{entry-label}. The short
form is as supplied by the \gloskey{short} key, which
\gls{newacronym} implicitly sets.

There are also analogous \casechanging\ variants:
\cmddef{Acrshort}
(\idx{sentencecase}) and
\cmddef{ACRshort}
(\idx{allcaps}).

There are also plural versions:
\cmddef{acrshortpl}
As \gls{acrshort} but uses the \gloskey{shortplural} value.
\cmddef{Acrshortpl}
(\idx{sentencecase}) and
\cmddef{ACRshortpl}
(\idx{allcaps}).

\cmddef{acrlong}
This sets the \idx{linktext} to the long form for the \idx{acronym} given by 
\meta{entry-label}. The long form is as supplied
by the \gloskey{long} key, which \gls{newacronym} implicitly sets.

There are also analogous \casechanging\ variants:
\cmddef{Acrlong}
(\idx{sentencecase}) and
\cmddef{ACRlong}
(\idx{allcaps}).

Again there are also plural versions:
\cmddef{acrlongpl}
As \gls{acrlong} but uses the \gloskey{longplural} value.
\cmddef{Acrlongpl}
(\idx{sentencecase}) and
\cmddef{ACRlongpl}
(\idx{allcaps}).

\cmddef{acrfull}
This sets the \idx{linktext} to show the full form according to the
format governed by the \idx{acronymstyle}. This may not necessarily
be the same format as that produced on the \idx{firstuse} of \gls{gls}.
For example, the \acrstyle{footnote} style has the long form in a
footnote on the \idx{firstuse} of \gls{gls} but \gls{acrfull} has the long form in
parentheses instead.

There are also analogous \casechanging\ variants:
\cmddef{Acrfull}
(\idx{sentencecase}) and
\cmddef{ACRfull}
(\idx{allcaps}).

The plural version is:
\cmddef{acrfullpl}
with \casechanging\ variants:
\cmddef{Acrfullpl}
(\idx{sentencecase}) and
\cmddef{ACRfullpl}
(\idx{allcaps}).

If you find the above commands too cumbersome to write, you can use
the \opt{shortcuts} package option to activate the shorter
command names listed in \tableref{tab:shortcuts}.

\begin{table}[htbp]
\caption{Synonyms provided by the \glsfmttext{opt.shortcuts} package option}
\label{tab:shortcuts}
\centering
\begin{tabular}{ll}
\bfseries Shortcut Command & \bfseries Equivalent Command\\
\inlineglsdef{acs} & \gls{acrshort}\\
\inlineglsdef{Acs} & \gls{Acrshort}\\
\inlineglsdef{acsp} & \gls{acrshortpl}\\
\inlineglsdef{Acsp} & \gls{Acrshortpl}\\
\inlineglsdef{acl} & \gls{acrlong}\\
\inlineglsdef{Acl} & \gls{Acrlong}\\
\inlineglsdef{aclp} & \gls{acrlongpl}\\
\inlineglsdef{Aclp} & \gls{Acrlongpl}\\
\inlineglsdef{acf} & \gls{acrfull}\\
\inlineglsdef{Acf} & \gls{Acrfull}\\
\inlineglsdef{acfp} & \gls{acrfullpl}\\
\inlineglsdef{Acfp} & \gls{Acrfullpl}\\
\inlineglsdef{ac} & \gls{gls}\\
\inlineglsdef{Ac} & \gls{Gls}\\
\inlineglsdef{acp} & \gls{glspl}\\
\inlineglsdef{Acp} & \gls{Glspl}
\end{tabular}
\end{table}

It is also possible to access the long and short forms without
\idx{indexing} using commands analogous to \gls{glsentrytext}
(described in \sectionref{sec:glsnolink}). These don't include the
\idx{acronym} font commands, such as \gls{acronymfont}.

\cmddef{glsentrylong}
Expands to the long form (that is, the value of the \gloskey{long}
key, which is internally set by \gls{newacronym}).
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrylong}

\cmddef{glsentrylongpl}
Expands to the long plural form (that is, the value of the
\gloskey{longplural}).
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentrylongpl}

\cmddef{glsentryshort}
Expands to the short form (that is, the value of the \gloskey{short}
key, which is internally set by \gls{newacronym}).
The corresponding \idx{sentencecase} command is:
\cmddef{Glsentryshort}

An similar command is available for the full form:
\cmddef{glsentryfull}
This command is redefined by the \idx{acronymstyle}.
Unlike \gls{glsentrylong} and \gls{glsentryshort}, this does include
\gls{acronymfont}, so if you need to use it in a section heading,
you may need to disable it in \idxpl{PDFbookmark}:
\begin{codebox*}
\gls{pdfstringdefDisableCommands}\marg{\comment{provided by \sty{hyperref}}
 \cmd{let}\gls{acronymfont}\gls{@firstofone}
 \cmd{let}\gls{firstacronymfont}\gls{@firstofone}
}
\end{codebox*} 

\cmddef{Glsentryfull}
This is like \gls{glsentryfull} but applies \idx{sentencecase}.

The analogous plural commands are:
\cmddef{glsentryfullpl}
(no \idx{casechange}) and
\cmddef{Glsentryfullpl}
(\idx{sentencecase}).

\section{Changing the Acronym Style}
\label{sec:setacronymstyle}

\begin{xtr}
If you are using \sty{glossaries-extra}, don't use the commands
described in this section. Use \gls{setabbreviationstyle} to set
the \idx{abbrvstyle}. This uses a different (but more consistent) naming
scheme. For example, \abbrstyle{long-noshort} instead of
\acrstyle{dua}. See the \qt{Abbreviations} chapter in the 
\sty{glossaries-extra} manual for further details.
\end{xtr}

The \idx+{acronymstyle} is set using:
\cmddef{setacronymstyle}
where \meta{style name} is the name of the required style.
The style must be set before the \idxpl{acronym} are defined
otherwise you will end up with inconsistencies.

For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries}
\codepar
\gls{makeglossaries}
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\codepar
\gls{newacronym}\marg{html}\marg{html}\marg{hypertext markup language}
\gls{newacronym}\marg{xml}\marg{xml}\marg{extensible markup language}
\end{codebox}

Unpredictable results will occur if you try to use multiple styles
since each \idx{acronymstyle} redefines commands like
\gls{glsentryfull} and \gls{genacrfullformat} that govern the way
the full form is displayed. The closest you can get to different
styles if you only want to use the base \sty{glossaries} package is
to adjust the \idx{entryformat} (see \sectionref{sec:glsdisplay})
or to provide a custom \idx{acronymstyle} such as in 
\exampleref{ex:addstoragekey}.

\begin{important}
If you need multiple styles, then 
use the \sty{glossaries-extra} package, which has better
\idx{abbreviation} management. See, for example,
\gallerypage{sample-name-font}{Gallery: Mixing Styles}.
\end{important}

The \gls{setacronymstyle} command will redefine \gls{newacronym} to
use the newer \idx{acronym} mechanism introduced in version 4.02
(2013-12-05).  The older mechanism was available, but deprecated, for
backward-compatibility until version 4.50 when it was removed.  If
the pre-4.02 \idx{acronym} styles are required, you will need to use
rollback. As from v4.50, if you don't use \gls{setacronymstyle}, the
first instance of \gls{newacronym} will automatically implement:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
which is the closest match to the old default.
\mExampleref{ex:newacronymrollback} is a modification of the earlier
\exampleref{ex:newacronym} so that it uses rollback in order to
demonstrate the difference:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}[=v4.46]\comment{rollback to v4.46}
\comment{no \gls{setacronymstyle} so old style used}
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
\cbeg{document}
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.
Next use:
the \gls{gls}\marg{idn}['s] prefix is a capital letter.
\cend{document}
\end{codebox}
This produces:
\begin{resultbox}
\createexample*[title={Defining and Using an Acronym (Rollback)},
 label={ex:newacronymrollback},
 description={Example document that defines an acronym
and references it in the text using deprecated style with rollback.}]
{%
\cmd{usepackage}\marg{glossaries}[=v4.46]\comment{rollback to v4.46}
\comment{no \gls{setacronymstyle} so old style used}
\gls{newacronym}\marg{idn}\marg{IDN}\marg{identification number}
}
{%
First use: \gls{gls}\marg{idn}. Next use: \gls{gls}\marg{idn}.
\codepar
\gls{glsreset}\marg{idn}\comment{reset first use}
The \gls{gls}\marg{idn}['s] prefix is a capital letter.\nl
Next use: the \gls{gls}\marg{idn}['s] prefix is a capital letter.
}
\end{resultbox}
The most noticeable difference is the way the \meta{insert} optional
argument is treated with \gls{gls} on \idx{firstuse} (\code{\gls{gls}\marg{idn}['s]}).
With the old way, \gls{newacronym} simply set
\gloskey{first}{identification number (IDN)} when it internally used
\gls{newglossaryentry} to define the \idx{acronym}. The default
\idx{entryformat} simply appends the \meta{insert} after the value of
the \gloskey{first} key. 

Unlike the original pre-4.02 behaviour of \gls{newacronym}, the
styles set via \gls{setacronymstyle} don't use the \gloskey{first}
key, but instead they use \gls{defglsentryfmt} to
set a~custom \idx{displaystyle} that uses the \gloskey{long} and \gloskey{short}
keys (or their plural equivalents). This means that these styles
cope better with plurals that aren't formed by simply appending the
singular form with the letter \qt{s}. In fact, most of the predefined
styles use \gls{glsgenacfmt} and modify the definitions of commands
like \gls{genacrfullformat}. If the original behaviour is still
required for some reason, use rollback.

In both the old and new implementation, the \gloskey{text} key is set to
the short form. Since the \gloskey{first} isn't set with the new
form, it will default to the value of the \gloskey{text} key. This
means that with the new implementation, \gls{glsfirst} will 
produce the same result as \gls{glstext}. This is why you need to
use \gls{acrlong} or \gls{acrfull} instead. Alternatively, reset the
\idx{firstuseflag} and use \gls{gls}.

When you use \gls{setacronymstyle} the \gloskey{name} key is set to:
\cmddef{acronymentry}
and the \gloskey{sort} key is set to
\cmddef{acronymsort}
These commands are redefined by the \idxpl{acronymstyle}. However, you can
redefine them again after the style has been set but before you use
\gls{newacronym}. Protected expansion is performed on \gls{acronymsort}
when the \idx{acronym} is defined.

\subsection{Predefined Acronym Styles}
\label{sec:predefinedacrstyles}

The \sty{glossaries} package provides a~number of predefined
\idxpl+{acronymstyle}. These styles apply:
\cmddef{firstacronymfont}
to the short form on \idx{firstuse} and
\cmddef{acronymfont}
on \idx{subsequentuse}. The styles modify the definition of
\gls{acronymfont} and \gls{firstacronymfont} as required. Usually,
\code{\gls{firstacronymfont}\margm{text}} simply does
\code{\gls{acronymfont}\margm{text}}.
If you want the short form displayed differently on \idx{firstuse}, you
can redefine \gls{firstacronymfont} after the \idx{acronymstyle} is
set.

The predefined \idx+{smallcaps} styles that contain \qt{sc} in their
name (for example \acrstyle{long-sc-short}) redefine
\gls{acronymfont} to use \gls+{textsc}, which means that the short
form needs to be specified in \idx+{lowercase} if it should be
rendered in \idx{smallcaps}.  This is because \idx{smallcaps} has
small capital glyphs for \idx{lowercase} letters but normal sized
capital glyphs for \idx{uppercase} letters, which means there's no
visual difference between a normal upright font and a
\idx{smallcaps} font if the text is in \idx{allcaps}.
This is demonstrated in \mexampleref{ex:longscshort}:
\begin{coderesult}
\gls{setacronymstyle}\marg{\acrstyle{long-sc-short}}
\gls{newacronym}\marg{mathml}\marg{MathML}\marg{mathematical markup language}
\cbeg{document}
\gls{acrshort}\marg{mathml}
\cend{document}
\tcblower
\createexample*[title={Small-Caps Acronym},
 label={ex:longscshort},
 description={Example document that uses the long-sc-short acronym
style, which renders the short form in a small-capital font.}]
{%
\cmd{usepackage}\marg{glossaries}\nl
\gls{setacronymstyle}\marg{long-sc-short}\nl
\gls{newacronym}\marg{mathml}\marg{MathML}\marg{mathematical markup language}
}%
{%
\gls{acrshort}\marg{mathml}
}
\end{coderesult}

\hypertarget{boldsc}{}%
\begin{important}%
Some fonts don't support bold \idx{smallcaps}, so you may need to redefine 
\gls{glsnamefont} (see \sectionref{sec:printglossary}) to switch to
medium weight if you are using a \idx{glossarystyle} that displays
\idx{entry} names in bold and you have chosen an \idx{acronymstyle} that uses
\gls{textsc}. (Alternatively, switch to a font that does support bold
\idx{smallcaps}.)
\end{important}

The predefined \idxpl{glossarystyle} that contain \qt{sm} in their name
(for example \acrstyle{long-sm-short}) redefine \gls{acronymfont} to
use \gls+{textsmaller}.

\hypertarget{smaller}{}%
\begin{important}
Note that the \sty{glossaries} package doesn't define or load any package that
defines \gls{textsmaller}. If you use one of the \idxpl{acronymstyle} that
set \gls{acronymfont} to \gls{textsmaller} you must
explicitly load the \sty{relsize} package or otherwise define
\gls{textsmaller}.
\end{important}

The remaining predefined styles redefine \gls{acronymfont}
to simply do its argument without any font change. 

\begin{important}
The predefined styles adjust \gls+{acrfull} and
\gls+{glsentryfull} (and their plural and \casechanging\ variants) to
reflect the style.
\end{important}

When \idxpl{acronym} are defined, \gls{newacronym} will set the
\gloskey{sort} key to \gls{acronymsort}.
The \idxpl{acronymstyle} redefine this to suit the style. This
command must fully expand in order for the \idx{indexingapp} to pick
up the correct sort value.
If the \gloskey{sort} key is set in the optional argument of
\gls{newacronym}, it will override this.

The \gloskey{name} key is set to \gls{acronymentry}.
Again, the \idxpl{acronymstyle} redefine this to suit the style.
If the \gloskey{name} key is set in the optional argument of
\gls{newacronym}, it will override this.

The \gloskey{type} key is set to \gls{acronymtype}.
If the \gloskey{type} key is set in the optional argument of
\gls{newacronym}, it will override this.

The \gloskey{shortplural} is set to the short form appended by:
\cmddef{acrpluralsuffix}
This is redefined by the \idxpl{acronymstyle} to the appropriate
suffix. In most cases, it will simply be defined to
\gls{glspluralsuffix}, but the \idx+{smallcaps} styles define it to:
\cmddef{glsupacrpluralsuffix}
This uses:
\cmddef{glstextup}
to cancel the effect of the \idx{smallcaps} font command \gls{textsc}.

If the \gloskey{shortplural} key is set in the optional argument of
\gls{newacronym}, it will override this default.

The \gloskey{longplural} is set to the long form appended by
\gls{glspluralsuffix}.
If the \gloskey{longplural} key is set in the optional argument of
\gls{newacronym}, it will override this default.

Some styles set the \gloskey{description} key to the long form, but others don't.
If you use a style that doesn't set it, you will have to supply the
\gloskey{description} in the optional argument of \gls{newacronym}.

\subsubsection{Long (Short)}
\label{sec:acrstyleslongshort}

With the \qt{long (short)} styles, \idxpl{acronym} are displayed in the form:
\begin{compactcodebox*}
\meta{long} (\gls{firstacronymfont}\margm{short})
\end{compactcodebox*}
on \idx{firstuse} and
\begin{compactcodebox*}
\gls{acronymfont}\margm{short}
\end{compactcodebox*}
on \idx{subsequentuse}.

They also set \gls{acronymsort} so that it just expands to its first
argument \meta{short}.  This means that the acronyms are sorted according to
their short form.  In addition, \gls{acronymentry}\marg{label} is set
to just the short form (enclosed in \gls{acronymfont}) and the
\gloskey{description} key is set to the long form.

\acrstyledef{long-short}
This is the default style that will be implemented if
\gls{setacronymstyle} isn't used (as from v4.50, which has removed
the default deprecated style). This shows the long form followed by
the short form in parentheses on \idx{firstuse} and also with
\gls{acrfull}. This redefines \gls{acronymfont} to simply do its
argument.

\acrstyledef{long-sc-short}
This is like \acrstyle{long-short} but uses \idx+{smallcaps} for the
short form, so it redefines \gls{acronymfont} to use \gls{textsc}
and \gls{acrpluralsuffix} to \gls{glsacrpluralsuffix}.

\acrstyledef{long-sm-short}
This is like \acrstyle{long-short} but uses \gls{textsmaller} for the
short form, so it redefines \gls{acronymfont} to use
\gls{textsmaller}. This style will require \sty{relsize} to be
loaded.

\acrstyledef{long-sp-short}
This is like \acrstyle{long-short} but instead of simply using a
space between the long and short form, it uses:
\cmddef*{glsacspace}
This measures the short form for the given entry and, if the width is
smaller than 3em, it will use \idx+{nbsp}. Otherwise it will use
\gls+{space}.

\begin{xtr}
Although the \sty{glossaries-extra} package doesn't support the base
\idxpl{acronymstyle}, it does redefine \gls{glsacspace} to use
\gls{glsacspacemax} instead of the hard-coded 3em, as
\gls{glsacspace} may also be useful in \idxpl{abbrvstyle}.
\end{xtr}

\begin{example}{Adapting a Predefined Acronym Style}{ex:acrstyle}
Suppose I~want to use the \acrstyle{footnote-sc-desc} style, but 
I~want the \gloskey{name} key set to the short form followed by the
long form in parentheses and the \gloskey{sort} key set to the short
form. Then I need to specify the \acrstyle{footnote-sc-desc} style:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{footnote-sc-desc}}
\end{codebox}
and then redefine \gls{acronymsort} and \gls{acronymentry}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\#1}\comment{sort by short form}
\cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{short (long) name}
  \gls{acronymfont}\marg{\gls{glsentryshort}\marg{\#1}}\gls{space} (\gls{glsentrylong}\marg{\#1})}\comment{}
\end{codebox}
(I've used \gls{space} for extra clarity, but you can just use an
actual space instead.)

Note that the default Computer Modern fonts don't support bold
\idx+{smallcaps}, so another font is required. For example:
\begin{codebox}
\cmd{usepackage}[T1]\marg{fontenc}
\end{codebox}
The alternative is to redefine \gls{acronymfont} so that it
always switches to medium weight to ensure the \idx{smallcaps} setting is
used. For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\cmd{textmd}\marg{\cmd{scshape} \#1}}
\end{codebox}

The sample file \samplefile{FnAcrDesc} illustrates this
example.
\end{example}

\subsubsection{Short (Long)}
\label{sec:acrstylesshortlong}

With the \qt{short (long)} styles, \idxpl{acronym} are displayed in the form:
\begin{compactcodebox*}
\gls{firstacronymfont}\margm{short} (\meta{long} )
\end{compactcodebox*}
on \idx{firstuse} and
\begin{compactcodebox*}
\gls{acronymfont}\margm{short}
\end{compactcodebox*}
on \idx{subsequentuse}.

They also set \gls{acronymsort}\marg{short}\marg{long} to just
\meta{short}.  This means that the \idxpl{acronym} are sorted according to
their short form.  In addition, \gls{acronymentry}\marg{label} is set
to just the short form (enclosed in \gls{acronymfont}) and the
\gloskey{description} key is set to the long form.

\acrstyledef{short-long}
This shows the short form followed by
the long form in parentheses on \idx{firstuse} and also with
\gls{acrfull}. This redefines \gls{acronymfont} to simply do its
argument.

\acrstyledef{sc-short-long}
This is like \acrstyle{short-long} but uses \idx+{smallcaps} for the
short form, so it redefines \gls{acronymfont} to use \gls{textsc}
and \gls{acrpluralsuffix} to \gls{glsacrpluralsuffix}.

\acrstyledef{sm-short-long}
This is like \acrstyle{short-long} but uses \gls{textsmaller} for the
short form, so it redefines \gls{acronymfont} to use
\gls{textsmaller}. This style will require \sty{relsize} to be
loaded.

\subsubsection{Long (Short) User Supplied Description}
\label{sec:acrstyleslongshortdesc}

\acrstyledef{long-short-desc}
This is like \acrstyle{long-short} but the \gloskey{description} key
must be provided in the optional argument of \gls{newacronym}.
The sort value command \gls{acronymsort} is redefined to expand to
its second argument (\meta{long}), and \gls{acronymentry} is
redefined to show the long form followed by the short form in
parentheses.

\acrstyledef{long-sc-short-desc}
This is like \acrstyle{long-short-desc} except that it uses
\idx+{smallcaps}, as \acrstyle{long-sc-short}.

\acrstyledef{long-sm-short-desc}
This is like \acrstyle{long-short-desc} except that it uses
\gls+{textsmaller}, as \acrstyle{long-sm-short}.

\acrstyledef{long-sp-short-desc}
This is like \acrstyle{long-short-desc} except that it uses
\gls{glsacspace}, as \acrstyle{long-sp-short}.

\subsubsection{Short (Long) User Supplied Description}
\label{sec:acrstylesshortlongdesc}

\acrstyledef{short-long-desc}
This is like \acrstyle{short-long} but the \gloskey{description} key
must be provided in the optional argument of \gls{newacronym}.
The sort value command \gls{acronymsort} is redefined to expand to
its second argument (\meta{long}), and \gls{acronymentry} is
redefined to show the long form followed by the short form in
parentheses.

\acrstyledef{sc-short-long-desc}
This is like \acrstyle{short-long-desc} except that it uses
\idx+{smallcaps}, as \acrstyle{long-sc-short}.

\acrstyledef{sm-short-long-desc}
This is like \acrstyle{short-long-desc} except that it uses
\gls+{textsmaller}, as \acrstyle{long-sm-short}.

\subsubsection{Do Not Use Acronym (DUA)}
\label{sec:acrstylesdua}

With these styles, the \gls{glslike} commands always display the long form 
regardless of whether the entry has been \idx{firstuse}{used} or not. 
However, \gls{acrfull}
and \gls{glsentryfull} will display the long form followed by the
short form, as per the \acrstyle{long-short} style.

\acrstyledef{dua}
The sort value command \gls{acronymsort} expands to just its second
argument (the long form), and \gls{acronymentry} shows just the
long form.

\acrstyledef{dua-desc}
The sort value command \gls{acronymsort} expands to just its second
argument (the long form), and \gls{acronymentry} shows just the
long form.

\subsubsection{Footnote}
\label{sec:acrstylesfootnote}

With these styles, the \gls{glslike} commands show the short form
followed by the long form in a footnote on \idx{firstuse}. 
The footnote is simply added with \gls{footnote}.
The \gls{acrfull} set of commands show the short form followed by the
long form in parentheses (as per styles like \acrstyle{short-long}).
The definitions of \gls{acronymsort} and \gls{acronymentry} are as
for the \qt{short (long)} styles described in \sectionref{sec:acrstylesshortlong}.

\begin{information}
The footnote styles automatically set \optval{hyperfirst}{false} to
prevent nested \idxpl+{hyperlink}. 
\end{information}

\acrstyledef{footnote}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{short-long} style

\acrstyledef{footnote-sc}
This defines \gls{acronymentry}, \gls{acronymsort},
\gls{acronymfont} and \gls{acrpluralsuffix} in the same way as the 
\acrstyle{sc-short-long} style

\acrstyledef{footnote-sm}
This defines \gls{acronymentry}, \gls{acronymsort} and
\gls{acronymfont} in the same way as the 
\acrstyle{sm-short-long} style

\acrstyledef{footnote-desc}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{short-long-desc} style

\acrstyledef{footnote-sc-desc}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{sc-short-long-desc} style

\acrstyledef{footnote-sm-desc}
This defines \gls{acronymentry}, \gls{acronymsort} and \gls{acronymfont}
in the same way as the \acrstyle{sm-short-long-desc} style

\subsection{Defining A Custom Acronym Style}
\label{sec:customacronym}

You may find that the predefined \idxpl{acronymstyle} that come with the
\sty{glossaries} package don't suit your requirements. In this
case you can define your own style using:
\cmddef{newacronymstyle}
where \meta{style name} is the name of the new style (avoid active
characters). The second argument, \meta{format def}, is equivalent to
the \meta{definition} argument of \gls{defglsentryfmt}. You can simply use
\gls{glsgenacfmt} or you can customize the \idxc{entryformat}{display} using commands
like \gls{ifglsused}, \gls{glsifplural} and \gls{glscapscase}.
(See \sectionref{sec:glsdisplay} for further details.)

If the style is likely to be used with a mixed \idx{glossary} (that
is, \idxpl{entry} in that \idx{glossary} are defined both with \gls{newacronym} and
\gls{newglossaryentry}) then you can test if the \idx{entry} is an
\idx{acronym} and use \gls{glsgenacfmt} if it is or \gls{glsgenentryfmt} if it
isn't. For example, the \acrstyle{long-short} style sets
\meta{format def} as
\begin{compactcodebox}
\gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}
\end{compactcodebox}
(You can use \gls{ifglshasshort} instead of \gls{ifglshaslong} to
test if the \idx{entry} is an \idx{acronym} if you prefer.)

The third argument, \meta{style defs}, can be used to redefine the
commands that affect the display style, such as \gls{acronymfont}
and \gls{genacrfullformat}.

\begin{information}
Bear in mind that you will need to use \idx{hashhash} rather than
\sym{hash} to reference parameters in command definitions within
\meta{style defs}.
\end{information}

Note that \gls{setacronymstyle} redefines \gls{glsentryfull} and
\gls{acrfullfmt} to use \gls{genacrfullformat} (and similarly for
the plural and \casechanging\ variants). If this isn't appropriate for the
style (as in the case of styles like \acrstyle{footnote} and
\acrstyle{dua}) \gls{newacronymstyle} should redefine these commands
within \meta{style defs}.

Within \gls{newacronymstyle}'s \meta{style defs} argument you 
can also redefine:
\cmddef{GenericAcronymFields}
This should expand to the list of additional fields to be set in
\gls{newglossaryentry}, when it's internally called by
\gls{newacronym}.
You can use the following token registers to access information
passed to the arguments of \gls{newacronym}.

\cmddef{glskeylisttok} 
Contains the \keyvallist\ options.

\cmddef{glslabeltok} 
Contains the \meta{entry-label}.

\cmddef{glsshorttok} 
Contains the \meta{short} form argument.

\cmddef{glslongtok} 
Contains the \meta{long} form argument.

As with all token registers, you can obtain the value of the
register with \gls{the}\meta{register}.  For example, the
\acrstyle{long-short} style does:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
   \gloskeyval{description}{\gls{the}\gls{glslongtok}}}
\end{compactcodebox}
which sets the \gloskey{description} field to the long form of the
\idx{acronym} whereas the \acrstyle{long-short-desc} style does:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}
\end{compactcodebox}
since the description needs to be specified by the user.

It may be that you want to define a new \idx{acronymstyle} that's based
on an existing style. Within \meta{format def} of the new style, you can use
\cmddef{GlsUseAcrEntryDispStyle}
to use the \meta{format def} definition from the style given by
\meta{style name}.

Within \meta{display defs} of the new style, you can use
\cmddef{GlsUseAcrStyleDefs}
to use the \meta{display defs} from the style given by \meta{style name}.

For example, the \acrstyle{long-sc-short} \idx{acronymstyle} is
based on the \acrstyle{long-short} style with minor
modifications:
\begin{compactcodebox}
\gls{newacronymstyle}\marg{\acrstyle{long-sc-short}}\comment{}
\marg{\comment{use the same display as \acrstyle{long-short}}
  \gls{GlsUseAcrEntryDispStyle}\marg{\acrstyle{long-short}}\comment{}
}\comment{}
\marg{\comment{use the same definitions as \acrstyle{long-short}}
  \gls{GlsUseAcrStyleDefs}\marg{\acrstyle{long-short}}\comment{}
  \comment{Minor modifications:}
  \cmd{renewcommand}\marg{\gls{acronymfont}}[1]\marg{\gls{textsc}\marg{\idx{hashhash}1}}\comment{}
  \cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glstextup}\marg{\gls{glspluralsuffix}}}\comment{}
}
\end{compactcodebox}

\begin{example}{Defining a Custom Acronym Style}{ex:customacrstyle}
Suppose I want my acronym on \idx{firstuse} to have the
short form in the text and the long form with the description in a
footnote. Suppose also that I want the short form to be put in small
caps in the main body of the document, but I want it in normal
capitals in the list of acronyms. In my list of acronyms, I want the
long form as the name with the short form in brackets followed by
the description. That is, in the text I want \gls{gls} on \idx{firstuse}
to display:
\begin{compactcodebox}
\gls{textsc}\margm{short}\gls{footnote}\marg{\meta{long}: \meta{description}}
\end{compactcodebox}
on \idx{subsequentuse}:
\begin{compactcodebox}
\gls{textsc}\margm{short}
\end{compactcodebox}
and in the list of acronyms, each entry will be displayed in the
form:
\begin{compactcodebox}
\meta{long} (\meta{short}) \meta{description}
\end{compactcodebox}

Let's suppose it's possible that I may have a mixed \idx{glossary}. I can
check this in the second argument (\meta{format def}) of \gls{newacronymstyle} using:
\begin{codebox}
\gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}
\end{codebox}
This will use \gls{glsgenentryfmt} if the entry isn't an \idx{acronym},
otherwise it will use \gls{glsgenacfmt}. The third argument
(\meta{display defs}) of
\gls{newacronymstyle} needs to redefine \gls{genacrfullformat} etc 
so that the \idx{firstuse} displays the short form in the text with the 
long form in a footnote followed by the description. This is done as
follows:
\begin{codebox}
\comment{No case change, singular \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{\Idx{sentencecase}, singular \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{Glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{No case change, plural \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{\Idx{sentencecase}, plural \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{Glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}
\end{codebox}
If you think it inappropriate for the short form to be capitalised
at the start of a sentence you can change the above to:
\begin{codebox}
\comment{No case change, singular \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\comment{No case change, plural \idx{firstuse}:}
\cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
 \gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
 \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
}\comment{}
\cmd{let}\gls{Genacrfullformat}\gls{genacrfullformat}
\cmd{let}\gls{Genplacrfullformat}\gls{genplacrfullformat}
\end{codebox}
Another variation is to use \gls{Glsentrylong} and
\gls{Glsentrylongpl} in the footnote instead of \gls{glsentrylong} and
\gls{glsentrylongpl}.

Now let's suppose that commands such as \gls{glsentryfull} and
\gls{acrfull} shouldn't
use a~footnote, but instead use the format: \meta{long}
(\meta{short}).
This means that the style needs to redefine \gls{glsentryfull},
\gls{acrfullfmt} and their plural and \casechanging\ variants.

First, the non-linking commands: 
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfull}}[1]\marg{\comment{}
  \gls{glsentrylong}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Glsentryfull}}[1]\marg{\comment{}
  \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{glsentryfullpl}}[1]\marg{\comment{}
  \gls{glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Glsentryfullpl}}[1]\marg{\comment{}
  \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
}
\end{codebox}
Now for the linking commands:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acrfullfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Acrfullfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{Glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
    (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{ACRfullfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{glsuppercase}\marg{\comment{}
     \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
       (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{acrfullplfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{Acrfullplfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
   \gls{Glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
  }\comment{}
}\comment{}
\cmd{renewcommand}*\marg{\gls{ACRfullplfmt}}[3]\marg{\comment{}
  \gls{glslink}\oarg{\idx{hashhash}1}{\idx{hashhash}2}{\comment{}
   \gls{glsuppercase}\marg{\comment{}
     \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\space
       (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
  }\comment{}
}
\end{codebox}
(This may cause problems with long \idxpl{hyperlink}, in which case adjust
the definitions so that, for example, only the short form is inside
the argument of \gls{glslink}.)

The style also needs to redefine \gls{acronymsort} so that the
\idxpl{acronym} are sorted according to the long form:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}2}
\end{codebox}
If you prefer them to be sorted according to the short form you can
change the above to:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}1}
\end{codebox}
The \idx{acronym} font needs to be set to \gls{textsc} and the plural
suffix adjusted so that the \qt{s} suffix in the plural short form
doesn't get converted to \idx{smallcaps}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\gls{textsc}\marg{\idx{hashhash}1}}\comment{}
\cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glsupacrpluralsuffix}}\comment{}
\end{codebox}
There are a number of ways of dealing with the format in the list of
\idxpl{acronym}. The simplest way is to redefine \gls{acronymentry} to the
long form followed by the upper case short form in parentheses:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{}
  \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
    (\gls{glsuppercase}{\gls{glsentryshort}\marg{\idx{hashhash}1}})}
\end{codebox}
(I've used \gls{Glsentrylong} instead of \gls{glsentrylong} to
capitalise the name in the \idx{glossary}.)

An alternative approach is to set \gls{acronymentry} to just the
long form and redefine \gls{GenericAcronymFields} to set the
\gloskey{symbol} key to the short form and use a \idx{glossarystyle} that
displays the symbol in parentheses after the \gloskey{name} (such as
the \glostyle{tree} style) like this:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\gls{Glsentrylong}\marg{\idx{hashhash}1}}\comment{}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{\comment{}
   \gloskeyval{symbol}{\cmd{protect}\gls{glsuppercase}\marg{\gls{the}\gls{glsshorttok}}}}\comment{}
\end{codebox}
I'm going to use the first approach and set
\gls{GenericAcronymFields} to do nothing:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{}
\end{codebox}

Finally, this style needs to switch off \idxpl{hyperlink} on
\idx{firstuse} to avoid nested links:
\begin{codebox*}
\gls{glshyperfirstfalse}
\end{codebox*}
Putting this all together:
\begin{codebox}
\gls{newacronymstyle}\marg{custom-fn}\comment{new style name}
\marg{\comment{\idx{entryformat}}
 \gls{ifglshaslong}\marg{\gls{glslabel}}\marg{\gls{glsgenacfmt}}\marg{\gls{glsgenentryfmt}}\comment{}
}\comment{}
\marg{\comment{}
 \cmd{renewcommand}*\marg{\gls{GenericAcronymFields}}\marg{}\comment{}
 \gls{glshyperfirstfalse}
 \comment{No case change, singular \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{\Idx{sentencecase}, singular \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{Glsentryshort}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylong}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{No case change, plural \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{\Idx{sentencecase}, plural \idx{firstuse}:}
 \cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
  \gls{firstacronymfont}\marg{\gls{Glsentryshortpl}\marg{\idx{hashhash}1}}\idx{hashhash}2\comment{}
  \gls{footnote}\marg{\gls{glsentrylongpl}\marg{\idx{hashhash}1}: \gls{glsentrydesc}\marg{\idx{hashhash}1}}\comment{}
 }\comment{}
 \comment{non-linking commands}
 \cmd{renewcommand}*\marg{\gls{glsentryfull}}[1]\marg{\comment{}
   \gls{glsentrylong}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Glsentryfull}}[1]\marg{\comment{}
   \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{glsentryfullpl}}[1]\marg{\comment{}
   \gls{glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Glsentryfullpl}}[1]\marg{\comment{}
   \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \comment{linking commands}
 \cmd{renewcommand}*\marg{\gls{acrfullfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Acrfullfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{Glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
     (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{ACRfullfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{glsuppercase}\marg{\comment{}
      \gls{glsentrylong}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
        (\gls{acronymfont}\marg{\gls{glsentryshort}\marg{\idx{hashhash}2}})\comment{}
    }\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{acrfullplfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
      (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Acrfullplfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}\marg{\idx{hashhash}2}{\comment{}
    \gls{Glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\gls{space}
      (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
   }\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{ACRfullplfmt}}[3]\marg{\comment{}
   \gls{glslink}\oarg{\idx{hashhash}1}{\idx{hashhash}2}{\comment{}
    \gls{glsuppercase}\marg{\comment{}
      \gls{glsentrylongpl}\marg{\idx{hashhash}2}\idx{hashhash}3\space
        (\gls{acronymfont}\marg{\gls{glsentryshortpl}\marg{\idx{hashhash}2}})\comment{}
    }\comment{}
   }\comment{}
 }\comment{}
 \comment{font}
 \cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\gls{textsc}\marg{\idx{hashhash}1}}\comment{}
 \cmd{renewcommand}*\marg{\gls{acrpluralsuffix}}\marg{\gls{glsupacrpluralsuffix}}\comment{}
 \comment{\gloskey{sort}}
 \cmd{renewcommand}*\marg{\gls{acronymsort}}[2]\marg{\idx{hashhash}2}\comment{}
 \comment{\gloskey{name}}
 \cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\comment{}
   \gls{Glsentrylong}\marg{\idx{hashhash}1}\gls{space}
     (\gls{glsuppercase}{\gls{glsentryshort}\marg{\idx{hashhash}1}})}\comment{}
}
\end{codebox}

Now I need to specify that I want to use this new style:
\begin{codebox}
\gls{setacronymstyle}\marg{custom-fn}
\end{codebox}
I also need to use a \idx{glossarystyle} that suits this acronym style,
for example \glostyle{altlist}:
\begin{codebox}
\gls{setglossarystyle}\marg{\glostyle{altlist}}
\end{codebox}

Once the \idx{acronymstyle} has been set, I can define my
\idxpl{acronym}:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{set of tags for use in 
developing hypertext documents}}\marg{html}\marg{html}\marg{Hyper 
Text Markup Language}
\codepar
\gls{newacronym}\oarg{\gloskeyval{description}{language used to describe the 
layout of a document written in a markup language}}\marg{css}
\marg{css}\marg{Cascading Style Sheet}
\end{codebox}

The sample file \samplefile{-custom-acronym} illustrates this
example.
\end{example}

\begin{example}{Italic and Upright Abbreviations}{ex:font-abbr}
Suppose I~want to have some \idxpl{acronym} in italic and some that
just use the surrounding font. Hard-coding this into the
\meta{short} argument of \gls{newacronym} can cause complications.

This example uses \gls{glsaddstoragekey} to add an extra field that
can be used to store the formatting declaration (such as \csfmt{em}).
\begin{codebox}
\gls{glsaddstoragekey}\marg{font}\marg{}\marg{\cmd{entryfont}}
\end{codebox}
This defines a~new field/key called \optfmt{font}, which defaults to
nothing if it's not explicitly set. This also defines a command
called \csfmt{entryfont} that's analogous to \gls{glsentrytext}. A~new
style is then created to format \idxpl{acronym} that access this field.

There are two ways to do this. The first is to create a style that
doesn't use \gls{glsgenacfmt} but instead provides a~modified
version that doesn't use \gls{acronymfont}
but instead uses
\begin{compactcodebox}
\marg{\cmd{entryfont}\marg{\gls{glslabel}}\meta{short}}.
\end{compactcodebox}
The full format given by commands such as \gls{genacrfullformat}
need to be similarly adjusted. For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
 \gls{glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
 (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
}\comment{}
\end{codebox}
This will deal with commands like \gls{gls} but not commands like
\gls{acrshort} which still use \gls{acronymfont}. Another approach
is to redefine \gls{acronymfont} to look up the required font
declaration. Since \gls{acronymfont} doesn't take the entry label as
an argument, the following will only work if \gls{acronymfont} is
used in a~context where the label is provided by \gls{glslabel}.
This is true in \gls{gls}, \gls{acrshort} and \gls{acrfull}. The
redefinition is now:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\marg{\cmd{entryfont}\marg{\gls{glslabel}}\idx{hashhash}1}}\comment{}
\end{codebox}
So the new style can be defined as:
\begin{codebox}
\gls{newacronymstyle}\marg{long-font-short}
\marg{\comment{}
 \gls{GlsUseAcrEntryDispStyle}\marg{long-short}\comment{}
}\comment{}
\marg{\comment{}
 \gls{GlsUseAcrStyleDefs}\marg{long-short}\comment{}
 \cmd{renewcommand}*\marg{\gls{genacrfullformat}}[2]\marg{\comment{}
  \gls{glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Genacrfullformat}}[2]\marg{\comment{}
  \gls{Glsentrylong}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{genplacrfullformat}}[2]\marg{\comment{}
  \gls{glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{Genplacrfullformat}}[2]\marg{\comment{}
  \gls{Glsentrylongpl}\marg{\idx{hashhash}1}\idx{hashhash}2\gls{space}
  (\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}})\comment{}
 }\comment{}
 \cmd{renewcommand}*\marg{\gls{acronymfont}}[1]\marg{\marg{\cmd{entryfont}\marg{\gls{glslabel}}\idx{hashhash}1}}\comment{}
 \cmd{renewcommand}*\marg{\gls{acronymentry}}[1]\marg{\marg{\cmd{entryfont}\marg{\idx{hashhash}1}\gls{glsentryshort}\marg{\idx{hashhash}1}}}\comment{}
}
\end{codebox}
Remember the style needs to be set before defining the entries:
\begin{codebox}
\gls{setacronymstyle}\marg{long-font-short}
\end{codebox}

The complete document is contained in the sample file
\samplefile{-font-abbr}.
\end{example}

Some writers and publishing houses have started to drop
\idxpl{fullstop} (periods) from \idx{uppercase} initials but may
still retain them for \idx{lowercase} abbreviations, while others
may still use them for both \idxc{uppercase}{upper} and
\idx{lowercase}. This can cause complications. Chapter~12 of
\booktitle{The \TeX book} discusses the spacing between words but,
briefly, the default behaviour of \TeX\ is to assume that an
\idx{uppercase} character followed by a~\idx{fullstop} and space is
an abbreviation, so the space is the default \idx{interwordspace}
whereas a~\idx{lowercase} character followed by a~\idx{fullstop} and
space is a word occurring at the end of a~sentence, which requires
an \idx{intersentencespace} (which may or may not be the same as an
\idx{interwordspace}).  In the event that this isn't true, you need
to make a~manual adjustment using \glsname{cs.sp} (backslash space)
in place of just a~space character for an inter-word mid-sentence
space and use \gls{cs.at} before the \idx{fullstop} to indicate the end
of the sentence.

For example:
\begin{codebox}
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{codebox}
is typeset as
\begin{resultbox}
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{resultbox}
The spacing is more noticeable with the typewriter font:
\begin{codebox}
\cmd{ttfamily}
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{codebox}
is typeset as
\begin{resultbox}\ttfamily
I was awarded a B.Sc. and a Ph.D. (From the same place.)
\end{resultbox}
The \idx{lowercase} letter at the end of \qt{B.Sc.}\ is confusing \TeX\
into thinking that the \idx{fullstop} after it marks the end of the
sentence. Whereas the \idx{uppercase} letter at the end of \qt{Ph.D.} has
confused \TeX\ into thinking that the following \idx{fullstop} is just
part of the abbreviation. These can be corrected:
\begin{codebox}
I was awarded a B.Sc.\gls{cs.sp}and a Ph.D\gls{cs.at}. (From the same place.)
\end{codebox}

This situation is a bit problematic for \sty{glossaries}. The
\idxpl{fullstop} can form part of the \meta{short} argument of
\gls{newacronym} and the \code{B.Sc.\glsname{cs.sp}} part can be dealt with by
remembering to add \glsname{cs.sp} (for example,
\code{\gls{gls}\marg{bsc}\glsname{cs.sp}}
but the end of sentence case is more troublesome as you need to omit
the sentence terminating \idx{fullstop} (to avoid two dots) which can
make the source code look a little strange but you also need to
adjust the \idx{spacefactor}, which is usually done by inserting
\gls{cs.at}
before the \idx{fullstop}.

The next example shows one way of achieving this.

\begin{xtr}
The \sty{glossaries-extra} package provides a much
simpler way of doing this, which you may prefer to use. See 
\gallery{sample-initialisms.shtml}{Gallery: Initialisms}.
\end{xtr}

\begin{example}{Abbreviations with Full Stops (Periods)}{ex:dotabbr}
The \idx+{postlinkhook} (\gls{glspostlinkhook})
is called at the very end of the \gls{glslike} and \gls{glstextlike}
commands. This can be redefined to check if the following character
is a \idx{fullstop}. The \sty{amsgen} package (which is automatically
loaded by \sty{glossaries}) provides an internal command
called \csfmt{new@ifnextchar} that can be used to determine if the
given character appears next. (For more information see the
\sty{amsgen} documentation. Alternatively, \LaTeX3 may provide a
better way of doing this.)

It's possible that I~may also want acronyms or contractions (without
\idxpl{fullstop}) in my
document, so I~need some way to differentiate between them.
Here I'm going to use the same method as in
\exampleref{ex:addstoragekey} where a~new field is defined
to indicate the type of abbreviation:
\begin{codebox}
\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}}
\codepar
\cmd{newcommand}*\marg{\cmd{newabbr}}[1][]\marg{\gls{newacronym}\oarg{abbrtype=initials,\#1}}
\end{codebox}
Now I just use \gls{newacronym} for the acronyms, for example,
\begin{codebox}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\end{codebox}
and my new command \csfmt{newabbr} for initials, for example,
\begin{codebox}
\cmd{newabbr}\marg{eg}\marg{e.g.}\marg{exempli gratia}
\cmd{newabbr}\marg{ie}\marg{i.e.}\marg{id est}
\cmd{newabbr}\marg{bsc}\marg{B.Sc.}\marg{Bachelor of Science}
\cmd{newabbr}\marg{ba}\marg{B.A.}\marg{Bachelor of Arts}
\cmd{newabbr}\marg{agm}\marg{A.G.M.}\marg{annual general meeting}
\end{codebox}
Within \gls{glspostlinkhook} the \idx{entry}['s] label can be accessed using
\gls{glslabel} and \gls{ifglsfieldeq} can be used to determine if
the current entry has the new \optfmt{abbrtype} field set to
\qt{initials}. If it doesn't, then nothing needs to happen, but if
it does, a~check is performed to see if the next character is 
a~\idx{fullstop}. If it is, this signals the end of a~sentence otherwise it's
mid-sentence.

Remember that internal commands within the document file (rather
than in a~class or package) need to be placed between
\gls{makeatletter} and \gls{makeatother}:
\begin{codebox}
\gls{makeatletter}
\cmd{renewcommand}\marg{\gls{glspostlinkhook}}\marg{\comment{}
 \gls{ifglsfieldeq}\marg{\gls{glslabel}}\marg{abbrtype}\marg{initials}\comment{}
 \marg{\cmd{new@ifnextchar}\sym{fullstop}\cmd{doendsentence}\cmd{doendword}}
 \marg{}\comment{}
}
\gls{makeatother}
\end{codebox}
In the event that a \idx{fullstop} is found then \csfmt{doendsentence} is
performed, but it will be followed by the \idx{fullstop}, which needs to
be discarded. Otherwise \csfmt{doendword} will be done, but it won't be
followed by a \idx{fullstop} so there's nothing to discard. The
definitions for these commands are:
\begin{codebox*}
\cmd{newcommand}\marg{\cmd{doendsentence}}[1]\marg{\gls{spacefactor}=10000 }
\cmd{newcommand}\marg{\cmd{doendword}}\marg{\gls{spacefactor}=1000 }
\end{codebox*}
Now, I can just do \code{\gls{gls}\marg{bsc}} mid-sentence and
\code{\gls{gls}\marg{phd}\sym{fullstop}}\ at the end of the sentence. 
The terminating \idx{fullstop} will be discarded in the latter case, 
but it won't be discarded in, say,
\code{\gls{gls}\marg{laser}\sym{fullstop}} as that doesn't have the
\optfmt{abbrtype} field set to \qt{initials}.

This also works on \idx{firstuse} when the style is set to one of the
\meta{long} (\meta{short}) styles but it will fail with the
\meta{short} (\meta{long}) styles as in this case the terminating
\idx{fullstop} shouldn't be discarded. Since \gls{glspostlinkhook} is
used after the \idx{firstuseflag} has been unset for the \idx{entry}, this
can't be fixed by simply checking with \gls{ifglsused}. One possible
solution to this is to redefine \gls{glslinkpostsetkeys} to check
for the \idx{firstuseflag} and define a macro that can then be used in
\gls{glspostlinkhook}.

The other thing to consider is what to do with plurals. One
possibility is to check for plural use within \csfmt{doendsentence}
(using \gls{glsifplural}) and put the \idx{fullstop} back if the plural
has been used.

The complete document is contained in the sample file
\samplefile{-dot-abbr}.
\end{example}

\section{Displaying the List of Acronyms}
\label{sec:disploa}

The list of acronyms is just like any other type of \idx{glossary} and can
be displayed on its own using the appropriate 
\gls{print...glossary} command, according to the
\idx{indexing} method.

For example, \option{noidx}:
\begin{codebox}
\gls{printnoidxglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}
\end{codebox}

\optionsor{mkidx,xdy}:
\begin{codebox}
\gls{printglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}}}
\end{codebox}
Or if you have used the \opt{acronym} or \opt{acronyms} package option:
\begin{codebox}
\gls{printacronyms}
\end{codebox}
See \sectionref{sec:pkgopts-acronym}.)

Alternatively, the list of acronyms can be displayed with all the other 
\idxpl{glossary} using \gls{printnoidxglossaries} (\option{noidx})
or \gls{printglossaries} (\optionsor{mkidx,xdy}).

The remaining \idx{indexing} methods require \sty{glossaries-extra},
which has its own \idx{abbreviation} commands that are incompatible
with the base \idx{acronym} commands.

\begin{warning}
Care must be taken to choose a \idx{glossarystyle} that's
appropriate to your \idx{acronymstyle}.
Alternatively, you can define your own custom style (see 
\sectionref{sec:newglossarystyle} for further details).
\end{warning}

\section{Upgrading From the \stytext{glossary} Package}
\label{sec:oldacronym}

\begin{information}
The old \sty{glossary} package was made obsolete in 2007, when the
first version of \sty+{glossaries} was released, so this section is
largely redundant but is retained in the event that someone may
happen to have an old document that needs to be converted to work
with a modern \TeX\ distribution. See also the accompanying
document \qtdocref{Upgrading from the \styfmt{glossary} package to
the \styfmt{glossaries} package}{glossary2glossaries}.
\end{information}

Users of the obsolete \sty{glossary} package may recall that
the syntax used to define new acronyms has changed with the
replacement \sty{glossaries} package. In addition, the old
\sty{glossary} package created the command 
\csmetafmt{}{acr-name}{} when defining the acronym \meta{acr-name}.

In order to facilitate migrating from the old \sty{glossary} package to the new
one, the \sty{glossaries} package provides the command:
\cmddef{oldacronym}
This uses the same syntax as the \sty{glossary} package's
method of defining acronyms. It is equivalent to:
\begin{compactcodebox}
\gls{newacronym}\oarg{\keyvallist}\margm{label}\margm{short}\margm{long}
\end{compactcodebox}
In addition, \gls{oldacronym} also defines the commands
\csmetafmt{}{label}{}, which is equivalent to
\code{\gls{gls}\margm{label}}, and \csmetafmt{}{label}{*}, which is
equivalent to the \idx{sentencecase} \code{\gls{Gls}\margm{label}}.
If \meta{label} is omitted, \meta{short} is used. Since commands
names must consist only of alphabetical characters, \meta{label}
must also only consist of alphabetical characters. Note that
\csmetafmt{}{label}{} doesn't allow you to use the first optional
argument of \gls{gls} or \gls{Gls}\dash you will need to explicitly
use \gls{gls} or \gls{Gls} to change the settings.

\begin{important}
Recall that, in general, \LaTeX\ ignores spaces following command
names consisting of alphabetical characters. This is also true for
\csmetafmt{}{label}{} unless you additionally load the \sty{xspace}
package, but be aware that there are some issues with using
\sty{xspace}. (See David Carlisle's explanation in
\href{http://tex.stackexchange.com/questions/86565/drawbacks-of-xspace}{Drawbacks
of xspace}.)
\end{important}

The \sty{glossaries} package doesn't load the \sty{xspace} package
since there are both advantages and disadvantages to using
\gls{xspace} in \csmetafmt{}{label}{}. If you don't use the
\sty{xspace} package, then you need to explicitly force a space
using \glsname{cs.sp} (backslash space). On the other hand, you can
follow the \csmetafmt{}{label}{} command with the optional
\meta{insert} text in square brackets (the final optional argument
to \gls{gls}). If you use the \sty{xspace} package you don't need to
escape the spaces but you can't use the optional argument to insert
text (you will have to explicitly use \gls{gls} to achieve that).

To illustrate this, suppose I define the acronym \qt{abc} as
follows:
\begin{codebox}
\gls{oldacronym}\marg{abc}\marg{example acronym}\marg{}
\end{codebox}
This will create the command \csfmt{abc} and its starred version
\csfmt{abc*}. \Tableref{tab:xspace} illustrates the effect of
\csfmt{abc} (on \idx{subsequentuse}) according to whether or not the
\sty{xspace} package has been loaded. As can be seen from the
final row in the table, the \sty{xspace} package prevents the
optional argument from being recognised.

\begin{table}[htbp]
\caption{The effect of using \stytext{xspace} with \glsfmttext{oldacronym}}
\label{tab:xspace}
\centering
\begin{tabular}{lll}
\bfseries Code & \bfseries With \sty{xspace} &
\bfseries Without \sty{xspace}\\
\code{\cmd{abc}.} & abc. & abc.\\
\code{\cmd{abc} xyz} & abc xyz & abcxyz\\
\code{\cmd{abc}\gls{cs.sp}xyz} & abc xyz & abc xyz\\
\code{\cmd{abc}* xyz} & Abc xyz & Abc xyz\\
\code{\cmd{abc}\oarg{'s} xyz} & abc ['s] xyz & abc's xyz
\end{tabular}
\end{table}

\chapter{Unsetting and Resetting Entry Flags}
\label{sec:glsunset}

When using the \gls{glslike} commands it is possible that you may
want to use the value given by the \gloskey{first} key, even though
you have already \idxc{firstuse}{used} the \idx{glossaryentry}.
Conversely, you may want to use the value given by the
\gloskey{text} key, even though you haven't used the
\idx{glossaryentry}.

The former can be achieved by one of the following commands:
\cmddef{glsreset}
which globally resets the \idx{firstuseflag} and
\cmddef{glslocalreset}
which locally resets the \idx{firstuseflag}.

The latter can be achieved by one of the following commands:
\cmddef{glsunset}
which globally unsets the \idx{firstuseflag} and
\cmddef{glslocalunset}
which locally unsets the \idx{firstuseflag}.

The above commands are for the specific \idx{entry} identified by
the argument \meta{entry-label}.
You can also reset or unset all \idxpl{entry} for a given
\idx{glossary} or multiple \idxpl{glossary} using:
\cmddef{glsresetall}
which globally resets the \idxpl{firstuseflag} and
\cmddef{glslocalresetall}
which locally resets the \idxpl{firstuseflag} or
\cmddef{glsunsetall}
which globally unsets the \idxpl{firstuseflag} and
\cmddef{glslocalunsetall}
which locally unsets the \idxpl{firstuseflag}.

The optional argument \meta{glossary labels list} should be a comma-separated
list of \idx{glossary} labels. If omitted, the list of all
non-\idxpl{ignoredglossary} is assumed.

For example, to reset all entries in the \glostype{main} glossary and the
\glostype{acronym} list:
\begin{codebox}
\gls{glsresetall}\oarg{\glostype{main},\glostype{acronym}}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package additional provides the options 
\glsopt{preunset} and \glsopt{prereset} for the \gls{glslike}
commands, that will unset or reset the \idx{firstuseflag} before the
\idx{linktext}, which will make the \gls{glslike} command behave
as though it was the \idx{subsequentuse} or \idx{firstuse},
irrespective of whether or not the \idx{entry} has actually been
used.
\end{xtr}

You can determine whether an entry's \idx{firstuseflag} is set with
\gls{ifglsused}. With \app{bib2gls}, you may need to use
\gls{GlsXtrIfUnusedOrUndefined} instead.

\begin{important}
Be careful when using \gls{glslike} commands within an
environment or command argument that gets processed multiple times
as it can cause unwanted side-effects when the \idx{firstuse} displayed
text is different from \idx{subsequentuse}.
\end{important}

For example, the \env{frame} environment in \cls{beamer} processes
its argument for each overlay. This means that the
\idx{firstuseflag} will be unset on the first overlay and subsequent
overlays will use the \idx{subsequentuse} form.

Consider the following example:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\cbeg{document}
\codepar
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{gls}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\codepar
\cend{document}
\end{codebox}

On the first overlay, \code{\gls{gls}\marg{svm}} produces \qt{support vector
machine (SVM)} and then unsets the \idx{firstuseflag}. When the second
overlay is processed, \code{\gls{gls}\marg{svm}} now produces \qt{SVM}, which
is unlikely to be the desired effect. I~don't know anyway around
this and I can only offer the following suggestions.

\begin{enumerate}
\item
Unset all \idxpl{acronym} at the start of the document and
explicitly use \gls{acrfull} when you want the full version to be
displayed:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\gls{newacronym}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\gls{glsunsetall}
\codepar
\cbeg{document}
\codepar
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{acrfull}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\codepar
\cend{document}
\end{codebox}

\item
Explicitly reset each \idx{acronym} on \idx{firstuse}:
\begin{codebox}
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{glsreset}\marg{svm}\gls{gls}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\end{codebox}
Alternatively, with \sty{glossaries-extra}:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries-extra}
\codepar
\gls{newabbreviation}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\cbeg{document}
\codepar
\cbeg{frame}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{gls}\oarg{\glsopt{prereset}}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\codepar
\cend{document}
\end{codebox}

\item Use the \sty{glossaries-extra} package's unset buffering
mechanism:
\begin{codebox}
\cmd{documentclass}\marg{beamer}
\codepar
\cmd{usepackage}\marg{glossaries-extra}
\codepar
\gls{newabbreviation}\marg{svm}\marg{SVM}\marg{support vector machine}
\codepar
\cbeg{document}
\codepar
\gls{GlsXtrStartUnsetBuffering}
\gls{GlsXtrUnsetBufferEnableRepeatLocal}
\cbeg{frame}
\gls{GlsXtrResetLocalBuffer}
 \cmd{frametitle}\marg{Frame 1}
\codepar
 \cbeg{itemize}
  \gls{item}<+-> \gls{gls}\marg{svm}
  \gls{item}<+-> Stuff.
 \cend{itemize}
\cend{frame}
\gls{GlsXtrStopUnsetBuffering}
\codepar
\cend{document}
\end{codebox}
See the \sty{glossaries-extra} manual for further details.
\end{enumerate}

These are non-optimal, but the \cls{beamer} class is too complex for
me to provide a programmatic solution. Other potentially problematic
environments are some \env{tabular}-like environments (but not
\env{tabular} itself) that process the contents in order to work out
the column widths and then reprocess the contents to do the actual
typesetting.

The \sty{amsmath} environments, such as \env{align}, also process
their contents multiple times, but the \sty{glossaries} package now
checks for this. For \sty{tabularx}, you need to explicitly patch it
by placing \gls{glspatchtabularx} in the \idx{preamble/document} (or anywhere
before the problematic use of \env{tabularx}).

\section{Counting the Number of Times an Entry has been Used (First Use
Flag Unset)}
\label{sec:enableentrycount}

It's possible to keep track of how many times an entry is used. That
is, how many times the \idx+{firstuseflag} is unset. Note that the
supplemental \sty{glossaries-extra} package improves this function
and also provides per-unit counting, which isn't available with the
\sty{glossaries} package.

\begin{important}
This function is disabled by default as it adds extra
overhead to the document build time and also switches
\gls{newglossaryentry} (and therefore \gls{newacronym}) into
a~\idx+{preamble/document}-only command.
\end{important}

To enable this function, use:
\cmddef{glsenableentrycount}
before defining your \idxpl{entry}. This adds two extra (internal) fields
to entries: \glosfielddef{currcount} and \glosfielddef{prevcount}.

The \glosfield{currcount} field keeps track of how many times
\gls{glsunset} is used within the document. A~local unset (using
\gls{glslocalunset}) performs a~local rather than global increment to
\glosfield{currcount}. Remember that not all commands use
\gls{glsunset}. Only the \gls{glslike} commands do this. 

The behaviour of the reset commands depend on the conditional:
\cmddef{ifglsresetcurrcount}
If true, the reset commands \gls{glsreset} and \gls{glslocalreset} 
will reset the value of the \glosfield{currcount} field back to 0.
This conditional can be set to true with:
\cmddef{glsresetcurrcounttrue}
and to false with:
\cmddef{glsresetcurrcountfalse}
The default is false, as from version 4.50.

The \glosfield{prevcount} field stores the final value of the
\glosfield{currcount} field \emph{from the previous run}. This value is
read from the \ext{aux} file at the beginning of the
\env{document} environment.

You can access these fields using
\cmddef{glsentrycurrcount}
for the \glosfield{currcount} field, and
\cmddef{glsentryprevcount}
for the \glosfield{prevcount} field. 

\begin{important}
These commands are only defined if you have used \gls{glsenableentrycount}.
\end{important}

For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{glsenableentrycount}
\codepar
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{a fruit}}
\codepar
\cbeg{document}
Total usage on previous run: \gls{glsentryprevcount}\marg{apple}.
\codepar
\gls{gls}\marg{apple}. \gls{gls}\marg{apple}.  \gls{glsadd}\marg{apple}\gls{glsentrytext}\marg{apple}.
\gls{glslink}\marg{apple}\marg{apple}.  \gls{glsdisp}\marg{apple}\marg{apple}. \gls{Gls}\marg{apple}.
\codepar
Number of times apple has been used: \gls{glsentrycurrcount}\marg{apple}.
\cend{document}
\end{codebox}
On the first \LaTeX\ run, \code{\gls{glsentryprevcount}\marg{apple}}
produces~0. At the end of the document,
\code{\gls{glsentryprevcount}\marg{apple}} produces~4. This is because
the only commands that have incremented the entry count are those
that use \gls{glsunset}. That is: \gls{gls}, \gls{glsdisp} and
\gls{Gls}. The other commands used in the above example, \gls{glsadd},
\gls{glsentrytext} and \gls{glslink}, don't use \gls{glsunset} so they
don't increment the entry count. On the \emph{next} \LaTeX\ run,
\code{\gls{glsentryprevcount}\marg{apple}} now produces~4 as that was the
value of the \glosfield{currcount} field for the \qt{apple} entry
at the end of the document on the previous run.

When you enable the entry count using \gls{glsenableentrycount}, you
also enable the following commands:
\cmddef{cgls}
(no case-change, singular, analogous to \gls{gls})
\cmddef{cglspl}
(no case-change, plural, analogous to \gls{glspl})
\cmddef{cGls}
(first letter uppercase, singular, analogous to \gls{Gls}), and
\cmddef{cGlspl}
(first letter uppercase, plural, analogous to \gls{Glspl}).

\begin{xtr}
\Idx{allcaps} versions are only available with \sty{glossaries-extra}.
\end{xtr}

If you don't use \gls{glsenableentrycount}, these commands behave
like their counterparts \gls{gls}, \gls{glspl}, \gls{Gls} and \gls{Glspl},
respectively, but there will be a warning that you haven't enabled
entry counting.

If you have enabled entry counting with
\gls{glsenableentrycount} then these commands test if
\code{\gls{glsentryprevcount}\margm{entry-label}} equals~1. If it doesn't then the
analogous \gls{gls} etc will be used. If it is~1, then the first optional
argument will be ignored and 
\begin{compactcodebox}
\meta{cs format}\margm{entry-label}\margm{insert}\gls{glsunset}\margm{entry-label}
\end{compactcodebox}
will be performed, where \meta{cs format} is a command that takes
two arguments. The command used depends whether you have used
\gls{cgls}, \gls{cglspl}, \gls{cGls} or \gls{cGlspl}.

The formatting command \meta{cs format} will be one of the
following:
\cmddef{cglsformat}
This command is used by \gls{cgls} and defaults to
\begin{compactcodebox}
\gls{glsentrylong}\margm{entry-label}\meta{insert}
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{glsentryfirst}\margm{entry-label}\meta{insert}
\end{compactcodebox}
otherwise.

\cmddef{cglsplformat}
This command is used by \gls{cglspl} and defaults to
\begin{compactcodebox}
\gls{glsentrylongpl}\margm{entry-label}\meta{insert} 
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{glsentryfirstplural}\margm{label}\meta{insert}
\end{compactcodebox}
otherwise.

\cmddef{cGlsformat}
This command is used by \gls{cGls} and defaults to
\begin{compactcodebox}
\gls{Glsentrylong}\margm{entry-label}\meta{insert}
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{Glsentryfirst}\margm{entry-label}\meta{insert}
\end{compactcodebox}
otherwise.

\cmddef{cGlsplformat}
This command is used by \gls{cGlspl} and defaults to
\begin{compactcodebox}
\gls{Glsentrylongpl}\margm{entry-label}\meta{insert}
\end{compactcodebox}
if the entry given by \meta{entry-label} has a~long form or
\begin{compactcodebox}
\gls{Glsentryfirstplural}\margm{entry-label}\meta{insert}
\end{compactcodebox}
otherwise.

This means that if the previous count for the given entry was~1, the
entry won't be \idxc+{hyperlink}{hyperlinked} with the
\gls{cgls}-like commands and those commands won't
\idxc+{indexing}{index} (that is, they won't add a~line to the
external \idx{glossaryfile}). If you haven't used any of the other
commands that \idxc{indexing}{index} (such as \gls{glsadd} or the
\gls{glstextlike} commands) then the \idx{entry} won't appear in the
\idx{glossary}.

Remember that since these commands use \gls{glsentryprevcount} you
need to run \LaTeX\ twice to ensure they work correctly.  The
document build requires a second \LaTeX\ call before running the
\idx{indexingapp}. For example, if the document is in a file called
\filefmt{myDoc.tex}, then the document build needs to be:
\begin{terminal}
pdflatex myDoc
pdflatex myDoc
makeglossaries myDoc
pdflatex myDoc
\end{terminal}

In \mexampleref{sec:entrycount}, the \idxpl{acronym} that have only been used once
(on the previous run) only have their long form shown with
\gls{cgls}:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries}
\gls{makeglossaries}
\codepar
\gls{glsenableentrycount}
\codepar
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\codepar
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup language}
\gls{newacronym}\marg{css}\marg{CSS}\marg{cascading style sheets}
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup language}
\gls{newacronym}\marg{sql}\marg{SQL}\marg{structured query language}
\gls{newacronym}\marg{rdbms}\marg{RDBMS}\marg{relational database management system}
\gls{newacronym}\marg{rdsms}\marg{RDSMS}\marg{relational data stream management system}
\codepar
\cbeg{document}
These entries are only used once: \gls{cgls}\marg{sql}, \gls{cgls}\marg{rdbms},
\gls{cgls}\marg{xml}. These entries are used multiple times:
\gls{cgls}\marg{html}, \gls{cgls}\marg{html}, \gls{cgls}\marg{css}, \gls{cgls}\marg{css}, \gls{cgls}\marg{css},
\gls{cgls}\marg{rdsms}, \gls{cgls}\marg{rdsms}.
\codepar
\gls{printglossaries}
\cend{document}
\end{codebox}
After a complete document build the list of \idxpl{acronym} only
includes the entries HTML, CSS and RDSMS. The entries SQL, RDBMS and
XML only have their long forms displayed and don't have
a~\idx{hyperlink}.
\begin{resultbox}
\createexample*[
 title={Don't index entries that are only used once},
 label={sec:entrycount},
 description={Example document that only includes the entries that
have been used more than once in the document},
 arara={pdflatex,pdflatex,makeglossaries,pdflatex,pdfcrop}
]
{%
\cmd{usepackage}[colorlinks]\marg{hyperref}\nl
\cmd{usepackage}[acronym]\marg{glossaries}\nl
\gls{makeglossaries}
\codepar
\gls{glsenableentrycount}
\codepar
\gls{setacronymstyle}\marg{long-short}
\codepar
\gls{newacronym}\marg{html}\marg{HTML}\marg{hypertext markup
language}\nl
\gls{newacronym}\marg{css}\marg{CSS}\marg{cascading style
sheets}\nl
\gls{newacronym}\marg{xml}\marg{XML}\marg{extensible markup
language}\nl
\gls{newacronym}\marg{sql}\marg{SQL}\marg{structured query
language}\nl
\gls{newacronym}\marg{rdbms}\marg{RDBMS}\marg{relational database
management system}\nl
\gls{newacronym}\marg{rdsms}\marg{RDSMS}\marg{relational data stream management system}
}%
{%
These entries are only used once: \gls{cgls}\marg{sql},
\gls{cgls}\marg{rdbms},\nl
\gls{cgls}\marg{xml}. These entries are used multiple times:\nl
\gls{cgls}\marg{html}, \gls{cgls}\marg{html}, \gls{cgls}\marg{css},
\gls{cgls}\marg{css}, \gls{cgls}\marg{css},\nl
\gls{cgls}\marg{rdsms}, \gls{cgls}\marg{rdsms}.
\codepar
\gls{printglossaries}
}
\end{resultbox}

\begin{bib2gls}
With \app{bib2gls} there's an analogous record counting set of
commands. See \sty{glossaries-extra} and \app{bib2gls} manuals for further details. 
\end{bib2gls}

\chapter{Displaying a Glossary}
\label{sec:printglossary}

All defined \idxpl+{glossary} may be displayed using the appropriate
command, such as \gls{printglossary}, that matches the
\idx{indexing} method.  These commands are collectively referred to
as the \inlineglsdef{print...glossary} set of commands.

\begin{information}
With \optionsor{mkidx,xdy,b2g}, if the \idx{glossary} does not
appear after you re-\LaTeX\ your document, check the
\app{makeindex}, \app{xindy} or \app{bib2gls} log files (\ext+{glg}
or the \meta{log-ext} argument of \gls{newglossary}), as applicable,
to see if there is a problem.  With \option{noidx}, you just need
two \LaTeX\ runs to make the \idxpl{glossary} appear, but you may
need further runs to make the \idxpl{numberlist} up-to-date.
If you have used the \opt{automake} option, check the \ext+{log}
file for \qt{runsystem} lines (see the information about the
\opt{automake} option in \sectionref{sec:pkgopts-sort} for further
details).
\end{information}

\option{noidx}
(must be used with \gls{makenoidxglossaries} in the \idxf{preamble/document}):
\cmddef{printnoidxglossary}
This displays the \idx{glossary} identified by the \printglossopt{type}
option in \meta{options} or, if omitted, the \idx{glossary} identified by
\gls{glsdefaulttype}.

The following is an iterative command:
\cmddef{printnoidxglossaries}
which internally uses \gls{printnoidxglossary} for each 
non-\idx{ignoredglossary}.

The \gls{printnoidxglossary} command works by constructing a list of
all entries in the identified \idx{glossary} that have been
\indexed\ or are a parent of an \indexed\ entry. (This information
is obtained from the \ext{aux} file created during the previous
\LaTeX\ run.)

With \opteqvalref{sort}{def}, this list will be
created in the order of definition, and with \opteqvalref{sort}{use},
this list will be created in the order that each entry was first
listed with the special \idx{indexing} reference in the \ext{aux}
file. For other \opt{sort} values, the list will be sorted according
to the designated sort method.

\begin{information}
Ensure you have at least v3.0 of \sty{datatool} and applicable
localisation support, if available (for example,
\sty{datatool-english}).
\end{information}

Version 4.57 has change the way \gls{printnoidxglossary} works to
allow it to work with the tabular-like \idxpl{glossarystyle}, such
as \glostyle{long} and \glostyle{super}.  It now (after sorting)
iterates over the list of entries that need to be included in the
glossary and constructs a token list containing the
\env{theglossary} environment and the commands that will be used to
typeset the glossary (such as \gls{glossentry}). Once completed, the
contents of this token list are then expanded. There are hooks
available during this construction process.

\cmddef{glsnoidxinithook}
Used at the start of the construction process (after the list of
entry labels has been sorted). This occurs within the scoping
introduced by \gls{printnoidxglossary} so the hook may be used to
make local adjustments.

\cmddef{glsnoidxitemhook}
This hook is performed at each iteration of the construction loop.
It does nothing by default but may be redefined. For example, to
calculate the widest name for \idxpl{glossarystyle} that require
this information (see \exampleref{ex:tree*alignnames}). The first
argument is the hierarchical level.  The second argument is the
entry's label.

\cmddef{glsnoidxprecontenthook}
Used at the end of construction, just before the token list variable
is used. This means that, for debugging purposes, this command can
be redefined to expand to \csfmt{show} to show the contents
of the token list variable (rather than using the variable).

If there are no entries to display (which happens on the first
\LaTeX\ run), a warning is issued and the
following command is used:
\cmddef{GlsNoIdxMissingAction}
This just does nothing if the glossary is empty, otherwise it does
the section header to ensure it's added to the table of contents on
the first run, if the \opt{toc} option is set, which can help to
reduce the number of \LaTeX\ calls.

The \gls{makenoidxglossaries} command automatically adds the
following command to the end document hook:
\cmddef{GlsNoIdxDoRerunCheck}
This iterates over a list of all entries to determine if any entry
that was indexed in the previous run was not indexed in this run
or if any entry not indexed in the previous run has been indexed in
this run (which indicates that a rerun warning should be issued).

\begin{information}
Due to \TeX's asynchronous output routine, it's not
possible to check if any \location\ has changed for any entry that
was indexed in both the current run and the previous run.
The rerun warning essentially means that either an entry is showing
in the glossary that should no longer be there or an entry isn't
showing in the glossary when it should be there.
\end{information}

If you have a large number of entries, you can slightly reduce the
document build time by redefining \gls{GlsNoIdxDoRerunCheck} to do
nothing (but obviously there will no longer be a warning).
This command may only be used once, so if you explicitly use it in
the document, it won't do anything when it's subsequently called at
the end of the document. Issuing this command too soon may result in
a rerun warning when it's not applicable.

For more advanced users: the processing function used before sorting
a list (for any sort option other than \optval{sort}{use} and
\optval{sort}{def}) checks each entry for a parent. If one is found, 
the parent will automatically be added to the list (if not already
included) and the parent entry will be checked for the existence of
the \glosfield{childcount} \gls{internalfield}. 

If the parent entry's \glosfield{childcount} field is set, the value will be
incremented, otherwise the field will be set to 1 and the 
sort value for the parent entry will be locally adjusted with:
\cmddef{glossariesadjustparentsort:Nn}
The first argument is the token list variable containing the parent's
original sort value and the second argument is the parent's label.
The default definition appends the following to \meta{tl-var}:
\begin{compactcodebox*}
\gls{datatoolctrlboundary} \gls{datatoolasciistart} 
\meta{parent-label} \gls{datatoolasciistart}
\end{compactcodebox*}
The parent entry's sort value is then locally updated to the content
of \meta{tl-var}.

Using the \glosfield{childcount} internal field helps to keep track
of whether or not this adjustment has already been done.  A convenient
by-product of this is that the glossary hooks (either style hooks,
such as \gls{glossariestreepostitem:nnn}, or the extra hooks
provided by \sty{glossaries-extra}) can check if an entry has
children that have been included in the list.

The child entry's sort value is locally prefixed with the parent's sort
value. This is done to ensure that the child entries always come
immediately after their parent. The incorporation of the parent's
label into the sort value helps to separate hierarchical families
where parents happen to have identical sort values.

\options{mkidx,xdy}
(must be used with \gls{makeglossaries} in the \idxf{preamble/document}):
\cmddef{printglossary}
This displays the \idx{glossary} identified by the \printglossopt{type}
option in \meta{options} or, if omitted, the \idx{glossary} identified by
\gls{glsdefaulttype}. This command internally inputs the associated
\idx+{glossaryfile} (created by the relevant \idx{indexingapp}) if it exists.
The \idx{glossaryfile} contains the markup to typeset the
\idx{glossary} (which is essentially the same content as the token
list constructed with \gls{printnoidxglossary}, except for the
\idx{locationlist}). See \sectionref{sec:makeglossaries} for information
on how to create the \idx{glossaryfile}.

Note that because this method simply inputs a file containing all the
typesetting commands, there is no list of labels for only those
entries that will appear in the \idx{glossary}. The only list
available is the list of all entry labels for a given \idx{glossary}
(which can be iterated over using \gls{forglsentries}). This makes
it much harder to do things like reference the \idx{locationlist}
elsewhere in the document or determine the widest name for
\idxpl{glossarystyle} such as \glostyle{tree*} or
\glostyle{alttree}. If this is required, you may want to consider
\optionsor{noidx,b2g} instead.

The following is an iterative command:
\cmddef{printglossaries}
which internally uses \gls{printglossary} for each 
non-\idx{ignoredglossary}.

\begin{important}
While the external \idxpl{glossaryfile} are missing, \gls{printglossary} will just do
\gls{null} for each missing \idx{glossary} to assist dictionary style
documents that just use \gls{glsaddall} without inserting any text.  
This use of \gls{null} ensures that all \idx{indexing} information is
written before the final page is shipped out. Once the external
\idxpl{glossaryfile} are present \gls{null} will no longer be used. This can cause a
spurious blank page on the first \LaTeX\ run before the 
\idxpl{glossaryfile} have been created. Once these files are present, \gls{null}
will no longer be used and so shouldn't cause interference for the
final document. With \sty{glossaries-extra}, placeholder text is
used instead.
\end{important}

\options{b2g,unsrt}
(\sty{glossaries-extra} only):
\cmddef{printunsrtglossary}
This displays the \idx{glossary} identified by the \printglossopt{type}
option in \meta{options} or, if omitted, the \idx{glossary} identified by
\gls{glsdefaulttype}. This command is similar to
\gls{printnoidxglossary}, in that it iterates over a list of
\idx{entry} labels and constructs a token list containing the
glossary markup, but in this case all defined entries within the
given glossary are included and the list is in the order in which
they were defined (that is, the order in which they were added to
the \idx{glossary}['s] internal label list).

The reason this command works with \app{bib2gls} is because
\app{bib2gls} writes the entry definitions in the \ext{glstex} file in
the order obtained by the \resourceopt{sort} resource option, and
\app{bib2gls} will only include the \idxpl{entry} that match the
required selection criteria.

With \option{unsrt} (that is, without \app{bib2gls}) the result will
be in the order the \idxpl{entry} were defined in the \ext{tex} file.
There's no attempt to gather child entries (see \sectionref{sec:subentries}).
This means that if you don't define child entries immediately after
their parent, you will have a strange result (depending on the
\idx{glossarystyle}).

As with \gls{printnoidxglossary}, there are hooks during the
construction of the token list which can be used to filter out
entries or determine the widest name for \idxpl{glossarystyle}
that required that information. See the \sty{glossaries-extra} manual for
further details.

The following is an iterative command:
\cmddef{printunsrtglossaries}
which internally uses \gls{printunsrtglossary} for each 
non-\idx{ignoredglossary}.

The \sty{glossaries-extra} package also provides
\cmddef{printunsrtinnerglossary}
which is designed for inner or nested glossaries. It allows many, but not all,
of the options listed below.  There's an example available in the gallery: 
\gallerypage{bib2gls-inner}{Inner or Nested Glossaries}.
See the \sty{glossaries-extra} package for further details.

All the individual \idx{glossary} commands \gls{print...glossary}
have an optional argument. Available options are listed 
in \sectionref{sec:printglossoptions}.

After the options have been set, the following command will be
defined:
\cmddef{currentglossary}
This expands to the label of the current \idx{glossary} (identified
by the \printglossopt{type} option). It may be used within
\idx{glossarystyle} hooks or the \gls{printnoidxglossary}
or \gls{printunsrtglossary} hooks, if required.

\section{\glsfmttext{print...glossary} Options}
\label{sec:printglossoptions}

These options may be used in the optional argument of the
\gls+{print...glossary} set of commands.
Some options are available for all those commands, but those that aren't
are noted. Before the options are set, the following commands are
defined to their defaults for the given \idx{glossary}. They may
then be redefined by applicable options.

\printglossoptdef{type}
Identifies the \idx{glossary} to display. The value should be the
\idx{glossary} label. Note that you can only display an
\idx{ignoredglossary} with \gls{printunsrtglossary} or
\gls{printunsrtinnerglossary}, otherwise \meta{glossary-label}
should correspond to a \idx{glossary} that was defined with
\gls{newglossary} or \gls{altnewglossary}.

\printglossoptdef{title}
Sets the \idx{glossary}['s] title (\gls{glossarytitle}). This option isn't available
with \gls{printunsrtinnerglossary}.

\printglossoptdef{toctitle}
Sets the \idx{glossary}['s] \idx+{tableofcontents} title
(\gls{glossarytoctitle}). This option isn't available
with \gls{printunsrtinnerglossary}.

\printglossoptdef{style}
The \idx{glossarystyle} to use with this \idx{glossary} (overriding
the current style that was either set with the \opt{style} package
option or with \gls{setglossarystyle}). 
This option isn't available with \gls{printunsrtinnerglossary}.

\printglossoptdef{numberedsection}
This may be used to override the \opt{numberedsection} package
option, and has the same syntax as that option (see \sectionref{sec:pkgopts-sec}). 
This option isn't available with \gls{printunsrtinnerglossary}.

\printglossoptdef{nonumberlist}
This may be used to override the \opt{nonumberlist} package option.
Note that, unlike the valueless package option, this option is boolean.

\printglossoptdef{nogroupskip}
This may be used to override the \opt{nogroupskip} package option.
Only relevant if the \idx{glossarystyle} uses the conditional 
\gls{ifglsnogroupskip} to test for this option.

\printglossoptdef{nopostdot}
This may be used to override the \opt{nopostdot} package option.
This option is only applicable if the \idx{glossarystyle} uses
\gls{glspostdescription}.

\printglossoptdef{entrycounter}
This may be used to override the \opt{entrycounter} package option.
Note that one of the package options \optval{entrycounter}{true} or
\optval{subentrycounter}{true} must be
used to make \gls{glsrefentry} work correctly. The setting can then
be switched off with this option for individual \idxpl{glossary}
where the setting shouldn't apply.

\printglossoptdef{subentrycounter}
This may be used to override the \opt{subentrycounter} package option.
Note that one of the package options \optval{entrycounter}{true}
or \optval{subentrycounter}{true} must be
used to make \gls{glsrefentry} work correctly. The setting can then
be switched off with this option for individual \idxpl{glossary}
where the setting shouldn't apply.

\begin{warning}
If you want to set both the \printglossopt{entrycounter} and
\printglossopt{subentrycounter} settings, and you haven't already
enabled them with the \opt{entrycounter} and \opt{subentrycounter}
package options, make sure you specify \printglossopt{entrycounter}
first (but bear in mind \gls{glsrefentry} won't work).
In general, it's best to enable these settings via the package
options and switch them off for the \idxpl{glossary} where they don't
apply.
\end{warning}

\printglossoptdef{sort}
This key is only available with \gls{printnoidxglossary}.

\begin{important}
If you use the \printglossopteqvalref{sort}{use} or
\printglossopteqvalref{sort}{def} values make sure
that you select a \idx{glossarystyle} that doesn't have a visual
indicator between groups, as the grouping no longer makes sense.
Consider using the \opt{nogroupskip} option.
\end{important}

If you don't get an error with \printglossopteqvalref{sort}{use} and
\printglossopteqvalref{sort}{def} but you do get an error with one
of the other sort options, then you probably need to use the
\optval{sanitizesort}{true} package option or make sure none of the
\idxpl{entry} have fragile commands in their \gloskey{sort} field.

\optionvaldef{printgloss.sort}{use}
Order of use. There's no actual sorting in this case. The order is
obtained from the \idx{indexing} information in the \ext{aux} file.

\optionvaldef{printgloss.sort}{def}
Order of definition. There's no actual sorting in this case. The order is
obtained from the \idx{glossary}['s] internal list of labels.

\begin{information}
The above two settings don't perform any actual sorting.
The following settings work best with \sty{datatool} v3.0+
and, if available, the applicable language support,
such as \sty{datatool-english}.

For a locale-sensitive sort, it's best to use
either \app{xindy} (\option{xdy}) or \app{bib2gls} (\option{b2g}).
(Note that \app{bib2gls} provides many other sort options.)
\end{information}

\optionvaldef{printgloss.sort}{nocase}
Case-insensitive order.

\optionvaldef{printgloss.sort}{case}
Case-sensitive order.

\optionvaldef{printgloss.sort}{word}
Word order (case-insensitive).

\optionvaldef{printgloss.sort}{wordcase}
Word order (case-sensitive).
Requires \sty{datatool} v3.0+.

\optionvaldef{printgloss.sort}{letter}
Letter order (case-insensitive).

\optionvaldef{printgloss.sort}{lettercase}
Letter order (case-sensitive).
Requires \sty{datatool} v3.0+.

\optionvaldef{printgloss.sort}{standard}
Word or letter order according to the \opt{order}
package option.

If \sty{datatool} v3.0+ is detected, these sort methods will
use \gls{datatoolsortwordseq:NN} function with an appropriate
handler.  See the \sty{datatool} documentation for further details.
If an older version of \sty{datatool} is present, an older, slower
method will be used. The letter group information obtained
from the \sty{datatool} sorting function is saved in the special
internal field \inlineoptdef{glosfield.dtlsortgroup}.

\begin{information}
The word and letter sort methods will use the current \sty{datatool}
localisation support for alphabetical ordering, if available.
Note that support for language files was only added to
\sty{datatool} version 3.0 (2025-03-03).
The localisation files must be installed in addition to
\sty{datatool}. At the time of writing,
the only language support is \sty{datatool-english}
(\href{https://github.com/nlct/datatool-english}{\nolinkurl{https://github.com/nlct/datatool-english}}).
Advice on developing language files is available 
in the \sty{datatool} user manual.
\end{information}

\printglossoptdef{label}
This key is only available with \sty{glossaries-extra} and labels
the \idx{glossary} with \code{\gls{label}\margm{label}}. This is an alternative to
the package option \optval{numberedsection}{autolabel}.
This option isn't available with \gls{printunsrtinnerglossary}.

\printglossoptdef{target}
This key is only available with \sty{glossaries-extra} and can be used to switch
off the automatic hypertarget for each \idx{entry}. (This refers to the
target used by commands like \gls{gls} and \gls{glslink}.)

This option is useful with \gls{printunsrtglossary} as it allows
the same list (or sub-list) of \idxpl{entry} to be displayed multiple
times without causing duplicate hypertarget names.

\printglossoptdef{prefix}
This key is only available with \sty{glossaries-extra} and provides
another way of avoiding duplicate hypertarget names. In this case it uses a
different prefix for those names. This locally redefines
\gls{glolinkprefix} but note this will also affect the target for any entry
referenced within the glossary with commands like \gls{gls},
\gls{glslink} or \gls{glshyperlink}.

\printglossoptdef{targetnameprefix}
This key is only available with \sty{glossaries-extra}.
This is similar to the \printglossopt{prefix} option, but it alters the prefix of
the hypertarget anchors without changing \gls{glolinkprefix} (so it
won't change the \idxpl{hyperlink} for any \idxpl{entry} referenced in the
\idx{glossary}).

\printglossoptdef{groups}
This key is only available with \gls{printunsrtglossary} and
\gls{printunsrtinnerglossary}.
If true, the \qt{unsrt} function that creates the code for
typesetting the \idx{glossary} will insert \idx{lettergroup}
headers whenever a change is detected in the \idx{lettergroup}
label between entries of the same \idx{hierarchicallevel}. 
See the \sty{glossaries-extra} manual for further details.

\printglossoptdef{leveloffset}
This key is only available with \gls{printunsrtglossary} and
\gls{printunsrtinnerglossary}.
It can be used to locally adjust the
\idx{hierarchicallevel} used by the \idx{glossarystyle}. See the
\sty{glossaries-extra} manual for further details and also
\gallerypage{bib2gls-inner}{Gallery: Inner or Nested Glossaries}.

\printglossoptdef{flatten}
This key is only available with \gls{printunsrtglossary} and
\gls{printunsrtinnerglossary}.  It can be used to locally remove the
\idx{hierarchicallevel} used by the \idx{glossarystyle}. See the
\sty{glossaries-extra} manual for further details.

\section{Glossary Markup}
\label{sec:glossmarkup}

This section describes the commands that are used to display the
\idx{glossary}. If you want to suppress the \idxpl{numberlist}
you can use the \opt{nonumberlist} option. If you want to save the
\idxpl{numberlist} for some other purpose outside of the
\idx{glossary}, you can use the \opt{savenumberlist} option. 
If you want information about an \idx{entry}['s] parent then you can use
\gls{ifglshasparent} (to determine if the entry has a parent)
or \gls{glsentryparent} (to expand to the parent's label).
The \idx{hierarchicallevel} is provided in \gls{subglossentry}
(and is 0 with \gls{glossentry}) but it's also stored in the
\glosfield{level} internal field.

If you're trying to work out how to parse the \idx{glossary} in
order to gather \idx{indexing} information, consider using
\app{bib2gls} instead, which stores all the \idx{indexing}
information, such as \idxpl{locationlist} and \idx{lettergroup}
labels, in internal fields. It can also store lists of sibling
entries or child entries. If you really want to input the
\idx{glossaryfile} in order to gather information obtained by
\app{makeindex} or \app{xindy} without actually displaying anything
(by redefining the markup commands to not produce any text), use
\gls{input} rather than \gls{printglossary}.

The \idx{glossary} is always started with:
\begin{compactcodebox}
\gls{glossarysection}\oarg{\gls{glossarytoctitle}}\marg{\gls{glossarytitle}}
\end{compactcodebox}
This creates the heading. This command sets the page header with:
\begin{compactcodebox}
\gls{glsglossarymark}\marg{\gls{glossarytoctitle}}
\end{compactcodebox} 
If this is unsuitable for your chosen class file or page style package,
you will need to redefine \gls{glsglossarymark}. If
\gls{phantomsection} is defined (\sty{hyperref}) then
\gls{glossarysection} will start with:
\begin{compactcodebox}
\gls{glsclearpage}
\gls{phantomsection}
\end{compactcodebox}

\cmddef{glossarysection}
By default, this command uses either \starredcs{chapter} or
\starredcs{section}, depending on whether or not \gls{chapter} is
defined.  This can be overridden by the \opt{section} package option
or the \gls{setglossarysection} command. Numbered sectional units
can be obtained using the \opt{numberedsection} package option. 
If the default unnumbered section setting is on, then the
\meta{toc-title} will only be added to the \idx+{tableofcontents} if
the \opt{toc} option is set. If \opt{numberedsection} is on, the
addition to the \idx{tableofcontents} is left to the sectional
command.

\begin{information}
Further information about these options and commands is given in
\sectionref{sec:pkgopts-sec}.
\end{information}

\cmddef{glsglossarymark}
This sets the page header, if supported by the current page style.
Originally the command \inlineglsdef{glossarymark} was provided for
this purpose, but this command is also provided by other packages
and classes, notably \cls{memoir} which has a different syntax. 
Therefore the command \gls{glossarymark} will
only be defined if it doesn't already exist. In which case,
\gls{glsglossarymark} will simply use \gls{glossarymark}.

If \cls{memoir} has been loaded, \gls{glsglossarymark} will be
defined to use \gls{markboth} otherwise, if some other class or
package has defined \gls{glossarymark}, \gls{glsglossarymark} will
be defined to use \gls{@mkboth} (using the same definition as the
\sty{glossaries} package's version of \gls{glossarymark}).

If \optval{ucmark}{true}, the \idx{casechange} will be applied
using \gls{memUChead} if \cls{memoir} has been loaded, otherwise it
will use \gls{glsuppercase}.

So if you want to redefine the way the header mark is set for the
\idxpl{glossary}, you need to redefine \gls{glsglossarymark} not
\gls{glossarymark}.
For example, to only change the right header:
\begin{codebox*}
\cmd{renewcommand}\marg{\gls{glsglossarymark}}[1]\marg{\gls{markright}\marg{\#1}}
\end{codebox*}
or to prevent it from changing the headers:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsglossarymark}}[1]\marg{}
\end{codebox}
If you want \gls{glsglossarymark} to use \idx{allcaps} in the header, use the
\opt{ucmark} option described below.

With \sty{hyperref} and unnumbered section headings, \gls{phantomsection}
is need to create an appropriate anchor (see the \sty{hyperref}
manual). This will need the page cleared for \starredcs{chapter},
which is done with:
\cmddef{glsclearpage}
If the \optval{section}{chapter} setting is on then
\gls{glsclearpage} will use \gls{cleardoublepage}, if it's defined
and if the \gls{if@openright} conditional (provided by classes with
an \opt{openright} option such as \cls{book} and \cls{report}) isn't
defined or is defined and is true, otherwise \gls{clearpage} is
used.

Occasionally you may find that another package defines 
\gls{cleardoublepage} when it is not required. This may cause an 
unwanted blank page to appear before each \idx{glossary}
If you only want a single page cleared, you can redefine
\gls{glsclearpage}. For example:
\begin{codebox*}
\cmd{renewcommand}*\marg{\gls{glsclearpage}}\marg{\gls{clearpage}}
\end{codebox*}
Note that this will no longer take the \opt{section} package option
into account.

\cmddef{glossarytitle}
This expands to the title that should be used by the \idx{glossary}
section header. It's initialised to the title provided in
\gls{newglossary} when the \idx{glossary} was defined. The
\printglossopt{title} option will redefined this command.

\cmddef{glossarytoctitle}
This expands to the \idx+{tableofcontents} title that's supplied in
the optional argument of the \idx{glossary} section command. It will
only be added to the \idx{tableofcontents} is the \opt{toc} package
option is on, but it may also be used in the page header (depending
on the definition of \gls{glsglossarymark} and the current page style).

The \gls{glossarytoctitle} command is initialised to \gls{glossarytitle}.
The \printglossopt{toctitle} option will redefine this command.
If neither the \printglossopt{title} nor \printglossopt{toctitle} are
used, \gls{glossarytoctitle} will be defined via:
\cmddef{glssettoctitle}
By default, this will redefine \gls{glossarytoctitle} to the title
provided in \gls{newglossary} when the \idx{glossary} was defined.

This means that if neither \printglossopt{title} nor
\printglossopt{toctitle} are set, the \idx{glossary}['s] associated
title will be used for both. If only \printglossopt{title} is used,
then it will also apply to the \idx{tableofcontents} title, and if
only \printglossopt{toctitle} is used, then \gls{glossarytoctitle} will
be defined to that value but \gls{glossarytitle} will be the
\idx{glossary}['s] associated title.


After the heading, but before the main body of the \idx{glossary}, is
the \inlineidxfdef{preamble/glossary} which is given by:
\cmddef{glossarypreamble}
You can redefine this before the \idx{glossary} is shown. For
example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{Numbers in italic 
indicate primary definitions.}
\end{codebox}
A \idx{glossary} may have its own specific \idx{preamble/glossary}. If it has one
defined, then the \gls{print...glossary} set of commands will
locally redefine \gls{glossarypreamble} to that \idx{preamble/glossary} instead.
Since this change is scoped, the previous definition will be
restored after the \gls{print...glossary} command.

You can globally assign a \idx{preamble/glossary} to a specific \idx{glossary} with:
\cmddef{setglossarypreamble}
If \meta{type} is omitted, \gls{glsdefaulttype} is used.
For example:
\begin{codebox}
\gls{setglossarypreamble}\marg{Numbers in italic 
indicate primary definitions.}
\end{codebox}
This will set the given \idx{preamble/glossary} text for just the
\glostype{main} glossary, not for any other \idx{glossary}. The
\sty{glossaries-extra} package additionally provides:
\cmddef{apptoglossarypreamble}
which locally appends \meta{text} to the \idx{preamble/glossary} for the specific
\idx{glossary} and
\cmddef{pretoglossarypreamble}
which locally prepends \meta{text} to the \idx{preamble/glossary} for
the specific \idx{glossary}.

There is also a \inlineidxdef{postamble} at the end of each \idx{glossary} which 
is given by:
\cmddef{glossarypostamble}
This is less useful than a \idx{preamble/glossary} and so there's no analogous
command to \gls{setglossarypreamble}.

\begin{information}
The \idx{preamble/glossary} and \idx{postamble} occur outside of \env{theglossary} and so
shouldn't be influenced by the \idx+{glossarystyle}.
\end{information}

\begin{example}{Switch to Two Column Mode for Glossary}{ex:twocolumn}
Suppose you are using the \glostyle{superheaderborder} style, and
you want the \idx{glossary} to be in two columns (you can't use the
\glostyle{longheaderborder} style for this example as you can't use
the \env{longtable} environment in two column mode), but after the
\idx{glossary} you want to switch back to one column mode, you could do:
\begin{codebox*}
\cmd{renewcommand}*\marg{\gls{glossarysection}}[2][]\marg{\comment{}
  \gls{twocolumn}\oarg{\marg{\gls{chapter}*\marg{\#2}}}\comment{}
  \cmd{setlength}\gls{glsdescwidth}\marg{0.6\cmd{linewidth}}\comment{}
  \gls{glsglossarymark}\marg{\gls{glossarytoctitle}}\comment{}
}
\codepar
\cmd{renewcommand}*\marg{\gls{glossarypostamble}}\marg{\gls{onecolumn}}
\end{codebox*}
(You may prefer to use the \glostyle{mcolalttree} style if you're
not interested in the column headers or borders.)
\end{example}

The actual \idx{glossary} content is contained within the
\env{theglossary} environment, which will typically be in the form:
\begin{compactcodebox}
\cbeg{theglossary}\gls{glossaryheader}
\gls{glsgroupheading}\margm{group-label}\cmd{relax}\gls{glsresetentrylist}
\gls{glossentry}\margm{entry-label}\margm{number-list}
\gls{subglossentry}\margm{level}\margm{entry-label}\margm{number-list}
\comment{\ldots}
\gls{glsgroupskip}
\gls{glsgroupheading}\margm{group-label}\cmd{relax}\gls{glsresetentrylist}
\gls{glossentry}\margm{entry-label}\margm{number-list}
\gls{subglossentry}\margm{level}\margm{entry-label}\margm{number-list}
\comment{\ldots}
\cend{theglossary}
\end{compactcodebox}

The entire \idx{numberlist} for each \idx{entry} is encapsulated with:
\cmddef{glossaryentrynumbers}
This command allows \gls{glsnonextpages}, \gls{glsnextpages}, and
the \opt{nonumberlist} and \opt{savenumberlist} options to work.
The \gls{glossaryentrynumbers} command is reset by:
\cmddef{glsresetentrylist}

With \option{noidx}, this command is preceded by:
\cmddef{glsnoidxprenumberlist}
The default behaviour is to use the value of the
\glosfield{prenumberlist} internal field. This command is not used
with \options{mkidx,xdy}.

If you want to suppress the \idx{numberlist} for a particular entry,
you can add the following to the entry's description:
\cmddef{glsnonextpages}
Within the \idx{glossary}, this will redefine \gls{glossaryentrynumbers}
to ignore its argument and then reset itself. This means that the
next \idx{numberlist} will be suppressed. Note that if the entry
doesn't have a \idx{numberlist} (for example, it's a parent entry
that only appears in the \idx{glossary} because it has an \indexed\
descendent entry) then the next \idx{numberlist} will be for the
first child entry that's been \indexed. This command does nothing
outside of the \idx{glossary}.

Similarly, if you want to override the \opt{nonumberlist} option to
ensure that the next \idx{numberlist} is shown, then use:
\cmddef{glsnextpages}
This command does nothing outside of the \idx{glossary}.

\begin{information}
The \gloskey{nonumberlist} key that may be used when defining an
\idx{entry}, works by automatically adding \gls{glsnonextpages} or
\gls{glsnextpages} to the \idx{indexing} information before
\gls{glossentry} or \gls{subglossentry} with \options{mkidx,xdy}.
With \option{noidx}, the relevant command is put in the
\glosfield{prenumberlist} internal field, but since
\gls{printnoidxglossary} only uses \gls{glsnoidxprenumberlist}
and \gls{glossaryentrynumbers} when the \glosfield{loclist} field is
set, it won't affect sub-entries.
\end{information}

The \env{theglossary} environment, and the other commands
(\gls{glossaryheader}, \gls{glsgroupskip}, \gls{glsgroupheading},
\gls{glossentry} and \gls{subglossentry}) are all redefined by
\idxpl{glossarystyle} and are described in
\sectionref{sec:newglossarystyle}.

\chapter{Defining New Glossaries}
\label{sec:newglossary}

A new \idx+{glossary} can be defined using:
\cmddef{newglossary}
where \meta{glossary-label} is the label to assign to this
\idx{glossary}. This label is used to reference the \idx{glossary}
in the value of the \gloskey{type} key when defining \idxpl{entry} or,
the similarly named, \printglossopt{type} option in the
\gls{print...glossary} commands.

\begin{important}
As with labels in general, \meta{glossary-label} must not contain any active
characters. 
\end{important}

The arguments \meta{in-ext} and \meta{out-ext} specify the
extensions of the input and output (from \TeX's point of
view) \idxc+{glossaryfile}{files} for that \idx{glossary},
\meta{title} is the default title for this new \idx{glossary}, and
the final optional argument \meta{counter} specifies which
\idx{locationcounter} to use for the associated \idxpl{numberlist}
(see also \sectionref{sec:numberlists}). If not specified, the
default \idx{locationcounter} will be the one identified in the
\opt{counter} option, if that option is used, otherwise it will be
the \ctr+{page} counter.

The first optional argument \meta{log-ext} specifies the extension
for the \idx{indexingapp}['s] transcript file (this information is
used by \app{makeglossaries} which picks up the information
from the \ext+{aux} file and also by the \opt{automake} option).  If
omitted, \ext+{glg} is used.

The file extensions only apply to \options{mkidx,xdy}. With
\options{noidx,b2g}, the \idx{indexing} information is written to
the \ext{aux} file. No input file is required for \option{noidx} and
\option{b2g} always has the \ext+{glstex} file extension. Since the
file extensions are only relevant for \options{mkidx,xdy}, there is
a starred version that omits those arguments:
\cmddef{newglossary*}
This is equivalent to
\begin{compactcodebox}
\gls{newglossary}\oarg{\meta{glossary-label}-glg}\margm{glossary-label}\marg{\meta{glossary-label}-gls}\marg{\meta{glossary-label}-glo}\margm{title}\oargm{counter}
\end{compactcodebox}
or you can use:
\cmddef{altnewglossary}
which is equivalent to
\begin{compactcodebox}
\gls{newglossary}\oarg{\meta{tag}-glg}\margm{glossary-label}\marg{\meta{tag}-gls}\marg{\meta{tag}-glo}\margm{title}\oargm{counter}
\end{compactcodebox}
Note that in both cases distinct file extensions are defined so these
commands are still useful with \options{mkidx,xdy}.

It may be that you have some terms that are so common
that they don't need to be listed. In this case, you can define 
a~special type of \idx{glossary} that doesn't create any associated files.
This is referred to as an \qt{\idx+{ignoredglossary}} and it's ignored by
commands that iterate over all the \idxpl{glossary}, such as
\gls{printglossaries}. To define an \idx{ignoredglossary}, use:
\cmddef{newignoredglossary}
where \meta{glossary-label} is the glossary label (as above). This
\idx{glossary} type will automatically be added to the
\opt{nohypertypes} list, since there are no hypertargets for
the entries in an \idx{ignoredglossary}.
(The sample file \samplefile{-entryfmt} defines an ignored glossary.)

An \idx{ignoredglossary} can't be displayed with
\gls{printnoidxglossary} or \gls{printglossary} but can be displayed
with \gls{printunsrtglossary} and \gls{printunsrtinnerglossary}.

\begin{xtr}
The \sty{glossaries-extra} package provides a starred version 
\starredcs{newignoredglossary} that doesn't suppress
\idxpl{hyperlink} (since \idxpl{ignoredglossary} can be
useful with \app{bib2gls}). There is also an analogous 
\gls{provideignoredglossary} command.
\end{xtr}

You can test if a \idx{glossary} is an ignored one using:
\cmddef{ifignoredglossary}
This does \meta{true} if \meta{glossary-label} was defined as an 
\idx{ignoredglossary}, otherwise it does \meta{false}.

Note that the \glostypedef{main} (default) \idx{glossary} is automatically created as:
\begin{compactcodebox}
\gls{newglossary}\marg{main}\marg{\ext+{gls}}\marg{\ext+{glo}}\marg{\gls{glossaryname}}
\end{compactcodebox}
so it can be identified by the label \glostype{main} (unless the
\opt{nomain} package option is used). If the \sty{doc} package has
been loaded (which uses the \ext{gls} and \ext{glo} extensions for
the change log) then the \glostype{main} glossary will instead be
defined as:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{glg2}}\marg{main}\marg{\ext+{gls2}}\marg{\ext+{glo2}}\marg{\gls{glossaryname}}
\end{compactcodebox}
If you are using a class or package that similarly requires
\ext{gls} and \ext{glo} as file extensions, you will need to use the
\opt{nomain} option and define your own custom \idx{glossary}, but
be aware of other possible conflicts, such as different definitions
of commands and environments like \gls{printglossary} or
\env{theglossary}.

The \opt{acronym} (or \opt{acronyms}) package option is equivalent to:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{alg}}\marg{\glostype{acronym}}\marg{\ext+{acr}}\marg{\ext+{acn}}\marg{\gls{acronymname}}
\end{compactcodebox}
so it can be identified by the label \glostype{acronym}. If you are
not sure whether the \opt{acronym} option has been used, you
can identify the list of \idxpl{acronym} by the command:
\cmddef{acronymtype}
The default definition is simply \gls{glsdefaulttype}. The
\opt{acronym} or \opt{acronyms} option will redefine \gls{acronymtype} to
\glostype{acronym}. If you want additional \idxpl{glossary} for
use with \idxpl{acronym}, remember to declare them with
\opt{acronymlists}.

The \opt{symbols} package option creates a new \idx{glossary} with the
label \glostype{symbols} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{slg}}\marg{\glostype{symbols}}\marg{\ext+{sls}}\marg{\ext+{slo}}\marg{\gls{glssymbolsgroupname}}
\end{compactcodebox}
The \opt{numbers} package option creates a new \idx{glossary} with
the label \glostype{numbers} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{nlg}}\marg{\glostype{numbers}}\marg{\ext+{nls}}\marg{\ext+{nlo}}\marg{\gls{glsnumbersgroupname}}
\end{compactcodebox}
The \opt{index} package option creates a new \idx{glossary} with
the label \glostype{index} using:
\begin{compactcodebox}
\gls{newglossary}\oarg{\ext+{ilg}}\marg{\glostype{index}}\marg{\ext+{ind}}\marg{\ext+{idx}}\marg{\gls{indexname}}
\end{compactcodebox}

\begin{important}
With \options{mkidx,xdy} all \idxpl{glossary} must be defined before
\gls+{makeglossaries} to ensure that the relevant output
\idxc{glossaryfile}{files} are opened.

See \sectionref{sec:fixednames} if you want to redefine \gls{glossaryname}, 
especially if you are using a language package.
(Similarly for \gls{glssymbolsgroupname} and
\gls{glsnumbersgroupname}.) If you want to redefine \gls{indexname},
just follow the advice in
\texfaq{FAQ-fixnam}{How to change LaTeX's \qt{fixed names}}.
\end{important}

\chapter{Adding an Entry to the Glossary Without Generating Text}
\label{sec:glsadd}

It is possible to \idx+{index}{indexing} an \idx{entry} without
\cmddef{glsadd}
This is similar to the \gls{glstextlike} commands, only it doesn't produce
any text. Therefore, there is no \glsopt{hyper} key
available in \meta{options} but all the other base options that can
be used with the \gls{glstextlike} commands can be passed to \gls{glsadd}.
The \sty{glossaries-extra} package provides addition options, such
as \glsopt{textformat}, that aren't applicable when there's no
\idx{linktext}, so they are also not available.
This ensures that the given entry is listed in the \idx{glossary}
and that the current \location\ is included in the entry's
\idx{numberlist}.

This command is particularly useful to create an explicit \idx{range} that
covers an entire section or block of text that might otherwise end
up with a long, ragged \idx{numberlist}. For example, suppose I have
defined an \idx{entry} with the label \qt{set}:
\begin{codebox}
\gls{newglossaryentry}\marg{set}\marg{\gloskeyval{name}{set},
 \gloskeyval{description}{a collection}}
\end{codebox}
Suppose I have a section about sets spanning from page~3 to page~8
with repeated use of \code{\gls{gls}\marg{set}} on pages~3, 5, 7 
and 8. This will result in the \idx{numberlist} \qt{3, 5, 7, 8}
which is a bit untidy. It would look far more compact, and better
emphasize that the section of the document from page~3 to~8 covers
sets, if the \idx{numberlist} was simply \qt{3--8}.

This can be done with an explicit \idx{range}:
\begin{codebox}
\gls{glsadd}\oarg{\glsoptval{format}{\sym+{startrange}}}\marg{set}
Lots of text about sets spanning page 3 to page 8.
\gls{glsadd}\oarg{\glsoptval{format}{\sym+{endrange}}}\marg{set}
\end{codebox}
See \sectionref{sec:encap} for more information about the
\idx{locationencap}.

\begin{xtr}
Explicit ranges can also be created using \gls{glsstartrange}
and \gls{glsendrange} with \sty{glossaries-extra}. You can also add
a subset of entries with \gls{glsaddeach}.
\end{xtr}

To add all entries that have been defined, use:
\cmddef{glsaddall}
The optional argument is the same as for \gls{glsadd}, except
there is also a key \glsoptdef{types} which can be
used to specify which \idxpl{glossary} to use. This should be a
comma-separated list. For example, if you only want to add
all the \idxpl{entry} belonging to the list of acronyms (specified by
the glossary type \gls{acronymtype}) and a list of
notation (specified by the glossary type \optfmt{notation}) then you can
do:
\begin{codebox}
\gls{glsaddall}\oarg{\glsoptvalm{types}{\gls{acronymtype},notation}}
\end{codebox}

\begin{bib2gls}
If you are using \app{bib2gls} with \sty{glossaries-extra}, you
can't use \gls{glsaddall}. Instead use the \resourceoptval{selection}{all}
resource option to select all \idxpl{entry} in the given \ext+{bib} files.
(You can use \gls{glsaddeach} with \app{bib2gls}.)
\end{bib2gls}

\begin{important}
Note that \gls{glsadd} and \gls{glsaddall} add the current
\location\ to the \idx{numberlist}. In the case of \gls{glsaddall},
all \idxpl{entry} in the listed \idxpl{glossary} will have the same
\location\ in the \idx{numberlist} (the \location\ at the point in
the document where \gls{glsaddall} was used, which will be page~1 if
it occurs in the \idx{preamble/document}). If you want to use
\gls{glsaddall}, it's best to suppress the \idx{numberlist} with the
\opt{nonumberlist} package option. (See
sections~\ref{sec:pkgopts-printglos} and~\ref{sec:numberlists}.)
\end{important}

If you want to ensure that all \idx{entry} are added to the
\idx{glossary}, but only want the \locations\ of entries that have
actually been used in the document, then you can use:
\cmddef{glsaddallunused}
Note that in this case, the optional argument is simply a list of
\idx{glossary} labels. The options available to \gls{glsadd} and
\gls{glsaddall} aren't available here. If the optional argument is
omitted, the list of all non-\idxpl{ignoredglossary} is assumed.

This command implements:
\begin{compactcodebox}
\gls{glsadd}\oarg{\glsoptval{format}{\encap{glsignore}}}\margm{entry-label}
\end{compactcodebox}
for each \idx{entry} in each \idx{glossary} listed in the optional
argument if the entry has been marked as \glslink{firstuseflag}{used}.
Since \gls{glsignore} discards its argument, this effectively
creates an \idx{invisiblelocation}. This is necessary because
\app{makeindex} and \app{xindy} require an associated \location\ for
each line in the \idx{indexingfile}. (They are
\idxc{indexingapp}{\emph{indexing} applications} not glossary
applications, so they expect page numbers.)

This means that \gls{glsaddallunused} adds \code{\gls{glsignore}\margm{location}} to
the \idx{numberlist} of all the \emph{unused} \idxpl{entry}.
If any of those \idxpl{numberlist} have other \locations\ (for
example, the \idxpl{firstuseflag} was reset before
\gls{glsaddallunused} or only the \gls{glstextlike} commands were
used or if any \idx{indexing} occurs after \gls{glsaddallunused})
then this will cause spurious commas or en-dashes in the
\idx{numberlist} that have been placed before or after the 
\idx{invisiblelocation}.

\begin{important}
If you want to use \gls{glsaddallunused}, it's best to place the
command at the end of the document to ensure that all the commands
you intend to use have already been used and make sure to use the
\gls{glslike} commands and don't issue any resets (\gls{glsreset} etc).
\end{important}

\begin{bib2gls}
You can't use \gls{glsaddallunused} with \app{bib2gls}. However,
since \app{bib2gls} was designed specifically for
\sty{glossaries-extra}, it recognises \encap{glsignore} as a special
format that indicates the \location\ shouldn't be added to the
\idx{locationlist} but the \idx{entry} should be selected.
So you can index an entry with \glsoptval{format}{\encap{glsignore}}
to ensure that the entry is selected without adding a \location\ to
the \idx{numberlist}.

Alternatively, the \resourceoptval{selection}{all} resource option
can be used, which will ensure all \idxpl{entry} are selected but only
those \indexed\ with one or more non-ignored \locations\ will have a
\idx{locationlist}.
\end{bib2gls}

Base \sty{glossaries} package only:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{cat}\marg{\gloskeyval{name}{cat},\gloskeyval{description}{feline}}
\gls{newglossaryentry}\marg{dog}\marg{\gloskeyval{name}{dog},\gloskeyval{description}{canine}}
\cbeg{document}
\gls{gls}\marg{cat}.
\gls{printglossaries}
\gls{glsaddallunused} \comment{<- make sure dog is also listed}
\cend{document}
\end{codebox}
Corresponding \sty{glossaries-extra} and \app{bib2gls} document code:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}\oarg{\opt{record}}\marg{glossaries-extra}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{all}}
\cbeg{document}
\gls{gls}\marg{cat}.
\gls{printunsrtglossaries}
\cend{document}
\end{codebox}
With the file \filefmt{entries.bib}:
\begin{codebox}
\atentry{entry}\marg{cat,\gloskeyval{name}{cat},\gloskeyval{description}{feline}}
\atentry{entry}\marg{dog,\gloskeyval{name}{dog},\gloskeyval{description}{canine}}
\end{codebox}

\begin{example}{Dual Entries}{ex:dual}
The example file \samplefile{-dual} makes use of \gls{glsadd} to
allow for an \idx{entry} that should appear both in the \glostype{main} glossary and
in the list of \idxpl{acronym}. This example sets up the list of 
\idxpl{acronym} using the \opt{acronym} package option:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries}
\end{codebox}
A new command (\gls{newdualentry}) is then defined to make it easier to define dual
entries:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newdualentry}}[5][]\marg{\comment{}
  \gls{newglossaryentry}\marg{main-\#2}\marg{\gloskeyval{name}{\#4},\comment{}
  \gloskeyval{text}{\#3\gls{glsadd}\marg{\#2}},\comment{}
  \gloskeyval{description}{\#5},\comment{}
  \#1
  }\comment{}
  \gls{newacronym}\marg{\#2}\marg{\#3\gls{glsadd}\marg{main-\#2}}\marg{\#4}\comment{}
}
\end{codebox}
This has the following syntax:
\begin{compactcodebox}
\gls{newdualentry}\oargm{options}\margm{label}\margm{abbrv}\margm{long}\margm{description}
\end{compactcodebox}
You can then define a new dual entry:
\begin{codebox}
\gls{newdualentry}\marg{svm}\comment{label}
  \marg{SVM}\comment{abbreviation}
  \marg{support vector machine}\comment{long form}
  \marg{Statistical pattern recognition technique}\comment{description}
\end{codebox}
Now you can reference the acronym with \code{\gls{gls}\marg{svm}} or you can
reference the entry in the \glostype{main} glossary with
\code{\gls{gls}\marg{main-svm}}.

This is just an example.
In general, think twice before you add this kind of duplication.
If all information (short, long and description) can be provided in
a single list, it's redundant to provide a second list unless any
of the short forms start with a different letter to the associated
long form, which may make it harder to look up.

\begin{bib2gls}
Note that with \app{bib2gls}, there are special dual entry types
that implement this behaviour. That is, if an entry is referenced
then its corresponding dual entry will automatically be selected as
well. So there is less need for \gls{glsadd} with \app{bib2gls}.
(Although it can still be useful, for example with \option{standalone}.)
\end{bib2gls}
\end{example}

\chapter{Cross-Referencing Entries}
\label{sec:crossref}

\begin{important}
You must use \gls{makeglossaries} (\optionsor{mkidx,xdy}) or
\gls{makenoidxglossaries} (\option{noidx}) \emph{before} defining
any \idxpl{entry} that cross-reference other \idxpl{entry}. If any
of the \idxpl{entry} that you have cross-referenced don't appear
in the \idx{glossary}, check that you have put
\gls{makeglossaries}\slash\gls{makenoidxglossaries} before all entry
definitions. The \sty{glossaries-extra} package provides better
cross-reference handling.
\end{important}

There are several ways of cross-referencing \idx{entry} in the 
\idxpl{glossary}: 

\begin{enumerate}
\item\label{itm.descsee} You can use commands such as \gls{gls} in the
entries description. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},
\gloskeyval{description}{firm, round fruit. See also \gls{gls}\marg{pear}}}
\end{codebox}
Note that with this method, if you don't use the cross-referenced term 
in the main part of the document, you will need two runs of
\app{makeglossaries}:
\begin{terminal}
pdflatex filename
makeglossaries filename
pdflatex filename
makeglossaries filename
pdflatex filename
\end{terminal}
This is because the \gls{gls} in the description won't be detected
until the \idx{glossary} has been created (unless the description is used
elsewhere in the document with \gls{glsentrydesc}). Take care not to
use \gls{glsdesc} (or \gls{Glsdesc}) in this case as it will cause a
nested link.

\item\label{itm.glssee} After you have defined the entry, use
\cmddef{glssee}
where \meta{xr-list} is a comma-separated list of \idx{entry}
labels to be cross-referenced, \meta{entry-label} is the label of the
\idx{entry} doing the cross-referencing and \meta{tag} is the \qt{see} tag.
(The default value of \meta{tag} is \gls{seename}.)

This command is essentially performing:
\begin{compactcodebox}
\gls{glsadd}\oarg{\glsoptval{format}{\meta{cross-ref-encap}}}\margm{entry-label}
\end{compactcodebox}
where \meta{cross-ref-encap} is a special form of \idx{locationencap}
that includes \meta{tag} and \meta{xr-list}. Remember from
\sectionref{sec:glsadd} that \app{makeindex} always requires a
\location. This special \idx{locationencap} discards the provided
location (which \gls{glssee} sets to \qt{Z} to push the
cross-reference to the end of the \idx{numberlist}) and replaces it
with the cross-reference in the form \qt{\emph{see} \meta{name(s)}}.

This means that \gls{glssee} indexes \meta{entry-label} so that
\meta{entry-label} appears in the \idx{glossary} but it doesn't
\idxc{indexing}{index} any of the entries listed in \meta{xr-list}.

For example:
\begin{codebox}
\gls{glssee}\oarg{see also}\marg{series}\marg{FourierSeries,TaylorsTheorem}
\end{codebox}
This \idxc{indexing}{indexes} the entry identified by the label
\qt{series} and adds a \location\ to the \qt{series} \idx{numberlist} 
that looks something like:
\begin{compactcodebox}
\emph{see also} \gls{glsentryname}\marg{FourierSeries} \gls{cs.amp}
\gls{glsentryname}\marg{TaylorsTheorem}
\end{compactcodebox}
(The actual format is performed with \gls{glsseeformat}.)

\item\label{itm.seekey} As described in \sectionref{sec:newglosentry}, you can use the
\gloskey{see} key when you define the entry. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{MaclaurinSeries}\marg{\gloskeyval{name}{Maclaurin series},
\gloskeyval{description}{Series expansion},
\gloskeyval{see}{TaylorsTheorem}}
\end{codebox}
This key was provided as a simple shortcut that does:
\begin{codebox}
\gls{newglossaryentry}\marg{MaclaurinSeries}\marg{\gloskeyval{name}{Maclaurin series},
\gloskeyval{description}{Series expansion}}
\gls{glssee}\marg{MaclaurinSeries}\marg{TaylorsTheorem}
\end{codebox}
This means that \qt{MaclaurinSeries} will automatically be added to
the \idx{glossary} with something like
\begin{compactcodebox}
\gls{emph}\marg{see} \gls{glsentryname}\marg{TaylorsTheorem}
\end{compactcodebox}
in its \idx{numberlist}, but \qt{TaylorsTheorem} will need to be
\indexed\ elsewhere to ensure that it also appears in the
\idx{glossary} otherwise, it would end up with the preamble
\location\ (page~1) in its \idx{numberlist}, assuming that the
\idx{entry} was defined in the \idx{preamble/document}.

You therefore need to ensure that you use the
cross-referenced term with the commands described in
\sectionref{sec:glslink} or \sectionref{sec:glsadd}.

The \qt{see} tag is produce using \gls{seename}, but can be
overridden in specific instances using square brackets
at the start of the \gloskey{see} value. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{MaclaurinSeries}\marg{\gloskeyval{name}{Maclaurin series},
\gloskeyval{description}{Series expansion},
\gloskey{see}=\oarg{see also}\marg{TaylorsTheorem}}
\end{codebox}
Take care if you want to use the optional argument of commands such
as \gls{newacronym} or \gls{newterm} as the value will need to be
grouped. For example:
\begin{codebox}
\gls{newterm}\marg{seal}
\gls{newterm}\oarg{\gloskeyval{see}{\oarg{see also}seal}}\marg{sea lion}
\end{codebox}
Similarly if the value contains a list. For example:
\begin{codebox}
\gls{glossaryentry}\marg{lemon}
\marg{
  \gloskeyval{name}{lemon},
  \gloskeyval{description}{Yellow citrus fruit}
}
\gls{glossaryentry}\marg{lime}
\marg{
  \gloskeyval{name}{lime},
  \gloskeyval{description}{Green citrus fruit}
}
\gls{glossaryentry}\marg{citrus}
\marg{
  \gloskeyval{name}{citrus},
  \gloskeyval{description}{Plant in the Rutaceae family},
  \gloskeyval{see}{lemon,lime}
}
\end{codebox}
\end{enumerate}

In both cases~\ref{itm.glssee} and \ref{itm.seekey} above, the
cross-referenced information appears in the \idx{numberlist},
whereas in case~\ref{itm.descsee}, the cross-referenced information
appears in the description. (See the \samplefile{-crossref} example
file that comes with this package.) This means that in
cases~\ref{itm.glssee} and~\ref{itm.seekey}, the cross-referencing
information won't appear if you have suppressed the
\idx{numberlist}. In this case, you will need to activate the
\idx{numberlist} for the given entries using
\gloskey{nonumberlist}{false}. Alternatively, if you just use the
\gloskey{see} key instead of \gls{glssee}, you can automatically
activate the \idx{numberlist} using the \opt{seeautonumberlist}
package option.

\begin{bib2gls}
\app{bib2gls} provides much better support for cross-references,
including the ability to only show the cross-reference in the
\idx{locationlist} (\resourceoptvalm{save-locations}{see}) without
the actual \locations.  See, for example, 
\gallery{index.php?label=bib2gls-xr}{Gallery: Cross-References (bib2gls)}.
\end{bib2gls}

\section{Customising Cross-Reference Text}
\label{sec:customxr}

When you use either the \gloskey{see} key or the
\gls{glssee} command, the cross-referencing information will be typeset in the 
\idx{glossary} (within the \idx{numberlist}) according to:
\cmddef{glsseeformat}
The default definition:
\begin{compactcodebox}
\cmd{emph}\margm{tag} \gls{glsseelist}\margm{xr-list}
\end{compactcodebox}
Note that the \meta{location} argument is always ignored.
(\app{makeindex} will always assign a \location\ number, even if it's not needed, so it
needs to be discarded.) For example, if you want the tag to appear
in bold, you can do:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeformat}}[3][\gls{seename}]\marg{\cmd{textbf}\marg{\#1} 
 \gls{glsseelist}\marg{\#2}}
\end{codebox}

The list of labels is formatted by: 
\cmddef{glsseelist}
This iterates through the comma-separated list of \idx{entry} labels
\meta{label-list} and formats each entry in the list. The \idxpl{entry}
are separated by:
\cmddef{glsseesep}
between all but the last pair, and
\cmddef{glsseelastsep}
between the last pair.

Each entry item in the list is formatted with:
\cmddef{glsseeitem}
This does: 
\begin{compactcodebox}
\gls{glshyperlink}\oarg{\gls{glsseeitemformat}\marg{\#1}}\marg{\#1}
\end{compactcodebox}
which creates a \idx{hyperlink}, if enabled, to the cross-referenced
entry. The \idx{hyperlink} text is given by:
\cmddef{glsseeitemformat}
This does:
\begin{compactcodebox}
\gls{ifglshasshort}\margm{entry-label}
 \marg{\gls{glsentrytext}\margm{entry-label}}\comment{acronym}
 \marg{\gls{glsentryname}\margm{entry-label}}\comment{non-acronym}
\end{compactcodebox}
which uses the \gloskey{text} field for \idxpl{acronym} and the
\gloskey{name} field otherwise.

\begin{information}
When \gls{glssee} was first introduced in v1.17, the cross-referenced entry was
displayed with just \gls{glsentryname}, but this caused problems because
back then the \gloskey{name} field had to be sanitized because it was
written to the \idx{glossaryfile}, which caused strange results if
the \gloskey{name} contained any commands. So in v3.0, the default
definition was switched to using \gls{glsentrytext} to avoid the
issue. In v3.08a, the information written to the \idx{glossaryfile}
was changed and the \gloskey{name} was no longer sanitized, but the
new definition was retained for backward-compatibility.

However, the original definition is more appropriate in some ways,
as it makes more sense for the cross-reference to show the name as
it appears in the \idx{glossary}, except for \idxpl{acronym} which
could have wide names if the long form is included. So in v4.50,
which had major compatibility-breaking changes to remove the
unconditional dependency on the now deprecated \sty{textcase}
package, the original use of \gloskey{name} was restored for
non-\idxpl{acronym}, which brings it into line with
\sty{glossaries-extra}.
\end{information}

For example, to make the cross-referenced list use small caps with
the \gloskey{text} (not \gloskey{name}) field:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsseeitemformat}}[1]\marg{\comment{}
  \gls{textsc}\marg{\gls{glsentrytext}\marg{\#1}}}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package redefines \gls{glsseeitemformat}
to use \gls{glsfmttext} for \idxpl{abbreviation} and
\gls{glsfmtname} otherwise.  Additionally, it provides
\gls{glsxtrhiername} which can be used as an alternative for
\hierarchical\ entries. See the \sty{glossaries-extra} manual for
further details.
\end{xtr}

\begin{important}
You can use \gls{glsseeformat} and \gls{glsseelist} in the main body
of the text, but they won't automatically add the cross-referenced
entries to the \idx{glossary}. If you want them added with that location,
you can do:
\begin{codebox}
Some information (see also 
\gls{glsseelist}\marg{FourierSeries,TaylorsTheorem}\comment{}
\gls{glsadd}\marg{FourierSeries}\gls{glsadd}\marg{TaylorsTheorem}).
\end{codebox}
\end{important}

\chapter{Number Lists}
\label{sec:numberlists}

Each \idx{entry} in the \idx{glossary} has an associated
\idx+{numberlist} (or \idx+{locationlist}).  By default, these
numbers (the \idxpl+{entrylocation}) refer to the pages on which
that \idx{entry} has been \indexed\ (using any of the commands
described in \sectionref{sec:glslink} and \sectionref{sec:glsadd})
and will also include any cross-references obtained with \gls{glssee}
(or the \gloskey{see} key).

The \locations\ in the \idx{numberlist} are separated with:
\cmddef{delimN}

The \idx{numberlist} can be suppressed using the
\opt{nonumberlist} package option, or an alternative counter can
be set as the default using the \opt{counter} package option.
The \sty{glossaries-extra} package additionally provides the
\opt{equations} and \opt{floats} options that can be used to
automatically switch the \idx{locationcounter} in certain
environments.

\begin{bib2gls}
With \app{bib2gls} you can prevent the \idx{numberlist} from being
created with the \resourceoptval{save-locations}{false} resource
option, or only include the cross-references with the
\resourceoptval{save-locations}{see} option.
\end{bib2gls}

\Idxpl{numberlist} are more common with indexes rather than
\idxpl{glossary} (although you can use the \sty{glossaries} package for
indexes as well). However, \options{mkidx,xdy} makes use of
\app{makeindex} or \app{xindy} to hierarchically sort and collate
the \idxpl{entry}. These applications are readily available with most
modern \TeX\ distributions, but because they are both designed as
\idxpl{indexingapp} they both require that terms either have a valid
\location\ or a cross-reference. 

\begin{important}
Even if you use \opt{nonumberlist}, the \locations\ must still be
provided and acceptable to the \idx{indexingapp} or they will cause
an error during the \idx{indexing} stage, which will interrupt the
document build.  \Idxpl{emptylocation} are not permitted with
\options{mkidx,xdy}. See \sectionref{sec:problemlocations}.
\end{important}

If you're not interested in the \locations, each
\idx{entry} only needs to be indexed once, so consider using
\opt{indexonlyfirst}, which can improve the document build time by
only \idx{indexing} the \idx{firstuse} of each term.

The \gls{glsaddall} command (see \sectionref{sec:glsadd}), which is used to
automatically \idxc{indexing}{index} all \idxpl{entry}, iterates over 
all defined \idxpl{entry} (in non-\idxpl{ignoredglossary})
and does \code{\gls{glsadd}\margm{entry-label}} for each 
\idx{entry} (where \meta{entry-label} is that \idx{entry}['s] label). 
This means that \gls{glsaddall} automatically
adds the same \location\ to every entry's \idx{numberlist}, which
looks weird if the \idx{numberlist} hasn't been suppressed.

With \option{b2g}, the \idx{indexing} is performed by \app{bib2gls}, which was
specifically designed for the \sty{glossaries-extra} package. 
So it will allow \idxc{emptylocation}{empty} or unusual locations.
(As from \app{bib2gls} v3.0, \idxpl{emptylocation} will be converted
to \idxpl{ignoredlocation}.)
Additionally, the \resourceoptval{selection}{all} resource option
option will select all \idxpl{entry} without adding an unwanted 
\location\ to the \idx{numberlist}. If \app{bib2gls} can deduce a numerical value for
a \location, it will attempt to form a \idx{range} over consecutive
\locations, otherwise it won't try to form a \idx{range} and the
\location\ will just form an individual item in the list.

\option{noidx} also allows any \location\ but it doesn't form
\idxpl{range}. Any \idxpl{emptylocation} or location with the
\encap{glsignore} format will result in an \idx{invisiblelocation} in the
\idx{numberlist}.

\section{Encap Values (Location Formats)}
\label{sec:encap}

The \idxc+{locationencap}{location encap or format} is the
encapsulating command used to format an \idx+{entrylocation}.
That is, it's a command that takes an argument that will be the
\location.

\begin{information}
If you aren't using \sty{hyperref} then you can use the control
sequence name of any text-block command that takes a single
argument. For example, \glsoptval{format}{\encap{emph}}. 
If you require \idxpl+{hyperlink} then it's more complicated.
\end{information}

The \qt{\idx{encap}} usually refers to the control sequence \emph{name} without
the leading backslash (such as \encap{textbf}) and is essentially
the same as the \app{makeindex} \idx{encap} value that can be provided within
the standard \gls{index} command.

\begin{warning}
Be careful not to use a declaration (such as
\gls{bfseries}) instead of a text-block command (such as
\gls{textbf}) as the effect is not guaranteed to be localised,
either within the \idx{numberlist} or throughout the \idx{glossary}.
\end{warning}

There is a special format:
\cmddef{glsignore}
which simply ignores its argument. With \options{noidx,mkidx,xdy} this
creates an \idxc{emptylocation}{empty (invisible) location} which can lead
to spurious commas or en-dashes if the \idx{numberlist} contains
other \locations.  However, with \app{bib2gls}, this format
identifies the \location\ as a special \idx{ignoredlocation} which
won't be added to the \idx{locationlist} but will influence
selection.

If you want to apply more than one style to a given \location\ (for example,
\textbf{bold} and \emph{italic}) you will need to create a command
that applies both formats. For example: 
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{textbfem}}[1]\marg{\gls{textbf}\marg{\gls{emph}\marg{\#1}}}
\end{codebox}
and use that command.

In this document, \idxn{standardformat} refer to the standard text
block commands such as \gls{textbf} or \gls{emph} or any of the
commands listed in \tableref{tab:hyperxx}.

\begin{important}
If you use \app{xindy} instead of \app{makeindex}, you
must use \gls{GlsAddXdyAttribute} to identify any 
non-\idxpl{standardformat} 
that you want to use with the \glsopt{format} key. So if you use
\app{xindy} with the above example \csfmt{textbfem}, you would need to add:
\begin{codebox}
\gls{GlsAddXdyAttribute}\marg{textbfem}
\end{codebox}
See \sectionref{sec:xindy} for further details.
\end{important}

If you are using \idxpl+{hyperlink} and you want to change the font
of the hyperlinked \location\, don't use \gls{hyperpage} (provided
by the \sty{hyperref} package) as the \locations\ may not refer to a
page number and the location argument may contain the range delimiter \gls{delimR}.
Instead, the \sty{glossaries} package provides
\idx{hyperlink}-supported \idxpl{encap} listed in
\tableref{tab:hyperxx}. These commands all use \gls{glshypernumber}
(described below) and so shouldn't be used in other contexts.

The \csmetafmt{hyper}{xx}{} can also be used without \sty{hyperref}, since
\gls{glshypernumber} will simply do its argument if \gls{hyperlink}
hasn't been defined. In which case, only the font change will be
applied.

\begin{table}[htbp]
\caption{Predefined Hyperlinked Location Formats}
\label{tab:hyperxx}
\centering
\begin{tabular}{ll}
\inlineencapdef{hyperrm} & serif (\gls{textrm}) \idx{hyperlink}\\
\inlineencapdef{hypersf} & sans-serif (\gls{textsf}) \idx{hyperlink}\\
\inlineencapdef{hypertt} & monospaced (\gls{texttt}) \idx{hyperlink}\\
\inlineencapdef{hyperbf} & bold (\gls{textbf}) \idx{hyperlink}\\
\inlineencapdef{hypermd} & medium weight (\gls{textmd}) \idx{hyperlink}\\
\inlineencapdef{hyperit} & italic (\gls{textit}) \idx{hyperlink}\\
\inlineencapdef{hypersl} & slanted (\gls{textsl}) \idx{hyperlink}\\
\inlineencapdef{hyperup} & upright (\gls{textup}) \idx{hyperlink}\\
\inlineencapdef{hypersc} & small caps (\gls{textsc}) \idx{hyperlink}\\
\inlineencapdef{hyperemph} & emphasized (\gls{emph}) \idx{hyperlink}
\end{tabular}
\par
\end{table}

If you want to make a new \idx{locationformat} that supports
\idxpl{hyperlink}, you
will need to define a command which takes one argument and use that
with the location encapsulated with \gls{glshypernumber} or the
appropriate \csmetafmt{hyper}{xx}{} command.
For example, if you want the \location\ number to be in a bold
sans-serif font, you can define a command called, say,
\csfmt{hyperbsf}:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{hyperbsf}}[1]\marg{\gls{textbf}\marg{\gls{hypersf}\marg{\#1}}}
\end{codebox}
and then use \optfmt{hyperbsf} as the value for the \glsopt{format} key.

\begin{important}
When defining a custom \idx{locationformat} command
that uses one of the \csmetafmt{hyper}{xx}{} commands, make sure
that the argument of \csmetafmt{hyper}{xx}{} is just the \location.
Any formatting must be outside of \csmetafmt{hyper}{xx}{} (as in the
above \csfmt{hyperbfsf} example).
\end{important}

Remember that if you use \app{xindy}, you
will need to add this to the list of location \idxpl{xindyattr}:
\begin{codebox*}
\gls{GlsAddXdyAttribute}\marg{hyperbsf}
\end{codebox*}

Complications can arise if you use different \idx{encap} values for the
same \location. For example, suppose on page~10 you have both the
default \encap{glsnumberformat} and \encap{hyperbf} \idxpl{encap}.  While it may
seem apparent that \encap{hyperbf} should override \encap{glsnumberformat}
in this situation, the \idx{indexingapp} may not know it.
This is therefore something you need to be careful about if you use the
\glsopt{format} key or if you use a command that implicitly sets it.

In the case of \app{xindy}, it only accepts one \idx{encap} (according to
the order of precedence given in the \app{xindy} module) and discards the
others for identical \locations\ (for the same \idx{entry}). This can cause
a problem if a discarded \location\ forms the start or end of a \idx{range}. 

In the case of \app{makeindex}, it accepts different \idxpl{encap} for the
same \location, but warns about it (\qt{\idxpl{multipleencap}}).  
This leads to a \idx{numberlist}
with the same \location\ repeated in different formats.  If you use
the \app{makeglossaries} Perl script with \option{mkidx} it will detect
\app{makeindex}['s] warning and attempt to fix the problem, ensuring
that the \encap{glsnumberformat} \idx{encap} always has the least precedence
unless it includes a \idx{range} identifier. Other conflicting
\idxpl{encap} will have the last one override earlier ones for the same 
\location\ with \idx{range} identifiers taking priority. If you
actually want the repeat, you can disable this feature with the
\mkglsopt{e} switch.

No discard occurs with \option{noidx} so again you get the same
\location\ repeated in different formats. With \option{b2g},
\app{bib2gls} will discard according to order of precedence, giving
priority to start and end \idxpl{range}.  (See the \app{bib2gls}
manual for further details.)

The default \location\ format is:
\cmddef{glsnumberformat}
This will simply do its argument \meta{location(s)} if
\sty{hyperref} hasn't been loaded, otherwise it will use:
\cmddef{glshypernumber}
This will create a \idx+{hyperlink} to the \location\ or will simply do
its argument if \sty{hyperref} hasn't been loaded. The
\meta{location(s)} argument may contain multiple \locations. If so,
they must be separated with \gls{delimR} or \gls{delimN}. (Usually
\gls{delimN} won't occur. The \gls{delimR} separator may occur with
\idxpl{range} and \app{makeindex}.) Any other markup is likely to cause a
problem (see \sectionref{sec:problemlocations}).

Each \location\ within \gls{glshypernumber} will have a
\idx{hyperlink} created with:
\begin{compactcodebox}
\gls+{hyperlink}\margm{anchor}\margm{text}
\end{compactcodebox}
where the \meta{text} is the location encapsulated with:
\cmddef{glswrglosslocationtextfmt}
This just does its argument by default.

The \meta{anchor} is constructed from the location but requires the
prefix and \idx{locationcounter}, which first have to be set with:
\cmddef{setentrycounter}
This command will be automatically inserted before the location in the
\idx{numberlist} by the appropriate \idx{indexing} method.
In the case of \app{makeindex}, this will be inserted at the start
of the \idx{encap} information, but with \app{xindy} the counter
will form part of the \idxc{xindyattr}{attribute} and a helper
command has to be provided that uses \gls{setentrycounter}. With
\option{noidx} the command occurs inside the definition of
\gls{glsnoidxdisplayloc}. 

The \meta{counter} will be stored in:
\cmddef{glsentrycounter}
and may be used in the hooks described below. Note that the prefix
can't be referenced as \gls{glswrglossdisableanchorcmds} is also
used when obtaining the prefix during \idx{indexing}.

The \meta{anchor} is then constructed as follows:
\begin{enumerate}
\item Use the \gls{glswrglossdisableanchorcmds} hook to disable problematic 
commands (scoped).
\item Expand (protected)
\begin{compactcodebox}
\meta{counter}\meta{prefix}\gls{glswrglosslocationtarget}\margm{location}
\end{compactcodebox}
\item Sanitize the result.
\end{enumerate}
For example:
\begin{compactcodebox}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\comment{page counter and empty prefix}
\gls{glshypernumber}\marg{1}
\end{compactcodebox}
will essentially do:
\begin{compactcodebox}
\gls{hyperlink}\marg{page.1}{1}
\end{compactcodebox}
whereas
\begin{compactcodebox}
\gls{setentrycounter}\oarg{1}\marg{\ctr{equation}}\comment{}
\gls{glshypernumber}\marg{2}
\end{compactcodebox}
will essentially do:
\begin{compactcodebox}
\gls{hyperlink}\marg{equation.1.2}{2}
\end{compactcodebox}

The initial hook to disable the problematic commands is:
\cmddef{glswrglossdisableanchorcmds}
By default, this is defined to:
\begin{compactcodebox}
\cmd{let}\gls+{glstexorpdfstring}\cmd{@secondoftwo}
\end{compactcodebox}
If \sty{hyperref} is loaded the definition will also include:
\begin{compactcodebox*}
\cmd{let}\gls{texorpdfstring}\cmd{@secondoftwo}
\gls{pdfstringdefPreHook}
\end{compactcodebox*}
The location is encapsulated with:
\cmddef{glswrglosslocationtarget}
This must expand but may be used to make adjustments. The default
definition is to simply expand to its argument. The 
\gls{glswrglossdisableanchorcmds} hook may be used to alter the
definition if some condition is required, but bear in mind that 
\gls{glswrglosslocationtarget} won't be used when the prefix is
obtained during \idx{indexing}.

Any leftover robust or protected commands will end up sanitized to
prevent an obscure error from occurring, but an invalid target name is
likely to result. See \sectionref{sec:problemlocations} for an
example.

The use of \gls{setentrycounter} to set the prefix and counter is 
necessary because the hypertarget can't be included in the
\idx{indexing} information supplied to \app{makeindex} or
\app{xindy}, because neither the \app{makeindex} nor \app{xindy}
syntax supports it. Unfortunately, not all definitions of
\gls{theHcounter} can be split into a prefix and location that can
be recombined in this way. This problem can occur, for example,
with \optval{counter}{\ctr{equation}} when it depends on the \ctr{chapter}
counter. This can result in warnings in the form:
\begin{transcript}
name\margm{target-name} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
The \samplefile{Eq} sample file deals with this issue by redefining
\theHcounter{equation} as follows:
\begin{codebox}
\cmd{renewcommand}*\theHcounter{equation}\marg{\theHcounter{chapter}.\gls{arabic}\marg{equation}}
\end{codebox}

\begin{bib2gls}
This issue is avoided with \app{bib2gls} and \optval{record}{nameref}
as that syntax allows the \idx{hyperlink} target to be supplied with the
\idx{indexing} information.
\end{bib2gls}

\section{Range Formations}
\label{sec:ranges}

There are two types of \inlineidxpdef{range}: explicit and implicit.
Neither are supported with \option{noidx}. Both are supported by
\options{mkidx,xdy,b2g}. Implicit ranges can be switched off using
the appropriate option for the required \idx{indexingapp}.
The start and end of a \idx{range} is separated with:
\cmddef{delimR}
\options{mkidx,xdy} can merge implicit and explicit \idxpl{range}
that overlap. With \option{b2g}, individual \locations\ can be
merged into an explicit range, but an individual location on either
side of the explicit range won't be merged into the explicit range.

As with \gls{index}, the characters \sym{startrange} and \sym{endrange} 
can be used at the start of the \glsopt{format} value to specify the
beginning and ending of a number \idx{range}. They must be in matching
pairs with the same \idx{encap}. For example,
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{emph}}}\marg{sample}
\end{codebox}
on one page to start the \idx{range} and later:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{emph}}}\marg{sample}
\end{codebox}
to close the \idx{range}. This will create an explicit \idx{range} in the
\idx{numberlist} that's encapsulated with \gls{emph}. If the default 
\encap{glsnumberformat} should be used, you can omit it and just
have the \sym{startrange} and \sym{endrange} characters.

\begin{xtr}
Explicit ranges can also be created using \gls{glsstartrange}
and \gls{glsendrange} with \sty{glossaries-extra}.
\end{xtr}


Implicit \idxpl{range} are formed by concatenating a sequence of
three or more consecutive \locations. For example, if an \idx{entry}
is \indexed\ on pages~3, 4, 5, and 6, this will be compacted into
\qt{3--6}.

With \option{xdy}, you can vary the minimum sequence length using
\gls{GlsSetXdyMinRangeLength}
where the argument is either the minimum number or the keyword
\optfmt{none}, which indicates that no implicit \idxpl{range} should be
formed. See \sectionref{sec:xindyloc} for further details.

\begin{xtr}
With \option{b2g}, the minimum number for form implicit \idxpl{range}
is given by the \resourceopt{min-loc-range} resource option.
Again, the value is either the minimum number or the keyword
\optfmt{none}, which indicates that no implicit \idxpl{range} should be
formed. It's also possible to compact a ragged sequence into a range
with \resourceopt{max-loc-diff}. For example, with
\resourceoptval{max-loc-diff}{2}, the sequence \qt{2, 4, 5, 6, 8}
can be compressed into the range \qt{2--8}. Another \idx{range}-related option is
\resourceopt{compact-ranges} which allows \idxpl{range} to be more
compact by omitting matching initial digits at the end of the
\idx{range}. For example, \qt{184--189} can be compacted into \qt{184--9}.
\end{xtr}

With both \app{makeindex} and \app{xindy} (\options{mkidx,xdy}), you can replace
the separator and the closing number at the end of the range using:
\cmddef{glsSetSuffixF}
to set the suffix for two consecutive \locations\ and
\cmddef{glsSetSuffixFF}
to set the suffix for three or more consecutive \locations.
\option{b2g} provides a similar feature with the
\resourceopt{suffixF} and \resourceopt{suffixFF} resource options.

For example:
\begin{codebox}
\gls{glsSetSuffixF}\marg{f.}
\gls{glsSetSuffixFF}\marg{ff.}
\end{codebox}
Note that if you use \app{xindy} (\option{xdy}), you will also need to
set the minimum range length to 1 if you want to change these
suffixes:
\begin{codebox}
\gls{GlsSetXdyMinRangeLength}\marg{1}
\end{codebox}
If you use the \sty{hyperref} package, you will need
to use \gls{nohyperpage} in the suffix to ensure that the 
\idxpl+{hyperlink} work correctly. For example:
\begin{codebox}
\gls{glsSetSuffixF}\marg{\gls{nohyperpage}\marg{f.}}
\gls{glsSetSuffixFF}\marg{\gls{nohyperpage}\marg{ff.}}
\end{codebox}

\begin{important}
Note that \gls{glsSetSuffixF} and \gls{glsSetSuffixFF} must be used 
before \gls{makeglossaries} and have no effect if \gls{noist} is 
used.
\end{important}

\section{Locations}
\label{sec:locationsyntax}

Each \idxc+{entrylocation}{location} in an \idx{entry}['s] \idx{numberlist} is the
result of \idx{indexing} the \idx{entry} at the point
in the document that corresponds to the location (typically where a
command such as \gls{gls} occurred). By default, this
is the page number, but can be changed with the \opt{counter}
package option, the \meta{counter} optional argument in
\gls{newglossary}, the \gloskey{counter} key in
\gls{newglossaryentry} or the \glsopt{counter} option in the
\gls{glslike} and \gls{glstextlike} commands (or in \gls{glsadd}).

The syntax of the \location\ must be valid for the given
\idx{indexingapp} if you use \optionsor{mkidx,xdy}. In the case of
\app{makeindex}, the syntax is quite restricted. The \location\ may
be a digit (\gls{arabic}), upper or lowercase Roman numerals
(\gls{Roman} or \gls{roman}) or upper or lowercase \idx{ascii}
letters (\gls{Alph} or \gls{alph}). The syntax also allows 
\idxpl{compositelocation} formed by combining the allowed digits, numerals and
letters with a \idx{compositor} (which can be identified with
\gls{glsSetCompositor}).

The following \locations\ are valid, assuming the default
\idx{fullstop} compositor:
\begin{itemize}
\item \qt{325}: a numeric location (\gls{arabic});
\item \qt{IV}: a Roman numeral location (\gls{Roman});
\item \qt{B}: an alphabetic location (\gls{Alph});
\item \qt{12.3.4}: a \idx{compositelocation}.
\end{itemize}
The following are invalid:
\begin{itemize}
\item \qt{I-3.2}: mixed \idxpl{compositor} not permitted;
\item \qt{X7}: a separator must be used in \idxpl{compositelocation};
\item \qt{\O}: letters must be \idx{ascii};
\item \qt{\code{\gls{textsc}\marg{iv}}}: commands not permitted in
locations;
\item \qt{}: locations can't be \idxc{emptylocation}{empty}.
\end{itemize}

\begin{warning}
Invalid \locations\ will be rejected by \app{makeindex}, which will
result in the entry being dropped from the \idx{glossary} if it has
no valid \locations.
\end{warning}

In the case of \app{xindy}, the \location\ syntax must be declared
in the \ext+{xdy} style file. This covers both the way that the 
location appears in the \idx{indexingfile} as a result of protected
expansion but also the \idxc{locationcounter}{counter} used to obtain the
\location, and is described in more detail in
\sectionref{sec:xindyloc}. The standard digit (\gls{arabic}), upper
or lowercase Roman numerals (\gls{Roman} or \gls{roman}) or upper or
lowercase \idx{ascii} letters (\gls{Alph} or \gls{alph}) are
automatically added for the \ctr{page} counter.

If a \location\ doesn't match any declared syntax, a warning will
be written to \app{xindy}['s] transcript file (\ext{glg}):
\begin{transcript}
WARNING: location-reference "\margm{prefix}\margm{location}" did not match any location-class! (ignored)
\end{transcript}
As with \app{makeindex} when it encounters an invalid \location,
\app{xindy} will drop that \location, which will result in the entry
being dropped from the \idx{glossary} if it has no valid \locations.

Additional problems can occur with \app{xindy} if any of
\app{xindy}['s] special characters occur in the \location. This
includes the backslash \sym{bksl} character, which is particularly
problematic if any robust or protected commands are written in the location
as \csmetafmt{}{csname}{} will have to be written to the file as
\code{\gls{cs.bsl}\meta{csname}}. This is quite difficult to do without
prematurely expanding \gls{thepage}.

If \opt{esclocations}{true}, an attempt will be made to hack commands
like \gls{@arabic} and \gls{@roman} to enable this, but, like all
hacks, this is problematic and liable to break in awkward
situations or with future releases of the \LaTeX\ kernel or other
packages. This setting is now off by default and it's better to use
the hooks below to ensure that the content written to the file is valid.

\begin{warning}
Any commands that end up in the \location\ can interfere with 
\gls{glsdohypertarget} when it tries to create \idxpl{hyperlink}.
\end{warning}

The following hook is used during the protected write:
\cmddef{glswrglossdisablelocationcmds}
This does nothing by default but may be used to disable problematic
commands that could lead to an invalid location. Note that this
can lead to unexpected results in the \idx{numberlist}, but you may
be able to correct this with a custom \idx{encap} or (if
\gls{glshypernumber} creates a \idx{hyperlink}) a custom
definition of \gls{glswrglosslocationtextfmt}. See
\sectionref{sec:problemlocations} for an example.

\begin{important}
The \gls{glswrglossdisablelocationcmds} hook occurs after
\gls{protected@write} sets \gls{thepage} to \gls{relax}.
By the time \gls{thepage} actually gets expanded when it's written
to the \idx{indexingfile}, any changes made within the hook will be
lost.
\end{important}

Both \options{noidx,b2g} write the \idx{indexing} information in the
\ext{aux} file and will accept any \location\ syntax (that's valid
in a \LaTeX\ document). In the case of \option{b2g}, \app{bib2gls}
will try parsing the \location\ and if it fits a common pattern that
allows it to obtain a numeric value, then it will be able to form an
implicit \idx{range} (if required), otherwise it will accept the
\location\ but not form any implicit \idxpl{range}.

With \optionsto{noidx}{b2g} (except with \optval{record}{nameref})
the location anchor isn't included in the \idx{indexing}
information. If a \idx{hyperlink} is required for the location, the
target (anchor name) has to be constructed from the location. The
\sty{hyperref} package provides \gls{hyperpage} for normal indexes
(with \gls{index}), but this forms the anchor from
\code{page.\meta{location}} which isn't suitable with
\sty{glossaries} as the \idx{locationcounter} may not be the default
\ctr{page}. Therefore the counter is saved within the \idx{encap}. A
prefix is also necessary if \gls{theHcounter} is defined and
isn't equivalent to \gls{thecounter}. 

The assumption here is that \gls{theHcounter} expands to the
equivalent of \code{\meta{prefix}\gls{thecounter}}.
If \gls{theHcounter} and \gls{thecounter} are equivalent then
\meta{prefix} will be empty.

The prefix is found as follows:
\begin{enumerate}
\item Use the \gls{glswrglossdisableanchorcmds} hook to disable problematic 
commands (scoped).

\item Perform a protected expansion on \gls{theHcounter} (\meta{Hloc}) and
\gls{thecounter} (\meta{loc}). If \meta{Hloc} ends with \meta{loc},
so that \meta{Hloc} is \meta{prefix}\meta{loc},
then the prefix is the \meta{prefix} substring.

In this step, \gls{thepage} may be incorrect, due to \TeX's
asynchronous output routine, but it will be incorrect in both
\meta{Hloc} and \meta{loc} and shouldn't occur in the prefix
(unless you have an unusual numbering system that's reset on every
page, in which case you may have other problems), so it shouldn't affect
the prefix formation. When the actual write operation occurs,
\gls{thepage} should then expand correctly.
\end{enumerate}

Unfortunately, not all definitions of \gls{theHcounter} will expand
in the form \code{\meta{prefix}\gls{thecounter}}. In which case a
warning will occur:
\begin{transcript}
Hyper target `\meta{Hloc}' can't be formed by prefixing
location `\meta{loc}'. You need to modify the definition of \gls{theHcounter}
otherwise you will get the warning: "`name\marg{\meta{counter}.\meta{loc}}' has been
referenced but does not exist"
\end{transcript}
If you need the \location\ hyperlink, you will either have to
redefine \gls{theHcounter} or switch to \option{b2g} and
\optval{record}{nameref}.

\section{Page Precedence}
\label{sec:pageprecedence}

The \inlineidxdef{pageprecedence} indicates the \location\ ordering within the
\idx{numberlist} based on the \location\ syntax. For example, if an
\idx{entry} has been \indexed\ on pages~5, 7, i and ii, then the
\idx{numberlist} will be \qt{i, ii, 5, 7} with the default order of
precedence.

With \app{makeindex}, the default precedence is \code{rnaRA}, which
indicates: \idx{lowercase} Roman
(\gls{roman}), numeric (\gls{arabic}), \idx{lowercase} alphabetic
(\gls{alph}), \idx{uppercase} Roman (\gls{Roman}), and
\idx{uppercase} alphabetic (\gls{Alph}). This order can be changed
by adding the \code{page\_precedence} parameter to the \ext+{ist}
file. There's no specific command provided for this, so you will
need to use the \gls{GlsSetWriteIstHook} to add this. For example:
\begin{codebox}
\gls{GlsSetWriteIstHook}\marg{\comment{}
 \gls{write}\gls{glswrite}\marg{page\_precedence "arnAR"}\comment{}
}
\end{codebox}

With \app{xindy}, the precedence is given by the order the
location classes are listed in \code{define-location-class-order} 
within the \ext+{xdy} style file. This order can either be changed
in a custom \ext{xdy} file or can be set with
\gls{GlsSetXdyLocationClassOrder}.

Since neither \optionsor{noidx,b2g} recognise specific location
classes, they have no concept of \idx{pageprecedence}. They will
both create \idxpl{locationlist} that are in the same order as the
\locations\ were \indexed, which means they will match the order
those locations occur in the document. However, with \app{bib2gls},
it's possible to gather the \locations\ into sub-groups according to
the associated \idxc{locationcounter}{counter} or split off
\locations\ with identified primary formats. See the \app{bib2gls}
manual for further details.

\section{Problematic Locations}
\label{sec:problemlocations}

The default \idx{locationcounter} is the \ctr{page} counter, the
value of which is obtained with \gls{thepage}. Due to \TeX's
asynchronous output routine, \gls{thepage} may be incorrect at the
start of a new page. To ensure that the page number is correct, a
delayed write is needed, which is what is usually done when writing
information to the \ext+{aux} and \ext{toc} files (and to
\idxpl{indexingfile}).

This works fine with \options{noidx,b2g} since neither of those
options have any restrictions on the location syntax (provided that
it's valid \LaTeX\ code). With \app{bib2gls}, if it can't work out a
numeric value for the location then it simply won't be able to form
a \idx{range}. Additionally, \app{bib2gls} v3.0+, converts an
\idx{emptylocation} into an \idx{ignoredlocation}, which means the
\idx{entry} will still be selected so that it can be included in the
\idx{glossary}, but it won't cause a spurious comma or en-dash as
there won't be an invisible location in the \idx{numberlist}.

The only problematic \locations\ with \options{noidx,b2g} are where
\idxpl+{hyperlink} are required but the target name can't be formed
from the prefix, counter and location information (see
\sectionref{sec:locationsyntax}). The best solution with
\app{bib2gls} in this case is to use \optval{record}{nameref}, which
saves the actual target name in the \idx{indexing} record.
With \option{noidx} you will have to redefine \gls{theHcounter} as
appropriate.

With \options{mkidx,xdy}, the \location\ must expand to content that
is compatible with the \idx{indexingapp}['s] syntax. The syntax for
\app{makeindex} is quite restrictive and is described in 
\sectionref{sec:locationsyntax}.

For example, \thecounter{part} is normally formatted as an
\idx{uppercase} Roman numeral. There's no Roman numeral for 0 so if
the \ctr{part} counter is 0 (that is, before the first \gls{part})
then \thecounter{part} will expand to nothing.
This can be demonstrated in the following document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{counter}{\ctr{part}}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{}}
\cbeg{document}
\gls{gls}\marg{sample}\comment{part = 0}
\gls{part}\marg{Sample Part}
\gls{section}\marg{Sample Section}
\gls{gls}\marg{sample}.
\gls{printglossaries}
\cend{document}
\end{codebox}
In the above, the first instance of \code{\gls{gls}\marg{sample}}
will have an \idx{emptylocation}. This will cause \app{makeindex} to
reject the \location\ with the following message in the transcript
(assuming the document file is called \filefmt{myDoc.tex}):
\begin{transcript}
!! Input index error (file = myDoc.glo, line = 1):
   -- Illegal page number  or page\_precedence rnaRA.
\end{transcript}
If \app{makeglossaries} encounters this warning, it will replace the
\idx{emptylocation} with \qt{0} and change the \idx{locationencap} to
\encap{glsignore}. In the above example, this will lead to an
\idx{invisiblelocation} in the \idx{numberlist}, but that's exactly
what an \idx{emptylocation} would do if \app{makeindex} allowed it.

Similarly, if the \idx{pagecompositor} hasn't been correctly identified,
then it can also result in an invalid \location. For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\optval{counter}{\ctr{section}}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{}}
\comment{default compositor is '.' not '-'}
\cmd{renewcommand}\marg{\thecounter{section}}\marg{\thecounter{part}-\gls{arabic}\marg{\ctr{section}}}
\cbeg{document}
\gls{part}\marg{Sample Part}
\gls{section}\marg{Sample Section}
\gls{gls}\marg{sample}.
\gls{printglossaries}
\cend{document}
\end{codebox}
This will cause \app{makeindex} to reject the \location\ with the 
following message in the transcript:
\begin{transcript}
!! Input index error (file = myDoc.glo, line = 1):
   -- Illegal Roman number: position 2 in I-1.
\end{transcript}
If \app{makeglossaries} encounters this warning, it will replace any
invalid content (the hyphen, in this case) with the \idx{pagecompositor}
specified in the \ext+{ist} file.

In both of the above examples, using \app{makeglossaries} will help
the document build to complete without the \idxpl{entry}
disappearing from the \idx{glossary}, however the resulting
\idx{numberlist} may look strange. If you are using
\opt{nonumberlist} then this isn't a problem.

If you don't use \app{makeglossaries} but explicitly call
\app{makeindex} then you won't have those corrections, and some or
all of your \idxpl{entry} may be omitted from the \idx{glossary}.
In which case, you will have to adjust the \location\ so that it fits
\app{makeindex}['s] syntax \emph{even if you have
\opt{nonumberlist}}. In the case of the invalid \idx{pagecompositor}
problem, you can simply use \gls{glsSetCompositor} to set the
correct compositor. In the case of \idxpl{emptylocation} you will
need to chose a different \idx{locationcounter}.

Other problems occur with commands that don't fully expand, which results
in \LaTeX\ markup in the \location\ in the \idx{indexingfile}.
For example, if \sty{babel} is used with \optfmt{spanish},
\idx{lowercase} Roman numerals (which may occur in the front matter)
will expand to the internal command \gls{es@scroman}, as in the
following:
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\cbeg{document}
\gls+{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}\comment{problem location}
\gls+{mainmatter}
\gls{chapter}\marg{Sample}
\gls{gls}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
The first instance of \gls{gls} occurs in the front matter on
page~i, which in this case is formatted in faked \idx{smallcaps} with
\gls{es@scroman}. This can be found in the \ext+{glo} file, which
contains:
\begin{codebox}
\cmd{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{page}\sym{dblquote}\gls{glsnumberformat}}\marg{\gls{es@scroman} \marg{i}}
\cmd{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{\ctr{page}}\sym{dblquote}\gls{glsnumberformat}}\marg{1}
\end{codebox}
Each line in the \ext+{glo} file corresponds to a single
\idx{indexing} instance (created with \gls{gls} in this case).

The double-quote (\sym{dblquote}) is \app{makeindex}['s] escape
character (which can be changed with \gls{GlsSetQuote}). It's not
necessary in the above but was added as a by-product of the internal
escaping of special characters (the backslash isn't a special
character for \app{makeindex}, except in the \ext{ist} file, 
but is for \app{xindy}).

The \idx{indexing} data is contained in the arguments of:
\cmddef{glossaryentry}
This isn't a defined command but is simply used as a keyword 
in the \idx{indexingfile}. By default, \app{makeindex} expects
\gls{indexentry}. The custom \ext+{ist} style file created by
\gls{makeglossaries} identifies \gls{glossaryentry} as the keyword:
\begin{compactcodebox}
keyword "\string\\glossaryentry"
\end{compactcodebox}

The syntax for the second argument \meta{location} is as described
in \sectionref{sec:locationsyntax}.
The syntax for the first argument \meta{data} is in the form:
\begin{compactcodebox}
\meta{sort}\sym{questionmark}\meta{text}\sym{pipe}\meta{encap}
\end{compactcodebox}
or for sub-entries:
\begin{compactcodebox}
\meta{parent sort}\sym{questionmark}\meta{parent text}\sym{exclammark}\meta{sort}\sym{questionmark}\meta{text}\sym{pipe}\meta{encap}
\end{compactcodebox}
The question mark (\sym{questionmark}) is the \qt{actual character}
and separates the sort value from the actual text that's written to
the \ext+{gls} file (which is input by \gls{printglossary}).

By default, \app{makeindex} uses \sym{at} as the actual character but
this caused a problem for early versions of \sty{glossaries} where
there was a greater chance of internal commands occurring in the
\ext{glo} file. The custom \ext{ist} file identifies
\sym{questionmark} as the actual character:
\begin{compactcodebox}
actual '?'
\end{compactcodebox}

You may remember from \sectionref{sec:encap} that the
\glsopt{format} option specifies the \idx{encap}, which I claimed
was essentially the same as the \idx{encap} with \gls{index}, but as
can be seen from the above example, that's not strictly speaking
true. The real \idx{encap} has to include \gls{setentrycounter} so
that (if \idxpl{hyperlink} are supported) the appropriate target
name can be constructed.

The way that \app{makeindex} works is that it will write
\begin{compactcodebox}
\sym{bksl}\meta{encap}\margm{location}
\end{compactcodebox}
in the \ext{gls} (or equivalent) file. What \sty{glossaries}
actually needs for the \idxpl{hyperlink} to work is:
\begin{compactcodebox}
\gls{setentrycounter}\oargm{prefix}\margm{counter}\sym{bksl}\meta{cs}\margm{location}
\end{compactcodebox}
where \meta{cs} is the real formatting command name (identified in
the \glsopt{format} option).

So from \app{makeindex}['s] point of view, the real \idx{encap} in
the above example is the literal string:
\begin{compactcodebox}
setentrycounter[]\marg{page}\cmd{glsnumberformat}
\end{compactcodebox}

In the above example, the \location\ has ended up as
\code{\gls{es@scroman}  \marg{i}} which is invalid, as
\app{makeindex} requires the location to consist solely of digits,
Roman numerals or alphabetic, optionally separated by a \idxpl{compositor}.

That means that this example will trigger a message from \app{makeindex}
which will be written to the \ext+{glg} transcript file:
\begin{transcript}
Scanning input file myDoc.glo...
!! Input index error (file = myDoc.glo, line = 1):
   -- Illegal space within numerals in second argument.
.done (1 entries accepted, 1 rejected).
Sorting entries...done (0 comparisons).
Generating output file myDoc.gls....done (6 lines written, 0 warnings).
\end{transcript}
Note that 1 entry has been rejected, but it also shows 0 warnings
and it has a 0 exit code, which means that it won't interrupt the
overall document build.

If you run \app{makeglossaries} instead of running \app{makeindex}
explicitly, then \app{makeglossaries} will search the \ext{glg}
transcript for the \qt{(\meta{n} entries accepted, \meta{m} rejected)}
line, and if \meta{m} is greater than 0 it will attempt to diagnose
and fix the problem.

Messages about the \qt{second argument} (as in \qt{Illegal space
within numerals in second argument}) indicate that the problem is
with the \location, so \app{makeglossaries} will search the
locations for content that matches \code{\cmd{\meta{csname}}
\margm{num}} (with any or no spaces after the command name and
optionally preceded by \gls{protect}). If it
finds a match, it will shift \meta{csname} into the \idx{encap} with
the following message:
\begin{transcript}
Encap/location issue: potential LaTeX commands in location detected. Attempting to remedy.
Reading myDoc.glo...
Invalid location '\gls{es@scroman}  \marg{i}' detected for entry 'sample'. Replaced with 'i'
Writing myDoc.glo...
Retrying
\end{transcript}
The altered \ext{glo} file now contains:
\begin{compactcodebox}
\gls{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{page}\sym{dblquote}\gls{glslocationcstoencap}\marg{glsnumberformat}\marg{es@scroman}}\marg{i}
\gls{glossaryentry}\marg{sample?\gls{glossentry}\marg{sample}|setentrycounter[]\marg{page}\sym{dblquote}\gls{glsnumberformat}}\marg{1}
\end{compactcodebox}
and \app{makeglossaries} will re-run \app{makeindex}.

Following this correction, the \idx{numberlist} for the 
\qt{sample} entry now contains:
\begin{compactcodebox}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\gls{glslocationcstoencap}\marg{\encap{glsnumberformat}}\marg{es@scroman}\marg{i}\gls{delimN}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\gls{glsnumberformat}\marg{1}
\end{compactcodebox}
The corrected \location\ needs to be encapsulated with both the designated
\idx{encap} (\encap{glsnumberformat} in this case) and the
formatting command that needs to be applied to the \location.
This is done via:
\cmddef{glslocationcstoencap}
This is simply defined to do:
\begin{compactcodebox}
\cmd{csuse}\margm{location-csname}\marg{\cmd{csuse}\margm{encap-csname}\margm{location}}
\end{compactcodebox}
This puts the intended \idx{encap} (\encap{glsnumberformat} in this
case) closer to the \location\ to enable it to work better with
\idxpl{hyperlink}, although this may not always work, particularly if
the command with the name \meta{location-csname} expects a numerical argument.

In the above example, the location command is \gls{es@scroman} which is
provided by \styfmt{babel-spanish} and performs fake
\idx{smallcaps}. Internal commands provided by other packages for
their own private use can't be relied upon. So the \sty{glossaries}
package can't assume they will stay the same, and the above example
document may produce a different result with different versions of
\sty{babel}. However, in this case (provided you use
\app{makeglossaries}), the document will correctly end up with 
the \idx{numberlist} \qt{\textsc{i}, 1} for the \qt{sample} entry in
the \idx{glossary}, which matches the document
page numbering. If you use \app{makeindex} explicitly, the
\idx{numberlist} will simply be \qt{1}.

This become more complicated if \sty{hyperref} is added to the
document (before \sty{glossaries}). Now \gls{glsnumberformat} uses
\gls{glshypernumber}, which needs to take into account that its
argument may contain a \idx{range} with the start and end location
separated by \gls{delimR} (the range delimiter), and it needs to
create a separate \idx{hyperlink} for each location component.

Here's a modified example that has an implicit \idx{range} in the front
matter and an explicit \idx{range} in the main matter.
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\cbeg{document}
\gls{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\gls{mainmatter}
\gls{chapter}\marg{Sample}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{hyperbf}}}\marg{sample}
\cmd{newpage}
Some text
\cmd{newpage}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{hyperbf}}}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
This again has problematic \locations, but \app{makeglossaries} can
shift the \gls{es@scroman} into the \idx{encap} as before. The
resulting \ext{gls} file has the following \idx{numberlist} for the
\qt{sample} entry:
\begin{compactcodebox}
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\comment{prefix and counter}
\gls{glslocationcstoencap}\marg{\encap{glsnumberformat}}\marg{es@scroman}\marg{i\gls{delimR} iii}\gls{delimN} 
\gls{setentrycounter}\oarg{}\marg{\ctr{page}}\comment{prefix and counter}
\gls{hyperbf}\marg{1\gls{delimR} 3}
\end{compactcodebox}
Both \idxpl{range} have been compacted so that the \idx{range},
including the \gls{delimR} separator, is in the argument of the
\idx{encap} command.

The default definition of \gls{glslocationcstoencap} means that the
first \idx{range} is formatted according to:
\begin{compactcodebox}
\gls{es@scroman}\marg{\gls{glshypernumber}\marg{i\gls{delimR} iii}}
\end{compactcodebox}
This allows \gls{glshypernumber} to detect the delimiter and split
up the range so that it can apply a separate \idx{hyperlink} to the start and
end locations, so that it effectively becomes:
\begin{compactcodebox}
\gls{es@scroman}\marg{\gls{hyperlink}\margm{target1}\marg{i}\gls{delimR}
\gls{hyperlink}\margm{target2}\marg{iii}}
\end{compactcodebox}
In this type of situation, the most problematic document is one where 
the \meta{location-csname} can't handle \gls{hyperlink} in its argument
and needs to be shifted into the \idx{hyperlink} text. In the above
example document, no actual error occurs, but there are warnings from \pdfTeX:
\begin{transcript}
pdfTeX warning (dest): name\marg{page.iii} has been referenced but does not exist, replaced by a fixed one
[...]
pdfTeX warning (dest): name\marg{page.i} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
This is due to the way that \gls{glshypernumber} forms the target
name. Since the actual target name isn't saved in the
\idx{indexing} data, it has to be reconstituted from available
information: the prefix, the counter and the location.
So the targets become \code{page.i} for location \qt{i} and
\code{page.iii} for location \qt{iii}. This usually works for common
page formats, but it doesn't in this case. Adding \optfmt{debug} to
\sty{hyperref}['s] package options reveals the following information
in the transcript:
\begin{transcript}
Package hyperref Info: Anchor `page.I'
[...]
Package hyperref Info: Anchor `page.II'
\end{transcript}
So the correct anchors are \qt{page.I} and \qt{page.II}.

The \idx{casechange} occurs as a result of the fake \idx{smallcaps},
but since \gls{es@scroman} is outside of \gls{glshypernumber}, the
\idx{casechange} isn't part of the location and so doesn't affect
the anchor name.

I can redefine \gls{glslocationcstoencap} to swap them around:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glslocationcstoencap}}[3]\marg{\cmd{csuse}\marg{\#1}\marg{\cmd{csuse}\marg{\#2}\marg{\#3}}}
\end{codebox}
However, now the transcript shows:
\begin{transcript}
pdfTeX warning (dest): name\marg{page.\string\\protect\string\040\string\\es@scroman\string\040\string\040\marg{i--iii}} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
This is because \gls{es@scroman} doesn't fully expand.

The \gls{glswrglossdisableanchorcmds} hook provides a workaround
for the problematic command:
\begin{codebox*}
\gls{appto}\gls{glswrglossdisableanchorcmds}\marg{\gls{csletcs}\marg{es@scroman}\marg{text\_uppercase:n}}
\end{codebox*}
This will cause \gls{es@scroman} to be locally redefined to just
convert its argument to \idx*{uppercase} while the anchor is being
constructed. Unfortunately this patch is only partially successful
as the transcript now has:
\begin{transcript}
pdfTeX warning (dest): name\marg{page.I\longswitch III} has been referenced but does not exist, replaced by a fixed one
\end{transcript}
The problem now is that \gls{glshypernumber} can't split on the
\idx{range} delimiter, so the location is now \qt{I\longswitch III}.

If the \idx{numberlist} doesn't contain any \idxpl{range}, then the
above redefinition of \gls{glslocationcstoencap} and the addition to
\gls{glswrglossdisableanchorcmds} will fix the \idx{hyperlink}.

Instead of redefining \gls{glslocationcstoencap} and altering
\gls{glswrglossdisableanchorcmds}, a solution that works with
\idxpl{range} can be achieved by redefining
\gls{glswrglosslocationtarget} to convert its argument to
\idx{uppercase}. You can do this with:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glswrglosslocationtarget}}[1]\marg{\gls{glsuppercase}\marg{\#1}}
\end{codebox}

This will successfully construct the anchor names \code{page.I} and
\code{page.III}. It won't affect the anchors for the main matter as
digits aren't affected by the \casechanging\ command.

If you're not using \app{makeglossaries} and are either calling
\app{makeindex} explicitly or via \app{makeglossaries-lite} or
with the \opt{automake} option, then you will need to find another
way of converting problematic \location\ into a form that won't be
discarded by \app{makeindex}. This is quite difficult if the
problematic content is inside \gls{thepage} since its delayed
expansion means that any attempt at locally changing the problematic
within \gls{glswrglossdisablelocationcmds} will be lost.

The earlier example can be rewritten to (sort of!) work without
\app{makeglossaries}:
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\codepar
\cmd{newcommand}\marg{\cmd{locthepage}}\marg{\gls{Roman}\marg{\ctr{page}}}
\cmd{newcommand}\marg{\cmd{delayedlocthepage}}\marg{\cmd{expandonce}\marg{\cmd{locthepage}}}
\cmd{appto}\gls{glswrglossdisablelocationcmds}\marg{\cmd{let}\gls{thepage}\cmd{delayedlocthepage}}
\codepar
\cbeg{document}
\gls{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\gls{mainmatter}
\cmd{renewcommand}\marg{\cmd{locthepage}}\marg{\gls{arabic}\marg{\ctr{page}}}
\gls{chapter}\marg{Sample}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{hyperbf}}}\marg{sample}
\cmd{newpage}
Some text
\cmd{newpage}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{hyperbf}}}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
Note that the custom \csfmt{locthepage} command needs to be
redefined after the page numbering changes at the start of the main
matter.

This ensures that the locations are valid in the \ext{glo} file, so
\app{makeindex} will process it without losing any rejecting any
entry lines. The hyperlink targets will also be correct. The only
problem now is that the front matter \locations\ will be in
\idx{uppercase} in the \idx{glossary}.

The above problems are all due to \app{makeindex} having a
restrictive location syntax. With \app{xindy}, you can define
location classes for custom \locations. Unfortunately, the backslash
\sym{bksl} is a special character for \app{xindy} that indicates an
escape sequence that indicates the next character should be
interpreted literally, which means that any \LaTeX\ commands that end up
in the \app{xindy} \idx{indexingfile} must have their initial
backslash escaped. This is quite tricky to do given the delayed
expansion of \gls{thepage}. If it's expanded early in order to
pre-process it then the page number could end up being incorrect.

The sample file \samplefile{xdy} provides a custom page format that
uses a robust command called \csfmt{tallynum}, which ends up in the
\ext{glo} file. With the default \optval{esclocations}{false}
setting, the location for the first page is written to the file as:
\begin{compactcodebox}
:locref "\marg{}\marg{\cmd{tallynum} \marg{1}}"
\end{compactcodebox}
This results in the following message from \app{xindy}:
\begin{transcript}
WARNING: location-reference "\marg{}\marg{tallynum \marg{1}}" did not match any location-class! (ignored)
\end{transcript}
Note that the backslash has gone from the start of \code{tallynum}.
As with \app{makeindex}, invalid \locations\ are dropped.

If you use \app{makeglossaries} rather than running \app{xindy}
directly, \app{makeglossaries} will detect the warning and provide
some diagnostic information:
\begin{transcript}
You may have forgotten to add a location 
class with \gls{GlsAddXdyLocation} or you may have 
the format incorrect or you may need 
the package option \optval{esclocations}{true}.
\end{transcript}
In this case, you need to use the package option
\optval{esclocations}{true}. This will use a hack to provide a way
to escape the backslash without prematurely expanding the actual
value of the \ctr{page} counter. As this is a hack, it may not work
and can result in obscure error messages.

Returning to the earlier \styfmt{babel-spanish} example, if it's
converted to use \app{xindy} instead of \app{makeindex}, a similar
problem arises. For example, simply adding the \opt{xindy} package
option:
\begin{codebox}
\cmd{documentclass}\marg{book}
\cmd{usepackage}[T1]\marg{fontenc}
\cmd{usepackage}[spanish]\marg{babel}
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\strong{\opt{xindy}}]\marg{glossaries}
\gls{makeglossaries}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},\gloskeyval{description}{un ejemplo}}
\cbeg{document}
\gls{frontmatter}
\gls{chapter}\marg{Foreword}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\cmd{newpage}
\gls{gls}\marg{sample}
\gls{mainmatter}
\gls{chapter}\marg{Sample}
\gls{gls}\oarg{\glsoptval{format}{\sym{startrange}\encap{hyperbf}}}\marg{sample}
\cmd{newpage}
Some text
\cmd{newpage}
\gls{gls}\oarg{\glsoptval{format}{\sym{endrange}\encap{hyperbf}}}\marg{sample}
\gls{printglossaries}
\cend{document}
\end{codebox}
The \ext{glo} file now contains locations with \gls{es@scroman}, but
as with the \csfmt{tallynum} example, the leading backslash hasn't
been escaped:
\begin{compactcodebox}
:locref "\marg{}\marg{\gls{es@scroman}  \marg{i}}"
\end{compactcodebox}
This needs \optval{esclocations}{true} to escape the backslash.
\begin{codebox}
\cmd{usepackage}[\opt{xindy},\strong{\opt{esclocations}}]\marg{glossaries}
\end{codebox}
Note that this produces a different result in the \ext{glo} file:
\begin{compactcodebox}
:locref "\marg{}\marg{\string\\protect \string\\es@scroman  \marg{i}}"
\end{compactcodebox}
This results from the partial protected expansion used on \gls{thepage}
before the special characters are escaped.
If you inspect the \ext+{xdy} file created by \gls{makeglossaries},
you should find the following:
\begin{compactcodebox}
(define-location-class "roman-page-numbers"
   ( :sep "\marg{}\marg{"  :sep "\gls{protect} \gls{es@scroman} \marg{" "roman-numbers-lowercase" :sep "}" :sep "}" )
   :min-range-length 2
)
\end{compactcodebox}
This is because the non-default behaviour of \gls{roman} has been
detected and a custom location class has automatically been supplied.
(Whereas with the \samplefile{xdy} sample file, it was necessary to
provide the custom class to support \csfmt{tallynum} with \gls{GlsAddXdyLocation}.)

\section{Iterating Over Locations}
\label{sec:numberlistloop}

\begin{important}
Not available with \options{mkidx,xdy}. The commands described here
rely on the \locations\ being stored in the \glosfield{loclist} internal field
in an \sty{etoolbox} internal list format, which is what happens
with \option{noidx}.
\end{important}

The \gls{printnoidxglossary} command displays the \idx{locationlist}
using:
\cmddef{glsnoidxloclist}
where \meta{list cs} is a temporary command that contains the 
value of the \glosfield{loclist} field. This uses \gls{forlistloop} to iterate
over all the \locations\ in the list with the handler macro:
\cmddef{glsnoidxloclisthandler}
This keeps track of the previous element in the list to determine whether or
not to insert the \gls{delimN} separator. Note that it doesn't attempt to
determine whether or not any of the locations are \idxpl{range}.

\begin{xtr}
The \gls{printunsrtglossary} command will also use \gls{glsnoidxloclist} if the
\glosfield{loclist} field has been set but the \gloskey{location}
field hasn't, but in general it's better to instruct \app{bib2gls}
to save the formatted \idx{locationlist} (which is the default).
\end{xtr}

You can iterate over an entry's \glosfield{loclist} field using:
\cmddef{glsnumberlistloop}
where \meta{entry-label} is the entry's label and \meta{handler cs} is a
handler control sequence with the syntax:
\begin{compactcodebox}
\meta{handler cs}\margm{prefix}\margm{counter}\margm{format}\margm{location}
\end{compactcodebox}
where \meta{prefix} is the hypertarget prefix, \meta{counter} is
the name of the \idx{locationcounter}, \meta{format} is the
\idx{locationencap} (for example, \encap{textbf})
and \meta{location} is the \location.

The third argument \meta{xr handler cs} is the control sequence that
will be applied to any cross-references in the list. This handler
should have the syntax:
\begin{compactcodebox}
\meta{xr handler cs}\oargm{tag}\margm{xr list}\margm{empty}
\end{compactcodebox}
where \meta{tag} is the cross-referenced textual tag (for example, \qt{see}) and
\meta{xr list} is a~comma-separated list of \idx{entry} labels. The final
argument \meta{empty} will always be empty, but it allows for
\gls{glsseeformat} to be used as the handler.

\begin{bib2gls}
This method is designed for \option{noidx}, but \app{bib2gls} also
saves individual \locations\ in the \glosfield{loclist} field (in
addition to the formatted \idx{locationlist} which is stored in the
\gloskey{location} field).
However, the format for each item in the internal list varies
depending on whether \optval{record}{only} or
\optval{record}{nameref} was used. See the \sty{glossaries-extra}
manual for further details.
\end{bib2gls}

For example, if on page~12 I~have:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\encap{textbf}}}\marg{apple}
\end{codebox}
and on page~18 I~have:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{emph}}\marg{apple}
\end{codebox}
then
\begin{codebox}
\gls{glsnumberlistloop}\marg{apple}\marg{\cmd{myhandler}}
\end{codebox}
will be equivalent to:
\begin{codebox}
\cmd{myhandler}\marg{}\marg{\ctr{page}}\marg{\encap{textbf}}\marg{12}\comment{}
\cmd{myhandler}\marg{}\marg{\ctr{page}}\marg{\encap{emph}}\marg{18}\comment{}
\end{codebox}
There is a predefined handler that's used to display the
\idx{numberlist} in \gls{printnoidxglossary}:
\cmddef{glsnoidxdisplayloc}
This simply does:
\begin{compactcodebox}
\gls{setentrycounter}\oargm{prefix}\margm{counter}\comment{}
\cmd{csuse}\margm{format}\margm{location}
\end{compactcodebox}
which sets up the \idx{hyperlink} information needed for
\gls{glshypernumber} (in case it's required by the \idx{encap})
and encapsulates the \location, with the provided formatting
command.

Internally, \gls{glsnumberlistloop} uses \sty{etoolbox}['s]
\gls{forlistloop} with the handler:
\cmddef{glsnoidxnumberlistloophandler}
The default behaviour is simply to do its argument, which (for
\option{noidx}) will be in the form:
\begin{compactcodebox}
\gls{glsnoidxdisplayloc}\margm{prefix}\margm{counter}\margm{format}\margm{location}
\end{compactcodebox}
The \gls{glsnumberlistloop} works by temporarily redefining \gls{glsnoidxdisplayloc}
to \meta{handler} and \gls{glsseeformat} to \meta{xr handler cs}.

\begin{xtr}
With \sty{glossaries-extra}, you can use the more general purpose
\gls{glsxtrfieldforlistloop} and provide your own handler that can
be customized to suit \optval{record}{only} or
\optval{record}{nameref}.
\end{xtr}

\chapter{Glossary Styles}
\label{sec:styles}

The markup used in the \idx{glossary} is described in
\sectionref{sec:glossmarkup}. \sectionref{sec:newglossarystyle}
describes how to define a new \idx{glossarystyle}.
Commands that may be used in styles, but should not be redefined by
styles, are described in \sectionsref{sec:glossarycmds,sec:hypernav}.  The
commands that should be redefined by the \idx{glossarystyle} are
described in \sectionref{sec:glossarystylecmds}.

\Idxpl{glossarystyle} typically use \gls{glossentryname} to display
the \idx{entry}['s] name, but some may use the \idx{sentencecase} version 
\gls{Glossentryname} instead. Both encapsulate the name with:
\cmddef{glsnamefont}
which takes one argument: the entry name (obtained with
\gls{glsentryname} or \gls{Glsentryname}).

By default, \gls{glsnamefont} simply displays its argument in
whatever the surrounding font happens to be, but bear in mind that
the \idx{glossarystyle} may switch the font.

\begin{xtr}
With \sty{glossaries-extra} the \catattr{glossnamefont} and
\catattr{glossname} \idxpl{categoryattribute} can be used to adjust
font and, for \gls{glossentryname} only, \casechanging.
\end{xtr}

For example, the \glostyle{tree} style displays the name as follows:
\begin{compactcodebox}
\gls{glstreenamefmt}\marg{\gls{glstarget}\margm{entry-label}\marg{\gls{glossentryname}\margm{entry-label}}}
\end{compactcodebox}
which is essentially (ignoring the \idx{hyperlink} target):
\begin{compactcodebox}
\gls{glstreenamefmt}\marg{\gls{glsnamefont}\marg{\gls{glsentryname}\margm{entry-label}}}
\end{compactcodebox}
Since \gls{glstreenamefmt} is defined to display its argument in
bold, the name will end up in bold unless \gls{glsnamefont} is
redefined to change it.

The \glostyle{list} style displays the name in the option argument
of \gls{item}:
\begin{compactcodebox}
\gls{item}\oarg{\gls{glsentryitem}\margm{entry-label}\gls{glstarget}\margm{entry-label}\marg{\gls{glossentryname}\margm{entry-label}}}
\end{compactcodebox}
which is essentially (ignoring the \glslink{opt.entrycounter}{entry
counter} and \idx{hyperlink} target):
\begin{compactcodebox}[before upper app=\small]
\gls{item}\oarg{\gls{glsnamefont}\marg{\gls{glsentryname}\margm{entry-label}}}
\end{compactcodebox}
This occurs within the \env{description} environment, which by
default uses bold for the item text. However, this may be changed by
various classes or packages. So the name may end up in bold or may
be in some other font, such as sans-serif.

The \glostyle{long} style displays the name in the first column of a
\env{longtable}:
\begin{compactcodebox*}
\gls{glsentryitem}\margm{entry-label}\comment{}
\gls{glstarget}\margm{entry-label}\marg{\gls{glossentryname}\margm{entry-label}} \idx{amp}
\end{compactcodebox*}
So the only font change will come from \gls{glsnamefont}, which
doesn't apply any change by default.

\Idxpl{glossarystyle} will typically display the description with
\gls{glossentrydesc} but may not show the symbol. If the symbol is
shown, it should be displayed with \gls{glossentrysymbol}.

There's no analogous font command for the description or symbol, but
the \sty{glossaries-extra} package provides the
\catattr{glossdescfont} and \catattr{glosssymbolfont} 
\idxc{categoryattribute}{attributes} to
change the font according to the \idx{entry}['s] category.

Some styles may supply their own helper commands (such as \gls{glstreenamefmt})
to make it easier to adjust the formatting without having to define
a new \idx{glossarystyle}.

\begin{example}{Changing the Font Used to Display Entry Names in the
Glossary}{ex:glsnamefont}
Suppose you want all the \idx{entry} names to appear in 
medium weight small caps in your \idxpl{glossary}, disregarding the
\idx{glossarystyle}, then you can do:
\begin{codebox}[before upper app=\small]
\cmd{renewcommand}\marg{\gls{glsnamefont}}[1]\marg{\gls{textsc}\marg{\cmd{mdseries} \#1}}
\end{codebox}
\end{example}

\begin{xtr}
The \sty{glossaries-extra-stylemods} package provides additional hooks that
can be used to make other minor adjustments.
\end{xtr}

Some styles support \idxpl{group}. These may simply insert a
vertical gap between groups, but some may also include
a heading with the \idx{group} title. The base \sty{glossaries}
package only has a simple mechanism for obtaining the title from the
\idx{group} label via \gls{glsgetgrouptitle}, which will test if
\gls{group-labelgroupname} exists where the \meta{group-label}
is \code{glssymbols}, \code{glsnumbers} or a single character.

\begin{xtr}
The \sty{glossaries-extra} package has commands \gls{glsxtrsetgrouptitle}
and \gls{glsxtrlocalsetgrouptitle} to set the \idx{group} title,
which take precedence over \gls{group-labelgroupname}. 
\end{xtr}


\section{Predefined Styles}
\label{sec:predefinedstyles}

The predefined styles can accommodate numbered \toplevel\ 
and \hierlevel{1} entries. See the
package options \opt{entrycounter}, \opt{counterwithin} and
\opt{subentrycounter} described in
\sectionref{sec:pkgopts-printglos}. There is a summary
of available styles in \tableref{tab:styles}. 
The most flexible style is the \glostyle{tree*} style or (for a
multi-column glossary) the \glostyle{mcoltree*} style (which mostly
just encapsulates the \glostyle{tree*} style in a \env{multicols}
environment.)
You can view samples of all the predefined styles at
\galleryurl{glossaries-styles/}.

Note that \sty{glossaries-extra} provides additional styles
in the supplementary packages \sty{glossary-bookindex},
\sty{glossary-topic} and \sty{glossary-longextra}. See the
\sty{glossaries-extra} manual for further details.

\begin{important}
Note that the \idx{group} styles (such as \glostyle{listgroup}) will
have unexpected results if used with the \opteqvalref{sort}{def}
or \opteqvalref{sort}{use} options. If you don't sort your entries
alphabetically, it's best to set the \opt{nogroupskip}
package option to prevent odd vertical gaps appearing.
\end{important}

The \idx{group} title is obtained using
\code{\gls{glsgetgrouptitle}\margm{label}},
which is described in \sectionref{sec:newglossarystyle}.

\begin{table}[htbp]
\caption[Glossary Styles]{Glossary Styles. A question mark in the style 
name indicates anything that matches that doesn't match any
previously listed style (for example, \code{long3col?}
matches \glostyle{long3col}, \glostyle{long3colheader}, 
\glostyle{long3colborder} and \glostyle{long3colheaderborder}).
A maximum level of 0 indicates a flat glossary (sub-entries
are displayed in the same way as main entries). Where the maximum
level is given as \unlimited\ there is no limit, but note that 
\app{makeindex} (\option{mkidx}) imposes a limit of 2 sub-levels. If the
\idx{homograph} column is checked, then the name is not displayed for
sub-entries. If the symbol column is checked, then the symbol will
be displayed.}
\label{tab:styles}
\centering
\begin{tabular}{lccc}
\bfseries Style & \bfseries Maximum Level &
\bfseries Homograph & \bfseries Symbol\\
\glostyle{listdotted} & 0 & & \\
\glostyle{sublistdotted} & 1 & & \\
\code{list?} & 1 & \yes & \\
\code{altlist?} & 1 & \yes & \\
\code{long?3col?} & 1 & \yes & \\
\code{long4col?} & 1 & \yes & \yes \\
\code{altlong?4col?} & 1 & \yes & \yes \\
\code{long?} & 1 & \yes & \\
\code{super?3col?} & 1 & \yes & \\
\code{super4col?} & 1 & \yes & \yes \\
\code{altsuper?4col?} & 1 & \yes & \yes \\
\code{super?} & 1 & \yes & \\
\code{?index?} & 2 & & \yes\\
\glostyle{tree*} & \unlimited & configurable & configurable\\
\glostyle{mcoltree*} & \unlimited & configurable & configurable\\
\code{treenoname?} & \unlimited & \yes & \yes\\
\code{?alttree?} & \unlimited & & \yes\\
\code{?tree?} & \unlimited & & \yes\\
\glostyle{inline} & 1 & \yes &  
\end{tabular}
\par
\end{table}

The tabular-like styles that allow multi-line descriptions and 
\idxpl{numberlist} use the length:
\cmddef{glsdescwidth}
to set the width of the description column and the length
\cmddef{glspagelistwidth} 
to set the width of the \idx{numberlist} column.

\begin{information}
These lengths will not be available if you use both the \opt{nolong}
and \opt{nosuper} package options or if you use the \opt{nostyles}
package option unless you explicitly load the relevant package.
\end{information}

These will need to be changed using \cmd{setlength} if the
\idx{glossary} is too wide. Note that the \glostyle{long4col} and
\glostyle{super4col} styles (and their header and border variations)
don't use these lengths as they are designed for single line
\idxpl{entry}. Instead you should use the analogous \glostyle{altlong4col}
and \glostyle{altsuper4col} styles.  If you need to
explicitly create a line-break within a multi-line description in
a tabular-like style it's better to use \gls{newline} instead of
\gls{cs.bsl} (but consider using a ragged style with narrow columns).

\begin{important}
Remember that a cell within a tabular-like environment can't
be broken across a page, so even if a tabular-like style, such as
\glostyle{long}, allows multilined descriptions, you'll probably encounter
page-breaking problems if you have entries with long descriptions.
You may want to consider using the \glostyle{alttree} style instead.
\end{important}

Note that if you use the \printglossopt{style} key in the
optional argument to \gls{print...glossary}, it will override any 
previous style settings for the given \idx{glossary}, so if, for example,
you do
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{no effect}
\gls{printglossary}\oarg{\printglossoptval{style}{\glostyle{long}}}
\end{codebox}
then the new definition of \gls{glsgroupskip} will not have an affect
for this \idx{glossary}, as \gls{glsgroupskip} is redefined by 
\printglossoptval{style}{\glostyle{long}}. Likewise, \gls{setglossarystyle} will also
override any previous style definitions, so, again
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}{}\comment{no effect}
\gls{setglossarystyle}\marg{\glostyle{long}}
\end{codebox}
will reset \gls{glsgroupskip} back to its default definition for the
named \idx{glossarystyle} (\glostyle{long} in this case). If you want to 
modify the styles, either use \gls{newglossarystyle} (described
in the next section) or make the modifications after 
\gls{setglossarystyle}. For example:
\begin{codebox}
\gls{setglossarystyle}\marg{\glostyle{long}}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}
\end{codebox}
In this case, it's better to use \opt{nogroupskip} to suppress the
gap between groups for the default styles instead of redefining
\gls{glsgroupskip}.

All the styles except for the three- and four-column styles and the
\glostyle{listdotted} style use the \idx{postdeschook}:
\cmddef{glspostdescription}
after the description. This simply displays a \idx+{fullstop} by default.
To eliminate this \idx{fullstop} (or replace it with something else, say,
a comma) you will need to redefine \gls{glspostdescription} before
the \idx{glossary} is displayed. Alternatively, you can suppress it for a
given entry by placing \gls{nopostdesc} in the entry's description.
Note that \gls{longnewglossaryentry} puts \gls{nopostdesc} at the end
of the description. The \sty{glossaries-extra} package provides a
starred version that doesn't.

Alternatively, you can use the package option \opt{nopostdot} to
suppress this \idx{fullstop}.  This is implemented by default with
\sty{glossaries-extra}.  You can switch it back on with
\optval{nopostdot}{false} or \optval{postdot} or you can use
\opt{postpunc} for a different punctuation character.

\begin{xtr}
The \sty{glossaries-extra-stylemods} package provides some
adjustments to some of the predefined styles listed here, allowing
for greater flexibility. See the \sty{glossaries-extra}
documentation for further details.
\end{xtr}

\subsection{List Styles}
\label{sec:liststyles}

\pkgdef*{glossary-list}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-list}. Since they all use the \env{description}
environment, they are governed by the same parameters as that
environment. These styles all ignore the \idx{entry}['s]
\gloskey{symbol}.  Note that these styles will automatically be
available unless you use the \opt{nolist} or \opt{nostyles}
package options.

\begin{important}
Note that, except for the \glostyle{listdotted} style, these 
list styles are incompatible with \sty{classicthesis}. They
may also be incompatible with other classes or packages that
modify the \env{description} environment.
\end{important}

There is an initialisation hook that provides a patch
if the \sty{gettitlestring} package is loaded, since this is used by
\sty{hyperref}.
\cmddef{glslistinit}
Note that this automatically implements:
\begin{codebox*}
\gls{GetTitleStringSetup}\marg{expand}
\end{codebox*}
This patch should ensure that the combination of \sty{hyperref} and
\opt{entrycounter} will correctly expand the \idx{entry} name to the
\ext{aux} file. The name is expanded using:
\cmddef{glslistexpandedname}
This uses \gls{glsunexpandedfieldvalue}. If you need the name to
fully expand, you can redefine this. For example:
\begin{codebox}[before upper app=\small]
\cmd{renewcommand}\marg{\gls{glslistexpandedname}}[1]\marg{\gls{glsentryname}\marg{\#1}}
\end{codebox}

If \optval{nogroupskip}{false}, the \gls{glsgroupskip} command creates
a vertical space using:
\cmddef{indexspace}
This command is defined by some other packages, so it's only defined
by \sty{glossary-list} if it hasn't already been defined.

For the styles that should \idx{group} headings, the group title is
encapsulated with:
\cmddef{glslistgroupheaderfmt}
This simply does its argument by default, but it occurs inside the
optional argument of \gls{item} so may appear bold from the item
font change.

For the styles that have a navigation line, the line is
formatted according to:
\cmddef{glslistnavigationitem}
This puts its argument inside the optional argument of \gls{item},
which can cause a problem if the navigation line is too long, in
which case you will need to redefine \gls{glslistnavigationitem}. For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslistnavigationitem}}[1]\marg{\gls{item} \gls{textbf}\marg{\#1}}
\end{codebox}
You may prefer to use the tree-like styles, such as
\glostyle{treehypergroup} instead.

\glostyledef{list}
The \glostyle{list} style uses the \env{description}
environment. The \idx{entry} name is placed in the optional argument of
the \gls{item} command (so it will usually appear in bold by default). The
description follows, and then the associated \idx{numberlist} for 
that entry. The symbol is ignored.  If the entry has child entries,
the description and number list follows (but not the name) for each
child entry.  Groups are separated using \gls{indexspace} with the
default \optval{nogroupskip}{true}.

The closest matching non-list style is the \glostyle{index} style.

\glostyledef{listgroup}
The \glostyle{listgroup} style is like \glostyle{list} but the
\idxpl{group} have headings obtained using \gls{glsgetgrouptitle},
which is described in \sectionref{sec:newglossarystyle}.

\glostyledef{listhypergroup}
The \glostyle{listhypergroup} style is like
\glostyle{listgroup} but has a navigation line at the start of the
\idx{glossary} with links to each \idx{group} that is present in the
glossary, which is displayed in the glossary header with
\gls{glslistnavigationitem}.
This requires an additional run through \LaTeX\ to ensure the \idx{group}
information is up to date. Within the navigation line, each
\idx{group} item is separated by \gls{glshypernavsep}.

\glostyledef{altlist}
The \glostyle{altlist} style is like \glostyle{list}
but the description starts on the line following the name. (As
with the \glostyle{list} style, the symbol is ignored.) Each child
entry starts a new line, but as with the \glostyle{list} style,
the name associated with each child entry is ignored.

The closest matching non-list style is the \glostyle{index}
style with the following adjustment:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstreepredesc}}\marg{\comment{}
 \gls{glstreeitem}\cmd{parindent}\cmd{hangindent}}
\end{codebox}

\glostyledef{altlistgroup}
The \glostyle{altlistgroup} style is like 
\glostyle{altlist} but the glossary \idxpl{group} have headings.

\glostyledef{altlisthypergroup}
The \glostyle{altlisthypergroup} style is like 
\glostyle{altlistgroup} but has a set of links to the glossary 
\idxpl{group}. The navigation line is the same as that for 
\glostyle{listhypergroup}, described above.

\glostyledef{listdotted}
This style uses the \env{description}
environment.\footnote{This style was supplied by Axel~Menzel.} Each
entry starts with \code{\gls{item}\oarg{}}, followed by the name followed by a
dotted line, followed by the description. Note that this style
ignores both the \idx{numberlist} and the symbol. The length
\cmddef{glslistdottedwidth}
governs where the description should start. This is a flat style, so
child entries are formatted in the same way as the parent entries.

A non-list alternative is to use the \glostyle{index} style with
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstreepredesc}}\marg{\cmd{dotfill}}
\cmd{renewcommand}\marg{\gls{glstreechildpredesc}}\marg{\cmd{dotfill}}
\end{codebox}
Note that this doesn't use \gls{glslistdottedwidth} and causes
the description to be flush-right and will display the
symbol, if provided. (It also doesn't suppress
the \idx{numberlist}, but that can be achieved with the
\opt{nonumberlist} option.)

\glostyledef{sublistdotted}
This is a variation on the \glostyle{listdotted}
style designed for \hierarchical\ glossaries. The main entries
have just the name displayed. The sub entries are displayed in
the same manner as \glostyle{listdotted}. Unlike the
\glostyle{listdotted} style, this style is incompatible with
\sty{classicthesis}.

\subsection{Longtable Styles}
\label{sec:longstyles}

\pkgdef*{glossary-long}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-long}. Since they all use the \env{longtable}
environment, they are governed by the same parameters as that
environment.  Note that these styles will automatically be available
unless you use the \opt{nolong} or \opt{nostyles} package
options.  These styles fully justify the description and 
\idx{numberlist} columns.  If you want ragged right formatting instead, use the
analogous styles described in \sectionref{sec:longraggedstyles}.
If you want to incorporate rules from the \sty{booktabs} package,
try the styles described in \sectionref{sec:longbooktabsstyles}.

\Idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\gls{setglossarystyle}\marg{\glostyle{long}}
\end{codebox}
Both may be combined in the same option list. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip},\optval{style}{\glostyle{long}}]\marg{glossaries}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{longragged}}}
\end{codebox}
The following doesn't work:
\begin{compactcodebox}
\gls{setglossarystyle}\marg{\glostyle{long}}
\gls{printglossary}\oarg{\printglossopt{nogroupskip}}\comment{too late}
\end{compactcodebox}
This is because the \gls{ifglsnogroupskip} conditional needs to be
outside of \gls{glsgroupskip} with tabular-like styles, so the
conditional is in the style definition to determine the appropriate
definition of \gls{glsgroupskip}.

\begin{xtr}
There are additional styles that use the \env{longtable} environment
provided with the \sty{glossary-longextra} package, but that
requires \sty{glossaries-extra}.
\end{xtr}

\glostyledef{long}

The \glostyle{long} style uses the \env{longtable}
environment (defined by the \sty{longtable} package). It has two
columns: the first column contains the \idx{entry}['s] name and the second
column contains the description followed by the \idx{numberlist}.
The entry's symbol is ignored.  The width of the
first column is governed by the widest entry in that column. The
width of the second column is governed by the length
\gls{glsdescwidth}. Child entries have a similar format to the
parent entries except that their name is suppressed.

\glostyledef{longborder}

The \glostyle{longborder} style is like
\glostyle{long} but has horizontal and vertical lines around it.

\glostyledef{longheader}

The \glostyle{longheader} style is like \glostyle{long} but has a header row.
You may prefer the \glostyle{long-booktabs} style instead.

\glostyledef{longheaderborder}

The \glostyle{longheaderborder} style is like \glostyle{longheader}
but has horizontal and vertical lines around it.  The
\glostyle{long-booktabs} style is generally better.

\glostyledef{long3col}

The \glostyle{long3col} style is like
\glostyle{long} but has three columns. The first column contains
the entry's name, the second column contains the description
and the third column contains the \idx{numberlist}.
The entry's symbol is ignored. The width of the
first column is governed by the widest entry in that column, the
width of the second column is governed by the length
\gls{glsdescwidth}, and the width of the third column is governed by the
length \gls{glspagelistwidth}.

\glostyledef{long3colborder}

The \glostyle{long3colborder} style is like
the \glostyle{long3col} style but has horizontal and vertical
lines around it.

\glostyledef{long3colheader}

The \glostyle{long3colheader} style is like
\glostyle{long3col} but has a header row.
You may prefer the \glostyle{long3col-booktabs} style instead.

\glostyledef{long3colheaderborder}

The \glostyle{long3colheaderborder} style is like
\glostyle{long3colheader} but has horizontal and vertical lines
around it.  The
\glostyle{long3col-booktabs} style is generally better.

\glostyledef{long4col}

The \glostyle{long4col} style is like \glostyle{long3col} but has an
additional column in which the entry's associated symbol appears.
This style is used for brief single line descriptions. The column
widths are governed by the widest entry in the given column. Use
\glostyle{altlong4col} for multi-line descriptions.

\glostyledef{long4colborder}

The \glostyle{long4colborder} style is like the \glostyle{long4col}
style but has horizontal and vertical lines around it.

\glostyledef{long4colheader}

The \glostyle{long4colheader} style is like
\glostyle{long4col} but has a header row.
You may prefer the \glostyle{long4col-booktabs} style instead.

\glostyledef{long4colheaderborder}

The \glostyle{long4colheaderborder} style is like
\glostyle{long4colheader} but has horizontal and vertical lines
around it.

\glostyledef{altlong4col}

The \glostyle{altlong4col} style is like \glostyle{long4col} but
allows multi-line descriptions and \idxpl{numberlist}.  The width of the
description column is governed by the length \gls{glsdescwidth} and
the width of the \idx{numberlist} column is governed by the length
\gls{glspagelistwidth}. The widths of the name and symbol columns
are governed by the widest entry in the given column.

\glostyledef{altlong4colborder}

The \glostyle{altlong4colborder} style is like
the \glostyle{long4colborder} but allows multi-line descriptions and
\idxpl{numberlist}.

\glostyledef{altlong4colheader}

The \glostyle{altlong4colheader} style is like
\glostyle{long4colheader} but allows multi-line descriptions and
\idxpl{numberlist}.
You may prefer the \glostyle{altlong4col-booktabs} style instead.

\glostyledef{altlong4colheaderborder}

The \glostyle{altlong4colheaderborder} 
style is like \glostyle{long4colheaderborder} but allows multi-line
descriptions and \idxpl{numberlist}.

\subsection{Longtable Styles (Ragged Right)}
\label{sec:longraggedstyles}

\pkgdef*{glossary-longragged}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-longragged}. These styles are analogous to those
defined in \sty{glossary-long} but the multiline columns are left
justified instead of fully justified. Since these styles all use the
\env{longtable} environment, they are governed by the same
parameters as that environment. The \sty{glossary-longragged}
package additionally requires the \sty{array} package.  Note that
these styles will only be available if you explicitly load
\sty{glossary-longragged}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-longragged}
\gls{setglossarystyle}\marg{\glostyle{longragged3col}}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \styfmt{glossaries} package has been loaded.
If you want to incorporate rules from the \sty{booktabs} package,
try the styles described in \sectionref{sec:longbooktabsstyles}.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{longragged3col}},\optval{stylemods}{longragged}]\marg{glossaries-extra}
\end{codebox}

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-longragged}
\gls{setglossarystyle}\marg{\glostyle{longragged}}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{longragged}}}
\end{codebox}

\glostyledef{longragged}

The \glostyle{longragged} style has two columns: the first column
contains the \idx{entry}['s] name and the second column contains the
(left-justified) description followed by the \idx{numberlist}.  The
entry's symbol is ignored. The width of the first column is governed
by the widest entry in that column. The width of the second column
is governed by the length \gls{glsdescwidth}. Child entries have a
similar format to the parent entries except that their name is
suppressed.

\glostyledef{longraggedborder}

The \glostyle{longraggedborder} style is like \glostyle{longragged}
but has horizontal and vertical lines around it.

\glostyledef{longraggedheader}

The \glostyle{longraggedheader} style is like
\glostyle{longragged} but has a header row.
You may prefer the \glostyle{longragged-booktabs} style instead.

\glostyledef{longraggedheaderborder}

The \glostyle{longraggedheaderborder} style is like
\glostyle{longraggedheader} but has horizontal and vertical lines
around it.

\glostyledef{longragged3col}

The \glostyle{longragged3col} style is like \glostyle{longragged}
but has three columns. The first column contains the entry's name,
the second column contains the (left justified) description and the
third column contains the (left justified) \idx{numberlist}.  The
entry's symbol is ignored. The width of the first column is governed
by the widest entry in that column, the width of the second column
is governed by the length \gls{glsdescwidth}, and the width of the
third column is governed by the length \gls{glspagelistwidth}.

\glostyledef{longragged3colborder}

The \glostyle{longragged3colborder} style is like the
\glostyle{longragged3col} style but has horizontal and vertical
lines around it.

\glostyledef{longragged3colheader}

The \glostyle{longragged3colheader} style is like
\glostyle{longragged3col} but has a header row.
You may prefer the \glostyle{longragged3col-booktabs} style instead.

\glostyledef{longragged3colheaderborder}

The \glostyle{longragged3colheaderborder} style is
like \glostyle{longragged3colheader} but has horizontal and vertical lines
around it.

\glostyledef{altlongragged4col}

The \glostyle{altlongragged4col} style is like
\glostyle{longragged3col} but has an additional column in which the
entry's associated symbol appears. The width of the description
column is governed by the length \gls{glsdescwidth} and the width of
the \idx{numberlist} column is governed by the length
\gls{glspagelistwidth}. The widths of the name and symbol columns
are governed by the widest entry in the given column.

\glostyledef{altlongragged4colborder}

The \glostyle{altlongragged4colborder} style is like the
\glostyle{altlongragged4col} but has horizontal and vertical lines
around it.

\glostyledef{altlongragged4colheader}

The \glostyle{altlongragged4colheader} style is like
\glostyle{altlongragged4col} but has a header row.
You may prefer the \glostyle{altlongragged4col-booktabs} style instead.

\glostyledef{altlongragged4colheaderborder}

The \glostyle{altlongragged4colheaderborder} style is like
\glostyle{altlongragged4colheader} but has horizontal and vertical
lines around it.

\subsection{Longtable Styles (\styfmt{booktabs})}
\label{sec:longbooktabsstyles}

\pkgdef*{glossary-longbooktabs}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-longbooktabs}.

Since these styles all use the
\env{longtable} environment, they are governed by the same
parameters as that environment. The \sty{glossary-longbooktabs}
package automatically loads the \sty{glossary-long}
(\sectionref{sec:longstyles})
and \sty{glossary-longragged} (\sectionref{sec:longraggedstyles}) packages.  Note that
these styles will only be available if you explicitly load
\sty{glossary-longbooktabs}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-longbooktabs}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \sty{glossaries} package has been loaded.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long3col-booktabs}},\optval{stylemods}{longbooktabs}]\marg{glossaries-extra}
\end{codebox}

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-longbooktabs}
\gls{setglossarystyle}\marg{\glostyle{long-booktabs}}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{long-booktabs}}}
\end{codebox}

These styles are similar to the \qt{header} styles in the \sty{glossary-long} and
\sty{glossary-longragged} packages, but they add the rules
provided by the \sty{booktabs} package, \gls{toprule}, \gls{midrule} and
\gls{bottomrule}. Additionally these styles patch the
\env{longtable} environment to check for instances of the group
skip occurring at a page break. If you don't want this patch to
affect any other use of \env{longtable} in your document, you can
scope the effect by only setting the style through the
\printglossopt{style} key in the optional argument of
\gls{print...glossary}.

Alternatively, you can restore the original \env{longtable}
behaviour with:
\cmddef{glsrestoreLToutput}

The penalty check is tested with:
\cmddef{glsLTpenaltycheck}
The default definition is:
\begin{compactcodebox}[before upper app=\small]
\cmd{ifnum}\cmd{outputpenalty}=-50\cmd{vskip}-\cmd{normalbaselineskip}\cmd{relax}\cmd{fi}
\end{compactcodebox}

With the default \optval{nogroupskip}{false}, \gls{glsgroupskip}
will be defined to use:
\cmddef{glspenaltygroupskip}
to insert the vertical gap. This is defined as:
\begin{compactcodebox}
\cmd{noalign}\marg{\cmd{penalty}-50\cmd{vskip}\cmd{normalbaselineskip}}
\end{compactcodebox}

\glostyledef{long-booktabs}

This style is similar to the \glostyle{longheader} style but adds
rules above and below the header (\gls{toprule} and \gls{midrule}) and
inserts a rule at the bottom of the table (\gls{bottomrule}).

\glostyledef{long3col-booktabs}

This style is similar to the \glostyle{long3colheader} style but
adds rules as per \glostyle{long-booktabs}.

\glostyledef{long4col-booktabs}

This style is similar to the \glostyle{long4colheader} style but
adds rules as above.

\glostyledef{altlong4col-booktabs}

This style is similar to the \glostyle{altlong4colheader} style but
adds rules as above.

\glostyledef{longragged-booktabs}

This style is similar to the \glostyle{longraggedheader} style but
adds rules as above.

\glostyledef{longragged3col-booktabs}

This style is similar to the \glostyle{longragged3colheader} style
but adds rules as above.

\glostyledef{altlongragged4col-booktabs}

This style is similar to the \glostyle{altlongragged4colheader}
style but adds rules as above.

\subsection{Supertabular Styles}
\label{sec:superstyles}

\pkgdef*{glossary-super}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-super}. Since they all use the \env{supertabular}
environment, they are governed by the same parameters as that
environment.  Note that these styles will automatically be available
unless you use the \opt{nosuper} or \opt{nostyles} package
options.  In general, the \env{longtable} environment is better,
but there are some circumstances where it is better to use
\env{supertabular}. (For example, with the \sty{flowfram}
package.) These styles fully justify the description and \idx{numberlist}
columns.  If you want ragged right formatting instead, use the
analogous styles described in \sectionref{sec:superraggedstyles}.

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\gls{setglossarystyle}\marg{\glostyle{super}}
\end{codebox}
Or
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip},\optval{style}{\glostyle{super}}]\marg{glossaries}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{super}}}
\end{codebox}

\begin{warning}
Sometimes the \env{supertabular} style doesn't put page breaks in
the right place. If you have unexpected output, try the
\sty{glossary-long} styles instead. Alternatively, try the
\glostyle{tree*} with fixed width elements or the \glostyle{alttree} style.
\end{warning}

\glostyledef{super}

The \glostyle{super} style uses the \env{supertabular}
environment (defined by the \sty{supertabular} package). It has two
columns: the first column contains the \idx{entry}['s] name and the second
column contains the description followed by the \idx{numberlist}.
The entry's symbol is ignored.  The width of the
first column is governed by the widest entry in that column. The
width of the second column is governed by the length
\gls{glsdescwidth}. Child entries have a similar format to the
parent entries except that their name is suppressed.

\glostyledef{superborder}

The \glostyle{superborder} style is like \glostyle{super} but has
horizontal and vertical lines around it.

\glostyledef{superheader}

The \glostyle{superheader} style is like \glostyle{super} but has a
header row.

\glostyledef{superheaderborder}

The \glostyle{superheaderborder} style is
like \glostyle{superheader} but has horizontal and vertical lines
around it.

\glostyledef{super3col}

The \glostyle{super3col} style is like \glostyle{super} but has
three columns. The first column contains the entry's name, the
second column contains the description and the third column contains
the \idx{numberlist}. The entry's symbol is ignored. The width of
the first column is governed by the widest entry in that column. The
width of the second column is governed by the length
\gls{glsdescwidth}. The width of the third column is governed by the
length \gls{glspagelistwidth}.

\glostyledef{super3colborder}

The \glostyle{super3colborder} style is like
the \glostyle{super3col} style but has horizontal and vertical
lines around it.

\glostyledef{super3colheader}

The \glostyle{super3colheader} style is like
\glostyle{super3col} but has a header row.

\glostyledef{super3colheaderborder}

The \glostyle{super3colheaderborder} style is like the
\glostyle{super3colheader} style but has horizontal and vertical
lines around it.

\glostyledef{super4col}

The \glostyle{super4col} style is like \glostyle{super3col} but has
an additional column in which the entry's associated symbol appears.
This style is designed for entries with brief single line
descriptions. The column widths are governed by the widest entry in
the given column. Use \glostyle{altsuper4col} for multi-line
descriptions.

\glostyledef{super4colborder}

The \glostyle{super4colborder} style is like the
\glostyle{super4col} style but has horizontal and vertical lines
around it.

\glostyledef{super4colheader}

The \glostyle{super4colheader} style is like \glostyle{super4col}
but has a header row.

\glostyledef{super4colheaderborder}

The \glostyle{super4colheaderborder} style is like the
\glostyle{super4colheader} style but has horizontal and vertical
lines around it.

\glostyledef{altsuper4col}

The \glostyle{altsuper4col} style is like \glostyle{super4col} but
allows multi-line descriptions and \idxpl{numberlist}.  The width of the
description column is governed by the length \gls{glsdescwidth} and
the width of the \idx{numberlist} column is governed by the length
\gls{glspagelistwidth}. The width of the name and symbol columns is
governed by the widest entry in the given column.

\glostyledef{altsuper4colborder}

The \glostyle{altsuper4colborder} style is like the
\glostyle{super4colborder} style but allows multi-line descriptions
and \idxpl{numberlist}.

\glostyledef{altsuper4colheader}

The \glostyle{altsuper4colheader} style is like
\glostyle{super4colheader} but allows multi-line descriptions and
\idxpl{numberlist}.

\glostyledef{altsuper4colheaderborder}

The \glostyle{altsuper4colheaderborder} style is like
\glostyle{super4colheaderborder} but allows multi-line descriptions
and \idxpl{numberlist}.

\subsection{Supertabular Styles (Ragged Right)}
\label{sec:superraggedstyles}

\pkgdef*{glossary-superragged}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-superragged}. These styles are analogous to those
defined in \sty{glossary-super} but the multiline columns are left
justified instead of fully justified. Since these styles all use the
\env{supertabular} environment, they are governed by the same
parameters as that environment. The \sty{glossary-superragged}
package additionally requires the \sty{array} package.  Note that
these styles will only be available if you explicitly load
\sty{glossary-superragged}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-superragged}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \sty{glossaries} package has been loaded.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{superragged3col}},\optval{stylemods}{superragged}]\marg{glossaries-extra}
\end{codebox}

As with the \sty{glossary-long} styles,
\idxpl{group} are separated with a blank row unless \opt{nogroupskip}
is used \emph{before} the style is set. For example:
\begin{codebox}
\cmd{usepackage}[\opt{nogroupskip}]\marg{glossaries}
\cmd{usepackage}\marg{glossary-superragged}
\gls{setglossarystyle}\marg{\glostyle{superragged}}
\end{codebox}
Or
\begin{codebox}
\gls{printglossary}\oarg{\printglossopt{nogroupskip},\printglossoptval{style}{\glostyle{superragged}}}
\end{codebox}

\glostyledef{superragged}

The \glostyle{superragged} style uses the \env{supertabular}
environment (defined by the \sty{supertabular} package). It has two
columns: the first column contains the \idx{entry}['s] name and the
second column contains the (left justified) description followed by
the \idx{numberlist}.  The entry's symbol is ignored. The width of
the first column is governed by the widest entry in that column. The
width of the second column is governed by the length
\gls{glsdescwidth}. Child entries have a similar format to the
parent entries except that their name is suppressed.

\glostyledef{superraggedborder}

The \glostyle{superraggedborder} style is like
\glostyle{superragged} but has horizontal and vertical lines around
it.

\glostyledef{superraggedheader}

The \glostyle{superraggedheader} style is like
\glostyle{superragged} but has a header row.

\glostyledef{superraggedheaderborder}

The \glostyle{superraggedheaderborder} style is like
\glostyle{superraggedheader} but has horizontal and vertical lines
around it.

\glostyledef{superragged3col}

The \glostyle{superragged3col} style is like
\glostyle{superragged} but has three columns. The first column
contains the entry's name, the second column contains the (left
justified) description and the third column contains the (left
justified) \idx{numberlist}. The entry's symbol is ignored. The
width of the first column is governed by the widest entry in that
column. The width of the second column is governed by the length
\gls{glsdescwidth}. The width of the third column is governed by the
length \gls{glspagelistwidth}.

\glostyledef{superragged3colborder}

The \glostyle{superragged3colborder}
style is like the \glostyle{superragged3col} style but has
horizontal and vertical lines around it.

\glostyledef{superragged3colheader}

The \glostyle{superragged3colheader}
style is like \glostyle{superragged3col} but has a header row.

\glostyledef{superragged3colheaderborder}

The \glostyle{superragged3colheaderborder} style is like the above
but has horizontal and vertical lines around it.

\glostyledef{altsuperragged4col}

The \glostyle{altsuperragged4col} style is like
\glostyle{superragged3col} but has an additional column in which the
entry's associated symbol appears. The column widths for the name
and symbol column are governed by the widest entry in the given
column.

\glostyledef{altsuperragged4colborder}

The \glostyle{altsuperragged4colborder} style is like the
\glostyle{altsuperragged4col} style but has horizontal and vertical
lines around it.

\glostyledef{altsuperragged4colheader}

The \glostyle{altsuperragged4colheader} style is like
\glostyle{altsuperragged4col} but has a header row.

\glostyledef{altsuperragged4colheaderborder}

The \glostyle{altsuperragged4colheaderborder} style is like the
above but has horizontal and vertical lines around it.

\subsection{Tree-Like Styles}
\label{sec:treestyles}

\pkgdef*{glossary-tree}

The \idxpl{glossarystyle} described in this section are all defined in the package
\sty{glossary-tree}. These styles are designed for \hierarchical\
glossaries but can also be used with glossaries that don't have
sub-entries. These styles will display the \idx{entry}['s] symbol if it
has been set. Note that these styles will automatically be available
unless you use the \opt{notree} or \opt{nostyles} package
options. 

\subsubsection{New Flexible Single Column Tree Style
(\glsfmttext{opt.glostyle.tree*})}
\label{sec:tree*style}

\glostyledef{tree*}

The \glostyle{tree*} style is new to version 4.59 and may be configured using the
\inlineoptdef{style-options.tree*} option within the
\opt{style-options} setting.
The \glostyleopt{tree*} option value is a comma-separated list of \keyval\
settings, where the keys are described in
\sectionsref{sec:tree*itemelemopts,sec:tree*groupopts,sec:tree*paralignopts,sec:tree*hypernavopts}.
These options also affect the \glostyle{mcoltree*} style, which
builds on the \glostyle{tree*} style.
For example:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{group-headings},
      \treestaroptval{pre-location}{\cmd{dotfill}}
    }
  }
}
\end{codebox}
Alternatively:
\cmddef{GlsTreeSetup}
This is a shorter way of just setting the \glostyleopt{tree*}
options. For example:
\begin{codebox}
\gls{GlsTreeSetup}\marg{
  \treestaropt{group-headings},
  \treestaroptval{pre-location}{\cmd{dotfill}}
}
\end{codebox}

The \glostyle{tree*} style normally obeys global options, such as
\opt{nogroupskip}, but some of the \glostyleopt{tree*} settings may
be used to bypass those global settings just for \idxpl{glossary}
that use the \glostyle{tree*} style, without affecting any
\idxpl{glossary} that use a different style.


\paragraph{Examples}
\label{sec:tree*examples}

\mExampleref{ex:tree*default} demonstrates the default settings for
the \glostyle{tree*} style. The \opt{nopostdot} option is used here because
some of the test entries have terminating punctuation.
\begin{codebox}
\cmd{usepackage}[\opt{nopostdot},\optval{style}{\glostyle{tree*}}]\marg{glossaries}
\end{codebox}
For simplicity, this document uses \option{noidx}:
\begin{codebox}
\gls{makenoidxglossaries}
\end{codebox}
The entries are input from some of the provided test files described in
\sectionref{sec:lipsum}:
\begin{codebox}
\gls{loadglsentries}\marg{\file{example-glossaries-user.tex}}
\gls{loadglsentries}\marg{\file{example-glossaries-symbols.tex}}
\gls{loadglsentries}\marg{\file{example-glossaries-constants.tex}}
\end{codebox}
A selection of the test entries are \indexed:
\begin{codebox}
\gls{glsadd}\marg{sample-i}
\gls{glsadd}\marg{sample-i-0}
\gls{glsadd}\marg{sample-i-1}
\gls{glsadd}\marg{sample-i-2}
\gls{glsadd}\marg{sample-p}
\gls{glsadd}\marg{sample-w}
\gls{glsadd}\marg{sample-w-0}
\gls{glsadd}\marg{sample-w-1}
\gls{glsadd}\marg{sample-w-2}
\gls{glsadd}\marg{i-constant}
\gls{glsadd}\marg{pi-constant}
\gls{glsadd}\marg{psi}
\gls{glsadd}\marg{Gauss-constant}
\gls{glsadd}\marg{Gieseking-constant}
\end{codebox}
The document simply sorts and displays the glossary:
\begin{codebox}
\gls{printnoidxglossary}
\end{codebox}
Note that the \gloskey{see} key in the \optfmt{tau-constant} entry
has caused it to be automatically \indexed.

Some of the entries have textual content in the \gloskey{name} but
others have mathematical content. Some entries also have the
\gloskey{symbol} set. There are also some child entries, some of
which have the same name as the parent entry ($G$).

The widths of the names vary, with the shortest being
$i$ for the top-level and $G$ for level~1, and the widest being
\qt{w name} for the top-level and \qt{w/2 name} for level~1.

The widths of the symbols (where set) also vary, with the shortest
being $\iota$ for the top-level and $\gamma$ for level~1, 
and the widest being $\sqrt{-1}$ for the top-level and $\chi_0$
for level~1.

One entry (\qt{psi}), has a long description that spans two lines
(formatted with the usual paragraph justification),
the next longest description is for the \qt{tau} entry, and the
other descriptions are quite short.

The default setting shows both the name and (if set) the symbol in
parentheses for all \idxpl{hierarchicallevel}. This is followed by the
description and the \idx{locationlist} (if set) separated by spaces.
There are no letter \idx{group} headings but there is a small
vertical gap between the letter \idxpl{group}. For example,
between \qt{psi} (in the \qt{P} letter \idx{group}) and
$\tau$ (in the \qt{T} letter \idx{group}).

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
default layout},
 label={ex:tree*default},
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that displays a glossary showing the
name, symbol, description and location list for each entry with
sub-levels indented.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}



\mExampleref{ex:tree*childomit} modifies \exampleref{ex:tree*default}
so that the child entries are numbered. This means using the
\opt{subentrycounter} option:
\begin{codebox}
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*},
 \opt{subentrycounter}]\marg{glossaries}
\end{codebox}
The child entries have their name and symbol omitted:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaroptval{child-name-style}{omit}
    }
  }
}
\end{codebox}

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
omit the child name and symbol},
 label={ex:tree*childomit},
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that displays a glossary showing the
name, symbol, description and location list for each entry with
sub-levels indented.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*},
 \opt{subentrycounter}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}
\codepar
\gls{setupglossaries}\marg{\nl
  \optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaroptval{child-name-style}{omit}\nlsp
    }\nl
  }\nl
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\mExampleref{ex:tree*alignnames} modifies \exampleref{ex:tree*default}
so that the name and symbols are aligned for each level. This is done by setting
the applicable name and symbol width options to \optfmt{widest}:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaroptval{name-width}{widest},
      \treestaroptval{symbol-width}{widest},
      \treestaroptval{sub-name-width}{widest},
      \treestaroptval{sub-symbol-width}{widest},
    }
  }
}
\end{codebox}

Additionally, the widest name and symbol need to be identified. This can be done by
visually inspecting the glossary content, but it's also possible to
calculate this automatically while the glossary content is being
constructed:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsnoidxitemhook}}[2]\marg{\comment{}
 \gls{GlsTreeUpdateWidestNameOrSymbol}\oarg{\#1}\marg{\#2}\comment{}
}
\end{codebox}
If you prefer to use \gls{printunsrtglossary}, you will instead
need:
\begin{codebox}[before upper app=\small]
\cmd{renewcommand}\gls{printunsrtglossaryentryprocesshook}\oarg{1}\marg{\comment{}
 \gls{GlsTreeUpdateWidestNameOrSymbol}\marg{\#1}\comment{}
}
\end{codebox}

\begin{information}
Since \gls{printglossary} just inputs a file containing the commands
to typeset the glossary there is no easy way to convert this example to use
\gls{printglossary}. You could first iterate over all entries
with \gls{forglsentries} but entries that have been defined but not
\indexed\ may cause interference.
\end{information}

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
aligning names and symbols for each level},
 label={ex:tree*alignnames},
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that displays a glossary showing the
name, symbol, description and location list for each entry with
sub-levels indented where the names and symbols are aligned for each
level.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}
\codepar
\gls{setupglossaries}\marg{\nl
  \optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaroptval{name-width}{widest},\nldbsp
      \treestaroptval{symbol-width}{widest},\nldbsp
      \treestaroptval{sub-name-width}{widest},\nldbsp
      \treestaroptval{sub-symbol-width}{widest},\nlsp
    }\nl
  }\nl
}
\codepar
\cmd{renewcommand}\marg{\gls{glsnoidxitemhook}}[2]\marg{\comment{}
 \gls{GlsTreeUpdateWidestNameOrSymbol}\oarg{\#1}\marg{\#2}\comment{}%
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\mExampleref{ex:tree*aligndesc} modifies \exampleref{ex:tree*default}
to align the descriptions. In this case the options are:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaroptval{name-symbol-width}{widest},
      \treestaroptval{sub-name-symbol-width}{widest},
      \treestaroptval{hang-indent}{calculated},
    }
  }
}
\end{codebox}
As with \exampleref{ex:tree*alignnames}, this requires the widest 
name and symbol to be known, but now it needs to be the widest
combination of name and symbol:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsnoidxitemhook}}[2]\marg{\comment{}
 \gls{GlsTreeUpdateWidestNameAndSymbol}\oarg{\#1}\marg{\#2}\comment{}
}
\end{codebox}
Note that in this case, unlike \exampleref{ex:tree*alignnames}, the
symbols are not aligned.

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
aligning descriptions},
 label={ex:tree*aligndesc},
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that displays a glossary showing the
name, symbol, description and location list for each entry with
sub-levels indented where the descriptions are aligned for each
level.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}
\codepar
\gls{setupglossaries}\marg{\nl
  \optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaroptval{name-symbol-width}{widest},\nldbsp
      \treestaroptval{sub-name-symbol-width}{widest},\nldbsp
      \treestaroptval{hang-indent}{calculated},\nlsp
    }\nl
  }\nl
}
\codepar
\cmd{renewcommand}\marg{\gls{glsnoidxitemhook}}[2]\marg{\comment{}
 \gls{GlsTreeUpdateWidestNameAndSymbol}\oarg{\#1}\marg{\#2}\comment{}%
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\FloatBarrier

\mExampleref{ex:tree*multipar} demonstrates the default settings for
hierarchical entries where some descriptions span multiple
paragraphs. The \opt{nopostdot} option is used here because
some of the test entries have terminating punctuation.
\begin{codebox}
\cmd{usepackage}[\opt{nopostdot},\optval{style}{\glostyle{tree*}}]\marg{glossaries}
\end{codebox}
As with \exampleref{ex:tree*default}, this document uses \option{noidx}:
\begin{codebox}
\gls{makenoidxglossaries}
\end{codebox}
A different set of test files are used:
\begin{codebox}
\gls{loadglsentries}\marg{\file{example-glossaries-parent.tex}}
\gls{loadglsentries}
 \marg{\file{example-glossaries-childmultipar.tex}}
\end{codebox}
A selection of the test entries are \indexed:
\begin{codebox}
\gls{glsadd}\marg{hierloremvii-viii}
\gls{glsadd}\marg{duisnisl}
\gls{glsadd}\marg{duisnibh}
\end{codebox}
The document just sorts and displays the glossary:
\begin{codebox}
\gls{printnoidxglossary}
\end{codebox}

With the default settings, the description simply follows on from
the name (none of the test entries have a symbol for this example) using the normal
paragraph settings for the top-level. The child entries are
indented. This is done by setting the hanging indentation for each
child level to \meta{level} times \meta{offset} plus the hanging
indentation for the top-level, where \meta{level} is the 
child entry's \idx{hierarchicallevel} and \meta{offset}
can be altered with the \treestaropt{child-offset} option.

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
default layout (multi-paragraph and hierarchical entries)},
 label={ex:tree*multipar},
 fontsize=11,
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that displays a glossary showing the
name, description and location list for each entry with
sub-levels indented.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-parent.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-childmultipar.tex}\nl
\gls{glsadd}\marg{hierloremvii-viii}\nl
\gls{glsadd}\marg{duisnisl}\nl
\gls{glsadd}\marg{duisnibh}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\FloatBarrier

\mExampleref{ex:tree*multipar2} adapts \exampleref{ex:tree*multipar}
to make the description start a new paragraph (instead of following
on from the name). Note that \gls{par} can't be used inside
\gls{setupglossaries} but \gls{glspar} can be used instead.
The hanging indentation for the top-level is set to 2em. Bear in
mind that the hanging indentation isn't applied to the first line of
a paragraph. The first line is dealt with by the paragraph
indentation, so this will need to be at least as wide as the hanging
indentation (for example, 3em).

The paragraph break can be achieved with
\treestaroptval{pre-description}{\gls{glspar}} but you may prefer
the first paragraph of the description not to have a noticeable
indentation. The paragraph indentation can be suppressed with
\csfmt{noindent}, but that would cause it to be flush with the left
margin. The desired effect can be created by adding a horizontal
space that's the same width as the hanging indent:
\begin{codebox}
\gls{setupglossaries}\marg{
 \optvalm{style-options}{
  \glostyleoptvalm{tree*}{
    \treestaroptval{pre-description}{\gls{glspar}\cmd{noindent}\cmd{hspace}\marg{\cmd{the}\cmd{hangindent}}},
    \treestaroptval{par-indent}{3em},
    \treestaroptval{hang-indent}{2em},
  }
 }
}
\end{codebox}

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
default layout (multi-paragraph and hierarchical entries with
hanging indentation)},
 fontsize=11,
 label={ex:tree*multipar2},
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that displays a glossary showing the
name, followed by a paragraph break and the description and location list for each entry with
sub-levels indented.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-parent.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-childmultipar.tex}\nl
\gls{glsadd}\marg{hierloremvii-viii}\nl
\gls{glsadd}\marg{duisnisl}\nl
\gls{glsadd}\marg{duisnibh}
\codepar
\gls{setupglossaries}\marg{\nl
 \optvalm{style-options}{\nl
  \glostyleoptvalm{tree*}{\nlsp
    \treestaroptval{pre-description}{\gls{glspar}\cmd{noindent}\cmd{hspace}\marg{\cmd{the}\cmd{hangindent}}},\nldbsp
    \treestaroptval{par-indent}{3em},\nldbsp
    \treestaroptval{hang-indent}{2em},\nlsp
  }\nl
 }\nl
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}


\FloatBarrier

\paragraph{Layout}
\label{sec:tree*layout}

A \idx{glossary} with the \glostyle{tree*} style consists of the following:
\begin{itemize}
\item The navigation strip (for documents that support
hyperlinks), which may be shown with \treestaropt{hyper-nav}.
The options governing the navigation strip are described in 
\sectionref{sec:tree*hypernavopts}. (Alternatively, you may prefer
the \treestaropt{bookmark-groups} setting.)

\item Letter \idx{group} headers and separators. By default, this is just the
vertical group skip separator, but may also include the \idx{group} header.
The options governing these are described in
\sectionref{sec:tree*groupopts}.

\item \Idxpl{entryitem}.  Each item consists of:
 \begin{itemize}
  \item An initial hook (\gls{glossariestreepreitem:nnn}) that does
nothing;
  \item The \inlineidxdef{tree*.pre-namesymbol}, which contains
   \code{\gls{glsentryitem}\margm{label}} for top-level items or
   \code{\gls{glssubentryitem}\margm{label}} for level~1 items (not present
   for deeper levels);
  \item The \inlineidxdef{tree*.namebox}, which contains the entry's
name (if applicable);
  \item The \inlineidxdef{tree*.namesymbolsep} (if applicable);
  \item The \inlineidxdef{tree*.symbolbox}, which contains the entry's
symbol (if applicable);
  \item If the entry has a non-empty and non-suppressed description
(and the applicable \treestaropt{omit-description}
or \treestaropt{omit-child-description} is not true):
   \begin{itemize}
    \item the \inlineidxdef{tree*.post-namesymbol} content;
    \item the \inlineidxdef{tree*.pre-description} content;
    \item the description;
   \end{itemize}
  \item If the entry has a \idx{locationlist}
(and the applicable \treestaropt{omit-location}
or \treestaropt{omit-child-location} is not true):
   \begin{itemize}
    \item the \inlineidxdef{tree*.pre-location} content;
    \item the \idx{locationlist};
    \item the \inlineidxdef{tree*.post-location} content.
   \end{itemize}

   \item An end hook (\gls{glossariestreepostitem:nnn}) that does
   nothing.

 \end{itemize}

\end{itemize}

Note that the order of the name and symbol may be switched or one or
other may be omitted. The name or symbol may be placed in
parentheses. See \sectionref{sec:tree*itemelemopts}.

Each \idx{entryitem} may be a single line if the description
is short, but may also span multiple paragraphs. Child items are
indented. The paragraph spacing and alignment options are described
in \sectionref{sec:tree*paralignopts}.

Note that the \idx{tree*.namebox} and \idx{tree*.symbolbox} may
not actually be boxes. If the default
\treestaroptval{name-width}{natural} or
\treestaroptval{symbol-width}{natural} settings are in effect, the
content will simply be scoped to localise the effect of the font
declarations. Otherwise the content will be placed inside a
fixed-width box created with \gls{makebox} (see \exampleref{ex:tree*alignnames}).

The \inlineidxdef{tree*.name+symbolbox} refers to the area that
encapsulates the \idx{tree*.pre-namesymbol}, 
\idx{tree*.namebox},
\idx{tree*.namesymbolsep}, 
\idx{tree*.symbolbox}, and
\idx{tree*.post-namesymbol}. If the default
\treestaroptval{name-symbol-width}{natural} option is in effect,
this content won't actually be in a box, although the
name and symbol may be in fixed width boxes, as mentioned above.

\mExampleref{ex:tree*elements} modifies \exampleref{ex:tree*default}
to highlight each element. The \opt{entrycounter}
and \opt{subentrycounter} options are set to show where the counter
values are positioned:
\begin{codebox}
\cmd{usepackage}[\opt{nopostdot},\optval{style}{\glostyle{tree*}},
\opt{entrycounter},\opt{subentrycounter}]\marg{glossaries}
\end{codebox}
An extra example file is added to demonstrate a level~2 entry:
\begin{codebox}
\gls{loadglsentries}\marg{example-glossaries-parent.tex}
\end{codebox}
This is in addition to the files used in
\exampleref{ex:tree*default}. A level~2 entry is added with:
\begin{codebox}
\gls{glsadd}\marg{duisnisl}
\end{codebox}

The letter \idx{group} headings are switched on with the
\treestaropt{group-headings} boolean option. Note that the spacing
above and below the group headings is different to the older
\glostyle{treegroup} style.

A frame can be added around the \idx{tree*.namebox}, 
\idx{tree*.symbolbox} and \idx{tree*.name+symbolbox} to show their
boundaries:
\begin{codebox*}
\cmd{renewcommand}\gls{GlsTreeStarBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}
\end{codebox*}
Similarly, a frame can be added around the entry item counter
and sub-entry item counter areas:
\begin{codebox}[before upper app=\small]
\cmd{renewcommand}\gls{GlsTreeStarItemCounterBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}
\end{codebox}
Note that the sub-entry item counter is only present for level~1
child entries. With the default \optval{entrycounter}{false} and
\optval{subentrycounter}{false} settings, those areas will be empty
but they would still be framed with the above redefinition.

Bear in mind that \gls{fbox} will add extra space. This is adjusted
to make it a bit smaller:
\begin{codebox}
\cmd{setlength}\marg{\gls{fboxsep}}\marg{2pt}
\end{codebox}

The locations of the separators are marked up as follows: an asterisk
(\textasteriskcentered)
showing the \idx{tree*.namesymbolsep}, an en-dash
(\textendash) showing the
\idx{tree*.post-namesymbol}, a bullet (\textbullet) showing the
\idx{tree*.pre-description} content, a dotted leader
showing the \idx{tree*.pre-location} content,
and the paragraph symbol (\P) showing the \idx{tree*.post-location} content.
The \treestaropt{symbol-font} setting is used to change the text
colour to \textcolor{teal}{teal} for the top-level symbol
and \textcolor{orange}{orange} for child symbols (which will require
the \sty{xcolor} package). Note that this also changes the
colour of the parentheses around the symbol.

Similarly, the \treestaropt{item-counter-font} setting is used to
change the text colour to \textcolor{cyan}{cyan}
and the \treestaropt{sub-item-counter-font} setting is used to
change the text colour to \textcolor{magenta}{magenta}
for the entry counter and sub entry counter values (and the font is
made smaller).
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{group-headings},
      \treestaroptval{name-symbol-sep}{\cmd{textasteriskcentered}},
      \treestaroptval{post-name-symbol}{\cmd{textendash}},
      \treestaroptval{pre-description}{\cmd{textbullet}},
      \treestaroptval{pre-location}{\cmd{dotfill}},
      \treestaroptval{post-location}{\cmd{P}},
      \treestaroptval{symbol-font}{\cmd{color}\marg{teal}},
      \treestaroptval{child-symbol-font}{\cmd{color}\marg{orange}},
      \treestaroptval{item-counter-font}{\cmd{small}\cmd{color}\marg{cyan}},
      \treestaroptval{sub-item-counter-font}{\cmd{small}\cmd{color}\marg{magenta}}
    }
  }
}
\end{codebox}

Note that for entries that don't have the \gloskey{symbol} field
set, the \idx{tree*.namesymbolsep} and \idx{tree*.symbolbox} are not
shown. In the case of entries that have the \gloskey{description} suppressed or
empty, the \idx{tree*.post-namesymbol}, \idx{tree*.pre-description} content
and description are omitted. If the \idx{locationlist} is empty, the
\idx{tree*.pre-location} content is omitted.

\begin{information}
The \opt{nonumberlist} option doesn't make the \idx{locationlist}
empty, but simply hides it.
\end{information}

The space after the counter number is in the definition of
\gls{glsentrycounterlabel} and \gls{glssubentrycounterlabel}. There
is no separator between the number box and the name\slash symbol box.
Note that there is no entry counter, or area allocated for one, for the
level~2 entry.

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style elements},
 label={ex:tree*elements},
 fontsize=10,
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that outlines each element of the
tree* style and uses markers to show the separators.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}\marg{xcolor}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*},
\opt{entrycounter},\opt{subentrycounter}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-parent.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}\nl
\gls{glsadd}\marg{duisnisl}\nl
\cmd{setlength}\marg{\gls{fboxsep}}\marg{2pt}\nl
\cmd{renewcommand}\gls{GlsTreeStarBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\cmd{renewcommand}\gls{GlsTreeStarItemCounterBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\gls{setupglossaries}\marg{\optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaropt{group-headings},\nldbsp
      \treestaroptval{name-symbol-sep}{\cmd{textasteriskcentered}},\nldbsp
      \treestaroptval{post-name-symbol}{\cmd{textendash}},\nldbsp
      \treestaroptval{pre-description}{\cmd{textbullet}},\nldbsp
      \treestaroptval{pre-location}{\cmd{dotfill}},\nldbsp
      \treestaroptval{post-location}{\cmd{P}},\nldbsp
      \treestaroptval{symbol-font}{\cmd{color}\marg{teal}},\nldbsp
      \treestaroptval{child-symbol-font}{\cmd{color}\marg{orange}},\nldbsp
      \treestaroptval{item-counter-font}{\cmd{small}\cmd{color}\marg{cyan}},\nldbsp
      \treestaroptval{sub-item-counter-font}{\cmd{small}\cmd{color}\marg{magenta}}\nldbsp
    }\nlsp
  }\nl
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\FloatBarrier

\mExampleref{ex:tree*fixednamesym} is a slightly modified version of
\exampleref{ex:tree*elements}. The \opt{entrycounter}
and \opt{subentrycounter} are no longer used:
\begin{codebox}
\cmd{usepackage}[\opt{nopostdot},\optval{style}{\glostyle{tree*}}]\marg{glossaries}
\end{codebox}
Note that even though there is no number, the frame still shows
around the empty (now zero-width and zero-height) area.

In addition to the \glostyleopt{tree*} options that were set in
\exampleref{ex:tree*elements}, \exampleref{ex:tree*fixednamesym}
sets the width of the \idx{tree*.namebox} and \idx{tree*.symbolbox}
to \optfmt{fixed}. This means that the widest content for those
values needs to be specified. (See \exampleref{ex:tree*alignnames}
to automatically calculate the values.) Note that the addition of
the level~2 test entry has resulted in a wider name than that for
\exampleref{ex:tree*fixednamesym} (\qt{aliquam et}).
\begin{codebox}
\treestaroptvalm{widest-name}{aliquam et},
\treestaroptvalm{widest-symbol}{\$\cmd{sqrt}\marg{-1}\$},
\treestaroptvalm{widest-sub-name}{w/2 name},
\treestaroptvalm{widest-sub-sub-name}{duisnibh},
\treestaroptvalm{widest-sub-symbol}{\$\cmd{chi}\_0\$},
\treestaroptval{name-width}{widest},
\treestaroptval{sub-name-width}{widest},
\treestaroptval{sub-sub-name-width}{widest},
\treestaroptval{symbol-width}{widest},
\treestaroptval{sub-symbol-width}{widest},
\end{codebox}
This aligns the names and symbols for each level, but note that the
outer \idx{tree*.name+symbolbox} is still at its natural width
setting, so it's narrower for entries that don't have the symbol set.

The entry counter boxes can have their width set with
\treestaropt{item-counter-width} and
\treestaropt{sub-item-counter-width}. Even if the counter isn't
incremented or visible, a box with that dimension will be shown.
Note that there is no \optfmt{widest} option available in this case.
In this example, they are left at their default natural width
setting.

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
fixed width name and symbol},
 label={ex:tree*fixednamesym},
 fontsize=10,
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that outlines each element of the
tree* style and uses markers to show the separators, where the name
and symbol appear in separated fixed width boxes calculated from the widest
name and symbol.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}\marg{xcolor}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-parent.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}\nl
\gls{glsadd}\marg{duisnisl}\nl
\cmd{setlength}\marg{\gls{fboxsep}}\marg{2pt}\nl
\cmd{renewcommand}\gls{GlsTreeStarBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\cmd{renewcommand}\gls{GlsTreeStarItemCounterBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\gls{setupglossaries}\marg{\optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaropt{group-headings},\nldbsp
      \treestaroptval{name-symbol-sep}{\cmd{textasteriskcentered}},\nldbsp
      \treestaroptval{post-name-symbol}{\cmd{textendash}},\nldbsp
      \treestaroptval{pre-description}{\cmd{textbullet}},\nldbsp
      \treestaroptval{pre-location}{\cmd{dotfill}},\nldbsp
      \treestaroptval{post-location}{\cmd{P}},\nldbsp
      \treestaroptval{symbol-font}{\cmd{color}\marg{teal}},\nldbsp
      \treestaroptval{child-symbol-font}{\cmd{color}\marg{orange}},\nldbsp
      \treestaroptval{item-counter-font}{\cmd{small}\cmd{color}\marg{cyan}},\nldbsp
      \treestaroptval{sub-item-counter-font}{\cmd{small}\cmd{color}\marg{magenta}},\nldbsp
      \treestaroptvalm{widest-name}{aliquam et},\nldbsp
      \treestaroptvalm{widest-symbol}{\string$\cmd{sqrt}\marg{-1}\string$},\nldbsp
      \treestaroptvalm{widest-sub-name}{w/2 name},\nldbsp
      \treestaroptvalm{widest-sub-sub-name}{duisnibh},\nldbsp
      \treestaroptvalm{widest-sub-symbol}{\string$\cmd{chi}\string_0\string$},\nldbsp
      \treestaroptval{name-width}{widest},\nldbsp
      \treestaroptval{sub-name-width}{widest},\nldbsp
      \treestaroptval{sub-sub-name-width}{widest},\nldbsp
      \treestaroptval{symbol-width}{widest},
      \treestaroptval{sub-symbol-width}{widest},
    }\nlsp
  }\nl
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\FloatBarrier

\mExampleref{ex:tree*fixedname+sym} is a slightly modified version of
\exampleref{ex:tree*fixednamesym}. Now the name and symbol widths
are left at their default settings:
\begin{codebox}
\treestaroptval{name-width}{natural},
\treestaroptval{sub-name-width}{natural},
\treestaroptval{symbol-width}{natural},
\treestaroptval{sub-symbol-width}{natural},
\end{codebox}
Instead the \idx{tree*.name+symbolbox} box is given a fixed width:
\begin{codebox}
\treestaroptval{name-symbol-width}{widest},
\treestaroptval{sub-name-symbol-width}{widest}
\end{codebox}
This calculates the width from the sum of the width of the entry item counter box
(which is 0pt for this example), \idx{tree*.namebox}, \idx{tree*.symbolbox},
\idx{tree*.namesymbolsep} and the \idx{tree*.post-namesymbol}
content. Since the \idx{tree*.namebox} and \idx{tree*.symbolbox}
have a natural length, the width of the widest name and widest symbol are used
instead.

Note that there's no point setting
\treestaroptval{sub-sub-name-symbol-width} as there's no level~2
entry with a symbol.

The calculation doesn't include any extra content that's created by
redefining commands such as \gls{GlsTreeStarBox}. This means that
the extra horizontal space caused by the use of \gls{fbox} will need
to be taken into account. This extra space is
\code{2\gls{fboxsep}+2\gls{fboxrule}} for each \gls{fbox}
inside the \idx{tree*.name+symbolbox}. This can be added into the
calculation by setting the corresponding padding:
\begin{codebox*}
\treestaroptval{item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{sub-item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{name-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\end{codebox*}

The resulting \idx{tree*.name+symbolbox} is actually much wider than
it needs to be. This is because the widest name and widest symbol
don't occur for the same entry. The entry with the widest name has a
much narrower symbol than the identified widest symbol.
(In fact, with the level~2 test entry included, the widest name doesn't have
a symbol.)
In this case, the widest pair of name and symbol should be used.
See \exampleref{ex:tree*aligndesc} for how to automate this.

If, on the other hand, you want the names, symbols and descriptions
to all line up for their given \idx{hierarchicallevel}, you can
specify \optfmt{widest} for the name width, symbol width and
name-symbol width, which is demonstrated in \exampleref{ex:tree*fixedname+sym2}.

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
combined name and symbol fixed width},
 label={ex:tree*fixedname+sym},
 fontsize=10,
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that outlines each element of the
tree* style and uses markers to show the separators, where the name
and symbol appear together in a single fixed width box calculated from the widest
name and symbol.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}\marg{xcolor}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-parent.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}\nl
\gls{glsadd}\marg{duisnisl}\nl
\cmd{setlength}\marg{\gls{fboxsep}}\marg{2pt}\nl
\cmd{renewcommand}\gls{GlsTreeStarBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\cmd{renewcommand}\gls{GlsTreeStarItemCounterBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\gls{setupglossaries}\marg{\optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaropt{group-headings},\nldbsp
      \treestaroptval{name-symbol-sep}{\cmd{textasteriskcentered}},\nldbsp
      \treestaroptval{post-name-symbol}{\cmd{textendash}},\nldbsp
      \treestaroptval{pre-description}{\cmd{textbullet}},\nldbsp
      \treestaroptval{pre-location}{\cmd{dotfill}},\nldbsp
      \treestaroptval{post-location}{\cmd{P}},\nldbsp
      \treestaroptval{symbol-font}{\cmd{color}\marg{teal}},\nldbsp
      \treestaroptval{child-symbol-font}{\cmd{color}\marg{orange}},\nldbsp
      \treestaroptval{item-counter-font}{\cmd{small}\cmd{color}\marg{cyan}},\nldbsp
      \treestaroptval{sub-item-counter-font}{\cmd{small}\cmd{color}\marg{magenta}},\nldbsp
      \treestaroptval{widest-name}{aliquam et},\nldbsp
      \treestaroptval{widest-symbol}{\string$\cmd{sqrt}\marg{-1}\string$},\nldbsp
      \treestaroptval{widest-sub-name}{w/2 name},\nldbsp
      \treestaroptval{widest-sub-sub-name}{duisnibh},\nldbsp
      \treestaroptval{widest-sub-symbol}{\string$\cmd{chi}\string_0\string$},\nldbsp
      \treestaroptval{name-symbol-width}{widest},\nldbsp
      \treestaroptval{sub-name-symbol-width}{widest},\nl
\comment{compensate for space taken up by \string\fbox:}\dbspace
      \treestaroptval{item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nldbsp
      \treestaroptval{sub-item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nldbsp
      \treestaroptval{name-padding}{4\gls{fboxsep}+4\gls{fboxrule}},\nldbsp
      \treestaroptval{symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nlsp
    }\nlsp
  }\nl
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\FloatBarrier

\mExampleref{ex:tree*fixedname+sym2} is also a slightly modified version of
\exampleref{ex:tree*fixednamesym}. Unlike
\exampleref{ex:tree*fixedname+sym}, the name and symbol widths are
still set to \optfmt{widest}, as for \exampleref{ex:tree*fixednamesym}:
\begin{codebox}
\treestaroptval{name-width}{widest},
\treestaroptval{sub-name-width}{widest},
\treestaroptval{sub-sub-name-width}{widest},
\treestaroptval{symbol-width}{widest},
\treestaroptval{sub-symbol-width}{widest},
\end{codebox}
However, as with \exampleref{ex:tree*fixedname+sym} the 
\idx{tree*.name+symbolbox} is also given a fixed width:
\begin{codebox}
\treestaroptval{name-symbol-width}{widest},
\treestaroptval{sub-name-symbol-width}{widest}
\end{codebox}

Again the padding needs to be set to include the extra horizontal space caused
by each \gls{fbox}:
\begin{codebox*}
\treestaroptval{item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{sub-item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{name-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\end{codebox*}

Unlike the previous
\examplesref{ex:tree*fixednamesym,ex:tree*fixedname+sym},
the hanging indentation and paragraph indentation are also adjusted.
Note that the \treestaroptval{hang-indent}{calculated} option will
also need the padding set to the extra horizontal space taken up by
the frame around the \idx{tree*.name+symbolbox}:
\begin{codebox*}
\treestaroptval{hang-indent}{calculated},
\treestaroptval{name-symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
\treestaroptval{par-indent}{\cmd{hangindent} + 1em},
\end{codebox*}

Note that because the overall child name and symbol widths are
narrower than for higher \idxpl{hierarchicallevel}, the child
descriptions start to the left of their parent descriptions, even
though the \idx{tree*.name+symbolbox} is indented further to the
right.
If you want the \idx{tree*.name+symbolbox} for child entries to have
the same width as the next \idx{hierarchicallevel} up, you can
instead use:
\begin{codebox}
\treestaroptval{sub-name-symbol-width}{match higher},
\treestaroptval{sub-sub-name-symbol-width}{match higher},
\end{codebox}

\begin{resultbox}[float=hp]
\createexample*[title={The \glsfmttext{opt.glostyle.tree*} style:
inner and outer name and symbol fixed width},
 label={ex:tree*fixedname+sym2},
 arara={pdflatex,pdflatex,pdfcrop},
 description={Example document that outlines each element of the
tree* style and uses markers to show the separators, where the name
and symbol appear together in a single fixed width box calculated from the widest
name and symbol but are also themselves in individual fixed boxes.}]
{%
\cmd{usepackage}[T1]\marg{fontenc}\nl
\cmd{usepackage}\marg{xcolor}\nl
\cmd{usepackage}[\opt{nopostdot},\optval{style}{tree*}]\marg{glossaries}\nl
\gls{makenoidxglossaries}\nl
\gls{loadglsentries}\marg{example-glossaries-user.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-symbols.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-constants.tex}\nl
\gls{loadglsentries}\marg{example-glossaries-parent.tex}\nl
\gls{glsadd}\marg{sample-i}\nl
\gls{glsadd}\marg{sample-i-0}\nl
\gls{glsadd}\marg{sample-i-1}\nl
\gls{glsadd}\marg{sample-i-2}\nl
\gls{glsadd}\marg{sample-p}\nl
\gls{glsadd}\marg{sample-w}\nl
\gls{glsadd}\marg{sample-w-0}\nl
\gls{glsadd}\marg{sample-w-1}\nl
\gls{glsadd}\marg{sample-w-2}\nl
\gls{glsadd}\marg{i-constant}\nl
\gls{glsadd}\marg{pi-constant}\nl
\gls{glsadd}\marg{psi}\nl
\gls{glsadd}\marg{Gauss-constant}\nl
\gls{glsadd}\marg{Gieseking-constant}\nl
\gls{glsadd}\marg{duisnisl}\nl
\cmd{setlength}\marg{\gls{fboxsep}}\marg{2pt}\nl
\cmd{renewcommand}\gls{GlsTreeStarBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\cmd{renewcommand}\gls{GlsTreeStarItemCounterBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}\nl
\gls{setupglossaries}\marg{\optvalm{style-options}{\nlsp
    \glostyleoptvalm{tree*}{\nldbsp
      \treestaropt{group-headings},\nldbsp
      \treestaroptval{name-symbol-sep}{\cmd{textasteriskcentered}},\nldbsp
      \treestaroptval{post-name-symbol}{\cmd{textendash}},\nldbsp
      \treestaroptval{pre-description}{\cmd{textbullet}},\nldbsp
      \treestaroptval{pre-location}{\cmd{dotfill}},\nldbsp
      \treestaroptval{post-location}{\cmd{P}},\nldbsp
      \treestaroptval{symbol-font}{\cmd{color}\marg{teal}},\nldbsp
      \treestaroptval{child-symbol-font}{\cmd{color}\marg{orange}},\nldbsp
      \treestaroptval{item-counter-font}{\cmd{small}\cmd{color}\marg{cyan}},\nldbsp
      \treestaroptval{sub-item-counter-font}{\cmd{small}\cmd{color}\marg{magenta}},\nldbsp
      \treestaroptvalm{widest-name}{aliquam et},\nldbsp
      \treestaroptvalm{widest-symbol}{\string$\cmd{sqrt}\marg{-1}\string$},\nldbsp
      \treestaroptvalm{widest-sub-name}{w/2 name},\nldbsp
      \treestaroptvalm{widest-sub-sub-name}{duisnibh},\nldbsp
      \treestaroptvalm{widest-sub-symbol}{\string$\cmd{chi}\string_0\string$},\nldbsp
      \treestaroptval{name-width}{widest},\nldbsp
      \treestaroptval{sub-name-width}{widest},\nldbsp
      \treestaroptval{sub-sub-name-width}{widest},\nldbsp
      \treestaroptval{symbol-width}{widest},\nldbsp
      \treestaroptval{sub-symbol-width}{widest},\nldbsp
      \treestaroptval{name-symbol-width}{widest},\nldbsp
      \treestaroptval{sub-name-symbol-width}{widest},\nl
\comment{compensate for space taken up by \string\fbox:}\dbspace
      \treestaroptval{item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nldbsp
      \treestaroptval{sub-item-counter-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nldbsp
      \treestaroptval{name-padding}{4\gls{fboxsep}+4\gls{fboxrule}},\nldbsp
      \treestaroptval{symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nldbsp
      \treestaroptval{hang-indent}{calculated},\nldbsp
      \treestaroptval{name-symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},\nldbsp
      \treestaroptval{par-indent}{\cmd{hangindent} + 1em},\nlsp
    }\nlsp
  }\nl
}
}
{
\gls{printnoidxglossary}
}
\end{resultbox}

\FloatBarrier

\paragraph{Item Element Options}
\label{sec:tree*itemelemopts}

These options relate to the way the name, symbol, description and
\idx{locationlist} are shown (where applicable). Note that the font
changing options for the name and symbol will also be applied to the
style parentheses, if they are present.

\treestaroptdef{name-font}
Sets the font declarations to use when typesetting the name for
top-level entries. The final command in the list may be a text-block
command. The value may be empty if no font change is required.

\treestaroptdef{child-name-font}
Sets the font declarations to use when typesetting the name for
child entries. The final command in the list may be a text-block
command. The value may be empty if no font change is required or
may also simply be the keyword \optfmt{inherit},
which indicates to use the same as \treestaropt{name-font}.

\treestaroptdef{symbol-font}
Sets the font declarations to use when typesetting the symbol for
top-level entries. The final command in the list may be a text-block
command.

\treestaroptdef{child-symbol-font}
Sets the font declarations to use when typesetting the symbol for
child entries. The final command in the list may be a text-block
command. The value may also simply be the keyword \optfmt{inherit},
which indicates to use the same as \treestaropt{symbol-font}.

\treestaroptdef{description-font}
Sets the font declarations to use when typesetting the description for
top-level entries. The final command in the list may be a text-block
command.

\treestaroptdef{child-description-font}
Sets the font declarations to use when typesetting the description for
child entries. The final command in the list may be a text-block
command. The value may also simply be the keyword \optfmt{inherit},
which indicates to use the same as \treestaropt{description-font}.

\treestaroptdef{location-font}
Sets the font declarations to use when typesetting the
\idx{locationlist} for top-level entries. The final command in the
list may be a text-block command.

\treestaroptdef{child-location-font}
Sets the font declarations to use when typesetting the
\idx{locationlist} for child entries. The final command in the list
may be a text-block command. The value may also simply be the
keyword \optfmt{inherit}, which indicates to use the same as
\treestaropt{location-font}.

\treestaroptdef{name-style}
Sets the way that the name and\slash or symbol should be displayed for
top-level entries.

\treestaroptvaldef{name-style}{name-psymbol}
The name is displayed first, followed by the symbol in parentheses (if set).

\treestaroptvaldef{name-style}{name-symbol}
The name is displayed first, followed by the symbol (if set).

\treestaroptvaldef{name-style}{symbol-name}
The symbol is displayed first (if set), followed by the name.

\treestaroptvaldef{name-style}{symbol-pname}
The symbol is displayed first (if set), followed by the name in parentheses.

\treestaroptvaldef{name-style}{symbol}
Only the symbol is displayed.

\treestaroptvaldef{name-style}{name}
Only the name is displayed.

\treestaroptdef{child-name-style}
Sets the way that the name and\slash or symbol should be displayed for
child entries.

\treestaroptvaldef{child-name-style}{inherit}
Match the \treestaropt{name-style} setting.

\treestaroptvaldef{child-name-style}{omit}
Don't show either the name or symbol.
Note that the \idx{tree*.post-namesymbol} content will still be
displayed if the entry has a description and the sub entry counter
will also be displayed for level~1 entries if the
\opt{subentrycounter} option is on.

\treestaroptvaldef{child-name-style}{name-psymbol}
The name is displayed first, followed
by the symbol in parentheses (if set).

\treestaroptvaldef{child-name-style}{name-symbol}
The name is displayed first, followed by the symbol (if set).

\treestaroptvaldef{child-name-style}{symbol-name}
The symbol is displayed first (if set), followed by the name.

\treestaroptvaldef{child-name-style}{symbol-pname}
The symbol is displayed first (if set), followed
by the name in parentheses.

\treestaroptvaldef{child-name-style}{symbol}
Only the symbol is displayed.

\treestaroptvaldef{child-name-style}{name}
Only the name is displayed.

\treestaroptdef{omit-description}
If true, the description and the \idx{tree*.pre-description} content
will be omitted. If false, the description and
\idx{tree*.pre-description} content will only be omitted if the
description is empty or has been suppressed. (Suppressed means that
the description is simply \gls{nopostdesc}.)

\begin{information}
If the description is omitted, the \gls{postdeschook}
will also be omitted.
\end{information}

\treestaroptdef{omit-child-description}
If true, the description and the \idx{tree*.pre-description} content
will be omitted for child entries.  If false, the description and
\idx{tree*.pre-description} content for child entries will only be omitted if the
description is empty or has been suppressed.
The value may also be \optfmt{inherit}, to match
\treestaropt{omit-description}.

\treestaroptdef{omit-location}
If true, the \idx{locationlist} and the pre- and post-location content
will be omitted. If false, they will only be omitted if the
\idx{locationlist} is empty.

\begin{important}
The \opt{nonumberlist} doesn't make the \idx{locationlist} empty; it
redefines the command used to encapsulate the location list
to expand to nothing. The \resourceoptval{save-locations}{false}
resource option, on the other hand, can result in an empty \idx{locationlist}.
\end{important}

\treestaroptdef{omit-child-location}
If true, the \idx{locationlist} and the pre- and post-location content
will be omitted for child entries. If false, they will only be omitted if the
\idx{locationlist} is empty. The value may also be \optfmt{inherit},
which will match \treestaropt{omit-location}.


\treestaroptdef{name-case}
Apply a \idx{casechange} when displaying the name for top-level entries.
The value may be one of: \optfmt{normal} (no \idx{casechange}),
\optfmt{firstuc} (\idx{sentencecase}), \optfmt{uc}
(\idx{uppercase}), or \optfmt{title} (\idx{titlecase}).

\begin{xtr}
With the default \optfmt{normal} setting, a \idx{casechange}
may still be applied via the \catattr{glossname} attribute.
\end{xtr}

\treestaroptdef{child-name-case}
Apply a \idx{casechange} when displaying the name for child entries.
The value may be one of: \optfmt{inherit} (match \treestaropt{name-case}),
\optfmt{normal} (no \idx{casechange}),
\optfmt{firstuc} (\idx{sentencecase}), \optfmt{uc}
(\idx{uppercase}), or \optfmt{title} (\idx{titlecase}).

It's not usual to change the case of symbols, however analogous
settings are still provided for completeness:
\treestaroptdef{symbol-case}
Apply a \idx{casechange} when displaying the symbol for top-level entries.
The value may be one of: \optfmt{normal} (no \idx{casechange}),
\optfmt{firstuc} (\idx{sentencecase}), \optfmt{uc}
(\idx{uppercase}), or \optfmt{title} (\idx{titlecase}).

\treestaroptdef{child-symbol-case}
Apply a \idx{casechange} when displaying the symbol for child entries.
The value may be one of: \optfmt{inherit} (match \treestaropt{symbol-case}),
\optfmt{normal} (no \idx{casechange}),
\optfmt{firstuc} (\idx{sentencecase}), \optfmt{uc}
(\idx{uppercase}), or \optfmt{title} (\idx{titlecase}).

\treestaroptdef{description-case}
Apply a \idx{casechange} when displaying the description for top-level entries.
The value may be one of: \optfmt{normal} (no \idx{casechange}),
\optfmt{firstuc} (\idx{sentencecase}), \optfmt{uc}
(\idx{uppercase}), or \optfmt{title} (\idx{titlecase}).

\begin{information}
If any description contains a paragraph break and you want to apply
\idx{sentencecase}, make sure that you have an up-to-date version of
\sty{mfirstuc} installed.
\end{information}

\treestaroptdef{child-description-case}
Apply a \idx{casechange} when displaying the description for child entries.
The value may be one of: \optfmt{inherit} (match \treestaropt{description-case}),
\optfmt{normal} (no \idx{casechange}),
\optfmt{firstuc} (\idx{sentencecase}), \optfmt{uc}
(\idx{uppercase}), or \optfmt{title} (\idx{titlecase}).

\treestaroptdef{name-symbol-sep}
Sets the \idx{tree*.namesymbolsep} for top-level entries 
(only used if both the name and symbol are shown).

\treestaroptdef{child-name-symbol-sep}
Sets the \idx{tree*.namesymbolsep} for child entries (only used if
both the name and symbol are shown). The value may be the keyword
\optfmt{inherit} to match \treestaropt{name-symbol-sep}, otherwise
it should be the required content.

\treestaroptdef{post-name-symbol}
The \idx{tree*.post-namesymbol} content for top-level entries (only used
if the entry has a description).

\treestaroptdef{post-child-name-symbol}
The \idx{tree*.post-namesymbol} content for child entries (only used
if the entry has a description). The value may be the keyword
\optfmt{inherit} to match \treestaropt{post-name-symbol}, otherwise
it should be the required content.

\treestaroptdef{pre-description}
The \idx{tree*.pre-description} content for top-level entries (only used if the
entry has a description). Note that the \gls{setupglossaries}
command doesn't permit paragraph breaks, but you can use \gls{glspar}
if you want the description to start a new paragraph (see
\exampleref{ex:tree*multipar2}).

\treestaroptdef{pre-child-description}
The \idx{tree*.pre-description} content for child entries (only used if the
entry has a description). The value may be the keyword
\optfmt{inherit} to match \treestaropt{pre-description}, otherwise
it should be the required content.

\treestaroptdef{pre-location}
The \idx{tree*.pre-location} content for top-level entries (only used if the entry
has a \idx{locationlist}).

\treestaroptdef{pre-child-location}
The \idx{tree*.pre-location} content for child entries (only used if the entry
has a \idx{locationlist}). The value may be the keyword
\optfmt{inherit} to match \treestaropt{pre-location}, otherwise
it should be the required content.

\treestaroptdef{post-location}
The \idx{tree*.post-location} content for top-level entries (only used if the entry
has a \idx{locationlist}).

\treestaroptdef{post-child-location}
The \idx{tree*.post-location} content for child entries (only used if the entry
has a \idx{locationlist}).

\treestaroptdef{name-width}
Sets the width of the \idx{tree*.namebox} for top-level entries. The value may be:
\optfmt{natural} (no fixed width), \optfmt{widest}
(the width of the widest name), or a valid dimension.
The widest name may be set with \treestaropt{widest-name}
or with one of the commands described in \sectionref{sec:tree*cmds}.

\begin{information}
If the dimension evaluates to a value less than or equal to zero, 
natural width will be used instead, but it will affect the
calculation of the \idx{tree*.name+symbolbox} width if
\treestaroptval{name-symbol-width}{widest} is set.
\end{information}


\treestaroptdef{sub-name-width}
Sets the width of the \idx{tree*.namebox} for level~1 entries. The value may be:
\optfmt{natural} (no fixed width), \optfmt{widest}
(the width of the widest name), or a valid dimension.
The widest name may be set with \treestaropt{widest-sub-name}
or with one of the commands described in \sectionref{sec:tree*cmds}.

As with \treestaropt{symbol-width}, if the dimension evaluates to
less than or equal to zero, natural width will be used instead, 
but it will affect any calculation dependent on this dimension.

\treestaroptdef{sub-sub-name-width}
Sets the width of the \idx{tree*.namebox} for level~2 entries. The value may be:
\optfmt{natural} (no fixed width), \optfmt{widest}
(the width of the widest name), or a valid dimension.
The widest name may be set with \treestaropt{widest-sub-sub-name}
or with one of the commands described in \sectionref{sec:tree*cmds}.

As with \treestaropt{symbol-width}, if the dimension evaluates to
less than or equal to zero, natural width will be used instead, 
but it will affect any calculation dependent on this dimension.

If a deeper level is required, you will need to use
\gls{glossariestreesetnamewidth:nn} (which is what the above options
use).

\treestaroptdef{name-align}
Sets the horizontal alignment of the \idx{tree*.namebox}, if it has
a fixed width. The value may be one of:
\optfmt{l} (left), \optfmt{c} (centred), or \optfmt{r} (right).
This setting covers any level that has a fixed-width
\idx{tree*.namebox}.

\treestaroptdef{widest-name}
Sets the widest name for top-level entries, which is used to
calculate the width if \treestaroptval{name-width}{widest}.

\treestaroptdef{widest-sub-name}
Sets the widest name for level~1 entries, which is used to
calculate the width if \treestaroptval{sub-name-width}{widest}.

\treestaroptdef{widest-sub-sub-name}
Sets the widest name for level~2 entries, which is used to
calculate the width if \treestaroptval{sub-sub-name-width}{widest}.

If a deeper level is required, you will need to use
\gls{glossariestreesetwidestname:nn} (which is what the above options
use) or \gls{glssetwidest}.

\treestaroptdef{update-widest-name}
Updates the widest name for top-level entries, if \meta{text} is
wider than the current setting. For example, if
\treestaroptval{name-width} was set to 2cm and later
\treestaropt{update-widest-name} is set to \optfmt{aardvark}
then if the width of \optfmt{aardvark} (using the current 
\treestaropt{name-font} and \treestaropt{name-case} setting) is
greater than 2cm, then the name width and current widest name will be updated.

\treestaroptdef{update-widest-sub-name}
Updates the widest name for level~1 entries, if \meta{text} is
wider than the current setting.

\treestaroptdef{update-widest-sub-sub-name}
Updates the widest name for level~2 entries, if \meta{text} is
wider than the current setting.

If a deeper level is required, you will need to use
\gls{glossariestreeupdatewidestname:nn} (which is what the above options
use).

\treestaroptdef{symbol-width}
Sets the width of the \idx{tree*.symbolbox} for top-level entries. The value may be:
\optfmt{natural} (no fixed width), \optfmt{widest}
(the width of the widest symbol), or a valid dimension.
The widest symbol may be set with \treestaropt{widest-symbol}
or with one of the commands described in \sectionref{sec:tree*cmds}.

\begin{information}
If the dimension evaluates to a value less than or equal to zero, 
natural width will be used instead, but it will affect the
calculation of the \idx{tree*.name+symbolbox} width if
\treestaroptval{name-symbol-width}{widest} is set.
\end{information}

\treestaroptdef{sub-symbol-width}
Sets the width of the \idx{tree*.symbolbox} for level~1 entries. The value may be:
\optfmt{natural} (no fixed width), \optfmt{widest}
(the width of the widest symbol), or a valid dimension.
The widest symbol may be set with \treestaropt{widest-sub-symbol}
or with one of the commands described in \sectionref{sec:tree*cmds}.

As with \treestaropt{symbol-width}, if the dimension evaluates to
less than or equal to zero, natural width will be used instead, 
but it will affect any calculation dependent on this dimension.

\treestaroptdef{sub-sub-symbol-width}
Sets the width of the \idx{tree*.symbolbox} for level~2 entries. The value may be:
\optfmt{natural} (no fixed width), \optfmt{widest}
(the width of the widest symbol), or a valid dimension.
The widest symbol may be set with \treestaropt{widest-sub-sub-symbol}
or with one of the commands described in \sectionref{sec:tree*cmds}.

As with \treestaropt{symbol-width}, if the dimension evaluates to
less than or equal to zero, natural width will be used instead, 
but it will affect any calculation dependent on this dimension.

If a deeper level is required, you will need to use
\gls{glossariestreesetsymbolwidth:nn} (which is what the above options
use).

\treestaroptdef{symbol-align}
Sets the horizontal alignment of the \idx{tree*.symbolbox}, if it has
a fixed width. The value may be one of:
\optfmt{l} (left), \optfmt{c} (centred), or \optfmt{r} (right).
This setting covers any level that has a fixed-width
\idx{tree*.symbolbox}.

\treestaroptdef{widest-symbol}
Sets the widest symbol for top-level entries, which is used to
calculate the width if \treestaroptval{symbol-width}{widest}.

\treestaroptdef{widest-sub-symbol}
Sets the widest symbol for level~1 entries, which is used to
calculate the width if \treestaroptval{sub-symbol-width}{widest}.

\treestaroptdef{widest-sub-sub-symbol}
Sets the widest symbol for level~2 entries, which is used to
calculate the width if \treestaroptval{sub-sub-symbol-width}{widest}.

If a deeper level is required, you will need to use
\gls{glossariestreesetwidestsymbol:nn} (which is what the above options
use).

\treestaroptdef{update-widest-symbol}
Updates the widest symbol for top-level entries, if \meta{text} is
wider than the current setting. For example, if
\treestaroptval{symbol-width} was set to 2cm and later
\treestaropt{update-widest-symbol} is set to \optfmt{aardvark}
then if the width of \optfmt{aardvark} (using the current 
\treestaropt{symbol-font} and \treestaropt{symbol-case} setting) is
greater than 2cm, then the symbol width and current widest symbol will be updated.

\treestaroptdef{update-widest-sub-symbol}
Updates the widest symbol for level~1 entries, if \meta{text} is
wider than the current setting.

\treestaroptdef{update-widest-sub-sub-symbol}
Updates the widest symbol for level~2 entries, if \meta{text} is
wider than the current setting.

If a deeper level is required, you will need to use
\gls{glossariestreeupdatewidestsymbol:nn} (which is what the above options
use).

Alternatively (or additionally), if you want a fixed-width 
\idx{tree*.name+symbolbox} you can use the following:
\treestaroptdef{name-symbol-width}
Sets the width for the \idx{tree*.name+symbolbox} for top-level
entries, which should include room for the
entry item counter (if applicable), the \idx{tree*.namesymbolsep} and
\idx{tree*.post-namesymbol} content.
The value may be the keyword \optfmt{natural} (natural width),
or the keyword \optfmt{widest} (calculate the width) or a valid dimension.

\begin{information}
If the dimension evaluates to a value less than or equal to zero, 
natural width will be used instead, but it will affect the
calculation of the hanging indentation.
\end{information}

If you use the \optfmt{widest} setting, you will need to ensure
that the name width and symbol width have either been set or 
can be calculated from the widest name and widest symbol.
Additionally, if you are also using \opt{entrycounter}, you will
need to supply a width for the entry counter with \treestaropt{item-counter-width}.

\treestaroptdef{sub-name-symbol-width}
As \treestaropt{name-symbol-width} but for level~1 entries.
You may also set this option to \optfmt{match higher} to use the
same width as \treestaropt{name-symbol-width}.

\treestaroptdef{sub-sub-name-symbol-width}
As \treestaropt{name-symbol-width} but for level~2 entries.
You may also set this option to \optfmt{match higher} to use the
same width as \treestaropt{sub-name-symbol-width} (which must be set
first).

If a deeper level is required, you will need to use
\gls{glossariestreesetnamesymbolwidth:nn} (which is what the above options
use). See \sectionref{sec:tree*cmds} for details on how the width is
calculated.

\treestaroptdef{name-symbol-align}
Sets the horizontal alignment of the \idx{tree*.name+symbolbox}, if it has
a fixed width. The value may be one of:
\optfmt{l} (left), \optfmt{c} (centred), or \optfmt{r} (right).
This setting covers any level that has a fixed-width
\idx{tree*.name+symbolbox}.

\treestaroptdef{item-counter-width}
Sets the width of the top-level entry counter box. The value may be
the keyword \optfmt{natural} if a fixed width box shouldn't be used,
or a valid dimension otherwise. Remember that the box will be
present even if \optval{entrycounter}{false}.
Note that there is no \optfmt{widest} option available in this case.
A zero dimension will result in a zero-width box.

\treestaroptdef{sub-item-counter-width}
Sets the width of the level~1 entry counter box. The value may be
the keyword \optfmt{natural} if a fixed width box shouldn't be used,
or a valid dimension otherwise. Remember that the box will be
present even if \optval{subentrycounter}{false}.
Note that there is no \optfmt{widest} option available in this case.
A zero dimension will result in a zero-width box.

\treestaroptdef{item-counter-align}
Sets the horizontal alignment of the top-level entry counter box, if
it has a fixed width. The value may be one of:
\optfmt{l} (left), \optfmt{c} (centred), or \optfmt{r} (right).
This setting is ignored if \treestaroptval{item-counter-width}{natural}.

\treestaroptdef{sub-item-counter-align}
Sets the horizontal alignment of the level~1 entry counter box, if
it has a fixed width. The value may be one of:
\optfmt{l} (left), \optfmt{c} (centred), or \optfmt{r} (right).
This setting is ignored if \treestaroptval{sub-item-counter-width}{natural}.

\treestaroptdef{item-counter-font}
Sets the font declarations to use when typesetting the top-level
entry counter. The last command in the list may be a text-block
command.

\treestaroptdef{sub-item-counter-font}
Sets the font declarations to use when typesetting the level~1
entry counter. The last command in the list may be a text-block
command.

\paragraph{Letter Group Options}
\label{sec:tree*groupopts}

These options relate to letter \idxpl{group}. Note that if \app{bib2gls}
is run with the default \switch{no-group} then there won't be any
letter \idxpl{group}. This isn't the same as having letter
\idxpl{group} that are then suppressed with options such as
\treestaropt{hide-groups}. If there aren't any letter \idxpl{group}
then changing these options won't have any effect.

\treestaroptdef{hide-groups}
If true, omit group skip and group heading, regardless of
the current \treestaropt{group-headings} or \opt{nogroupskip}
settings. If false, the group skip and group headings will behave as
normal. When set, this just locally sets \opt{nogroupskip}
and \treestaroptval{group-headings}{false} within the scope of
\env{theglossary} for the \glostyle{tree*} style.

\treestaroptdef{group-headings}
If true, the letter group headings will be shown (unless
\treestaroptval{hide-groups}{true} is set). Note that the group skip
(which can be suppressed with \opt{nogroupskip} and adjusted with
\treestaropt{group-skip}) comes before the heading (except for the
first one). The vertical gap after the heading is governed by
\treestaropt{post-group-heading-skip}.

\treestaroptdef{bookmark-groups}
If true and \treestaroptval{group-headings}{true} and
\gls{pdfbookmark} has been defined, then each letter
\idx{group} will be added to the PDF bookmarks.
If you prefer to use a different bookmark command then you can
redefined \gls{glossariestreebookmarkgroup:nnn}
as appropriate.

\treestaroptdef{group-skip}
The value should be a dimension which specifies the height of
the gap between letter groups (before the group heading, if
applicable). This setting is ignored if the group skip is suppressed
via \opt{nogroupskip} or \treestaropt{hide-groups}.
Note that the value isn't evaluated until
the start of \env{theglossary}.

\treestaroptdef{post-group-heading-skip}
The value should be a dimension which specifies the height of the
gap following the letter group heading. This setting is ignored if
the group heading isn't shown.
Note that the value isn't evaluated until
the start of \env{theglossary}.

\treestaroptdef{header-font}
The font to apply to the letter \idx{group} header (if shown).
The value may be a list of font declarations. The last in the list
may be a text-block command. For example:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{group-headings},
      \treestaroptval{header-font}{\cmd{large}\cmd{textbf}}
    }
  }
}
\end{codebox}

\treestaroptdef{header-align}
The horizontal alignment of the group header (if shown). The value
may be one of: \optfmt{left} (flush left), \optfmt{right} (flush
right), \optfmt{center} (centred) or \optfmt{indent} (use the same
paragraph indentation as the items).

\treestaroptdef{sub-header-font}
The font declarations to use for the sub-group headers
(if supported). The final command in the list may be a text-block
command. The \meta{value} may also be the keyword \optfmt{inherit}
which indicates to use the same setting as
\treestaropt{header-font}.

\begin{bib2gls}
Sub-groups are only available with \gls{printunsrtglossary} and can
be created with \app{bib2gls}['s] \resourceopt{group-level} resource option.
\end{bib2gls}

\treestaroptdef{sub-header-align}
The horizontal alignment of the sub-group header (if supported). The value
may be one of: \optfmt{inherit} (match \treestaropt{header-align}),
\optfmt{left} (flush left), \optfmt{right} (flush right),
\optfmt{center} (centred) or \optfmt{indent} (use the same paragraph
indentation as the items).

\paragraph{Paragraph, Spacing and Alignment Options}
\label{sec:tree*paralignopts}

\treestaroptdef{par-skip}
The value may be empty (use the current paragraph
skip) or a dimension to use as the paragraph skip
within the glossary. Note that the value isn't tested or evaluated until
the start of \env{theglossary}.

\treestaroptdef{par-indent}
The value may be empty (use the current paragraph
indentation) or a dimension to use as the paragraph indentation
within the glossary. Note that the value isn't tested or evaluated until
the start of \env{theglossary}.

\treestaroptdef{child-offset}
The offset for each sub-level. Note that the value isn't evaluated until
the start of \env{theglossary}. Each sub-level has the paragraph
indentation set to the \treestaropt{par-indent} value plus the
offset times the hierarchical level (1 for the first sub-level, 2
for the second sub-level, etc).
Similarly for the hanging indentation.

\treestaroptdef{hang-indent}
The value may be empty (use the current hanging indentation) or the
keyword \optfmt{calculated} to calculate the indentation or a
dimension to use as the hanging indentation within the glossary.
Note that the value isn't tested or evaluated until
the start of \env{theglossary}.

The \treestaroptval{hang-indent}{calculated} value will set the
hanging indentation to the combined width of the 
\idx{tree*.name+symbolbox} plus the 
\idx{tree*.name+symbolbox} padding.
This means that the width of the \idx{tree*.name+symbolbox} must be
set with \treestaroptval{name-symbol-width} or be possible to calculate.

\treestaroptdef{name-symbol-padding}
The extra padding that should be taken into account by
\treestaroptval{hang-indent}{calculated}.
An empty value indicates that the padding dimension (which is
initially zero) shouldn't be changed.
Note that the value isn't tested or evaluated until the start of
\env{theglossary}.

\treestaroptdef{name-padding}
The extra padding taken up by the \idx{tree*.namebox} that should be taken into
account when calculating the width of the \idx{tree*.name+symbolbox}.  An empty
value indicates that the padding dimension (which is initially zero)
shouldn't be changed.  Note that the
value isn't tested or evaluated until the start of
\env{theglossary}.

\treestaroptdef{symbol-padding}
The extra padding taken up by the \idx{tree*.symbolbox} that should be taken into
account when calculating the width of the \idx{tree*.name+symbolbox}.  An empty
value indicates that the padding dimension (which is initially zero)
shouldn't be changed.  Note that the
value isn't tested or evaluated until the start of
\env{theglossary}.

For example, if \gls{GlsTreeStarBox} is redefined to use a frame
then the padding needs to include the space taken up by the frame:
\begin{codebox*}
\cmd{renewcommand}\gls{GlsTreeStarBox}\oarg{1}\marg{\gls{fbox}\marg{\#1}}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{hang-indent},
      \treestaroptval{name-symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
      \treestaroptval{name-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
      \treestaroptval{symbol-padding}{2\gls{fboxsep}+2\gls{fboxrule}},
      \treestaroptval{name-width}{2.5cm},
      \treestaroptval{symbol-width}{1.5cm}
    }
  }
}
\end{codebox*}

\treestaroptdef{item-counter-padding}
The extra padding taken up by the top-level entry counter
(\opt{entrycounter}) that should be taken into
account when calculating the width of the \idx{tree*.name+symbolbox}.
An empty value is equivalent to \optfmt{0pt} and indicates no padding.
Note that the value isn't tested or evaluated until the start of
\env{theglossary}.

\treestaroptdef{sub-item-counter-padding}
As \treestaropt{item-counter-padding} but for the level~1 entry
counter (\opt{subentrycounter}).

\paragraph{Hyper-Navigation Options}
\label{sec:tree*hypernavopts}

If the document supports \idxpl{hyperlink}, a navigation strip can
be added to the start of the glossary. This will require an extra
\LaTeX\ run (unless \app{bib2gls} can determine the relevant
information). The strip will contain a hyperlink to each letter
group shown in the glossary. The following settings have no effect
if there are no letter \idxpl{group} or if the group headings aren't
shown.

\treestaroptdef{hyper-nav}
If true, show the hyper-navigation strip.

\treestaroptdef{hyper-nav-skip}
The height of the space after the navigation strip (if shown). The
default setting is to use the same value as
\treestaropt{group-skip}.

\treestaroptdef{hyper-nav-font}
The font declarations to use for the navigation strip
(if shown). The final command in the list may be a text-block
command. For example
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{hyper-nav},
      \treestaroptval{hyper-nav-font}{\cmd{large}\cmd{textbf}}
    }
  }
}
\end{codebox}

\treestaroptdef{hyper-nav-align}
The horizontal alignment of the navigation strip (if shown). The value
may be one of: \optfmt{left} (flush left), \optfmt{right} (flush
right), \optfmt{center} (centred) or \optfmt{indent} (use the same
paragraph indentation as the items).

\paragraph{Commands}
\label{sec:tree*cmds}

Most settings can be implemented via the \opt{style-options.tree*}
option but there are a few helper commands and hooks that may be
redefined.

\cmddef{GlsTreeStarNameBox}
This command is used to encapsulate the \idx{tree*.namebox}
(if shown). The default definition expands to
\code{\gls{GlsTreeStarBox}\margm{text}}.

\cmddef{GlsTreeStarSymbolBox}
This command is used to encapsulate the \idx{tree*.symbolbox}
(if shown). The default definition expands to
\code{\gls{GlsTreeStarBox}\margm{text}}.

\cmddef{GlsTreeStarOuterBox}
This command is used to encapsulate the \idx{tree*.name+symbolbox}
(if shown). The default definition expands to
\code{\gls{GlsTreeStarBox}\margm{text}}.

\cmddef{GlsTreeStarBox}
Used by the above commands to provide a quick way of framing the
boxes to check the bounds.

\cmddef{GlsTreeStarItemCounterBox}
This command is used to encapsulate the top-level entry counter
representation.  Note that with the default
\optval{entrycounter}{false} setting, the area will be empty (not
omitted). The default definition simply expands to
\meta{text}.

\cmddef{GlsTreeStarSubItemCounterBox}
This command is used to encapsulate the level~1 entry counter
representation.  Note that with the default
\optval{subentrycounter}{false} setting, the area will be empty (not
omitted). The default definition expands to:
\begin{compactcodebox}
\gls{GlsTreeStarItemCounterBox}\margm{text}
\end{compactcodebox}

\cmddef{GlsTreeUpdateWidestNameOrSymbol}
Updates the widest name or symbol settings if the entry identified
by \meta{entry-label} has a name or symbol wider than the current
setting. If the optional argument is omitted, the level is obtained
from the entry's internal field whose value was calculated when the entry
was defined.

This internally uses \gls{glossariestreeupdatewidestname:nn}
and \gls{glossariestreeupdatewidestsymbol:nn} (described below).
You may find this useful in \gls{glsnoidxitemhook} or
\gls{printunsrtglossaryentryprocesshook} to automatically calculate
the widest name and symbol, if you want the names and symbols
aligned.

\cmddef{GlsTreeUpdateWidestNameAndSymbol}
Updates the widest name and symbol if the combined width of the
given entry's name and symbol is wider than the current setting.
If the optional argument is omitted, the level is obtained
from the entry's internal field whose value was calculated when the entry
was defined.

This internally uses \gls{glossariestreeupdatewidestnamesymbol:nnn}.
You may find this useful in \gls{glsnoidxitemhook} or
\gls{printunsrtglossaryentryprocesshook} to automatically calculate
the widest name and symbol, if you want the hanging indent
calculated to align the descriptions.

\begin{important}
Don't mix using a command that updates both the name and symbol
based on their combined width with commands or options that
set the widest name and symbol individually.
\end{important}

If \LaTeX3 syntax is enabled, the following commands may also be
used:

\cmddef{glossariestreepreitem:nnn}
Hook used at the start of each \idx{entryitem} (before the
\idx{tree*.name+symbolbox}). This does nothing by default but may be
redefined. For example, if the \sty{glossary-bookindex} package has
also been loaded, then to mark top-level items:
\begin{codebox*}
\cmd{cs\_set:Nn} \gls{glossariestreepreitem:nnn}
 \marg
 {
   \cmd{int\_if\_zero:nTF} \marg{ \#1 }
    \marg{
     \gls{glsxtrbookindexmarkentry} \marg{ \#2 }
    }
 }
\end{codebox*}
See the \sty{glossaries-extra} manual for further details of the 
\sty{glossary-bookindex} commands.

\cmddef{glossariestreepostitem:nnn}
Hook used at the end of each \idx{entryitem} (before the
\idx{tree*.name+symbolbox}). This does nothing by default but may be
redefined. For example, if the \glosfield{childcount} field is
available, this hook can be used to add content if the entry has one
or more children. For example with \option{noidx}:
\begin{codebox}
\cmd{cs\_set:Nn} \gls{glossariestreepostitem:nnn}
 \marg{
   \gls{ifglsfieldvoid} \marg{ \glosfield{childcount} } \marg{ \#2 }
    \marg{ } \comment{no child count}
    \marg{ : }
 }
\end{codebox}
or with \option{b2g}:
\begin{codebox}
\cmd{cs\_set:Nn} \gls{glossariestreepostitem:nnn}
 \marg{
   \gls{GlsXtrIfHasNonZeroChildCount} \marg{ \#2 }
    \marg{ : }
    \marg{ } \comment{no child count}
 }
\end{codebox}
(This assumes \gls{printnoidxglossary} or \app{bib2gls} has been
used with the appropriate options. The \glosfield{childcount} field
is not available with \gls{printglossary}.)

\cmddef{glossariestreebookmarkgroup:nnn}
If \gls{pdfbookmark} has been defined, this expands to:
\begin{compactcodebox}
\gls{pdfbookmark} \oargm{bookmark-level} \margm{group-title}
  \marg{ \gls{currentglossary} . \meta{group-label} }
\end{compactcodebox}
otherwise it expands to nothing. This command is used if
both \treestaroptval{bookmark-groups}{true} and
\treestaroptval{group-headings}{true}. The \meta{level} argument will be the
value of one plus the group's \idx{hierarchicallevel} plus (if defined)
the expansion of \csmetafmt{toclevel@}{section}{} where
\meta{section} is the current \opt{section} value.
Note the \code{\gls{currentglossary}.}\ prefix for the bookmark
name, which helps provide a unique label.

If you have repeated \idxpl{glossary} (for example, a compact
summary at the start of a section and a full list at the end of the
document) then you may need to redefine this command to ensure
uniqueness if all \idxpl{glossary} need to add bookmarks.

\cmddef{glossariestreesubgrouptitle:nn}
Used to format the sub-group header title (if shown).
By default this will show the parent's hierarchical name
followed by the title separated by a slash (\code{/}).
Note that sub-groups are only supported by
\gls{printunsrtglossary}.

\cmddef{glossariestreenamenobox:n}
Used to format the \idx{tree*.namebox} for the natural width setting. 
The default definition is:
\begin{compactcodebox}
\gls{GlsTreeStarBox}\marg{\margm{text}}
\end{compactcodebox}
This applies grouping to localise the font change.

\cmddef{glossariestreenamebox:nnn}
Used to format the \idx{tree*.namebox} for the fixed width setting. 
The default definition is:
\begin{compactcodebox*}
\gls{GlsTreeStarBox}\marg{\gls{makebox}\oargm{width}\oargm{h-align}\margm{text}}
\end{compactcodebox*}

\cmddef{glossariestreesymbolnobox:n}
Used to format the \idx{tree*.symbolbox} for the natural width setting. 
The default definition is:
\begin{compactcodebox}
\gls{GlsTreeStarBox}\marg{\margm{text}}
\end{compactcodebox}
This applies grouping to localise the font change.

\cmddef{glossariestreesymbolbox:nnn}
Used to format the \idx{tree*.symbolbox} for the fixed width setting. 
The default definition is:
\begin{compactcodebox*}
\gls{GlsTreeStarBox}\marg{\gls{makebox}\oargm{width}\oargm{h-align}\margm{text}}
\end{compactcodebox*}

\cmddef{glossariestreeparen:n}
Applies parentheses to \meta{text}. This is used by the style
settings that encapsulate the name or symbol in parentheses.
This command should be redefined if a different type of parentheses
or brackets are required.

\cmddef{glossariestreeentryitemnobox:n}
Used to format the top-level entry item counter (corresponding to
the \opt{entrycounter} option) for the natural width setting. 
The default definition is:
\begin{compactcodebox}
\gls{GlsTreeStarItemCounterBox}\marg{\margm{text}}
\end{compactcodebox}
This applies grouping to localise any font change.
Note that with \optval{entrycounter}{false}, \meta{text} will be
empty. This means that you can redefine this command (or the next)
if you want some other initial marker for level~0 items.

\cmddef{glossariestreeentryitembox:nnn}
Used to format the top-level entry item counter for the fixed
width setting.
The default definition is:
\begin{compactcodebox*}
\gls{GlsTreeStarItemCounterBox}\marg{\gls{makebox}\oargm{width}\oargm{h-align}\margm{text}}
\end{compactcodebox*}

\cmddef{glossariestreesubentryitemnobox:n}
Used to format the level~1 entry item counter (corresponding to
the \opt{subentrycounter} option) for the natural width setting. 
The default definition is:
\begin{compactcodebox}
\gls{GlsTreeStarSubItemCounterBox}\marg{\margm{text}}
\end{compactcodebox}
This applies grouping to localise any font change.
Note that with \optval{subentrycounter}{false}, \meta{text} will be
empty. This means that you can redefine this command (or the next)
if you want some other initial marker for level~1 items.

\cmddef{glossariestreesubentryitembox:nnn}
Used to format the level~1 entry item counter for the fixed
width setting.
The default definition is:
\begin{compactcodebox*}
\gls{GlsTreeStarSubItemCounterBox}\marg{\gls{makebox}\oargm{width}\oargm{h-align}\margm{text}}
\end{compactcodebox*}

\cmddef{glossariestreesetnamewidth:nn}
Sets the name width for the given level. This command is used by
the \treestaropt{name-width}, \treestaropt{sub-name-width}
and \treestaropt{sub-sub-name-width} options. Any deeper levels will
need to use this command.

The \meta{value} may be the keyword \optfmt{natural} (natural width),
or the keyword \optfmt{widest} (calculate the width from the widest name 
setting for the given level) or a valid dimension.

If the width has to be calculated from the widest name, the
font formatting and, if applicable, parentheses will be included.
Remember that you will need to specify the widest name.

\cmddef{glossariestreesetsymbolwidth:nn}
Sets the symbol width for the given level. This command is used by
the \treestaropt{symbol-width}, \treestaropt{sub-symbol-width}
and \treestaropt{sub-sub-symbol-width} options. Any deeper levels will
need to use this command.

The \meta{value} may be the keyword \optfmt{natural} (natural width),
or the keyword \optfmt{widest} (calculate the width from the widest symbol 
setting for the given level) or a valid dimension.

If the width has to be calculated from the widest symbol, the
font formatting and, if applicable, parentheses will be included.
Remember that you will need to specify the widest symbol.

\cmddef{glossariestreesetwidestname:nn}
Locally sets the widest name for the given level. This command is used by
the \treestaropt{widest-name}, \treestaropt{widest-sub-name}, and
\treestaropt{widest-sub-sub-name} options. Any deeper levels will
need to use this command.
As from v4.59, \gls{glssetwidest} now simply uses the above command.

\begin{xtr}
If you are also using \sty{glossaries-extra-stylemods} (either
explicitly or via \opt{stylemods}) make sure you have at least
version 1.6 of \sty{glossaries-extra}.
\end{xtr}

\cmddef{glossariestreegsetwidestname:nn}
Globally sets the widest name for the given level.

\cmddef{glossariestreeupdatewidestname:nn}
Updates the widest name for the given level. Note that, unlike
\gls{glsupdatewidest}, this command doesn't re-measure the current
widest name but instead only measures \meta{text} and compares it
with the currently set or calculated name width. If it's wider, the
current widest name will be locally updated.

For example, if the widest name hasn't been set but the name width
has been set to a dimension then the width of \meta{text} will be
compared against that dimension.

\cmddef{glossariestreesetwidestsymbol:nn}
Locally sets the widest symbol for the given level. This command is used by
the \treestaropt{widest-symbol}, \treestaropt{widest-sub-symbol}, and
\treestaropt{widest-sub-sub-symbol} options. Any deeper levels will
need to use this command.

\cmddef{glossariestreegsetwidestsymbol:nn}
Globally sets the widest symbol for the given level.

\cmddef{glossariestreeupdatewidestsymbol:nn}
Updates the widest symbol for the given level (analogous to 
\gls{glossariestreeupdatewidestname:nn}).

\cmddef{glossariestreeresetallwidest:}
Resets the widest name and symbol for all levels and reverts the
settings back to natural.

\cmddef{glossariestreesetnamesymbolwidth:nn}
Sets the width for the \idx{tree*.name+symbolbox}, which should
include room for the \idx{tree*.namesymbolsep} and
\idx{tree*.post-namesymbol} content.
The value may be the keyword \optfmt{natural} (natural width),
or the keyword \optfmt{match higher} (only if there is a higher level)
or the keyword \optfmt{widest} (calculate the width) or a valid dimension.

If \optfmt{widest} is specified, the width is calculated by summing
the applicable the name width, symbol width, and measured widths of
the \idx{tree*.namesymbolsep} and \idx{tree*.post-namesymbol}
content. If the style setting omits the name or symbol
then the omitted parts aren't included in the calculation.

The \optfmt{match higher} setting sets the dimension after the
dimension for the higher level has been assigned or calculated.
The setting for the next level up must be set first.

\begin{important}
If the name width or symbol width has been set to \optfmt{natural}
then the applicable width will need to be calculated according to the widest
name or symbol.
\end{important}

\cmddef{glossariestreeupdatewidestnamesymbol:nnn}
Updates the widest name and symbol if the combined width of the
given \meta{name} and \meta{symbol} is wider than the current setting.

\begin{important}
Don't mix using a command that updates both the name and symbol
based on their combined width with commands or options that
set the widest name and symbol individually.
\end{important}

\subsubsection{Old Styles}
\label{sec:oldtreestyles}

These older styles can't be configured with the \opt{style-options}
setting, but instead need to have associated commands redefined
to adjust the format. These styles can mostly be replicated with the newer
\glostyle{tree*} style. However, they are still available if you
prefer them.

These styles all format the entry name using:
\cmddef{glstreenamefmt}
This defaults to \code{\gls{textbf}\margm{text}}, but note that \meta{text}
will include \gls{glsnamefont} so the bold setting in \gls{glstreenamefmt}
may be counteracted by another font change in \gls{glsnamefont} (or
in \gls{acronymfont}). The tree-like styles that also display the
header use
\cmddef{glstreegroupheaderfmt}
to format the heading. This defaults to
\code{\gls{glstreenamefmt}\margm{text}}. The tree-like styles that display
navigation links to the groups (such as \glostyle{indexhypergroup}), format
the navigation line using
\cmddef{glstreenavigationfmt}
which defaults to \code{\gls{glstreenamefmt}\margm{text}}. 

Note that this is different from \gls{glslistnavigationitem},
provided with the styles such as \glostyle{listhypergroup}, as that
also includes \gls{item}.

With the exception of the \glostyle{alttree} style (and those
derived from it), the space before the description for top-level
entries is produced with
\cmddef{glstreepredesc}
This defaults to \gls{space}.

With the exception of the \glostyle{treenoname} and
\glostyle{alttree} styles (and those derived from them), the 
space before the description for child
entries is produced with
\cmddef{glstreechildpredesc}
This defaults to \gls{space}.

\begin{important}
Most of these styles are not designed for multi-paragraph 
descriptions. (The \glostyle{tree} style isn't too bad for
multi-paragraph top-level entry descriptions, or you can use the
\glostyle{index} style with the adjustment shown below.)
\end{important}

\glostyledef{index}

The \glostyle{index} style is similar to the way standard indices
are usually formatted in that it has a \hierarchical\ structure up
to three levels (the main level plus two sub-levels).  If the symbol
is present it is set in parentheses after the name and before the
description.  Sub-entries are indented and also include the name,
the symbol in brackets (if present) and the description.
\Idxpl{group} are separated using \gls{indexspace}.

Each main level item is started with
\cmddef{glstreeitem}
The \hierlevel{1} entries are started with
\cmddef{glstreesubitem}

The \hierlevel{2} entries are started with
\cmddef{glstreesubsubitem}

Note that the \glostyle{index} style automatically sets
\begin{compactcodebox*}
\cmd{let}\gls{item}\gls{glstreeitem}
\cmd{let}\gls{subitem}\gls{glstreesubitem}
\cmd{let}\gls{subsubitem}\gls{glstreesubsubitem}
\end{compactcodebox*}
at the start of the \env{theglossary} environment for backward compatibility.

The \glostyle{index} style isn't suitable for multi-paragraph
descriptions, but this limitation can be overcome by redefining
the above commands. For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glstreeitem}}\marg{\comment{}
 \cmd{parindent}0pt\cmd{par}\cmd{hangindent}40pt
 \cmd{everypar}\marg{\cmd{parindent}50pt\cmd{hangindent}40pt}}
\end{codebox}

\glostyledef{indexgroup}

The \glostyle{indexgroup} style is similar to the \glostyle{index}
style except that each group has a heading obtained using
\gls{glsgetgrouptitle}.

\glostyledef{indexhypergroup}

The \glostyle{indexhypergroup} style is like \glostyle{indexgroup}
but has a set of links to the glossary \idxpl{group}. The navigation
line is the same as that for \glostyle{listhypergroup}, described
above, but is formatted using \gls{glstreenavigationfmt}.

\glostyledef{tree}

The \glostyle{tree} style is similar to the
\glostyle{index} style except that it can have arbitrary 
\idxpl{hierarchicallevel}.
(Note that \app{makeindex} is limited to three levels, so
you will need to use another indexing method if you want more than 
three levels.) Each sub-level is indented according to the length
\cmddef{glstreeindent}
This value can be changed with \cmd{setlength}.

Note that the name, symbol (if present) and description are placed
in the same paragraph block. If you want the name to be apart from
the description, use the \glostyle{alttree} style instead. (See
below.)

\glostyledef{treegroup}

The \glostyle{treegroup} style is similar to the \glostyle{tree}
style except that each \idx{group} has a heading.

\glostyledef{treehypergroup}

The \glostyle{treehypergroup} style is like 
\glostyle{treegroup} but has a set of links to the glossary 
\idxpl{group}. The navigation line is the same as that for 
\glostyle{listhypergroup}, described above, but is formatted using
\gls{glstreenavigationfmt}.

\glostyledef{treenoname}

The \glostyle{treenoname} style is like the \glostyle{tree} style
except that the name for each sub-entry is ignored.

\glostyledef{treenonamegroup}

The \glostyle{treenonamegroup} style is similar to the
\glostyle{treenoname} style except that each group has a heading.

\glostyledef{treenonamehypergroup}

The \glostyle{treenonamehypergroup} style is like
\glostyle{treenonamegroup} but has a set of links to the glossary
\idxpl{group}. The navigation line is the same as that for
\glostyle{listhypergroup}, described above, but is formatted using
\gls{glstreenavigationfmt}.

\glostyledef{alttree}

The \glostyle{alttree} style is similar to the
\glostyle{tree} style except that the indentation for each level
is determined by the width of the text specified by
\cmddef{glssetwidest}
The optional argument \meta{level} indicates the
\idx{hierarchicallevel}, where 0 indicates the top-most level, 1
indicates the first level sub-entries, etc. If \gls{glssetwidest}
hasn't been used for a given sub-level, the level~0 widest text is
used instead. If \meta{level} is omitted, 0 is assumed.

Note that \gls{glssetwidest} uses the same underlying function 
as \glostyle{tree*} options such as \treestaropt{widest-name}.

\begin{warning}
If you use the \glostyle{alttree} style without setting the widest
\toplevel\ name, there will be no room available for the name.
If a name overlaps the description, then this is an indication that 
there is a name wider than the one specified.
\end{warning}

This requires keeping track of which \idx{entry} has the widest name,
which may not be practical for large \idxpl{glossary}. Instead you
can use:
\cmddef{glsfindwidesttoplevelname}
This iterates over all entries in the glossaries identified by the
comma-separated list \meta{glossary labels} and determines the
widest \toplevel\ entry. If the optional argument is omitted, all
non-\idxpl{ignoredglossary} are assumed.

For example, to have the same name width for all glossaries:
\begin{codebox}
\gls{glsfindwidesttoplevelname}
\gls{setglossarystyle}\marg{\glostyle{alttree}}
\gls{printglossaries}
\end{codebox}
Alternatively, to compute the widest entry for each glossary
before it's displayed:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glossarypreamble}}\marg{\comment{}
  \gls{glsfindwidesttoplevelname}\oarg{\gls{currentglossary}}}
\gls{setglossarystyle}\marg{\glostyle{alttree}}
\gls{printglossaries}
\end{codebox}

\begin{information}
These commands only affects the \glostyle{alttree} styles, including those 
listed below and the ones in the \sty{glossary-mcols} package.
\end{information}

\begin{xtr}
The \gls{glssetwidest} command also affects the styles provided by
\sty{glossary-topic}.
The \sty{glossaries-extra-stylemods} package provides additional
commands. With \app{bib2gls}, you may prefer the
\resourceopt{set-widest} resource option.
\end{xtr}

For each level, the name is placed to the left of the paragraph
block containing the symbol (optional) and the description. If the
symbol is present, it is placed in parentheses before the
description.

The name is placed inside a left-aligned \gls{makebox}, created with:
\cmddef{glstreenamebox}
where \meta{width} is the width of the box (calculated from the
widest name) and \meta{text} is the contents of the box. For
example, to make the name right-aligned:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glstreenamebox}}[2]\marg{\comment{}
  \gls{makebox}\oarg{\#1}\oarg{r}\marg{\#2}\comment{}
}
\end{codebox}

\glostyledef{alttreegroup}

The \glostyle{alttreegroup} is like the \glostyle{alttree} style
except that each \idx{group} has a heading.

\glostyledef{alttreehypergroup}

The \glostyle{alttreehypergroup} style is like
\glostyle{alttreegroup} but has a set of links to the glossary
\idxpl{group}.

\subsection{Multicols Style}
\label{sec:mcolstyles}

\pkgdef*{glossary-mcols}

The \sty{glossary-mcols} package provides tree-like
\idxpl{glossarystyle} that are in the \env{multicols} environment
(defined by the \sty{multicol} package). The style names are as
their analogous tree styles (as defined in
\sectionref{sec:treestyles}) but are prefixed with \qt{mcol}.  For
example, the \glostyle{mcolindex} style is essentially the
\glostyle{index} style but put in a \env{multicols} environment.
For the complete list, see \tableref{tab:mcols}. The
\sty{glossary-tree} package is automatically loaded by
\sty{glossary-mcols} (even if the \opt{notree} package option is
used when loading \sty{glossaries}).

Note that these styles will only be available if you explicitly load
\sty{glossary-mcols}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-mcols}
\end{codebox}
Note that you can't set these styles using the \opt{style}
package option since the styles aren't defined until after
the \sty{glossaries} package has been loaded.

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{mcolindex}},\optval{stylemods}{mcols}]\marg{glossaries-extra}
\end{codebox}

\glostyledef{mcoltree*}

The \glostyle{mcoltree*} style is new to version 4.59 and may be configured using the
\glostyleopt{mcoltree*} key within the \opt{style-options} setting.
This style is based on the \glostyle{tree*} style and will therefore 
be influenced by any \glostyleopt{tree*} options and commands (see
\sectionref{sec:tree*style}).
For example:
\begin{codebox}
\gls{setupglossaries}\marg{
  \optvalm{style-options}{
    \glostyleoptvalm{tree*}{
      \treestaropt{group-headings},
      \treestaroptval{pre-location}{\cmd{dotfill}}
    },
    \glostyleoptvalm{mcoltree*}{
      \mcoltreestaropt{balance},
      \mcoltreestaroptval{columns}{3}
    }
  }
}
\end{codebox}
Alternatively:
\cmddef{GlsMcolTreeSetup}
This is a shorter way of just setting the \glostyleopt{mcoltree*}
options. For example:
\begin{codebox}
\gls{GlsMcolTreeSetup}\marg{
  \mcoltreestaropt{balance},
  \mcoltreestaroptval{columns}{3}
}
\end{codebox}

The following \glostyleopt{mcoltree*} options are available:

\mcoltreestaroptdef{balance}
If true, balance the columns. That is, the unstarred \env{multicols}
environment is used. If false, \env{multicols*} is used instead.

\mcoltreestaroptdef{columns}
The number of columns. This is unconnected to the \gls{glsmcols}
command that's used by the other \sty{glossary-mcols} styles.

\mcoltreestaroptdef{span-nav}
If the \glostyleopt{tree*} option \treestaropt{hyper-nav}
is true and \mcoltreestaropt{span-nav} is also true,
then the hyper navigation panel will span all
columns, otherwise if \mcoltreestaroptval{span-nav}{false}
then the hyper navigation panel will be at the start of the first column.
This option has no effect if \treestaropt{hyper-nav}{false}.

The older styles can't be configured with the \opt{style-options}
setting, but instead need to have associated commands redefined
to adjust the format. These styles can mostly be replicated with the newer
\glostyle{mcoltree*} style.

The formatting commands
\gls{glstreenamefmt}, \gls{glstreegroupheaderfmt} and
\gls{glstreenavigationfmt} are all used by the corresponding
\sty{glossary-mcols} styles.

The default number of columns is 2, but can be changed by redefining:
\cmddef{glsmcols}
For example, for a three column glossary:
\begin{codebox}
\cmd{usepackage}\marg{glossary-mcols}
\cmd{renewcommand}*\marg{\gls{glsmcols}}\marg{3}
\gls{setglossarystyle}\marg{mcolindex}
\end{codebox}

\begin{table}[htbp]
\caption{Multicolumn Styles}
\label{tab:mcols}
\centering
\begin{tabular}{ll}
\bfseries \sty{glossary-mcols} Style &
\bfseries Analogous Tree Style\\
\glostyle{mcoltree*} & \glostyle{tree*}\\
\inlineglostyledef{mcolindex} & \glostyle{index}\\
\inlineglostyledef{mcolindexgroup} & \glostyle{indexgroup}\\
\inlineglostyledef{mcolindexhypergroup} or \inlineglostyledef{mcolindexspannav} 
 & \glostyle{indexhypergroup}\\
\inlineglostyledef{mcoltree} & \glostyle{tree}\\
\inlineglostyledef{mcoltreegroup} & \glostyle{treegroup}\\
\inlineglostyledef{mcoltreehypergroup} or \inlineglostyledef{mcoltreespannav}
  & \glostyle{treehypergroup}\\
\inlineglostyledef{mcoltreenoname} & \glostyle{treenoname}\\
\inlineglostyledef{mcoltreenonamegroup} & \glostyle{treenonamegroup}\\
\inlineglostyledef{mcoltreenonamehypergroup} or
\inlineglostyledef{mcoltreenonamespannav} & \glostyle{treenonamehypergroup}\\
\inlineglostyledef{mcolalttree} & \glostyle{alttree}\\
\inlineglostyledef{mcolalttreegroup} & \glostyle{alttreegroup}\\
\inlineglostyledef{mcolalttreehypergroup} or 
\inlineglostyledef{mcolalttreespannav} & \glostyle{alttreehypergroup}
\end{tabular}
\end{table}

The styles with a navigation line, such as
\glostyle{mcoltreehypergroup}, now have a variant (as from v4.22)
with \qt{hypergroup} replaced with \qt{spannav} in the style name.
The original \qt{hypergroup} styles place the navigation line at the
start of the first column. The newer \qt{spannav} styles put the
navigation line in the optional argument of the \env{multicols}
environment so that it spans across all the columns.


\subsection{In-Line Style}
\label{sec:inline}

\pkgdef*{glossary-inline}

This section covers the \sty{glossary-inline} package that supplies
the \glostyle{inline} style. This is a \idx{glossarystyle} that is designed for
in-line use (as opposed to block styles, such as lists or tables).
This style doesn't display the \idx{numberlist}.

Note that this style will only be available if you explicitly load
\sty{glossary-inline}:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-inline}
\end{codebox}

With \sty{glossaries-extra}, you can load both the package and style
with the \opt{style} and \opt{stylemods} options. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{inline}},\optval{stylemods}{inline}]\marg{glossaries-extra}
\end{codebox}

You will most likely need to redefine \gls{glossarysection} with
this style. For example, suppose you are required to have your
\idxpl{glossary} and list of \idxpl{acronym} in a footnote, you can do:
\begin{codebox}
\cmd{usepackage}\marg{glossary-inline}
\cmd{renewcommand}*\marg{\gls{glossarysection}}[2][]\marg{\gls{textbf}\marg{\#1}: }
\gls{setglossarystyle}\marg{inline}
\end{codebox}
Then where you need to include your \idxpl{glossary} as a footnote you can do:
\begin{codebox}
\gls{footnote}\marg{\gls{printglossaries}}
\end{codebox}

\glostyledef{inline}
This is the only style provided by \sty{glossary-inline}.

The group skip command \gls{glsgroupskip} is defined to do nothing,
regardless of the \opt{nogroupskip} option. Likewise,
\gls{glsgroupheading} is defined to do nothing. If you want to
create a custom style base on the \glostyle{inline} style that shows
a heading, then add \inlineglsdef{glsinlinedopostchild} to the definition of
\gls{glsgroupheading} in case a \idx{group} heading follows a child
entry.

\begin{important}
Don't redefine \gls{glsinlinedopostchild}. It's provided as a user
command to make it easier to add it to the start of a custom definition
of \gls{glossaryheader} to enable \idx{group} headings.
If you need to adjust the content between a sub-entry and the next
entry, redefine \gls{glsinlinepostchild} instead.
\end{important}

The \glostyle{inline} style is governed by the following commands.

\cmddef{glsinlineseparator}
This is used between \toplevel\ entries.

\cmddef{glsinlinesubseparator}
This is used between sub-entries.

\cmddef{glsinlineparentchildseparator}
This is used between a \toplevel\ parent entry and its first sub-entry.

\cmddef{glspostinline}
This is used at the end of the glossary.
The default definition is:
\begin{compactcodebox}
\gls{glspostdescription}\gls{space}
\end{compactcodebox}
This is the only place that the post-description hook is used in
this style.

\cmddef{glsinlinenameformat}
This is used to create the target, where \meta{name} is provided
in the form \code{\gls{glossentryname}\margm{entry-label}} and 
\meta{entry-label} is the entry's label. 
The default definition is:
\begin{compactcodebox}
\gls{glstarget}\margm{entry-label}\margm{name}
\end{compactcodebox}

For example, if you want the name to appear in \idx{smallcaps}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsinlinenameformat}}[2]\marg{\gls{glstarget}\marg{\#1}\marg{\gls{textsc}\marg{\#2}}}
\end{codebox}

This style needs to know if an entry has any children. This test is
performed with:
\cmddef{glsinlineifhaschildren}
The default definition simply uses \gls{ifglshaschildren}, which is
inefficient as it has to iterate through all \idxpl{entry} (in the
same \idx{glossary} as \meta{entry-label}) to determine
which ones have the given entry as a parent. This can be
time-consuming for large \idxpl{glossary}, but the assumption here is
that an inline \idx{glossary} is unlikely to be used with a large
set of entries. However, if you are using \app{bib2gls} with the
\resourceopt{save-child-count} resource option, it's more efficient
to use \gls{GlsXtrIfHasNonZeroChildCount} instead (particularly if
you are using \gls{printunsrtglossary} with a filtered subset). For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsinlineifhaschildren}}[3]\marg{\comment{}
 \gls{GlsXtrIfHasNonZeroChildCount}\margm{\#1}\marg{\#2}\marg{\#3}\comment{}
}
\end{codebox}

Sub-entry names are formatted according to:
\cmddef{glsinlinesubnameformat}
which has the same syntax as \gls{glsinlinenameformat} but a
different definition:
\begin{compactcodebox}
\gls{glstarget}\margm{entry-label}\marg{}
\end{compactcodebox}
which means that the sub-entry name is ignored.

If the description is empty or has been suppressed (according to
\gls{ifglshasdesc} and \gls{ifglsdescsuppressed}, respectively) then:
\cmddef{glsinlineemptydescformat}
(which does nothing by default) is used,
otherwise the description is formatted according to:
\cmddef{glsinlinedescformat}
This defaults to just \code{\gls{space}\meta{description}} so the symbol and
\idx{locationlist} are ignored.

For example, if you want a colon between the name and the
description:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsinlinedescformat}}[3]\marg{: \#1}
\end{codebox}

The sub-entry description is formatted according to:
\cmddef{glsinlinesubdescformat}
This defaults to just \meta{description}.

\cmddef{glsinlinepostchild}
This hook is used at the start of a \toplevel\ entry that immediate
follows a sub-entry.  It does nothing by default.

\section{Defining your own glossary style}
\label{sec:newglossarystyle}

The markup used in the \idx{glossary} is described in
\sectionref{sec:glossmarkup}. Commands that may be used by styles,
but should not be redefined by styles, are described in
\sectionsref{sec:glossarycmds,sec:hypernav}.
The commands that should be redefined by the \idx{glossarystyle} are
described in \sectionref{sec:glossarystylecmds}.

\begin{important}
Commands like \gls{printglossary} are designed to produce content in
the \idx{PDF}. If your intention is to design a style that doesn't print
any content (for example, to simply capture information) then you
are likely to experience unwanted side-effects. If you just want to
capture \idx{indexing} information (such as \locations) then a much better
approach is to use \app{bib2gls}, which automatically stores this
information in dedicated fields when the entry is defined.
If you still really want to use a style to capture information
obtained from \app{makeindex} or \app{xindy} then simply \gls{input}
the \idx{indexingfile} instead of using \gls{printglossary}.
\end{important}

If the predefined \idxpl{glossarystyle} don't fit your requirements, you can
define your own style using:
\cmddef{newglossarystyle}
where \meta{style-name} is the name of the new \idx{glossarystyle}
(to be used in the \opt{style} option or \gls{setglossarystyle}). 
An existing style can be redefined with:
\cmddef{renewglossarystyle}
In both cases, the second argument \meta{definitions}
needs to redefine all of the commands listed in \sectionref{sec:glossarystylecmds}.

\begin{important}
Bear in mind that parameters will need to be referenced with
\idx{hashhash} rather than \sym{hash}.
\end{important}

A style may inherit from an existing style by starting
\meta{definitions} with \gls{setglossarystyle} and then just
redefine the commands that are different from the inherited style.

For example, the \glostyle{indexgroup} style is basically the same as
the \glostyle{index} style, except for the definition of
\gls{glsgroupheading}, so the style is simply defined as:
\begin{compactcodebox}
\gls{newglossarystyle}\marg{\glostyle{indexgroup}}\marg{\comment{}
 \gls{setglossarystyle}\marg{\glostyle{index}}\comment{inherit \glostyle{index}}
\comment{alter the command that's different:}
 \cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{\comment{}
   \gls{item}\gls{glstreegroupheaderfmt}\marg{\gls{glsgetgrouptitle}\marg{\idx{hashhash}1}}\comment{}
   \gls{indexspace}
 }\comment{}
}
\end{compactcodebox}

\subsection{Commands For Use in Glossary Styles}
\label{sec:glossarycmds}

These commands are typically used in style definitions but should
not be modified by the style. See \sectionref{sec:hypernav} for
\idxpl{hyperlink} to \idx{group} headings.

In order to support the \opt{entrycounter} option, a style needs
to use:
\cmddef{glsentryitem}
at the place where the associated number should appear if the option
is set.
If \optval{entrycounter}{true}, \gls{glsentryitem} will do:
\begin{compactcodebox}
\gls{glsstepentry}\margm{label}\gls{glsentrycounterlabel}
\end{compactcodebox}
otherwise it will do \gls{glsresetsubentrycounter} (which ensures
the sub-entry counter is reset if it has been enabled with
\opt{subentrycounter}).

For example, the \glostyle{list} style defines \gls{glossentry} as follows:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
  \gls{item}\oarg{\gls{glsentryitem}\marg{\idx{hashhash}1}\comment{}
      \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}}
   \gls{glossentrydesc}\marg{\idx{hashhash}1}\gls{glspostdescription}\gls{space} \idx{hashhash}2}
\end{compactcodebox}

In order to support the \optval{subentrycounter} option, a style needs
to use:
\cmddef{glssubentryitem} 
at the place where the associated number should appear if the option
is set.
If \optval{subentrycounter}{true}, this will do:
\begin{compactcodebox}
\gls{glsstepsubentry}\margm{label}\gls{glssubentrycounterlabel}
\end{compactcodebox}
otherwise it does nothing.
This will typically only be used with \hierlevel{1} and omitted
for deeper \idxpl{hierarchicallevel}.

For example, the \glostyle{index} style has:
\begin{compactcodebox}
\cmd{renewcommand}\marg{\gls{subglossentry}}[3]\marg{\comment{}
  \cmd{ifcase}\idx{hashhash}1\relax
    \comment{level 0}
    \gls{item}
  \cmd{or}
    \comment{level 1}
    \gls{subitem}
    \gls{glssubentryitem}\marg{\idx{hashhash}2}\comment{}
  \cmd{else}
    \comment{all other levels}
    \gls{subsubitem}
  \cmd{fi}
  \gls{glstreenamefmt}\marg{\gls{glstarget}\marg{\idx{hashhash}2}\marg{\gls{glossentryname}\marg{\idx{hashhash}2}}}\comment{}
  \gls{ifglshassymbol}\marg{\idx{hashhash}2}\marg{\gls{space}(\gls{glossentrysymbol}\marg{\idx{hashhash}2})}\marg{}\comment{}
  \gls{glstreechildpredesc}\gls{glossentrydesc}\marg{\idx{hashhash}2}\gls{glspostdescription}\gls{space} \idx{hashhash}3\comment{}
}
\end{compactcodebox}
The test for level~0 is redundant in this case as \gls{glossentry}
will be used for \toplevel\ entries, but is provided for
completeness. Note that \gls{glssubentryitem} is only used for
level~1.

The style will typically also create the target to enable \idxpl{hyperlink}
from an entry reference within the document (created with commands
like \gls{gls}) to the \idx{entryline} in the \idx{glossary}.

The target is created with:
\cmddef{glstarget}
If \idxpl{hyperlink} aren't enabled, this simply does the second
argument \meta{text}, otherwise it will create a target with the
name \meta{prefix}\meta{entry-label}, where the prefix is obtained
by expanding:
\cmddef{glolinkprefix}
The \sty{glossaries-extra} package has options, such as
\printglossopt{prefix}, that can be used to override this.

\cmddef{glossentryname}
This is used in \idxpl{glossarystyle} to display the name
encapsulated with \gls{glsnamefont}. Unlike \gls{glsentryname}, this
command will trigger a warning if the \idx{entry}
hasn't been defined. The \idx{sentencecase} version is:
\cmddef{Glossentryname}
Both commands internally use \gls{glsnamefont} so
there's no need to explicitly use that command in a style.

\begin{xtr}
With \sty{glossaries-extra}, the \catattr{glossnamefont}
and \catattr{glossname} \idxpl{categoryattribute} can be used to adjust font and,
for \gls{glossentryname}, \casechanging. If you just use
\gls{glsentryname}, the style won't be influenced by those
attributes.
\end{xtr}

\cmddef{glossentrydesc}
This is used in \idxpl{glossarystyle} to display the description. 
Unlike \gls{glsentrydesc}, this command will trigger a warning if
the \idx{entry} hasn't been defined. The \idx{sentencecase} version is:
\cmddef{Glossentrydesc}

\begin{xtr}
With \sty{glossaries-extra} the \catattr{glossdescfont}
and \catattr{glossdesc} \idxpl{categoryattribute} can be used to adjust font and,
for \gls{glossentrydesc}, \casechanging. If you just use
\gls{glsentrydesc}, the style won't be influenced by those
attributes.
\end{xtr}

\cmddef{glossentrysymbol}
This is used in \idxpl{glossarystyle} to display the \gloskey{symbol}. 
Unlike \gls{glsentrysymbol}, this command will trigger a warning if
the \idx{entry} hasn't been defined. The \idx{sentencecase} version is:
\cmddef{Glossentrysymbol}

\begin{xtr}
With \sty{glossaries-extra} you can use the \catattr{glosssymbolfont}
\idx{categoryattribute} to adjust font. If you just use
\gls{glsentrysymbol}, the style won't be influenced by that
attribute.
\end{xtr}

\idxpl{glossarystyle} that support \idxpl{group} can obtain the
group title with:
\cmddef{glsgetgrouptitle}
This gets the title associated with the \idx{group} identified by
\meta{group-label} and displays it. The title is determined as
follows:
\begin{itemize}
\item if \meta{group-label} is a single character or either
\code{glsnumbers} or \code{glssymbols} and the command
\inlineglsdef{group-labelgroupname} exists, then that command is
used as the title.

\item otherwise the title is the same as the group label.
\end{itemize}

\begin{xtr}
The \sty{glossaries-extra} package provides improved support for
\idx{group} titles, but redefines \gls{glsgetgrouptitle} to
accommodate the enhanced features.
\end{xtr}

\subsection{Hyper Group Navigation}
\label{sec:hypernav}

\pkgdef{glossary-hypernav}

There is no need to load this package. It will automatically be
loaded by \sty{glossaries}. If \sty{hyperref} hasn't been loaded,
these commands will still be available but simply won't form
\idxpl{hyperlink} or targets, so they can be used in
\idxpl{glossarystyle} without any need to check for \idx{hyperlink}
support. (However, the result might look a bit strange if the reader
expects the navigation text to be \idxpl{hyperlink}.)

\cmddef{glsnavhypertarget}
Creates a hyper target for a \idx{group}.
The \meta{glossary-label} argument is the label that identifies the
\idx{glossary}. If omitted, \gls{currentglossary} is assumed.
The \meta{group-label} argument is the label that identifies the
\idx{group}. This additionally writes information to the \ext+{aux} file so that
on the next \LaTeX\ run, \gls{glsnavigation} will have a list of
\idxpl{group} for the \idx{glossary}.

For example, the \glostyle{indexhypergroup} includes a \idx{group}
target in the header:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{\comment{}
  \gls{item}\gls{glstreegroupheaderfmt}
    \marg{\gls{glsnavhypertarget}\marg{\#1}\marg{\gls{glsgetgrouptitle}\marg{\#1}}}\comment{}
  \gls{indexspace}
}
\end{compactcodebox}

\cmddef{glsnavhypergroupdotarget}
This is used by \gls{glsnavhypertarget} to create the actual \idx{hyperlink} 
target. So if you need to change the way that the target is created,
redefine this command rather than \gls{glsnavhypertarget}.

\cmddef{glsnavhyperlink}
Creates a \idx{hyperlink} to the given \idx{group}, where the
target name is obtained from:
\cmddef{glsnavhyperlinkname}
The \meta{glossary-label} argument is the label that identifies the
\idx{glossary}. If omitted, \gls{currentglossary} is assumed.
Typically, styles don't need to explicitly use this command as they
can use the following command instead.

\begin{information}
Version 4.53 has switched from using an internal comma-separated
list to a sequence command. If you have hacked the internal commands
you will need to either rollback to v4.52 or switch to the newer
commands.
\end{information}

\cmddef{glsnavigation}
Displays a simple navigation list, where each item in the list has a
\idx{hyperlink} created with \gls{glsnavhyperlink} to a \idx{group},
where the \idx{group} title is obtained with \gls{glsgetgrouptitle}.  
Each item in the list has the title and hyperlink set with:
\cmddef{glsnavigationitem}
This fetches the corresponding group title and creates a hyperlink
with \gls{glsnavhyperlink}.
The items are separated with:
\cmddef{glshypernavsep}
The default definition is \code{\gls{space}\gls{textbar}\gls{space}}
which creates a vertical bar with a space on either side.

\cmddef{glssymbolnav}
Just produces a simple set of navigation links for the symbol and
number \idxpl{group} and ends with the \gls{glshypernavsep}
separator. Unlike \gls{glsnavigation}, there's no check
to determine if the \idx{glossary} has those \idxpl{group}. This
command is a historical artefact leftover from early versions. There should
be little need for it now as \gls{glsnavigation} should
include all the \idxpl{group} that are in the \idx{glossary}.

\subsection{Glossary Style Commands}
\label{sec:glossarystylecmds}

The commands listed in this section should all be redefined by every
\idx{glossarystyle}.  However, a style may be based on another
style, in which case the style definitions should start with
\gls{setglossarystyle} and then only redefine the commands that
should differ from the inherited style.

Note that \gls{print...glossary} sets \gls{currentglossary}
to the current glossary label, so it's possible to create a glossary
style that varies according to the glossary type, but this will
generally limit its usefulness.

\envdef{theglossary}
The actual content of the \idx{glossary} is placed inside the
\env{theglossary} environment. For example, the \glostyle{list} style
redefines this to start and end the \env{description} environment:
\begin{compactcodebox}
\cmd{renewenvironment}\marg{theglossary}\comment{}
  \marg{\gls{glslistinit}\cbeg{description}}\marg{\cend{description}}
\end{compactcodebox}
Immediately after \code{\cbeg{theglossary}} comes the header:
\cmddef{glossaryheader}
For example, the \glostyle{longheader} style has:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glossaryheader}}\marg{\comment{}
 \cmd{bfseries} \gls{entryname} \idx{amp} \cmd{bfseries} \gls{descriptionname}\cmd{tabularnewline}\cmd{endhead}}
\end{compactcodebox}
(Note that this is not the same as the \idx{preamble/glossary} which
occurs before the start of the \env{theglossary} environment and is
not part of the style.)

The rest of the contents of the \env{theglossary} environment is
divided into \idx+{lettergroup} blocks. Each block starts with the
\idx{group} heading:
\cmddef{glsgroupheading}
Note that the argument is a label that identifies the \idx{group}. Some
\idxpl{glossarystyle} redefine this command to do nothing, which
means there's no \idx{group} title displayed. Others, such as
\idxpl{glossarystyle}, will obtain the group title from the
\meta{group-label} and format the title to fit the style.

\begin{information}
The \meta{group-label} is typically obtained by the
\idx{indexingapp}, based on the sort value.
\end{information}

With \options{noidx,mkidx,xdy}, \idxpl{group} only related to
\toplevel\ entries.

\begin{xtr}
The \sty{glossaries-extra} package additionally provides
\gls{glssubgroupheading} to support sub-\idxpl{group}, which are
only available with \options{b2g,unsrt}. \Idxpl{glossarystyle}
should only include a redefinition of \gls{glssubgroupheading}  if
the style is specifically designed for use with
\sty{glossaries-extra} as the command won't be available with just
the base \sty{glossaries} package. (A default definition will be
provided if this command isn't set with \sty{glossaries-extra}.)
\end{xtr}

After the \idx{group} heading, each \toplevel\ \gls+{entryline} within the
\idx{group} is formatted with:
\cmddef{glossentry}
The first argument is the \idx{entry}['s] label. The second is the
\idx{numberlist} that was collated by the \idx{indexingapp}.

The \meta{number-list} argument may be empty or \gls{relax}, or may contain the
\idx{numberlist} encapsulated with \gls{glossaryentrynumbers},
possibly prefixed with a pre-\idx{numberlist} hook. If
\meta{number-list} is an unbraced \gls{relax}, that typically indicates that
\optionsor{mkidx,xdy} were used and the entry was a parent that wasn't
\indexed\ but has been included because it has an \indexed\ child entry.
An empty \meta{number-list} argument is more likely to be a result
of \optionsor{noidx,b2g,unsrt}, in which case nothing can be
inferred about whether or not the entry was actually \indexed.

Each \glslink{entryline}{sub-entry line} is formatted with:
\cmddef{subglossentry}
where \meta{level} is the \idx{hierarchicallevel}. The other
arguments are the same as for \gls{glossentry}. Some
\idxpl{glossarystyle} redefine this command to simply use
\gls{glossentry}, in which case the \idx{glossary} will have a flat
(no-hierarchy) appearance, but the \idx{indexingapp} will still take the
hierarchy into account when ordering the \idxpl{entry}.

\begin{important}
The \idxpl{glossarystyle} should redefine \gls{glossentry} and
\gls{subglossentry} to fit the style, but they should not 
redefine the markup in \meta{number-list}. If the style doesn't
support \idxpl{numberlist}, then the \meta{number-list} argument
should simply be ignored.
\end{important}

The \idxpl{glossarystyle} will typically redefine \gls{glossentry}
to use \gls{glsentryitem} to support the \opt{entrycounter} option, 
\gls{glstarget} to create the \idx{hyperlink} target,
and will use \gls{glossentryname} to format the name.

Similarly, \gls{subglossentry} will typically start with
\gls{glssubentryitem} to support the \opt{subentrycounter} option.
Again \gls{glstarget} is needed to create the \idx{hyperlink}
target. The entry name may be displayed with \gls{glossentryname} or
may be omitted to support \idxpl{homograph}.

Between each \idx{lettergroup} block (that is, before all instances
of \gls{glsgroupheading} except for the first one) is the \idx{group} skip:
\cmddef{glsgroupskip}
Some \idxpl{glossarystyle} redefine this to do nothing, but some
may define it to create a vertical gap in order to visually separate
the \idxpl{lettergroup}. Most of the predefined styles use the
\gls{ifglsnogroupskip} conditional within this command to determine whether or
not to add the gap.

For example, the \glostyle{list} style defines \gls{glsgroupskip} as
follows:
\begin{compactcodebox}
\cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{\gls{ifglsnogroupskip}\cmd{else}\gls{indexspace}\cmd{fi}}%
\end{compactcodebox}
This has the conditional inside the definition of \gls{glsgroupskip}
which allows it to be changed after the style has been set. This
causes a problem for tabular-like styles, so those need to have the
conditional outside of the definition. For example, the
\glostyle{long-booktabs} style has:
\begin{compactcodebox}
\gls{ifglsnogroupskip}
  \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{}
\cmd{else}
  \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{\gls{glspenaltygroupskip}}\comment{}
\cmd{fi}
\end{compactcodebox}
This requires the conditional to be set before the style definitions
are performed.

\begin{example}{Creating a completely new style}{sec:exnewstyle}

If you want a completely new style, you will need to redefine all
of the commands and the environment listed above in this section. 

For example, suppose you want each entry to start with a bullet point.
This means that the \idx{glossary} should be placed in the \env{itemize}
environment, so \env{theglossary} should start and end that
environment. Let's also suppose that you don't want anything between
the glossary \idxpl{group} (so \gls{glsgroupheading} and \gls{glsgroupskip}
should do nothing) and suppose you don't want anything to appear
immediately after \code{\cbeg{theglossary}} (so \gls{glossaryheader}
should do nothing). In addition, let's suppose the symbol should
appear in brackets after the name, followed by the description and
last of all the \idx{numberlist} should appear within square brackets
at the end. Then you can create this new \idx{glossarystyle}, called, say,
\optfmt{mylist}, as follows:
\begin{codebox}
\gls{newglossarystyle}\marg{mylist}\marg{\comment{}
 \comment{put the glossary in the itemize environment:}
 \cmd{renewenvironment}\marg{\env{theglossary}}\comment{}
   \marg{\cbeg{itemize}}\marg{\cend{itemize}}\comment{}
 \comment{no header after \cbeg{theglossary}}
 \cmd{renewcommand}*\marg{\gls{glossaryheader}}\marg{}\comment{}
 \comment{no visual distinction between glossary \idxpl{group}:}
 \cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{}\comment{}
 \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{}
 \comment{set how each entry should appear:}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
 \gls{item} \comment{bullet point}
 \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}\comment{the entry name}
 \gls{space} (\gls{glossentrysymbol}\marg{\idx{hashhash}1})\comment{the symbol in brackets}
 \gls{space} \gls{glossentrydesc}\marg{\idx{hashhash}1}\comment{the description}
 \gls{space} \oarg{\idx{hashhash}2}\comment{the number list in square brackets}
 }\comment{}
 \comment{set how sub-entries appear:}
 \cmd{renewcommand}*\marg{\gls{subglossentry}}[3]\marg{\comment{}
   \gls{glossentry}\marg{\idx{hashhash}2}\marg{\idx{hashhash}3}}\comment{}
 }
\end{codebox}
Note that this style creates a flat glossary, where sub-entries
are displayed in exactly the same way as the top level entries.
It also hasn't used \gls{glsentryitem} or \gls{glssubentryitem} so
it won't be affected by the \opt{entrycounter},
\opt{counterwithin} or \opt{subentrycounter} package options.

Variations:
\begin{itemize}
\item You might want the entry name to start with a capital, in
which case use \gls{Glossentryname} instead of \gls{glossentryname}.

\item You might want to check if the symbol hasn't been set and omit
the parentheses if the symbol is absent. In this case you can use
\gls{ifglshassymbol} (see \sectionref{sec:utilities}):
\begin{codebox}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
 \gls{item} \comment{bullet point}
 \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}\comment{the entry name}
 \strong{\gls{ifglshassymbol}\marg{\idx{hashhash}1}}\comment{check if symbol exists}
 \marg{\comment{}
   \gls{space} (\gls{glossentrysymbol}\marg{\idx{hashhash}1})\comment{the symbol in brackets}
 }\comment{}
 \marg{}\comment{no symbol so do nothing}
 \gls{space} \gls{glossentrydesc}\marg{\idx{hashhash}1}\comment{the description}
 \gls{space} \oarg{\idx{hashhash}2}\comment{the number list in square brackets}
 }\comment{}
\end{codebox}
\end{itemize}
\end{example}

\begin{example}{Creating a new glossary style based on an
existing style}{sec:exadaptstyle}

If you want to define a new style that is a slightly modified
version of an existing style, you can use \gls{setglossarystyle}
within the second argument of \gls{newglossarystyle} followed by
whatever alterations you require. For example, suppose you want 
a style like the \glostyle{list} style but you don't want the extra
vertical space created by \gls{indexspace} between \idxpl{group}, then you
can create a new \idx{glossarystyle} called, say, \optfmt{mylist} as
follows:
\begin{codebox}
\cmd{newglossarystyle}\marg{mylist}\marg{\comment{}
 \gls{setglossarystyle}\marg{\glostyle{list}}\comment{base this style on the list style}
 \comment{make nothing happen between \idxpl{group}:}
 \cmd{renewcommand}\marg{\gls{glsgroupskip}}\marg{}\comment{} 
}
\end{codebox} 
(In this case, you can actually achieve the same effect using the
\glostyle{list} style in combination with the package option
\opt{nogroupskip}.)
\end{example}

\begin{example}{Example: creating a glossary style that uses the
\gloskeyfmttext{user1}, \ldots, \gloskeyfmttext{user6} keys}{sec:exuserstyle}

Suppose each \idx{entry} not only has an associated symbol,
but also units (stored in \gloskey{user1}) and dimension
(stored in \gloskey{user2}). Then you can define a 
\idx{glossarystyle} that displays each entry in a \env{longtable} as follows:
\begin{codebox}
\gls{newglossarystyle}\marg{long6col}\marg{\comment{}
 \comment{put the glossary in a \env{longtable} environment:}
 \cmd{renewenvironment}\marg{\env{theglossary}}\comment{}
  \marg{\cbeg{longtable}\marg{lp\marg{\gls{glsdescwidth}}cccp\marg{\gls{glspagelistwidth}}}}\comment{}
  \marg{\cend{longtable}}\comment{}
 \comment{Set the table's header:}
 \cmd{renewcommand}*\marg{\gls{glossaryheader}}\marg{\comment{}
  \gls{bfseries} Term \idx{amp} \gls{bfseries} Description \idx{amp} \gls{bfseries} Symbol \idx{amp}
  \gls{bfseries} Units \idx{amp} \gls{bfseries} Dimensions \idx{amp} \gls{bfseries} Page List
  \gls{cs.bsl}\cmd{endhead}}\comment{}
 \comment{No heading between \idxpl{group}:}
  \cmd{renewcommand}*\marg{\gls{glsgroupheading}}[1]\marg{}\comment{}
 \comment{\toplevel\ entries displayed in a row optionally numbered:}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
   \gls{glsentryitem}\marg{\idx{hashhash}1}\comment{Entry number if required}
   \gls{glstarget}\marg{\idx{hashhash}1}\marg{\gls{glossentryname}\marg{\idx{hashhash}1}}\comment{Name}
   \idx{amp} \gls{glossentrydesc}\marg{\idx{hashhash}1}\comment{Description}
   \idx{amp} \gls{glossentrysymbol}\marg{\idx{hashhash}1}\comment{Symbol}
   \idx{amp} \gls{glsentryuseri}\marg{\idx{hashhash}1}\comment{Units}
   \idx{amp} \gls{glsentryuserii}\marg{\idx{hashhash}1}\comment{Dimensions}
   \idx{amp} \idx{hashhash}2\comment{Page list}
   \cmd{tabularnewline} \comment{end of row}
 }\comment{}
 \comment{Similarly for sub-entries (no sub-entry numbers)}
 \cmd{renewcommand}*\marg{\gls{subglossentry}}[3]\marg{\comment{}
    \comment{ignoring first argument (sub-level)}
    \gls{glstarget}\marg{\idx{hashhash}2}\marg{\gls{glossentryname}\marg{\idx{hashhash}2}}\comment{Name}
    \idx{amp} \gls{glossentrydesc}\marg{\idx{hashhash}2}\comment{Description}
    \idx{amp} \gls{glossentrysymbol}\marg{\idx{hashhash}2}\comment{Symbol}
    \idx{amp} \gls{glsentryuseri}\marg{\idx{hashhash}2}\comment{Units}
    \idx{amp} \gls{glsentryuserii}\marg{\idx{hashhash}2}\comment{Dimensions}
    \idx{amp} \idx{hashhash}3\comment{Page list}
    \cmd{tabularnewline} \comment{end of row}
 }\comment{}
 \comment{Nothing between \idxpl{group}:}
 \cmd{renewcommand}*\marg{\gls{glsgroupskip}}\marg{}\comment{}
}
\end{codebox}
\end{example}


\chapter{Xindy (Option \glsfmttext{idx.opt.xdy})}
\label{sec:xindy}

\glsstartrange{app.xindy,ext.xdy}%
If you want to use \app{xindy} to sort the \idx{glossary}, you
must use the package option \opt+{xindy}:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy}}\marg{glossaries}
\end{codebox}
This ensures that the information is written
to the \idxpl{indexingfile} using \app{xindy}['s] raw syntax.

\Sectionref{sec:makeglossaries} covers how to use the external
\idx{indexingapp}, and \sectionref{sec:locationsyntax} covers the
issues involved in the \location\ syntax. This section covers the
commands provided by the \sty{glossaries} package that allow you
to adjust the \app{xindy} style file (\ext+{xdy}) and
parameters.

To assist writing information to the \app{xindy} style
file, the \sty{glossaries} package provides the following
commands:
\cmddef{glsopenbrace}
which expands to \sym{bg} (a literal open brace) and
\cmddef{glsclosebrace}
which expands to \sym{eg} (a literal closing brace). 
This is needed because \gls{cs.openbrace} and \gls{cs.closebrace} don't expand
to a simple brace character when written to a file.

\cmddef{glspercentchar}
Expands to \sym{pc} (a literal percent).

\cmddef{glstildechar}
Expands to \sym{tilde} (a literal tilde).

For example, a newline character is specified in a \app{xindy} style
file using \idx{tilden} so you can use \code{\gls{glstildechar} n}
to write this correctly (or you can do \code{\gls{string}\idx{tilde}n}).

\cmddef{glsbackslash}
Expands to \sym{bksl} (a literal tilde).

In addition, if you are using a package that makes
\idx{dblquote} active you can use:
\cmddef{glsquote}
which will produce \code{\sym{dblquote}\meta{text}\sym{dblquote}},
where \sym{dblquote} is a literal character.
Alternatively, you can use \code{\gls{string}\sym{dblquote}} to write 
the double-quote character. 
This document assumes that the double quote character has not been
made active, so the examples just use \sym{dblquote} for clarity.

If you want greater control over the \app{xindy} style file than is
available through the \LaTeX\ commands provided by the
\sty{glossaries} package, you will need to edit the \app{xindy}
style file. In which case, you must use \gls{noist} to prevent the
style file from being overwritten by \gls+{makeglossaries}
package. For additional information about \app{xindy}, read the
\app{xindy} documentation. I'm sorry I can't provide any assistance
with writing \app{xindy} style files. If you need help, I recommend
you ask on the \app*{xindy}
\urlfootref{http://xindy.sourceforge.net/mailing-list.html}{mailing list}.

\section{Required Styles}
\label{sec:xdystyles}

The \ext{xdy} file created by \gls{makeglossaries} starts with 
identifying the required styles.
By default, the \optfmt{tex} style is automatically added, so the \ext{xdy} 
file should contain:
\begin{compactcodebox}
; required styles
   
(require "tex.xdy")
\end{compactcodebox}
Any additional styles can be identified in the \idx{preamble/document} 
(before \gls{makeglossaries}) with:
\cmddef{GlsAddXdyStyle}
The styles are all stored as a comma-separated list, so you can list
multiple styles within the argument, but avoid spurious spaces.
You can reset the style list (for example, if a style needs to be identified before
\filefmt{tex.xdy}) with:
\cmddef{GlsSetXdyStyles} 
The argument should be a comma-separated list where, again, you need to make
sure there are no spurious spaces.

\section{Language and Encodings}
\label{sec:langenc}

\begin{information}
The commands in this section are only relevant if you use
\app{makeglossaries} or \opt{automake}. If you are calling \app{xindy} explicitly you
need to set the \xdyopt{L} and \xdyopt{C} switches appropriately.
\end{information}

When you use \app{xindy}, you need to specify the language
and encoding used (unless you have written your own custom
\app{xindy} style file that defines the relevant alphabet
and sort rules). If you use \app{makeglossaries},
this information is obtained from the document's auxiliary 
(\ext{aux}) file.  The \app{makeglossaries} script attempts to 
find the \app{xindy} language name given your document settings,
which may not match the \sty{babel} or \sty{polyglossia} name, using
set of known mappings. 

\begin{information}
Language mappings aren't supported with \app{makeglossaries-lite}
or \opt{automake}.
\end{information}

The default is to use \gls{languagename}. The information is written to the
\ext{aux} file at the start of \gls{printglossary}, which means that
it should match the language in the document at that point.

In the event that \app{makeglossaries} gets the language name wrong
or if \app{xindy} doesn't support 
that language, then you can specify the required language using:
\cmddef{GlsSetXdyLanguage}
where \meta{language} is the name of the language. The
optional argument can be used if you have multiple \idxpl{glossary}
in different languages. If \meta{glossary type} is omitted, 
\gls{glsdefaulttype} is assumed. If a language hasn't been set for a
particular \idx{glossary} then the language will be as for the
default glossary.

\begin{information}
The \app{xindy} \inlineidxdef{codepage} may not simply be the file \idx+{encoding}
but may also include sorting rules.
\end{information}

The default \idx{codepage} will be obtained from the value of
\gls{inputencodingname}. If that command isn't defined or is empty,
\code{utf8} is assumed. As with \gls{languagename}, the input
\idx{encoding} name obtained with \gls{inputencodingname} may not match
the \app{xindy} \idx{codepage} name, which may include additional
information, such as \code{ij-as-ij} (with Dutch) or
\code{din5007} (with German).

Again, \app{makeglossaries} will try to adjust the \idx{codepage}
for known cases, but it may get it wrong.  Neither
\app{makeglossaries-lite} nor the \opt{automake} option will make
those adjustments.

If the default is incorrect, you can specify the correct \idx{codepage} using:
\cmddef{GlsSetXdyCodePage}
where \meta{code-page} is the name of the \idx{codepage}. Note there's only one
\idx{codepage} for all \idxpl{glossary} as it's rare to
switch \idx{encoding} mid-document.
For example:
\begin{codebox}
\gls{GlsSetXdyLanguage}\marg{dutch}
\gls{GlsSetXdyCodePage}\marg{ij-as-y-utf8}
\end{codebox}
This can also be implemented as a package option:
\begin{codebox}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{language}{dutch}},\styoptxdyval{codepage}{ij-as-y-utf8}]\marg{glossaries}
\end{codebox}

In the event that you want one \idx{glossary} sorted with
\code{ij-as-y} and another with \code{ij-as-ij} you will need to
call \app{xindy} explicitly for each \idx{glossary}.

\begin{important}
Some \app{xindy} modules only support one encoding for a particular
language. For example, the Latin language module only supports
\idx{utf8}
\end{important}

If you write your own custom \app{xindy} style file that 
includes the language settings, you need to set the language
to nothing:
\begin{codebox}
\gls{GlsSetXdyLanguage}\marg{}
\end{codebox}
(and remember to use \gls{noist} to prevent the style file from
being overwritten).

\section{Locations and Number lists}
\label{sec:xindyloc}

If you use \app{xindy}, the \sty{glossaries} package needs to
know which \idxc+{locationcounter}{counters} you will be using in the \idx{numberlist} 
in order to correctly format the \app{xindy} style
file. Counters specified using the \opt{counter} package option
or the \meta{counter} option of \gls{newglossary} are
automatically taken care of, but if you plan to use a different
counter in the \glsopt{counter} key for the \gls{glslike} or
\gls{glstextlike} commands,
then you need to identify these counters \emph{before} 
\gls{makeglossaries} using:
\cmddef{GlsAddXdyCounters}
where \meta{counter list} is a comma-separated list of counter names.

\Inlineidxdef{xindyattr} normally correspond to the \idx{encap} when
using the standard \gls{index} command where the \locations\ are all
page numbers, but the \sty{glossaries} package needs to
incorporate the \idx{locationcounter} as well. For example, if the
\encap{hyperbf} \idx{encap} is used with the \ctr{section} counter,
then the \idx{xindyattr} will be \code{sectionhyperbf}.
This is in contrast to using \app{makeindex}, where the counter is
incorporated in the \idx{encap} with \gls{setentrycounter}.

The most likely \idxpl+{xindyattr} (such as \code{pagehyperbf}) are
automatically added to the \ext{xdy} style file, but if you want to
use another \idx{encap}, you need to add it with:
\cmddef{GlsAddXdyAttribute}
where \meta{name} is the name of the \idx{encap}, as used in
the \glsopt{format} key. 

Note that \gls{GlsAddXdyAttribute} will define commands in the form:
\cmddef{glsXcounterXformat}
where \meta{counter} is the \idx{locationcounter} and \meta{format}
is the \idx{encap} (identified by the \meta{name} argument of
\gls{GlsAddXdyAttribute}).

This command is provided for each counter that has been identified either by the
\opt{counter} package option, the \meta{counter} option for
\gls{newglossary} or in the argument of \gls{GlsAddXdyCounters}.
Each command has a definition in the form:
\begin{compactcodebox}
\gls+{setentrycounter}\oargm{H-prefix}\margm{counter}\csmetafmt{}{format}{}\margm{location}
\end{compactcodebox}
This ensures that, if required, location \idxpl{hyperlink} can be
supported.

\begin{warning}
The \gls{glsXcounterXformat} commands may need redefining for
unusual \locations\ where the default definition won't work with \idxpl{hyperlink}
(see \exampleref{ex:dice}).
\end{warning}

Take care if you have multiple instances of the same \location\ with
different formats. The duplicate \locations\ will be discarded
according to the order in which the \idxc{xindyattr}{attributes} are listed. Consider
defining semantic commands to use for primary references. For
example:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{primary}}[1]\marg{\gls{hyperbf}\marg{\sym{hash}1}}
\gls{GlsAddXdyAttribute}\marg{primary}
\end{codebox}
Then in the document:
\begin{codebox}
A \gls{gls}\oarg{\glsoptval{format}{primary}}\marg{duck} is an aquatic bird.
There are lots of different types of \gls{gls}\marg{duck}.
\end{codebox}
This will give the \glsoptval{format}{primary} instance preference over
the next use that doesn't use the \glsopt{format} key.

\begin{example}{Custom Font for Displaying a Location}{ex:hyperbfit}
Suppose I want a bold, italic, hyperlinked location. I first need to define a
command that will do this:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{hyperbfit}}[1]\marg{\gls{textit}\marg{\gls{hyperbf}\marg{\sym{hash}1}}}
\end{codebox}
but with \app{xindy}, I also need to add this as an allowed
\idxc{xindyattr}{attribute}:
\begin{codebox}
\gls{GlsAddXdyAttribute}\marg{hyperbfit}
\end{codebox}
Now I can use it in the optional argument of commands like
\gls{gls}:
\begin{codebox}
Here is a \gls{gls}\oarg{\glsopt{format}{hyperbfit}}\marg{sample} entry.
\end{codebox}
(where \qt{sample} is the label of the required entry).
\end{example}

\begin{important}
Note that \gls{GlsAddXdyAttribute} has no effect if \gls{noist} is
used or if \gls{makeglossaries} is omitted.
\gls{GlsAddXdyAttribute} must be used before \gls{makeglossaries}.
Additionally, \gls{GlsAddXdyCounters} must come before
\gls{GlsAddXdyAttribute}.
\end{important}


If the \locations\ include robust or protected formatting commands, then
you need to add a location style using the appropriate \app{xindy}
syntax using:
\cmddef{GlsAddXdyLocation}
where \meta{name} is the name of the location style and \meta{definition} is
the \app{xindy} definition. The optional argument \meta{H-prefix}
is needed if \gls{theHcounter} either isn't defined or is
different from \gls{thecounter}.
Be sure to also read \sectionref{sec:locationsyntax} for some issues
that you may encounter.

\begin{important}
Note that \gls{GlsAddXdyLocation} has no effect if \gls{noist} is
used or if \gls{makeglossaries} is omitted.
\gls{GlsAddXdyLocation} must be used before \gls{makeglossaries}.
\end{important}

\begin{example}{Custom Numbering System for Locations}{ex:customloc}
Suppose I decide to use a somewhat eccentric numbering
system for sections where I redefine \thecounter{section} as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{section}}\marg{[\thecounter{chapter}]\gls{arabic}\marg{\ctr{section}}}
\end{codebox}
If I haven't used the package option \optval{counter}{section},
then I need to specify that the \ctr{section} counter will be used as a
\idx{locationcounter}:
\begin{codebox}
\gls{GlsAddXdyCounters}\marg{\ctr{section}}
\end{codebox}
Next I need to add the location syntax:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{section}\marg{:sep "[" "arabic-numbers" :sep "]"
  "arabic-numbers"
}
\end{codebox}
This assumes that \thecounter{chapter} is defined as
\code{\gls{arabic}\marg{\ctr{chapter}}}.

Note that if I have further decided to use the \sty{hyperref}
package and want to redefine \theHcounter{section} as:
\begin{codebox}
\cmd{renewcommand}*\marg{\theHcounter{section}}\marg{\thecounter{part}.\thecounter{section}}
\cmd{renewcommand}*\marg{\thecounter{part}}\marg{\gls{Roman}\marg{\ctr{part}}}
\end{codebox}
then I need to modify the \gls{GlsAddXdyLocation} code above to:
\begin{codebox}
\gls{GlsAddXdyLocation}\oarg{"roman-numbers-uppercase"}\marg{section}\marg{:sep "[" 
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
Since \gls{Roman} will result in an empty string if the counter is
zero, it's a good idea to add an extra location to catch this:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{zero.section}\marg{:sep "[" 
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
This example is illustrated in the sample file
\samplefile{xdy2}.
\end{example}

\begin{example}{Locations as Dice}{ex:dice}
This example will cause \app{xindy} special characters to appear in
the \location, which means that location escaping will need to be
enabled:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy},\opt+{esclocations}}\marg{glossaries}
\gls+{glswrallowprimitivemodstrue}
\end{codebox}

Suppose I want a rather eccentric page numbering system that's
represented by the number of dots on dice. The \sty{stix} package
provides \gls{dicei}, \glsaddeach{diceii,diceiii,diceiv,dicev}\ldots, 
\gls{dicevi} that represent the six
sides of a die. I can define a command that takes a number as its
argument. If the number is less than seven, the appropriate
\csmetafmt{dice}{n}{} command is used otherwise it does \gls{dicevi} the
required number of times with the leftover in a final
\csmetafmt{dice}{n}{}. For example, the number 16 is represented by
\code{\gls{dicevi}\gls{dicevi}\gls{diceiv}} ($6+6+4=16$). I've called this command
\cmd{tallynum} to match the example given earlier in 
\sectionref{sec:locationsyntax}:
\begin{codebox}
\cmd{newrobustcmd}\marg{\cmd{tallynum}}[1]\marg{\comment{}
 \cmd{ifnum}\cmd{number}\sym{hash}1<7
  \$\cmd{csname} dice\cmd{romannumeral}\sym{hash}1\cmd{endcsname}\$\comment{}
 \cmd{else}
  \$\gls{dicevi}\$\comment{}
  \cmd{expandafter}\cmd{tallynum}\cmd{expandafter}\marg{\cmd{numexpr}\sym{hash}1-6}\comment{}
 \cmd{fi}
}
\end{codebox}
Here's the counter command:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{tally}}[1]\marg{\cmd{tallynum}\marg{\gls{arabic}\marg{\sym{hash}1}}}
\end{codebox}
The \ctr{page} counter representation (\thecounter{page}) needs to be
changed to use this command:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{page}}\marg{\cmd{tally}\marg{\ctr{page}}}
\end{codebox}
The \cmd{tally} command expands to \code{\cmd{tallynum} \marg{number}} so
this needs a location class that \emph{exactly} matches this format:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{tally}\marg{\comment{}
 :sep "\cmd{string}\cmd{tallynum}\gls{space}\gls{glsopenbrace}"
 "arabic-numbers"
 :sep "\gls{glsclosebrace}"
}
\end{codebox}
The space between \cmd{tallynum} and \marg{number} is
significant to \app{xindy} so \gls{space} is required.

The sample file \samplefile{xdy}, which comes with the \sty{glossaries}
package, uses the default \ctr{page} counter for \locations, and it
uses the default \gls{glsnumberformat} and a custom \cmd{hyperbfit}
format. A new \app{xindy} location called \qt{tallynum}, as
illustrated above, is defined to make the page numbers appear as
dice. In order for the location numbers to
hyperlink to the relevant pages, I~need to redefine the necessary
\gls{glsXcounterXformat} commands:
\begin{codebox}
\cmd{renewcommand}\marg{\cmd{glsXpageXglsnumberformat}}[2]\marg{\comment{}
 \cmd{linkpagenumber}\sym{hash}2\comment{}
}
\codepar
\cmd{renewcommand}\marg{\cmd{glsXpageXhyperbfit}}[2]\marg{\comment{}
 \gls{textbf}\marg{\cmd{em}\cmd{linkpagenumber}\sym{hash}2}\comment{}
}
\codepar
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[2]\marg{\gls{hyperlink}\marg{page.\sym{hash}2}\marg{\sym{hash}1\marg{\sym{hash}2}}}
\end{codebox}
Note that the second argument of \cmd{glsXpageXglsnumberformat} is
in the form \code{\cmd{tallynum}\margm{number}} so the line
\begin{codebox}
 \cmd{linkpagenumber}\sym{hash}2\comment{}
\end{codebox}
does
\begin{codebox}
 \cmd{linkpagenumber}\cmd{tallynum}\margm{number}
\end{codebox}
so \cmd{tallynum} is the first argument of \cmd{linkpagenumber}
and \meta{number} is the second argument.
\end{example}

\begin{important}
This method is very sensitive to the internal definition of the
location command. If you are defining your own command, you control
how it expands, but if you are using a command provided by another
package, be aware that it may stop working in a future version of
that package.
\end{important}

\begin{example}{Locations as Words not Digits}{ex:fmtcount}
This example will cause \app{xindy} special characters to appear in
the \location, which means that location escaping will need to be
enabled:
\begin{codebox}
\cmd{usepackage}\oarg{\opt{xindy},\opt+{esclocations}}\marg{glossaries}
\gls+{glswrallowprimitivemodstrue}
\end{codebox}

Suppose I want the page numbers written as words
rather than digits and I~use the \sty{fmtcount} package to
do this. I~can redefine \gls{thepage} as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{thepage}}\marg{\gls{Numberstring}\marg{\ctr{page}}}
\end{codebox}
This \emph{used} to get expanded to 
\begin{compactcodebox}
\cmd{protect} \cmd{Numberstringnum} \margm{n}
\end{compactcodebox}
where \meta{n} is the Arabic page number. This means that I~needed to
define a new location with the form:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{Numberstring}\marg{:sep "\cmd{string}\cmd{protect}\gls{space}
  \cmd{string}\cmd{Numberstringnum}\gls{space}\gls{glsopenbrace}"
  "arabic-numbers" :sep "\gls{glsclosebrace}"}
\end{codebox}
and if I'd used the \cmd{linkpagenumber} command from the previous
example, it would need \emph{three} arguments (the first being
\cmd{protect}):
\begin{codebox}
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[3]\marg{\gls{hyperlink}\marg{page.\sym{hash}3}\marg{\sym{hash}1\sym{hash}2\marg{\sym{hash}3}}}
\end{codebox}

The internal definition of \gls{Numberstring} has since changed
so that it now expands to 
\begin{compactcodebox}
\cmd{Numberstringnum} \margm{n}
\end{compactcodebox}
(no \cmd{protect}). This means that the location class definition
must be changed to:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{Numberstring}\marg{\comment{no \cmd{protect} now!}
  :sep "\cmd{string}\cmd{Numberstringnum}\gls{space}\gls{glsopenbrace}"
  "arabic-numbers" :sep "\gls{glsclosebrace}"}
\end{codebox}
and \cmd{linkpagenumber} goes back to only two arguments:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[2]\marg{\gls{hyperlink}\marg{page.\sym{hash}2}\marg{\sym{hash}1\marg{\sym{hash}2}}}
\end{codebox}
The other change is that \gls{Numberstring} uses
\begin{compactcodebox}
\cmd{the}\cmd{value}\margm{counter}
\end{compactcodebox}
instead of
\begin{compactcodebox}
\cmd{expandafter}\cmd{the}\cmd{csname} c@\meta{counter}\cmd{endcsname}
\end{compactcodebox}
so it hides \cmd{c@page} from the location escaping mechanism 
(see \sectionref{sec:locationsyntax}). This means that the page
number may be incorrect if the \idx{indexing} occurs during the output
routine.

A more recent change to \sty{fmtcount} (v3.03) now puts three
instances of \cmd{expandafter} before \code{\cmd{the}\cmd{value}} which
no longer hides \cmd{c@page} from the location escaping mechanism, so
the page numbers should once more be correct. Further changes
to the \sty{fmtcount} package may cause a problem again.

\begin{important}
When dealing with custom formats where the internal definitions
are outside of your control and liable to change, it's best
to provide a wrapper command.
\end{important}

Instead of directly using \gls{Numberstring} in the definition of
\gls{thepage}, I can provide a custom command in the same form
as the earlier \cmd{tally} command:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{customfmt}}[1]\marg{\cmd{customfmtnum}\marg{\gls{arabic}\marg{\sym{hash}1}}}
\cmd{newrobustcmd}\marg{\cmd{customfmtnum}}[1]\marg{\cmd{Numberstringnum}\marg{\sym{hash}1}}
\end{codebox}
This ensures that the location will always be written to
the indexing file in the form:
\begin{compactcodebox}
:locref "\gls{glsopenbrace}\gls{glsclosebrace}\gls{glsopenbrace}\cmd{string}\gls{cs.bsl}customfmtnum \margm{n}\gls{glsclosebrace}"
\end{compactcodebox}
So the location class can be defined as:
\begin{compactcodebox}
\gls{GlsAddXdyLocation}\marg{customfmt}\marg{
 :sep "\cmd{string}\cmd{customfmtnum}\gls{space}\gls{glsopenbrace}"
 "arabic-numbers" 
 :sep "\gls{glsclosebrace}"}
\end{compactcodebox}

The sample file
\samplefile{xdy3} illustrates this.
\end{example}

In the \idx{numberlist}, the \locations\ are sorted according to the list of
provided location classes. The default ordering is: 
\begin{enumerate}
\item \code{roman-page-numbers} (i, ii, \ldots);
\item \code{arabic-page-numbers} (1, 2, \ldots);
\item \code{arabic-section-numbers} (for example, 1.1 if the \idx{compositor} is a
full stop or 1-1 if the compositor is a hyphen);
\item \code{alpha-page-numbers} (a, b, \ldots);
\item \code{Roman-page-numbers} (I, II, \ldots);
\item \code{Alpha-page-numbers} (A, B, \ldots);
\item \code{Appendix-page-numbers} (for
example, A.1 if the Alpha compositor, see \gls{glsSetAlphaCompositor}, is a
full stop or A-1 if the Alpha \idx{compositor} is a hyphen);
\item user defined location names (as specified by 
\gls{GlsAddXdyLocation} in the order in which
they were defined);
\item \code{see} (cross-referenced entries).
\end{enumerate}

\begin{xtr}
With \sty{glossaries-extra} \code{seealso} is appended to the end of the
list.
\end{xtr}

This ordering can be changed using:
\cmddef{GlsSetXdyLocationClassOrder}
where each location name is delimited by double quote marks and
separated by white space. For example:
\begin{codebox}
\gls{GlsSetXdyLocationClassOrder}\marg{
  "arabic-page-numbers"
  "arabic-section-numbers"
  "roman-page-numbers"
  "Roman-page-numbers"
  "alpha-page-numbers"
  "Alpha-page-numbers"
  "Appendix-page-numbers"
  "see"
}
\end{codebox}
(Remember to add \code{"seealso"} if you're using \sty{glossaries-extra}.)

\begin{important}
Note that \gls{GlsSetXdyLocationClassOrder} has no effect if 
\gls{noist} is used or if \gls{makeglossaries} is omitted.
\gls{GlsSetXdyLocationClassOrder} must be used before 
\gls{makeglossaries}.
\end{important}

If a \idx{numberlist} consists of a sequence of consecutive 
numbers, the range will be concatenated. The 
number of consecutive locations that causes a range formation 
defaults to 2, but can be changed using:
\cmddef{GlsSetXdyMinRangeLength}
The \meta{value} may be the keyword \optfmt{none}, to indicate no 
\idx{range} formation, or a number.
For example:
\begin{codebox}
\gls{GlsSetXdyMinRangeLength}\marg{3}
\end{codebox}
See the \app{xindy} manual for further details on \idx{range} formations.

\begin{important}
Note that \gls{GlsSetXdyMinRangeLength} has no effect if \gls{noist}
is used or if \gls{makeglossaries} is omitted.
\gls{GlsSetXdyMinRangeLength} must be used before 
\gls{makeglossaries}.
\end{important}
See also \sectionref{sec:ranges}.

\section{Glossary Groups}
\label{sec:groups}

The \idx{glossary} is divided into \idxpl+{group} according to the first
letter of the sort key. The \sty{glossaries} package also adds
a number \idx{group} by default, unless you suppress it in the
\opt{xindy} package option. For example:
\begin{codebox*}
\cmd{usepackage}[\optval{xindy}{\styoptxdyval{glsnumbers}{false}}]\marg{glossaries}
\end{codebox*}
Any entry that doesn't go in one of the letter \idxpl{group} or the
number group is placed in the default group. If you want \app{xindy}
to sort the number group numerically (rather than by a string sort)
then you need to use \app{xindy}['s] \optfmt{numeric-sort} module:
\begin{codebox}
\gls{GlsAddXdyStyle}\marg{numeric-sort}
\end{codebox}

With the default \styoptxdyval{glsnumbers}{true}, the number group will be placed
before the \qt{A} letter group. This is done in the \code{define-letter-group}
block in the \ext{xdy} file:
\begin{compactcodebox}
(define-letter-group "glsnumbers"
   :prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
   :before "A")
\end{compactcodebox}

If you are not using a Roman alphabet, you need
to change this with:
\cmddef{GlsSetXdyFirstLetterAfterDigits}\marg{letter}
where \meta{letter} is the first letter of your alphabet. 
This will change \code{:before "A"} to \code{:before "\meta{letter}"}.

A starred version of this command was added to v4.33 which sanitized \meta{letter}
before writing it to the \ext{xdy} file to protect it from expansion
with \sty{inputenc}. This shouldn't be necessary with recent \LaTeX\
kernels.

Alternatively you can use:
\cmddef{GlsSetXdyNumberGroupOrder}
This will change \code{:before "A"} to \meta{relative location}.
Again, a starred version was provided to sanitize the argument, which
should no longer be necessary unless \idx{sym.dblquote} is active.

For example:
\begin{codebox}
\gls{GlsSetXdyNumberGroupOrder}\marg{:after "Z"}
\end{codebox}
will put the number group after the \qt{Z} letter group.

\begin{important}
Note that these commands have no effect if 
\gls{noist} is used or if \gls{makeglossaries} is omitted.
\gls{GlsSetXdyFirstLetterAfterDigits} must be used before 
\gls{makeglossaries}.
\end{important}

\glsendrange{app.xindy,ext.xdy}

\chapter{Utilities}
\label{sec:utilities}

This section describes the utility commands provided with the base
\sty{glossaries} package.

\begin{xtr}
The \sty{glossaries-extra} package provides extra utility commands,
such as \gls{glsxtrusefield} and \gls{glsxtrfieldformatlist}.
See the \sty{glossaries-extra} manual for further details.
\end{xtr}

\section{\stytext{hyperref}}
\label{sec:hyperref}

The \sty{hyperref} package needs to be loaded before
\sty{glossaries} to ensure that the commands provided by
\sty{hyperref} are only used if they have been defined.

\cmddef{glsdisablehyper}
This disables the creation of \idxpl+{hyperlink} and targets by
commands such as \gls{glshyperlink}, the \gls{glslike} and
\gls{glstextlike} commands and \gls{glstarget}. This setting is the
default if \sty{hyperref} hasn't been loaded.

The commands that normally create a \idx{hyperlink} will use:
\cmddef{glsdonohyperlink}

The internal command used by \gls{glstarget} to create a target is just set to
\cmd{@secondoftwo}.

\cmddef{glsenablehyper}
This enables the creation of \idxpl+{hyperlink} and targets, and is
the default if \sty{hyperref} has been loaded.

The internal command used by \gls{glstarget} to create a target is
set to:
\cmddef{glsdohypertarget}
This will include the debugging information if \opteqvalref{debug}{showtargets}
has been used, but also measures the height of \meta{text} so that
it can place the actual target at the top of \meta{text} rather than
along the baseline. This helps to prevent \meta{text} from scrolling
off the top of the page out of sight.

The corresponding command that's used to link to this target is:
\cmddef{glsdohyperlink}
This includes the debugging information, if applicable, and creates
a link with \gls{hyperlink}.

Both the above target and link commands have a corresponding hook that does
nothing by default. These commands are not used if hyperlinks have been 
disabled (or if \sty{hyperref} has not been loaded).
\cmddef{glsdohypertargethook}
This hook occurs after the height of the \meta{text} has been measured and
before the target is inserted.

\cmddef{glsdohyperlinkhook}
This hook occurs immediately before the link is created with \gls{hyperlink}.

\cmddef{glslabelhypertarget}
This command is provided for use in \gls{glsdohypertargethook} and will simulate
a label corresponding to the target. It's primarily intended for use with 
\gls{pageref} rather than \gls{ref} as there is no corresponding counter
to provide a numeric value. It is an alternative to using the \opt{entrycounter}
option. The label is given by \code{\meta{prefix}\meta{target}}, where the
\meta{prefix} is obtained by expanding:
\cmddef{glslabelhypertargetprefix}
The target \meta{text} will be the title corresponding to the label (which
can be referenced with \gls{nameref}). Since there is no numeric value, 
the text obtained with \gls{ref} will either be empty or the name of the most recent
entry in the glossary list where the hypertarget occurs.
For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsdohypertargethook}}[2]\marg{\gls{glslabelhypertarget}\marg{\#1}\marg{\#2}}
\end{codebox}
Certain commands that may occur in the \meta{text} argument, such as
\gls{glossentryname}, are locally redefined during the protected write
to the \ext{aux} file. These redefinitions are performed by:
\cmddef{glslabelhypertargetdefs}
You can append any additional redefinitions of problematic commands to this 
hook.

The \qt{value} part of the label (that is, the text produced with \gls{ref}) is
obtained by expanding:
\cmddef{glslabelhypertargetvalue}
The default definition expands
\begin{compactcodebox}
\gls{glsentryname}\gls{glscurrententrylabel}
\end{compactcodebox}
if \gls{glscurrententrylabel} is defined and not empty. Otherwise it expands to nothing.

\cmddef{glstexorpdfstring}
If you're not sure whether or not the \sty{hyperref} package will be
loaded, this command will use \gls{texorpdfstring} if
that command has been defined, otherwise it will simply expand to
\meta{\TeX}.


\section{Case-Changing}
\label{sec:casechanging}

These commands may be used to perform a \idx+{casechange}.

\begin{important}
Ensure you have at least \sty{mfirstuc} v2.08 installed to take
advantage of improved case-changing. If you also use
\sty{glossaries-extra}, make sure you have at least v1.49.
See the \sty{mfirstuc} manual for further details.
\end{important}

\cmddef{glsuppercase}

An expandable command that converts \meta{text} to 
\idx+{uppercase} (\idx+{allcaps}).
This is used by commands such as \gls{GLS} and \gls{GLStext} and is affected by
\gls{glsmfuexcl}.

\cmddef{glslowercase}

An expandable command that converts \meta{text} to \idx+{lowercase}.
This isn't used by the \sty{glossaries} package, but you may find it
useful with \idx{acronym} or \idx{abbreviation} font commands for
\idx{smallcaps} styles. This command is affected by
\gls{glsmfuexcl}.

\cmddef{MFUsentencecase}

This command is used by \idx+{sentencecase} commands, such as
\gls{Glsentrytext}, when expanding in a \idx{PDFbookmark}.

This command is actually defined by \sty{mfirstuc} v2.08+, but if an
old version of \sty{mfirstuc} is installed, the \sty{glossaries}
package will provide the same command. This command is affected by
\gls{glsmfuexcl}.

\cmddef{glssentencecase}

Converts \meta{text} to \idx+{sentencecase}. This is used by
commands such as \gls{Gls} and \gls{Glstext}, and also by commands
like \gls{Glsentrytext} in the document text.

The default definition is to use the robust \gls{makefirstuc}
provided by the \sty{mfirstuc} package.  If you need an expandable
command, use \gls{MFUsentencecase} instead.

Note that \gls{makefirstuc} internally uses \gls{glsmakefirstuc},
which is provided by \sty{mfirstuc}. The default definition is:
\begin{compactcodebox}
\cmd{newcommand}*\marg{\gls{glsmakefirstuc}}[1]\marg{\gls{MFUsentencecase}\marg{\cmd{unexpanded}\marg{\sym{hash}1}}}
\end{compactcodebox}
The \optval{mfirstuc}{expanded} package option will redefine this
command without \cmd{unexpanded}.

The reason for the use of \cmd{unexpanded} is mostly a
backward-compatibility feature, as without it there is now the
possibility for fragile commands to expand prematurely and cause an
error.

This is because the \LaTeX3 kernel command used by
\gls{MFUsentencecase} expands its argument before applying the
\idx{casechange}. With previous versions of \sty{mfirstuc},
\gls{glsmakefirstuc} would simply apply the \idx{casechange} to the
first token.

Suppose a document created with \sty{mfirstuc} v2.07 had something
like:
\begin{compactcodebox}
\gls{newglossaryentry}\marg{sample}\marg{
  \gloskeyval{name}{sample},
  \gloskeyval{description}{an example with a \cmd{fragilecommand}}
}
\end{compactcodebox}
and a \idx{glossarystyle} is used that performs automated
sentence-casing for the description (for example, with the
\glostyle{topic} style, provided by \sty{glossaries-extra}), then
this would essentially do:
\begin{compactcodebox}
\gls{makefirstuc}\marg{an example with a \cmd{fragilecommand}}
\end{compactcodebox}
With old versions of \sty{mfirstuc}, this would simply end up as:
\begin{compactcodebox}
\gls{MakeTextUppercase}{a}n example with a \cmd{fragilecommand}
\end{compactcodebox}
so the fragile command is unaffected.

However, with \sty{mfirstuc} v2.08 and \optval{mfirstuc}{expanded}
this would end up as:
\begin{compactcodebox}
\gls{MFUsentencecase}{an example with a \cmd{fragilecommand}}
\end{compactcodebox}
and the underlying \cmd{text\_titlecase\_first:n} will expand the
entire argument, which will break the fragile command.

The use of \cmd{unexpanded} prevents this from happening, but if you
don't have fragile commands and you want the content to be expanded,
then use \optval{mfirstuc}{expanded}.

\begin{information}
Note that the original definition of \gls{glsmakefirstuc} is a short command, which means no
paragraph breaks are permitted. The \sty{glossaries}['s]
\opt{mfirstuc} option (as from v4.58) will redefine
\gls{glsmakefirstuc} as a long command instead.
\end{information}

\cmddef{glscapitalisewords}

Converts \meta{text} to \idx+{titlecase}. The default definition is
to use the robust \gls{capitalisewords} provided by \sty{mfirstuc}.
You may need to redefine this command to use \gls{capitalisefmtwords}
instead.

\cmddef{glsmfuexcl}

This uses \gls{MFUexcl} with \sty{mfirstuc} v2.08+, otherwise its defined in the
same way (so it won't affect \gls{makefirstuc} but will affect
commands like \gls{glsuppercase}).

\cmddef{glsmfublocker}

This uses \gls{MFUblocker} with \sty{mfirstuc} v2.08+, otherwise it simply uses
\gls{glsmfuexcl}.

\cmddef{glsmfuaddmap}

This uses \gls{MFUaddmap} with \sty{mfirstuc} v2.08+, otherwise it
simply does
\begin{compactcodebox}
\gls{glsmfuexcl}\margm{cs}
\gls{glsmfublocker}\margm{Cs}
\end{compactcodebox}

This uses \gls{MFUblocker} if defined, otherwise it simply uses
\gls{glsmfuexcl}.


\section{Loops}
\label{sec:loops}

\begin{important}
Some of the commands described here take a comma-separated list as
an argument. As with \LaTeX's \gls{@for} command, make sure your list
doesn't have any unwanted spaces in it as they don't get stripped.
(Discussed in more detail in
\dickimawhref{latex/admin/html/docsvlist.shtml\#spacesinlists}{\S2.7.2 of \qt{\LaTeX\ for Administrative
Work}}.)
\end{important}

\cmddef{forallglossaries}
This iterates through \meta{types}, a comma-separated list of
\idx+{glossary} labels (as supplied when the glossary was defined).
At each iteration the command \meta{cs} is defined to the
\idx{glossary} label for the current iteration and \meta{body} is
performed. If \meta{types} is omitted, the default is to iterate
over all non-\idxpl{ignoredglossary}.

\cmddef{forallacronyms}
This is like \gls{forallglossaries} but only iterates over the
lists of \idxpl{acronym} (that have previously been declared using
\gls{DeclareAcronymList} or the \opt{acronymlists} package
option). This command doesn't have an optional argument. If you want
to explicitly say which lists to iterate over, just use the optional
argument of \gls{forallglossaries}.

\begin{xtr}
The \sty{glossaries-extra} package provides an analogous command
\gls{forallabbreviationlists}.
\end{xtr}

\cmddef{forglsentries}
This iterates through all \idxpl{entry} in the \idx{glossary} given by
\meta{type}. At each iteration the command \meta{cs} is defined 
to the entry label for the current
iteration and \meta{body} is performed. If \meta{type} is
omitted, \gls{glsdefaulttype} is used.

\cmddef{forallglsentries}
This is just a nested loop that essentially does:
\begin{compactcodebox}
\gls{forallglossaries}\oargm{types}\margm{type-cs}\margm{\comment{outer loop}
  \gls{forglsentries}\oargm{type-cs}\margm{cs}\margm{body}\comment{inner loop}
}
\end{compactcodebox}
If \meta{types} is omitted, the default is the list of all non-\idxpl{ignoredglossary}.
(The current glossary label can be obtained using 
\code{\gls{glsentrytype}\margm{cs}} within \meta{body}.)

\begin{xtr}
The \sty{glossaries-extra} package provides commands like \gls{glsxtrforcsvfield}
to iterate over any fields that contain comma-separated lists.
\end{xtr}

\section{Conditionals}
\label{sec:conditionals}

\begin{xtr}
The \sty{glossaries-extra} package provides many more conditional
commands.
\end{xtr}

\cmddef{ifglossaryexists}

This checks if the \idx{glossary} given by \meta{glossary-type} 
exists (that is, if it has been defined). If it does exist \meta{true part} 
is performed, otherwise \meta{false part}.

The unstarred form will treat \idxpl{ignoredglossary} as
non-existent. The starred form will consider them as existing.
So both forms will do \meta{true} if \meta{glossary-type} was
defined by \gls{newglossary}, but only the starred form will do
\meta{true} if \meta{glossary-type} was defined with
\gls{newignoredglossary}.

For example, given:
\begin{codebox}
\gls{newignoredglossary}\marg{common}
\end{codebox}
then
\begin{codebox}
\gls{ifglossaryexists}\marg{common}\marg{true}\marg{false}
\gls{ifglossaryexists}*\marg{common}\marg{true}\marg{false}
\end{codebox}
will produce \qt{false true}.

\cmddef{ifglsentryexists}

This checks if the \idx{glossaryentry} given by \meta{entry-label} exists. If it
does exist then \meta{true} is performed, otherwise this does \meta{false}.
Simply uses \sty{etoolbox}['s] \gls{ifcsundef} so can expand.

\cmddef{glsdoifexists}
Does \meta{code} if the entry given by \meta{entry-label} exists. If it
doesn't exist, an undefined error is generated.

\cmddef{glsdoifnoexists}
Does \meta{code} if the entry given by \meta{entry-label} doesn't exist. If it
does exist, an already defined error is generated.

\cmddef{glsdoifexistsorwarn}
As \gls{glsdoifexists} but issues a warning rather than an error if
the entry doesn't exist.

\cmddef{glsdoifexistsordo}
Does \meta{code} if the entry given by \meta{entry-label} exists otherwise
it generates an undefined error and does \meta{else code}.

\begin{xtr}
The undefined\slash already defined errors can be converted to warnings 
with \optval{undefaction}{warn}.
\end{xtr}

\cmddef{ifglsused}

Tests the entry's \idx+{firstuseflag}.  If the \idx{entry} has been
used, \meta{true} will be done, otherwise (if the \idx{entry} has
been defined) \meta{false} will be done.  If the \idx{entry} isn't
defined, then an undefined error will occur and neither \meta{true} nor
\meta{false} will be done (see \sectionref{sec:glsunset}).

This means that \gls{ifglsused} is unreliable with \app{bib2gls} as
no \idxpl{entry} are defined on the first \LaTeX\ run, which means there's no
way of determining if it has been used, so
\sty{glossaries-extra} provides a similar command:
\cmddef{GlsXtrIfUnusedOrUndefined}
In this case, \meta{true} will be done if the entry hasn't been
used or hasn't been defined, which is essentially the logical
negation of \gls{ifglsused} for defined \idxpl{entry}.

\begin{important}
Some of the following \csmetafmt{ifglshas}{xxx}{} commands use
\gls{glsdoifexists}. In those cases, the \meta{true} or \meta{false} parts are only
performed if the entry exists. Neither are done if the entry doesn't
exist.
\end{important}

\cmddef{ifglshaschildren}

This does \meta{true} if any \idxpl{entry} in the same \idx{glossary}
as \meta{entry-label} had \gloskeyval{parent}{\meta{entry-label}}.
This is inefficient and time-consuming if there are a large number
of entries defined. Uses \gls{glsdoifexists}.

\begin{bib2gls}
If you use \app{bib2gls}, a more efficient method is to use the
\resourceopt{save-child-count} resource option and test the value of
the \glosfield{childcount} field with \gls{GlsXtrIfHasNonZeroChildCount}.
\end{bib2gls}

If you have at least \sty{glossaries} v4.59 and \sty{datatool} v3.0,
the sort function used by \gls{printnoidxglossary} may now also
locally set the \glosfield{childcount} field during the pre-sort
processing. This means that the field can be accessed in
\idx{glossary} hooks. If the field is not set, then the entry
doesn't have children included in the glossary. (Not available with
\optval{sort}{def} or \optval{sort}{use}.) Therefore, a more efficient
test in this case is to use \gls{ifglsfieldvoid}. For example:
\begin{codebox}
\gls{ifglsfieldvoid}\marg{\glosfield{childcount}}\marg{\gls{glscurrententrylabel}}
 \marg{no children}\marg{has one or more children}
\end{codebox}
Bear in mind that \gls{printnoidxglossary} only sets this field for
an entry once a child of the entry is encountered in the list.
This means that with \gls{printnoidxglossary}, the
\glosfield{childcount} field will never be set to \code{0}.

\cmddef{ifglshasparent}

This does \meta{true} if the \gloskey+{parent} field is non-empty
for the entry identified by \meta{entry-label}. Uses \gls{glsdoifexists}.

\cmddef{ifglshassymbol}

A robust command that does \meta{true} if the \gloskey+{symbol} field is non-empty
and not \gls{relax} for the entry identified by \meta{entry-label}.

\cmddef{ifglshaslong}

A robust command that does \meta{true} if the \gloskey+{long} field is non-empty
and not \gls{relax} for the entry identified by \meta{entry-label}.

\cmddef{ifglshasshort}

A robust command that does \meta{true} if the \gloskey+{short} field is non-empty
and not \gls{relax} for the entry identified by \meta{entry-label}.

\cmddef{ifglshasdesc}

Expands to \meta{true} if the \gloskey{description} is empty for the
entry identified by \meta{entry-label}, otherwise expands to
\meta{false}. Compare with:
\cmddef{ifglsdescsuppressed}
This expands to \meta{true} if \gloskeyval{description}{\gls{nopostdesc}}
for the entry identified by \meta{entry-label}
otherwise expands to \meta{false}.

If \LaTeX3 syntax is enabled, the following conditional function may
also be used:
\cmddef{glossariesifhasnonsuppresseddesc:n}
This returns true if the entry identified by \meta{entry-label} exists and has the
\gloskey{description} field set to a non-empty value that isn't
simply \gls{nopostdesc}.

There are also commands available for arbitrary fields. Some may
allow the field to be identified by its corresponding key (such as
\gloskey{description}) but some require the \idx{internalfieldlabel}
(such as \glosfield{desc}). See \tableref{tab:fieldmap} for the
\idxpl{internalfieldlabel} that correspond to each key. If you
provide your own keys, for example with \gls{glsaddkey}, then the
internal label will be the same as the key.

\begin{xtr}
The \sty{glossaries-extra} package provides some low-level \LaTeX3
conditionals that may be preferred. See the \sty{glossaries-extra}
manual for further details.
\end{xtr}

\cmddef{ifglsfieldvoid}
Expands to \meta{true} if the field identified by its
\idx{internalfieldlabel} \meta{field-label} is void for the entry
identified by \meta{entry-label}, otherwise it expands to
\meta{false}. The void test is performed with \sty{etoolbox}['s]
\gls{ifcsvoid}. This means that an undefined field or an undefined
entry will be considered void. An empty field value or a field set
to \gls{relax} are also considered void.

\cmddef{ifglshasfield}

This robust command tests the value of the field given by
\meta{field} for the entry identified by \meta{entry-label}. 
The \meta{field} argument may either be the key associated with the
field or the \idx{internalfieldlabel}.

If the field value is empty or \gls{relax}, then \meta{false} is
performed, otherwise \meta{true} is performed. If the field supplied
is unrecognised \meta{false part} is performed and a warning is
issued. If the entry is undefined, an undefined error occurs.

Within \meta{true}, you can access the field's value with:
\cmddef{glscurrentfieldvalue}
This command is initially defined to empty but has
no relevance outside of the \meta{true} argument. This saves re-accessing the
field if the test is true. For example:
\begin{codebox}
\gls{ifglshasfield}\marg{useri}\marg{sample}\marg{, \gls{glscurrentfieldvalue}}\marg{}
\end{codebox}
will insert a comma, space and the field value if the
\gloskey{user1} key has been set for
the entry whose label is \qt{sample}.

\cmddef{ifglsfieldeq}
This robust command does \meta{true} if the entry identified by
\meta{entry-label} has the field identified by its
\idx{internalfieldlabel} (not the key) \meta{field-label} defined and set to
the given \meta{string}. The test is performed by \sty{etoolbox}['s]
\gls{ifcsstring}. An error will occur if the field value is
undefined or if the entry hasn't been defined.

The result may vary depending on whether or not expansion was on for
the given field when the entry was defined (see \sectionref{sec:expansion}).
For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{\cmd{foo}}}
\cbeg{document}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
This will produce \qt{TRUE} in both cases since expansion is on for
the \gloskey{user1} key, so
\cmd{foo} was expanded to \qt{FOO} when \qt{sample2} was defined.
If the tests are changed to:
\begin{codebox}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\end{codebox}
then this will produce \qt{FALSE} in both cases. Now suppose
expansion is switched off for the \gloskey{user1} key:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{glssetnoexpandfield}\marg{\glosfield{useri}}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},
 \gloskeyval{description}{an example},
\gloskeyval{user1}{\cmd{foo}}}
\cbeg{document}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{FOO}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
This now produces \qt{TRUE} for the first case (comparing \qt{FOO}
with \qt{FOO}) and \qt{FALSE} for the second case (comparing
\qt{\cmd{foo}} with \qt{FOO}).

The reverse happens in the following:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{glssetnoexpandfield}\marg{\glosfield{useri}}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{\cmd{foo}}}
\cbeg{document}
\gls{ifglsfieldeq}\marg{sample1}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfieldeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
This now produces \qt{FALSE} for the first case (comparing \qt{FOO}
with \qt{\cmd{foo}}) and \qt{TRUE} for the second case (comparing
\qt{\cmd{foo}} with \qt{\cmd{foo}}).

You can test if the value of a field is equal to the replacement
text of a command using:
\cmddef{ifglsfielddefeq}
This robust command is essentially like \gls{ifglsfieldeq} but
internally uses \sty{etoolbox}'s \gls{ifdefstrequal} command to
perform the comparison. The argument \meta{cs} argument must be a macro.

For example:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}\marg{glossaries}
\codepar
\cmd{newcommand}*\marg{\cmd{foo}}\marg{FOO}
\codepar
\gls{glssetnoexpandfield}\marg{\glosfield{useri}}
\codepar
\gls{newglossaryentry}\marg{sample1}\marg{\gloskeyval{name}{sample1},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{FOO}}
\gls{newglossaryentry}\marg{sample2}\marg{\gloskeyval{name}{sample2},
 \gloskeyval{description}{an example},
 \gloskeyval{user1}{\cmd{foo}}}
\codepar
\cbeg{document}
\gls{ifglsfielddefeq}\marg{sample1}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\codepar
\gls{ifglsfielddefeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{foo}}\marg{TRUE}\marg{FALSE}.
\cend{document}
\end{codebox}
Here, the first case produces \qt{TRUE} since the value of the
\glosfield{useri} field (\qt{FOO}) is the same as the replacement text
(definition) of \cmd{foo} (\qt{FOO}). We have the result
\qt{\code{FOO}} is equal to \qt{\code{FOO}}.

The second case produces \qt{FALSE} since the value of the
\glosfield{useri} field (\qt{\cmd{foo}}) is not the same as the replacement
text (definition) of \cmd{foo} (\qt{FOO}). No expansion has been
performed on the value of the \glosfield{useri} field. We have the
result \qt{\cmd{foo}} is not equal to \qt{\code{FOO}}.

If we add:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{FOO}}\marg{\cmd{foo}}
\gls{ifglsfielddefeq}\marg{sample2}\marg{\glosfield{useri}}\marg{\cmd{FOO}}\marg{TRUE}\marg{FALSE}.
\end{codebox}
we now get \qt{TRUE} since the value of the
\glosfield{useri} field (\qt{\cmd{foo}}) is the same as the replacement
text (definition) of \cmd{FOO} (\qt{\cmd{foo}}). We have the result
\qt{\cmd{foo}} is equal to \qt{\cmd{foo}}.

There is a similar command that requires the control sequence name
(without the leading backslash) instead of the actual control sequence:
\cmddef{ifglsfieldcseq}
This robust command is like {ifglsfielddefeq}
but internally uses \sty{etoolbox}'s \gls{ifcsstrequal} command
instead of \gls{ifdefstrequal}.

\section{Measuring}
\label{sec:measuring}

Sometimes it's necessary to measure the width or height of some
text. For example, \gls{glsdohypertarget} measures the height of the
supplied text to position the target at the top of the line instead
of at the baseline (where it can cause the line to scroll up out of
view). Some styles measure the width of text to assist with
alignment.

Measuring can be performed using \gls{settowidth}, \gls{settoheight}
and \gls{settodepth}, but if the content being measured contains any
\idx{glslike} or \idx{glstextlike} commands, or if it contains
commands like \gls{glsentryitem}, it can cause duplication.  (See
also \sectionref{sec:glsunset} for the problems this can cause with
unsetting and resetting the \idx{firstuseflag}.)

The following measuring commands locally disable \idx{indexing}, the
unset/reset commands, and \gls{label}, and adjust
\gls{refstepcounter} to only locally update the counter value.

\cmddef{glsmeasureheight}
Measures the height of \meta{text} and stores the result in the
supplied \meta{length} register.

\cmddef{glsmeasuredepth}
Measures the depth of \meta{text} and stores the result in the
supplied \meta{length} register.

\cmddef{glsmeasurewidth}
Measures the width of \meta{text} and stores the result in the
supplied \meta{length} register.

You can test if content is inside an area that's being measured
with:
\cmddef{glsifmeasuring}
This will do \meta{true} if it occurs inside either of the above
commands and does \meta{false} otherwise. This will also take
\sty{amsmath}['s] \cmd{ifmeasuring@} into account.

If \sty{tabularx} is loaded, its \cmd{TX@trial} command can be
patched with:
\cmddef{glspatchtabularx}
If you use \sty{tabularx} and have any of the \idx{glslike} commands
inside a \env{tabularx} environment, you will need to use
\gls{glspatchtabularx} in the \idx{preamble/document} to disable
unset/reset while the environment measures its content.

\begin{warning}
Patches made on other package's internal commands may break if the
other package removes those commands or changes their definitions.
\end{warning}

\section{Fetching and Updating the Value of a Field}
\label{sec:fetchset}

In addition to the commands described in \sectionref{sec:glsnolink},
the commands described in this section may also be used to fetch field information.

\begin{xtr}
The \sty{glossaries-extra} package has additional commands, such as
\gls{glsxtrusefield}.
\end{xtr}

\cmddef{glsentrytype}
Expands to the value of the entry's \gloskey{type} field, which
is the label of the \idx{glossary} the entry has been assigned to. 
No existence check is performed.

\cmddef{glsentryparent}
Expands to the value of the entry's \gloskey{parent} field, 
which is the label identifying the entry's parent. No existence check is
performed.

\cmddef{glsentrysort}
Expands to the entry's \gloskey{sort} value. No existence check is performed.
This is not intended for general use, but can be useful to display
the value for debugging purposes. Note that there is also an
\idxc{internalfieldlabel}{internal field} \glosfield{sortvalue}
which contains the escaped sort value, which may not necessarily be
the same as the \gloskey{sort} value.

\cmddef{glsfieldfetch}

This robust command fetches the value of the field identified by its
\idx{internalfieldlabel}\meta{field-label} for the \idx{entry}
identified by \meta{entry-label} and stores it in the
given command \meta{cs}. An error will occur if the entry doesn't
exist or if the field hasn't been defined.

\cmddef{glsletentryfield}

This command simply assigns the supplied command \meta{cs} to the
value of the field identified by its
\idx{internalfieldlabel}\meta{field-label} for the \idx{entry}
identified by \meta{entry-label}. This differs from
\gls{glsfieldfetch} in that it doesn't test for existence. If either
the field or the entry haven't been defined, no error or warning
will be trigger but \meta{cs} will be undefined. You can then use
\sty{etoolbox}['s] \gls{ifdef} or \gls{ifundef} on \meta{cs}.

For example, to store
the description for the entry whose label is \qt{apple} in the
control sequence \code{\cmd{tmp}}:
\begin{codebox}
\gls{glsletentryfield}\marg{\cmd{tmp}}\marg{apple}\marg{\glosfield{desc}}
\gls{ifdef}\marg{\cmd{tmp}}{description: \cmd{tmp}}\marg{no description}
\end{codebox}
An alternative is to use \gls{ifglshasfield} or, with
\sty{glossaries-extra}, \gls{glsxtrifhasfield}.

\cmddef{glsunexpandedfieldvalue}
This command is provided for use in expandable contexts where the
field value is required but the contents should not be expanded.
The \meta{field-label} argument must be the
\idx{internalfieldlabel}. Does nothing if the field or entry isn't
defined.

You can change the value of a given field using one of the following
commands. Note that these commands only change the value of the
given field. They have no affect on any related field. For example,
if you change the value of the \gloskey{text} field, it won't modify the
value given by the \gloskey{name}, \gloskey{plural}, \gloskey{first} 
or any other related key.

\begin{warning}
There are some fields that should only be set when the \idx{entry}
is defined and will cause unexpected results if changed later.  For
example, \gloskey{type} (which additionally needs to add the
\idx{entry}['s] label to the corresponding \idx{glossary}['s]
internal list), \gloskey{parent} (which needs to calculate the
\idx{hierarchicallevel} and setup the \idx{indexing} syntax
appropriately), and \gloskey{sort} (which may need pre-processing
and is required to setup the \idx{indexing} syntax).
\end{warning}

In all the four related commands below, \meta{entry-label}
identifies the entry and \meta{field-label} is the
\idx{internalfieldlabel}.  The \meta{definition} argument is the new
value of the field. Both the entry and field must already be
defined. If you want internal fields that don't require a
corresponding key to be defined, you will need the supplementary
commands provided by \sty{glossaries-extra}.

\cmddef{glsfielddef}
This robust command uses \gls{def} to change the value of the field (so it will be
localised by any grouping).

\cmddef{glsfieldedef}
This robust command uses \gls{protected@csedef} to change the value of the 
field (so it will be localised by any grouping).

\cmd{glsfieldgdef}
This uses \gls{gdef} to change the value of the field (so it will
have a global effect).

\cmddef{glsfieldxdef}
This robust command uses \gls{protected@csxdef} to change the value of the 
field (so it will be localised by any grouping).

\chapter{Prefixes or Determiners}\label{sec:prefix}

\pkgdef{glossaries-prefix}

The \sty{glossaries-prefix} package that comes with the
\sty{glossaries} package provides additional keys that can be used
as prefixes. For example, if you want to specify determiners (such
as \qt{a}, \qt{an} or \qt{the}). The \sty{glossaries-prefix} package
automatically loads the \sty{glossaries} package and has the same
package options.

\begin{xtr}
The \sty{glossaries-prefix} package can automatically be loaded 
with \sty{glossaries-extra} via the \opt{prefix} package option.
\end{xtr}

The extra keys for \gls{newglossaryentry} are as follows:

\optiondef{gloskey.prefix}

The prefix associated with the \gloskey{text} key. This defaults to nothing.

\optiondef{gloskey.prefixplural}

The prefix associated with the \gloskey{plural} key. This defaults to nothing.

\optiondef{gloskey.prefixfirst}

The prefix associated with the \gloskey{first} key. If omitted, this
defaults to the value of the \gloskey{prefix} key.

\optiondef{gloskey.prefixfirstplural}

The prefix associated with the \gloskey{firstplural} key. If
omitted, this defaults to the value of the \gloskey{prefixplural}
key.

\begin{example}{Defining Determiners}{ex:determiners}
Here's the start of my example document:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks]\marg{hyperref}
\cmd{usepackage}[\opt{toc},\opt{acronym}]\marg{glossaries-prefix}
\end{codebox}
Note that I've simply replaced \sty{glossaries} from previous
sample documents with \sty{glossaries-prefix}. Now for a sample
definition:
\begin{codebox*}
\gls{newglossaryentry}\marg{sample}\marg{\gloskey{name}{sample},
  \gloskeyval{description}{an example},
  \gloskeyval{prefix}{a\sym{nbsp}},
  \gloskeyval{prefixplural}{the\gls{space}}
}
\end{codebox*}
(Single letter words, such as \qt{a} and \qt{I}
should typically not appear at the end of a line, hence the
non-breakable space \sym{nbsp} after \qt{a} in the \gloskey{prefix} field.)

Note that I've had to explicitly insert a~space after the prefix
since there's no designated separator between the prefix and the
term being referenced. This not only means that you can vary between
a breaking space and non-breaking space, but also
allows for the possibility of prefixes that shouldn't have a~space, 
such as:
\begin{codebox}
\gls{newglossaryentry}\marg{oeil}\marg{\gloskeyval{name}{oeil},
  \gloskeyval{plural}{yeux},
  \gloskeyval{description}{eye},
  \gloskeyval{prefix}{l'},
  \gloskeyval{prefixplural}{les\gls{space}}}
\end{codebox}

\begin{important}
Where a space is required at the end of the prefix, you must use 
a~spacing command, such as \gls{space}, \gls{cs.sp} (backslash space) or
\sym{nbsp} due to the automatic spacing trimming performed in
\keyval\ options.
\end{important}

In the event that you always require a space between the prefix and
the term, then you can instead redefine \gls{glsprefixsep}
to do a space. For example:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsprefixsep}}\marg{\gls{space}}
\end{codebox}

The prefixes can also be used with acronyms. For example:
\begin{codebox}
\gls{newacronym}
 \oarg{
   \gloskeyval{prefix}{an\gls{space}},\gloskeyval{prefixfirst}{a\sym{nbsp}}
 }\marg{svm}\marg{SVM}\marg{support vector machine}
\end{codebox}
\end{example}

The \sty{glossaries-prefix} package provides convenient commands to
use these prefixes with commands such as \gls{gls}. Note that the
prefix is not considered part of the \idx{linktext}, so it's not
included in the hyperlink (where hyperlinks are enabled). The
options and any star or plus modifier are passed on to the
appropriate \gls{glslike} command. (See \sectionref{sec:glslink} for
further details.)

\cmddef{glsprefixsep}
The separator used between the appropriate prefix and the
corresponding \gls{glslike} command.

Each of the following commands \csmetafmt{p}{gls}{} essentially does
\code{\meta{prefix}\gls{glsprefixsep}\meta{gls}} if the appropriate
prefix field has been set, otherwise it simply does \meta{gls},
where \meta{gls} is the corresponding \gls{glslike} command.

The \idx+{allcaps} commands \csmetafmt{P}{GLS}{} will convert the
prefix to \idx{allcaps} (using \gls{glsuppercase}) and use the
\idx{allcaps} \gls{glslike} counterpart.

The \idx+{sentencecase} commands \csmetafmt{P}{Gls}{} are slightly
more complicated. If the appropriate prefix field has been set, then
the prefix will have the \idx{casechange} applied and the non-case 
\gls{glslike} command will be used (\gls{gls} or \gls{glspl}).
If the appropriate prefix field hasn't been set, then the
\idx{sentencecase} \gls{glslike} command is used (\gls{Gls} or
\gls{Glspl}).

The usual \gls{glslike} optional argument and star (\sym{starmod})
and plus (\sym{plusmod}) modifiers can be used with these commands,
in which case they will be applied to the applicable \gls{glslike}
command.

\cmddef{pgls}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{gls}} if
\meta{prefix} is non-empty otherwise just uses \gls{gls}.

The \meta{prefix} will be the value of the \gloskey{prefixfirst} key on 
\idx+{firstuse} or the \gloskey{prefix} key on \idx+{subsequentuse}.

\cmddef{pglspl}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{glspl}} if
\meta{prefix} is non-empty otherwise just uses \gls{glspl}.

The \meta{prefix} will be the value of the
\gloskey{prefixfirstplural} key on \idx{firstuse} or the
\gloskey{prefixplural} key on \idx{subsequentuse}.

\cmddef{Pgls}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{gls}} if
\meta{prefix} is non-empty otherwise just uses \gls+{Gls}.

As \gls{pgls}, the prefix fields are \gloskey{prefixfirst} on 
\idx{firstuse} or the \gloskey{prefix} on \idx{subsequentuse}, but
the \meta{prefix} will now be obtained from the \idx{sentencecase}
commands \gls{Glsentryprefix} and \gls{Glsentryprefixfirst}.

\cmddef{Pglspl}
Does \code{\meta{prefix}\gls{glsprefixsep}\gls+{glspl}} if
\meta{prefix} is non-empty otherwise just uses \gls+{Glspl}.

As \gls{pglspl}, the prefix fields are \gloskey{prefixfirstplural} on 
\idx{firstuse} or the \gloskey{prefixplural} on \idx{subsequentuse}, but
the \meta{prefix} will now be obtained from the \idx{sentencecase}
commands \gls{Glsentryprefixplural} and
\gls{Glsentryprefixfirstplural}.

\cmddef{PGLS}
Does:
\begin{compactcodebox}
\gls{glsuppercase}\marg{\meta{prefix}\gls{glsprefixsep}}\gls{GLS}
\end{compactcodebox}
if \meta{prefix} is non-empty otherwise just uses \gls+{GLS}.

The \meta{prefix} will be the value of the \gloskey{prefixfirst} key on 
\idx{firstuse} or the \gloskey{prefix} key on \idx{subsequentuse}.

\cmddef{PGLSpl}
Does:
\begin{compactcodebox}
\gls{glsuppercase}\marg{\meta{prefix}\gls{glsprefixsep}}\gls{GLSpl}
\end{compactcodebox}
if
\meta{prefix} is non-empty otherwise just uses \gls+{GLSpl}.

The \meta{prefix} will be the value of the
\gloskey{prefixfirstplural} key on \idx{firstuse} or the
\gloskey{prefixplural} key on \idx{subsequentuse}.

\begin{xtr}
The \sty{glossaries-extra} package provides additional commands,
such as \gls{pglsxtrshort}, for use in section headings.
\end{xtr}

\begin{example}{Using Prefixes}{ex:prefixes}
Continuing from \exampleref{ex:determiners}, now that I've defined
my entries, I~can use them in the text via the above commands:
\begin{codebox}
First use: \gls{pgls}\marg{svm}. Next use: \gls{pgls}\marg{svm}.
Singular: \gls{pgls}\marg{sample}, \gls{pgls}\marg{oeil}.
Plural: \gls{pglspl}\marg{sample}, \gls{pglspl}\marg{oeil}.
\end{codebox}
which produces:
\begin{resultbox}
First use: a~support vector machine (SVM). Next use: an SVM.
Singular: a~sample, l'oeil. Plural: the samples, les yeux.
\end{resultbox}
For a complete document, see \samplefile{-prefix}.
\end{example}

This package also provides the commands described below, none of
which perform any check to determine the entry's existence.

\cmddef{ifglshasprefix}
Expands to \meta{true} if the \gloskey{prefix} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{ifglshasprefixplural}
Expands to \meta{true} if the \gloskey{prefixplural} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{ifglshasprefixfirst}
Expands to \meta{true} if the \gloskey{prefixfirst} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{ifglshasprefixfirstplural}
Expands to \meta{true} if the \gloskey{prefixfirstplural} field is non-empty,
otherwise expands to \meta{false}.

\cmddef{glsentryprefix}
Expands to the value if the \gloskey{prefix} field.

\cmddef{glsentryprefixplural}
Expands to the value if the \gloskey{prefixplural} field.

\cmddef{glsentryprefixfirst}
Expands to the value if the \gloskey{prefixfirst} field.

\cmddef{glsentryprefixfirstplural}
Expands to the value if the \gloskey{prefixfirstplural} field.

There are also variants that convert to \idx+{sentencecase}. As with
command like \gls{Glsentrytext}, these will use
\gls{MFUsentencecase} to expand in \idxpl{PDFbookmark}, but will use
\gls{glssentencecase} in the document.

\cmddef{Glsentryprefix}
As \gls{glsentryprefix} with \idx{sentencecase} applied.

\cmddef{Glsentryprefixplural}
As \gls{glsentryprefixplural} with \idx{sentencecase} applied.

\cmddef{Glsentryprefixfirst}
As \gls{glsentryprefixfirst} with \idx{sentencecase} applied.

\cmddef{Glsentryprefixfirstplural}
As \gls{glsentryprefixfirstplural} with \idx{sentencecase} applied.

\begin{example}{Adding Determiner to Glossary Style}{ex:plist}
You can use the above commands to define a new \idx{glossarystyle} that
uses the determiner. For example, the following style is a slight
modification of the \glostyle{list} style that inserts the prefix
before the name:
\begin{codebox}
\gls{newglossarystyle}\marg{plist}\marg{\comment{}
 \gls{setglossarystyle}\marg{\glostyle{list}}\comment{}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
  \gls{item}\oarg{\gls{glsentryitem}\marg{\sym{hashhash}1}\comment{}
      \gls{glsentryprefix}\marg{\sym{hashhash}1}\comment{}
      \gls{glstarget}\marg{\sym{hashhash}1}\marg{\gls{glossentryname}\marg{\sym{hashhash}1}}}
   \gls{glossentrydesc}\marg{\sym{hashhash}1}\gls{glspostdescription}\gls{space} \sym{hashhash}2}\comment{}
}
\end{codebox}
If you want to change the prefix separator (\gls{glsprefixsep}) then
the following is better:
\begin{codebox}
\gls{newglossarystyle}\marg{plist}\marg{\comment{}
 \setglossarystyle{list}\comment{}
 \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
   \gls{item}\oarg{\gls{glsentryitem}\marg{\sym{hashhash}1}\comment{}
        \gls{ifglshasprefix}\marg{\sym{hashhash}1}\marg{\gls{glsentryprefix}\marg{\sym{hashhash}1}\gls{glsprefixsep}}\marg{}\comment{}
        \gls{glstarget}\marg{\sym{hashhash}1}\marg{\gls{glossentryname}\marg{\sym{hashhash}1}}}
     \gls{glossentrydesc}\marg{\sym{hashhash}1}\gls{glspostdescription}\gls{space} \sym{hashhash}2}\comment{}
}
\end{codebox}
The conditional is also useful if you want the style to use an
\idx{uppercase} letter at the start of the entry item:
\begin{codebox}
\gls{newglossarystyle}\marg{plist}\marg{\comment{}
  \gls{setglossarystyle}\marg{\glostyle{list}}\comment{}
  \cmd{renewcommand}*\marg{\gls{glossentry}}[2]\marg{\comment{}
    \gls{item}\oarg{\gls{glsentryitem}\marg{\sym{hashhash}1}\comment{}
        \gls{glstarget}\marg{\sym{hashhash}1}\comment{}
        \marg{\comment{}
          \gls{ifglshasprefix}\marg{\sym{hashhash}1}\comment{}
          \marg{\gls{Glsentryprefix}\marg{\sym{hashhash}1}\gls{glsprefixsep}\gls{glossentryname}\marg{\sym{hashhash}1}}\comment{}
          \marg{\gls{Glossentryname}\marg{\sym{hashhash}1}}\comment{}
        }}
     \gls{glossentrydesc}\marg{\sym{hashhash}1}\gls{glspostdescription}\gls{space} \sym{hashhash}2}\comment{}
}
\end{codebox}
\end{example}

\chapter{Accessibility Support}\label{sec:accsupp}

\pkgdef{glossaries-accsupp}

Limited accessibility support is provided by the accompanying
\sty{glossaries-accsupp} package, but note that this package is
experimental. This package automatically
loads the \sty{glossaries} package. Any options are passed to
\sty{glossaries} (if it hasn't already been loaded). For example:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries-accsupp}
\end{codebox}
This will load \sty{glossaries} with the \opt{acronym} package
option as well as loading \sty{glossaries-accsupp}.

\begin{xtr}
If you are using the \sty{glossaries-extra} extension package, you
need to load \sty{glossaries-extra} with the \opt{accsupp}
package option. For example:
\begin{verbatim}
\usepackage[abbreviations,accsupp]{glossaries-extra}
\end{verbatim}
This will load \sty{glossaries-extra} (with the
\opt{abbreviations} option), \sty{glossaries} and
\sty{glossaries-accsupp} and make appropriate patches to integrate
the accessibility support with the extension commands.
\end{xtr}

\section{Accessibility Keys}
\label{sec:accsuppkeys}

The \sty{glossaries-accsupp} package defines
additional keys that may be used when defining \idxpl{glossaryentry}.
If a key isn't set, then there will be not accessibility support for
the corresponding field.

\optiondef{gloskey.access}

The value of this key is the replacement text corresponding to
the \gloskey{name} key.

\optiondef{gloskey.textaccess}

The value of this key is the replacement text corresponding to
the \gloskey{text} key.

\optiondef{gloskey.firstaccess}

The value of this key is the replacement text corresponding to
the \gloskey{first} key.

\optiondef{gloskey.pluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{plural} key.

\optiondef{gloskey.firstpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{firstplural} key.

\optiondef{gloskey.symbolaccess}

The value of this key is the replacement text corresponding to
the \gloskey{symbol} key.

\optiondef{gloskey.symbolpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{symbolplural} key.

\optiondef{gloskey.descriptionaccess}

The value of this key is the replacement text corresponding to
the \gloskey{description} key. The corresponding
\idx{internalfieldlabel} is \glosfield{descaccess}.

\optiondef{gloskey.descriptionpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{descriptionplural} key. The corresponding
\idx{internalfieldlabel} is \glosfield{descpluralaccess}.

\optiondef{gloskey.longaccess}

The value of this key is the replacement text corresponding to
the \gloskey{long} key.

\optiondef{gloskey.longpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{longplural} key.

\optiondef{gloskey.shortaccess}

The value of this key is the replacement text corresponding to
the \gloskey{short} key.

If you define \idxpl{acronym} with \gls{newacronym}, the
\gloskey{shortaccess} field will automatically be set to:
\cmddef{glsdefaultshortaccess}
This just expands to \meta{long}. If redefined, this command must be
fully expandable. It expands when the \idx{acronym} is defined.

\optiondef{gloskey.shortpluralaccess}

The value of this key is the replacement text corresponding to
the \gloskey{shortplural} key.

\optiondef{gloskey.user1access}

The value of this key is the replacement text corresponding to
the \gloskey{user1} key. The corresponding
\idx{internalfieldlabel} is \glosfield{useriaccess}.

\optiondef{gloskey.user2access}

The value of this key is the replacement text corresponding to
the \gloskey{user2} key. The corresponding
\idx{internalfieldlabel} is \glosfield{useriiaccess}.

\optiondef{gloskey.user3access}

The value of this key is the replacement text corresponding to
the \gloskey{user3} key. The corresponding
\idx{internalfieldlabel} is \glosfield{useriiiaccess}.

\optiondef{gloskey.user4access}

The value of this key is the replacement text corresponding to
the \gloskey{user4} key. The corresponding
\idx{internalfieldlabel} is \glosfield{userivaccess}.

\optiondef{gloskey.user5access}

The value of this key is the replacement text corresponding to
the \gloskey{user5} key. The corresponding
\idx{internalfieldlabel} is \glosfield{uservaccess}.

\optiondef{gloskey.user6access}

The value of this key is the replacement text corresponding to
the \gloskey{user6} key. The corresponding
\idx{internalfieldlabel} is \glosfield{userviaccess}.

For example:
\begin{codebox}
\gls{newglossaryentry}\marg{tex}\marg{\gloskeyval{name}{\cmd{TeX}},\gloskeyval{description}{Document 
preparation language},\gloskeyval{access}{TeX}}
\end{codebox}
Now the \idx{linktext} produced by \code{\gls{gls}\marg{tex}} will be:
\begin{codebox}
\gls{BeginAccSupp}\marg{ActualText=\marg{TeX}}\cmd{TeX}\gls{EndAccSupp}{}
\end{codebox}
which is produced via \gls{glsaccessibility}. If you want to use
another accessibility package, see \sectionref{sec:accsuppdevnote}.

The sample file \samplefile{accsupp} illustrates the
\sty{glossaries-accsupp} package.

\section{Incorporating Accessibility Support}
\label{sec:accsuppcmds}

The \gls{glslike} and \gls{glstextlike} commands have their
\idx{linktext} adjusted to incorporate the accessibility support, if
provided.
A helper command is used to identify the replacement text that depends 
on the field name:
\cmddef{glsfieldaccsupp}
This will use 
\cmddef{glsfield-labelaccsupp} 
if it's defined otherwise it will just use:
\cmddef{glsaccsupp}
Note that \meta{field-label} is the \idx{internalfieldlabel} which may not
match the corresponding key. For example, the \glosfield{shortpl}
field label corresponds to the \gloskey{shortplural} key.

\begin{xtr}
With \sty{glossaries-extra}, there's a prior test for the existence
of the command \gls{glsxtrcategoryfieldaccsupp}.
\end{xtr}

There are two commands pre-defined:
\cmddef{glsshortaccsupp}
which is defined as:
\begin{compactcodebox}
\gls{glsaccessibility}\marg{E}\margm{replacement}\margm{content}
\end{compactcodebox}
and
\cmddef{glsshortplaccsupp}
which is simply defined to use \gls{glsshortaccsupp}.

These helper commands all internally use:
\cmddef{glsaccessibility}
The default definition uses commands provided by the \sty{accsupp}
package. If you want to experiment with another accessibility
package, see \sectionref{sec:accsuppdevnote}. The \meta{options} are
passed to the underlying accessibility support command.

The \meta{PDF element} argument is the appropriate \idx{PDFelement}
tag. The \idx+{PDF} specification identifies three different types of
replacement text:
\begin{deflist}
\itemtitle{Alt}
\begin{itemdesc}
Description of some content that's non-textual (for
example, an image). A word break is assumed after the content.
\end{itemdesc}

\itemtitle{ActualText}

\begin{itemdesc}
A character or sequence of characters that replaces textual content
(for example, a dropped capital, a ligature or a symbol). No word
break is assumed after the content.
\end{itemdesc}

\itemtitle{E}

\begin{itemdesc}
Expansion of an abbreviation to avoid ambiguity (for
example, \qt{St} could be short for \qt{saint} or \qt{street}).
\end{itemdesc}
\end{deflist}

\begin{important}
Many \idx{PDF} viewers don't actually support any type of replacement text. Some may
support \qt{ActualText} but not \qt{Alt} or \qt{E}. 
\href{https://pdfbox.apache.org/}{PDFBox}'s \qt{PDFDebugger} tool
can be used to inspect the PDF content to make sure that the
replacement text has been correctly set.
\end{important}

You can define your own custom helper commands for specific fields
that require them. For example:
\begin{codebox}
\cmd{newcommand}\marg{\glsfieldlabelaccsupp{symbol}}[2]\marg{\comment{}
 \gls{glsaccessibility}\oarg{method=hex,unicode}\marg{ActualText}\marg{\sym{hash}1}\marg{\sym{hash}2}\comment{}
}
\end{codebox}
This definition requires the replacement text to be specified with
the hexadecimal character code. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}},\gloskeyval{symbolaccess}{222B}
}
\end{codebox}

\begin{xtr}
The \sty{glossaries-extra} package provides additional support.
\end{xtr}

\section{Incorporating the Access Field Values}
\label{sec:glsentryaccessdisplay}

These robust commands are all in the form
\begin{compactcodebox}
\csmetafmt{gls}{field}{accessdisplay}\margm{text}\margm{entry-label}
\end{compactcodebox}
They may be used to apply the supplied accessibility
information to \meta{text}. If the relevant access field hasn't
been set, these simply do \meta{text}.

\glsxtrnote
The \sty{glossaries-extra} package provides convenient wrapper
commands such as:
\begin{compactcodebox*}
\cmd{newcommand}*\marg{\gls{glsaccessname}}[1]\marg{\comment{}
 \gls{glsnameaccessdisplay}\marg{\gls{glsentryname}\marg{\sym{hash}1}}{\sym{hash}1}\comment{}
}
\end{compactcodebox*}
See the \sty{glossaries-extra} manual for further details.

\cmddef{glsnameaccessdisplay}
Applies the accessibility information from the \gloskey{access}
field to \meta{text}.

\cmddef{glstextaccessdisplay}
Applies the accessibility information from the \gloskey{textaccess}
field to \meta{text}.

\cmddef{glspluralaccessdisplay}
Applies the accessibility information from the \gloskey{pluralaccess}
field to \meta{text}.

\cmddef{glsfirstpluralaccessdisplay}
Applies the accessibility information from the \gloskey{firstpluralaccess}
field to \meta{text}.

\cmddef{glssymbolaccessdisplay}
Applies the accessibility information from the \gloskey{symbolaccess}
field to \meta{text}.

\cmddef{glssymbolpluralaccessdisplay}
Applies the accessibility information from the \gloskey{symbolpluralaccess}
field to \meta{text}.

\cmddef{glsdescriptionaccessdisplay}
Applies the accessibility information from the \glosfield{descaccess}
field (which corresponds to the \gloskey{descriptionaccess} key) to \meta{text}.

\cmddef{glsdescriptionpluralaccessdisplay}
Applies the accessibility information from the \glosfield{descpluralaccess}
field (which corresponds to the \gloskey{descriptionpluralaccess} key) to \meta{text}.

\cmddef{glsshortaccessdisplay}
Applies the accessibility information from the \gloskey{shortaccess}
field to \meta{text}.

\cmddef{glsshortpluralaccessdisplay}
Applies the accessibility information from the \gloskey{shortpluralaccess}
field to \meta{text}.

\cmddef{glslongaccessdisplay}
Applies the accessibility information from the \gloskey{longaccess}
field to \meta{text}.

\cmddef{glslongpluralaccessdisplay}
Applies the accessibility information from the \gloskey{longpluralaccess}
field to \meta{text}.

\cmddef{glsuseriaccessdisplay}
Applies the accessibility information from the \glosfield{useriaccess}
field (which corresponds to the \gloskey{user1access} key) to \meta{text}.

\cmddef{glsuseriiaccessdisplay}
Applies the accessibility information from the \glosfield{useriiaccess}
field (which corresponds to the \gloskey{user2access} key) to \meta{text}.

\cmddef{glsuseriiiaccessdisplay}
Applies the accessibility information from the \glosfield{useriiiaccess}
field (which corresponds to the \gloskey{user3access} key) to \meta{text}.

\cmddef{glsuserivaccessdisplay}
Applies the accessibility information from the \glosfield{userivaccess}
field (which corresponds to the \gloskey{user4access} key) to \meta{text}.

\cmddef{glsuservaccessdisplay}
Applies the accessibility information from the \glosfield{uservaccess}
field (which corresponds to the \gloskey{user5access} key) to \meta{text}.

\cmddef{glsuserviaccessdisplay}
Applies the accessibility information from the \glosfield{userviaccess}
field (which corresponds to the \gloskey{user6access} key) to \meta{text}.

\section{Obtaining the Access Field Values}
\label{sec:glsentryaccess}

There are commands analogous to \gls{glsentrytext} if you need to
obtain the value of any of the accessibility fields. Since the
accessibility information isn't intended to be typeset but should be
written as a \idx{PDF} string, use the expandable
\gls{MFUsentencecase} or \gls{glsuppercase} if any \idx{casechange}
is required.

\cmddef{glsentryaccess}
Expands to the value of the \gloskey{access} field.

\cmddef{glsentrytextaccess}
Expands to the value of the \gloskey{textaccess} field.

\cmddef{glsentryfirstaccess}
Expands to the value of the \gloskey{firstaccess} field.

\cmddef{glsentrypluralaccess}
Expands to the value of the \gloskey{pluralaccess} field.

\cmddef{glsentryfirstpluralaccess}
Expands to the value of the \gloskey{firstpluralaccess} field.

\cmddef{glsentrysymbolaccess}
Expands to the value of the \gloskey{symbolaccess} field.

\cmddef{glsentrysymbolpluralaccess}
Expands to the value of the \gloskey{symbolpluralaccess} field.

\cmddef{glsentrydescaccess}
Expands to the value of the \glosfield{descaccess} field, which
corresponds to the \gloskey{descriptionaccess} key.

\cmddef{glsentrydescpluralaccess}
Expands to the value of the \glosfield{descpluralaccess} field, which
corresponds to the \gloskey{descriptionpluralaccess} key.

\cmddef{glsentryshortaccess}
Expands to the value of the \gloskey{shortaccess} field.

\cmddef{glsentryshortpluralaccess}
Expands to the value of the \gloskey{shortpluralaccess} field.

\cmddef{glsentrylongaccess}
Expands to the value of the \gloskey{longaccess} field.

\cmddef{glsentrylongpluralaccess}
Expands to the value of the \gloskey{longpluralaccess} field.

\cmddef{glsentryuseriaccess}
Expands to the value of the \glosfield{useriaccess} field, which
corresponds to the \gloskey{user1access} key.

\cmddef{glsentryuseriiaccess}
Expands to the value of the \glosfield{useriiaccess} field, which
corresponds to the \gloskey{user2access} key.

\cmddef{glsentryuseriiiaccess}
Expands to the value of the \glosfield{useriiiaccess} field, which
corresponds to the \gloskey{user3access} key.

\cmddef{glsentryuserivaccess}
Expands to the value of the \glosfield{userivaccess} field, which
corresponds to the \gloskey{user4access} key.

\cmddef{glsentryuservaccess}
Expands to the value of the \glosfield{uservaccess} field, which
corresponds to the \gloskey{user5access} key.

\cmddef{glsentryuserviaccess}
Expands to the value of the \glosfield{userviaccess} field, which
corresponds to the \gloskey{user6access} key.

\section{Developer's Note}
\label{sec:accsuppdevnote}

Currently there's only support for \sty{accsupp}. If you want to
experiment with another package that provides accessibility support, 
define the following command before \sty{glossaries-accsupp} is
loaded:
\cmddef{gls@accsupp@engine}
If this command has its default definition of \code{accsupp} when
\sty{glossaries-accsupp} loads then the \sty{accsupp} package will
automatically be loaded, otherwise it won't and you'll need to
redefine \gls{gls@accessibility} to use the appropriate
accessibility commands.

\cmddef{gls@accessibility}
This command is used internally by \gls{glsaccessibility}. The
default definition if \gls{gls@accsupp@engine} is defined to
\code{accsupp} does:
\begin{compactcodebox}
\gls{BeginAccSupp}\marg{\meta{options},\meta{PDF element}\dequals\margm{value}}\meta{content}\gls{EndAccSupp}\marg{}
\end{compactcodebox}
Otherwise it simply does \meta{content}.

\chapter{Sample Documents}
\label{sec:samples}

In addition to the \hyperref[sec:listofexamples]{examples within this manual},
the \sty{glossaries} package is provided with some sample
documents that illustrate the various functions. These should
be located in the \filefmt{samples} subdirectory (folder) of the
\sty{glossaries} documentation directory. This location varies
according to your operating system and \TeX\ distribution. You
can use \app{texdoc} to locate the main \sty{glossaries} documentation.
For example:
\texdocref{-l glossaries}
This should display a list of all the files in the \sty{glossaries}
documentation directory with their full pathnames. (The \idx{gui} version
of \app{texdoc} may also provide you with the information.)

If you can't find the sample files on your computer, they are also available
from your nearest CTAN mirror at
\url{http://mirror.ctan.org/macros/latex/contrib/glossaries/samples/}. 
Each sample file listed below has a \idx{hyperlink} to the file's location on
the CTAN mirror.

The \sty{glossaries-extra} package and \app{bib2gls}
provide some additional sample files. There are also examples in the
\gallery{Dickimaw Books Gallery}.

If you prefer to use \idx{utf8} aware engines (\appfmt{xelatex} or
\appfmt{lualatex}) remember that you'll need to switch from
\sty{fontenc} \& \sty{inputenc} to \sty{fontspec} where
appropriate.

If you get any errors or unexpected results, check that you have
up-to-date versions of all the required packages. (Search the log
file for lines starting with \qtt{Package:\ }.) Where
\sty{hyperref} is loaded you will get warnings about non-existent
references that look something like:
\begin{transcript}
pdfTeX warning (dest): name\marg{glo:aca} has been 
referenced but does not exist, replaced by a fixed one
\end{transcript}
These warnings may be ignored on the first \LaTeX\ run. (The
destinations won't be defined until the \idx{glossary} has been created.)

\section{Basic}
\label{sec:samplesbasic}

\filedef{minimalgls.tex}
This document is a minimal working example. You can test your installation using this
file. To create the complete document you will need to do the
following steps:
  \begin{enumerate}
  \item Run \file{minimalgls.tex} through \LaTeX\ either by 
  typing
\begin{terminal}
pdflatex minimalgls
\end{terminal}
  in a terminal or by using the relevant button or menu item in
  your text editor or front-end. This will create the required 
  associated files but you will not see the \idx{glossary} in the document.

  \item If you have Perl installed, run \app{makeglossaries} on the document 
  (\sectionref{sec:makeglossaries}). This can
  be done on a terminal by typing:
\begin{terminal}
makeglossaries minimalgls
\end{terminal}
  otherwise use \app{makeglossaries-lite}:
\begin{terminal}
makeglossaries-lite minimalgls
\end{terminal}
  If for some reason you want to call \app{makeindex} explicitly, you can do this
  in a terminal by typing (all on one line):
\begin{terminal}
makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo
\end{terminal}
  See \sectionref{sec:makeindexapp} for further details on using 
   \app{makeindex} explicitly.

  Note that if the file name contains spaces, you will need to use
  the double-quote character to delimit the name.

  \item Run \file{minimalgls.tex} through \LaTeX\ again (as step~1)
  \end{enumerate}
You should now have a complete document. The number following
each entry in the \idx{glossary} is the
\idxc{entrylocation}{location number}. By default, this is the page
number where the entry was referenced.

The \opt{acronym} package option creates a second \idx{glossary} with
the label \glostype{acronym} (which can be referenced with
\gls{acronymtype}). If you decide to enable this option then there
will be a second set of \idxpl{indexingfile} that need to be processed by
\app{makeindex}. If you use \app{makeglossaries} or
\app{makeglossaries-lite} you don't need to worry about it, as
those scripts automatically detect which files need to be processed
and will run \app{makeindex} (or \app{xindy}) the appropriate number
of times.

If for some reason you don't want to use \app{makeglossaries} or
\app{makeglossaries-lite} and you want the \opt{acronym}
package option then the complete build process is:
\begin{terminal}
pdflatex minimalgls
makeindex -s minimalgls.ist -t minimalgls.glg -o minimalgls.gls minimalgls.glo
makeindex -s minimalgls.ist -t minimalgls.alg -o minimalgls.acr minimalgls.acn
pdflatex minimalgls
\end{terminal}

There are three other files that can be used as 
\href{http://www.dickimaw-books.com/latex/minexample/}{minimal working
examples}: \mirrorsamplefile{mwe-gls.tex}, \mirrorsamplefile{mwe-acr.tex} and
\mirrorsamplefile{mwe-acr-desc.tex}.

\glsxtrnote
If you want to try out the \sty{glossaries-extra} extension package,
you need to replace the package loading line:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{\strong{glossaries}}
\end{codebox}
with:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}\strong{,\opt{postdot},\opt{stylemods}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Note the different default package options. (You may omit the
\opt{acronym} package option in both cases if you only want a
single \idx{glossary}.) The \sty{glossaries-extra} package internally
loads the base \sty{glossaries} package so you don't need to
explicitly load both (in fact, it's better to let
\sty{glossaries-extra} load \sty{glossaries}).

Next, replace:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\strong{\cat{acronym}}}\marg{\abbrstyle{long-short}}
\end{codebox}
The optional argument \cat{acronym} identifies the category that
this style should be applied to. The \gls{newacronym} command
provided by the base \sty{glossaries} package is redefined by
\sty{glossaries-extra} to use \gls{newabbreviation} with the category
set to \cat{acronym}.

If you prefer to replace \gls{newacronym} with \gls{newabbreviation}
then the default category is \cat{abbreviation} so the style should
instead be:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\strong{\cat{abbreviation}}}\marg{\abbrstyle{long-short}}
\end{codebox}
This is actually the default category if the optional argument is
omitted, so you can simply do:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}
\end{codebox}
The \abbrstyle{long-short} style is the default for the
\cat{abbreviation} category so you can omit this line completely if
you replace \gls{newacronym}. (The default style for the
\cat{acronym} category is \abbrstyle{short-nolong}, which only shows
the short form on \idx{firstuse}.)

As mentioned earlier, the \opt{acronym} package option creates a
new \idx{glossary} with the label \glostype{acronym}. This is independent of
the \cat{acronym} category.  You can use the \opt{acronym}
package option with either \gls{newacronym} or \gls{newabbreviation}.

You may instead prefer to use the \opt{abbreviations} package
option, which creates a new \idx{glossary} with the label \glostype{abbreviations}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{abbreviations}},\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}
This can again be used with either \gls{newacronym} or
\gls{newabbreviation}, but the file extensions are different. This
isn't a problem if you are using \app{makeglossaries} or
\app{makeglossaries-lite}. If you are explicitly calling
\app{makeindex} (or \app{xindy}) then you need to modify the file
extensions.
See the \sty{glossaries-extra} user manual for further details.

If you use both the \opt{acronym} and \opt{abbreviations}
package options then \gls{newacronym} will default to the
\glostype{acronym} glossary and \gls{newabbreviation} will default to
the \glostype{abbreviations} glossary.

\bibglsnote
If you want to try \app{bib2gls}, you first need to convert the
document to use \sty{glossaries-extra} as described above. Then add
the \opt{record} package option. For example:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next you need to convert the \idx{entry} definitions into the
\ext{bib} format required by \app{bib2gls}. This can easily be
done with \app{convertgls2bib}. For example:
\begin{terminal}
convertgls2bib \switch{preamble-only} minimalgls.tex entries.bib
\end{terminal}
This will create a file called \strong{\filefmt{entries.bib}}. Next, replace:
\begin{codebox}
\gls{makeglossaries}
\end{codebox}
with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{\strong{entries}}}
\end{codebox}
Now remove all the entry definitions in the \idxf{preamble/document}
(\gls{longnewglossaryentry}, \gls{newglossaryentry} and \gls{newacronym}
or \gls{newabbreviation}). 

The \idx{abbrvstyle} command
must go before \gls{GlsXtrLoadResources}. For example (if you are
using \gls{newacronym}):
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
Finally, replace:
\begin{codebox}
\gls{printglossaries}
\end{codebox}
with:
\begin{codebox}
\gls{printunsrtglossaries}
\end{codebox}
The document build is now:
\begin{terminal}
pdflatex minimalgls
bib2gls minimalgls
pdflatex minimalgls
\end{terminal}

\file{sampleDB.tex}
This document illustrates how
to load external files containing the glossary entry definitions. It also
illustrates how to define a new \idx{glossary} type. This document has the
\idx{numberlist} suppressed and uses \gls{glsaddall} to add all
the entries to the \idxpl{glossary} without referencing each one
explicitly. (Note that it's more efficient to use
\sty{glossaries-extra} and \app{bib2gls} if you have a large number
of entries.) To create the document do:
\begin{terminal}
pdflatex sampleDB
makeglossaries sampleDB
pdflatex sampleDB
\end{terminal}
or
\begin{terminal}
pdflatex sampleDB
makeglossaries-lite sampleDB
pdflatex sampleDB
\end{terminal}
The glossary definitions are stored in the accompanying files
\mirrorsamplefile{database1.tex} and \mirrorsamplefile{database2.tex}. If for some
reason you want to call \app{makeindex} explicitly you must
have a separate call for each glossary:
\begin{enumerate}
\item Create the \glostype{main} glossary (all on one line):
\begin{terminal}
makeindex -s sampleDB.ist -t sampleDB.glg -o sampleDB.gls sampleDB.glo
\end{terminal}
\item Create the secondary glossary (all on one line):
\begin{terminal}
makeindex -s sampleDB.ist -t sampleDB.nlg -o sampleDB.not sampleDB.ntn
\end{terminal}
Note that both \app{makeglossaries} and \app{makeglossaries-lite} do
this all in one call, so they not only make it easier because you
don't need to supply all the switches and remember all the
extensions but they also call \app{makeindex} the appropriate number of times.
\end{enumerate}

\bibglsnote
If you want to switch to using \app{bib2gls} with \sty{glossaries-extra}, you can convert
\mirrorsamplefile{database1.tex} and
\mirrorsamplefile{database2.tex} to \ext{bib}
files using \app{convertgls2bib}:
\begin{terminal}
convertgls2bib database1.tex database1.bib
convertgls2bib database2.tex database2.bib
\end{terminal}
The document code then needs to be:
\begin{codebox}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[colorlinks,plainpages=false]\marg{hyperref}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot}]\marg{\strong{glossaries-extra}}
\codepar
\strong{\gls{newglossary*}}\marg{punc}\marg{Punctuation Characters}
\codepar
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{database1},
 \strong{\resourceoptval{selection}{all}},\resourceoptval{sort}{en}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{database2},\strong{\resourceoptval{type}{punc},}
 \strong{\resourceoptval{selection}{all}},\resourceoptval{sort}{letter-case}}
\codepar
\cbeg{document}
\glslink{printunsrtglossaries}{\xtrcsfmt{print\strong{unsrt}glossaries}}
\cend{document}
\end{codebox}
Note that the \opt{nonumberlist} package option has been omitted.
It's not needed because there are no locations in this amended
document (whereas in the original \samplefile{DB} locations are
created with \gls{glsaddall}). The starred \gls{newglossary*} is used
since the \app{makeindex}/\app{xindy} extensions are now irrelevant.

Instead of using \app{makeglossaries} you need to use \app{bib2gls} 
when you build the document:
\begin{terminal}
pdflatex sampleDB
bib2gls sampleDB
pdflatex sampleDB
\end{terminal}
Note that one \app{bib2gls} call processes all the \idx{indexing} (rather
than one call per \idx{glossary}). Unlike \app{makeindex} and \app{xindy},
\app{bib2gls} processes each resource set in turn, but the resource
sets aren't linked to a specific \idx{glossary}. Multiple \idxpl{glossary} may
be processed in a single resource set or sub-blocks of a single
glossary may be processed by multiple resource sets. In this
example, there happens to be one resource set per glossary because
each glossary requires a different sort method. (A locale-sensitive
alphabetical sort for the first and a character code sort for the
second.)

If you want \idxpl{lettergroup}, you need to use the \switch{group}
switch:
\begin{terminal}
bib2gls \switch{group} sampleDB
\end{terminal}
and use an appropriate glossary style.

See also \bibglsgallery{sorting}, \bibglsbegin\ and the \app{bib2gls} user manual.

\section{Acronyms and First Use}
\label{sec:sampleacronyms}

\file{sampleAcr.tex}
This document has some sample \idxpl{acronym}. It also adds the
\idx{glossary} to the \idx{tableofcontents},
so an extra run through \LaTeX\ is required to ensure the document
is up to date:
\begin{terminal}
pdflatex sampleAcr
makeglossaries sampleAcr
pdflatex sampleAcr
pdflatex sampleAcr
\end{terminal}
(or use \app{makeglossaries-lite}).

Note that if the \idx{glossary} is at the start of the document
and spans across multiple pages, then this can cause the locations
to be shifted. In that case, an extra \app{makeglossaries} and
\LaTeX\ call are required. In this particular example, the \idx{glossary}
is at the end of the document so it's not a problem. It's also not a
problem for a \idx{glossary} at the start of the document if the page
numbering is reset at the end of the glossary. For example, if the
\idx{glossary} is at the end of the front matter in a book-style document.

This document uses \gls{ifglsused} to determine whether to use
\qt{a} or \qt{an} in:
\begin{codebox}
\ldots\ is \gls{ifglsused}\marg{svm}\marg{an}\marg{a} \gls{gls}\marg{svm} \ldots
\end{codebox}
This clumsy bit of code can be tidied up with the
\sty{glossaries-prefix} package. Since that package automatically
loads \sty{glossaries} and passes all its options to the base
package it's possible to do a simple replacement of:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long}},\opt{toc}]\marg{glossaries}
\end{codebox}
with:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long}},\opt{toc}]\marg{\strong{glossaries-prefix}}
\end{codebox}
The definition of \qt{svm} now needs an adjustment:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{statistical pattern recognition 
technique\sym{nbsp}\cmd{protect}\gls{cite}\marg{svm}},
\strong{\gloskeyval{prefixfirst}{a\sym{nbsp}},\gloskeyval{prefix}{an\gls{space}}}
}\marg{svm}\marg{svm}\marg{support vector machine}
\end{codebox}
The clumsy text can now simply be changed to:
\begin{codebox}
\ldots\ is \gls{pgls}\marg{svm} \ldots
\end{codebox}

\glsxtrnote
If you want to convert this sample document to use \sty{glossaries-extra},
you may want the patched version of the styles provided in \sty{glossary-long}, 
in which case you can also add \opt{stylemods}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{stylemods},}\optval{style}{\glostyle{long}}]\marg{\strong{glossaries-extra}}
\end{codebox}
If you want to suppress all the other glossary style packages with
\opt{nostyles}, then you need to specify exactly which package
(or packages) that you do want:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{nostyles},}\opt{stylemods}\strong{=long},\optval{style}{\glostyle{long}}]\marg{glossaries-extra}
\end{codebox}
(Now that \sty{glossaries-extra} is being used, there are more
available \qt{long} styles in the \sty{glossary-longextra} package,
which you may prefer.)

If you want to use \sty{glossaries-prefix}, you can simply add the
\opt{prefix} package option.

Note that the \opt{toc} package option has been dropped. This is
the default with \sty{glossaries-extra}, so it doesn't need to be
specified now. The document build is now shorter:
\begin{terminal}
pdflatex sampleAcr
makeglossaries sampleAcr
pdflatex sampleAcr
\end{terminal}
The third \LaTeX\ call is no longer required to make the 
\idx{tableofcontents} up-to-date. This is because \sty{glossaries-extra} provides
boilerplate text on the first \LaTeX\ call when the \idxpl{indexingfile}
are missing. This means that the \idx{glossary} header is added to the
\ext{toc} file on the first \LaTeX\ call, whereas with just the
base \sty{glossaries} package, the header isn't present until the
second \LaTeX\ call. (As with just the base \sty{glossaries}
package, if the \idx{glossary} occurs at the start of the document without
a page reset after it then part of the build process needs repeating
to ensure all referenced page numbers are up-to-date. This problem isn't
specific to the \sty{glossaries} package.)

The other different default setting is the post-description
punctuation. The base package has \optval{nopostdot}{false} as the
default. This means that a \idx{fullstop} (period) is automatically
inserted after the description in the glossary. The extension
package has \opt{nopostdot}{true} as the default. If you want the
original behaviour then you can use \optval{nopostdot}{false} or the
shorter synonym \opt{postdot}. 

The \sty{glossaries-extra} package has different
\idx{abbreviation} handling that's far more flexible than that provided by
the base \sty{glossaries} package. The style now needs to be set with
\gls{setabbreviationstyle} instead of \gls{setacronymstyle}:
\begin{codebox}
\strong{\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-sc}}}
\gls{newacronym}\marg{svm}\marg{svm}\marg{support vector machine}
\end{codebox}
(Note the different style name \abbrstyle{long-short-sc} instead of
\acrstyle{long-sc-short} and the optional argument \cat{acronym}.) If you
prefer to replace \gls{newacronym} with \gls{newabbreviation} then
omit the optional argument:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc}}
\gls{newabbreviation}\marg{svm}\marg{svm}\marg{support vector machine}
\end{codebox}
(The optional argument of \gls{setabbreviationstyle} is the
category to which the style should be applied. If it's omitted, 
\cat{abbreviation} is assumed. You can therefore have different
styles for different categories.)

Finally, you need to replace \gls{acrshort}, \gls{acrlong} and
\gls{acrfull} and their variants with \gls{glsxtrshort}, \gls{glsxtrlong} and
\gls{glsxtrfull} etc.

\filedef{sampleAcrDesc.tex}
This is similar to the previous example, except that the
\idxpl{acronym} have an associated description. As with the previous
example, the \idx{glossary} is added to the table of contents, so an extra
run through \LaTeX\ is required:
\begin{terminal}
pdflatex sampleAcrDesc
makeglossaries sampleAcrDesc
pdflatex sampleAcrDesc
pdflatex sampleAcrDesc
\end{terminal}
This document uses the \opt{acronym} package option, which
creates a new \idx{glossary} used by \gls{newacronym}. This leaves the
default \glostype{main} glossary available for general terms. However,
in this case there are no general terms so the \glostype{main}
glossary is redundant. The \opt{nomain} package option will
prevent its creation. Obviously, if you decide to add some terms
with \gls{newglossaryentry} you will need to remove the
\opt{nomain} option as the \glostype{main} glossary will now be
required.

\glsxtrnote
As with the previous example, if you want to convert this document
to use \sty{glossaries-extra} you need to make a few modifications.
The most obvious one is to replace \sty{glossaries} with
\sty{glossaries-extra} in the \csfmt{usepackage} argument. Again you
can omit \opt{toc} as this is the default for
\sty{glossaries-extra}. As in the previous example, you may want to
use the patched styles. This document uses \glostyle{altlist} which
is provided by \sty{glossary-list}, so the style can be patched with
\opt{stylemods}.
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\opt{nomain},\optval{style}{altlist}\strong{,\opt{stylemods}}]\marg{\strong{glossaries-extra}}
\end{codebox}
You may prefer to replace the \opt{acronym} option with
\opt{abbreviations}, but this will change the file extensions.
If you use \app{makeglossaries} or \app{makeglossaries-lite} you
don't need to worry about it.

Again the style command needs to be changed:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-sc-desc}}
\end{codebox}
(Note the change in style name \abbrstyle{long-short-sc-desc}
instead of \acrstyle{long-sc-short-desc} and the optional argument \cat{acronym}.) 

As with the previous example, if
you prefer to use \gls{newabbreviation} instead of \gls{newacronym}
then you need to omit the optional argument:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc-desc}}
\end{codebox}
The original document uses:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\comment{}
 \gls{acronymfont}\marg{\gls{glsentrytext}\marg{\#1}}}
\end{codebox}
to ensure that the cross-references (from the \gloskey{see} key) use
the acronym font. The new \idxpl{abbrvstyle} don't
use \gls{acronymfont} so this isn't appropriate with
\sty{glossaries-extra}. If you're using at least version 1.42 of
\sty{glossaries-extra}, you don't need to do anything as it
automatically redefines \gls{glsseeitemformat} to take the style
formatting into account. If you have an earlier version you can
redefine this command as follows:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\comment{}
 \gls{ifglshasshort}\marg{\#1}\marg{\gls{glsfmttext}\marg{\#1}}\marg{\gls{glsfmtname}\marg{\#1}}\comment{}
}
\end{codebox}
This will just show the short form in the cross-reference. If you
prefer the name instead (which includes the short and long form) you can use:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsseeitemformat}}[1]\marg{\gls{glsfmtname}\marg{\#1}}
\end{codebox}

The \sty{glossaries-extra} package provides two additional
cross-referencing keys \gloskey{seealso} and \gloskey{alias}, 
so \code{\gloskeyval{see}{[see also]\marg{svm}}}
can be replaced with a more appropriate key:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition 
technique using the ``kernel trick''},
\strong{\gloskeyval{seealso}{svm}},
}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine}
\end{codebox}

Finally, as with the previous example, you need to replace
\gls{acrshort}, \gls{acrlong} and \gls{acrfull} etc with
\gls{glsxtrshort}, \gls{glsxtrlong} and \gls{glsxtrfull} etc.

\bibglsnote
If you want to convert this document so that it uses \app{bib2gls},
you first need to convert it to use \sty{glossaries-extra}, as above, 
but remember that you now need the \opt{record} option:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\opt{nomain},\optval{style}{altlist},\strong{\opt{record},\opt{postdot},\opt{stylemods}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
Now you need to convert the \idx{acronym} definitions to the \ext{bib}
format required by \app{bib2gls}. This can be done with:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampleAcrDesc.tex entries.bib
\end{terminal}
If you retained \gls{newacronym} from the original example file,
then the new \filefmt{entries.bib} file will contain entries
defined with \atentry{acronym}. For example:
\begin{codebox}
\atentry{acronym}\marg{ksvm,
  \gloskeyval{description}{Statistical pattern recognition technique
  using the ``kernel trick''},
  \gloskeyval{seealso}{svm},
  \gloskeyval{short}{ksvm},
  \gloskeyval{long}{kernel support vector machine}
}
\end{codebox}
If you switched to \gls{newabbreviation} then the entries will
instead be defined with \atentry{abbreviation}.

Next replace \gls{makeglossaries} with the resource command, but note
that the \idx{abbrvstyle} must be set first:
\begin{codebox*}
\strong{\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-sc-desc}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{terms defined in entries.bib}
 \strong{\resourceoptval{abbreviation-sort-fallback}{long}}}
\end{codebox*}
Another possibility is to make \atentry{acronym} behave as though it
was actually \atentry{abbreviation}:
\begin{codebox}
\strong{\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-sc-desc}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\resourceoptval{abbreviation-sort-fallback}{long}\strong{,
 \resourceoptvalm{entry-type-aliases}{acronym=abbreviation}}}
\end{codebox}
Note that the category is now \cat{abbreviation} not \cat{acronym} so the optional
argument of \gls{setabbreviationstyle} needs to be removed.

If the \gloskey{sort} field is missing (which should usually be the
case), then both \atentry{acronym} and \atentry{abbreviation} will
fallback on the \gloskey{short} field (not the \gloskey{name} field,
which is usually set by the style and therefore not visible to
\app{bib2gls}). For some styles, as in this example, it's more
appropriate to sort by the long form so the fallback is changed.
(Remember that you will break this fallback mechanism if you
explicitly set the sort value.) See the \app{bib2gls} manual for
further details and other examples.

Remember to delete any \gls{newacronym} or \gls{newabbreviation} in
the \ext{tex} file. 
Finally replace \gls{printglossary} with \gls{printunsrtglossary}.
The document build is now:
\begin{terminal}
pdflatex sampleAcrDesc
bib2gls sampleAcrDesc
pdflatex sampleAcrDesc
\end{terminal}

Note that it's now much easier to revert back to the descriptionless
style used in \samplefile{Acr}:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\strong{\abbrstyle{long-short-sc}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}\strong{,\resourceoptvalm{ignore-fields}{description}}}
\end{codebox*}
With the other options it would be necessary to delete all the
\gloskey{description} fields from the \idx{abbreviation} definitions in
order to omit them, but with \app{bib2gls} you can simply instruct
\app{bib2gls} to ignore the description. This makes it much easier
to have a large database of \idxpl{abbreviation} for use across multiple
documents that may or may not require the description.

\filedef{sampleDesc.tex}
This is similar to the previous example, except that it defines the
\idxpl{acronym} as normal \idxpl{entry} using \gls{newglossaryentry} instead of
\gls{newacronym}. As with the previous example, the \idx{glossary} is
added to the \idx{tableofcontents}, so an extra run through \LaTeX\ is
required:
\begin{terminal}
pdflatex sampleDesc
makeglossaries sampleDesc
pdflatex sampleDesc
pdflatex sampleDesc
\end{terminal}
This sample file demonstrates the use of the \gloskey{first} and
\gloskey{text} keys but in general it's better to use
\gls{newacronym} instead as it's more flexible. For even greater
flexibility use \gls{newabbreviation} provided by \sty{glossaries-extra}.
For other variations, such as showing the symbol on \idx{firstuse},
you may prefer to make use of the post-link category hook. For
examples, see the section \qt{Changing the Formatting} in \bibglsbegin.

\filedef{sampleFnAcrDesc.tex}
This document has some sample \idxpl{acronym} that
use the \acrstyle{footnote-sc-desc} \idx{acronymstyle}. As with the previous example, 
the \idx{glossary} is added to the \idx{tableofcontents}, so an extra run through 
\LaTeX\ is required:
\begin{terminal}
pdflatex sampleFnAcrDesc
makeglossaries sampleFnAcrDesc
pdflatex sampleFnAcrDesc
pdflatex sampleFnAcrDesc
\end{terminal}
\glsxtrnote
If you want to convert this sample document to use
\sty{glossaries-extra}, then you just need to follow the same steps
as for \samplefile{Acr} with a slight modification. This time the 
\abbrstyle{short-sc-footnote-desc} \idx{abbrvstyle} is needed:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{short-sc-footnote-desc}}
\end{codebox}
The command redefinitions (performed with \csfmt{renewcommand}) should
now all be deleted as they are no longer applicable.

You may prefer to use the \abbrstyle{short-sc-postfootnote-desc}
style instead. There are subtle differences between the \abbrstyle{postfootnote} and
\abbrstyle{footnote} set of styles. Try changing the \idx{abbrvstyle} to
\abbrstyle{short-sc-footnote} and compare the position of the footnote marker
with the two styles.

This modified sample file now has a shorter build:
\begin{terminal}
pdflatex sampleFnAcrDesc
makeglossaries sampleFnAcrDesc
pdflatex sampleFnAcrDesc
\end{terminal}
This is because the \sty{glossaries-extra} package produces
boilerplate text when the \idx{indexingfile} is missing (on the first
\LaTeX\ run) which adds the \idx{glossary} title to the
\idx{tableofcontents} (\ext{toc}) file.

\filedef{sampleCustomAcr.tex}
This document has some sample \idxpl{acronym} with a
custom \idx+{acronymstyle}. It also adds the \idx{glossary} to the 
\idx{tableofcontents}, so an extra run through \LaTeX\ is required:
\begin{terminal}
pdflatex sampleCustomAcr
makeglossaries sampleCustomAcr
pdflatex sampleCustomAcr
pdflatex sampleCustomAcr
\end{terminal}
This is a slight variation on the previous example where the name is
in the form \meta{long} (\meta{short}) instead of \meta{short}
(\meta{long}), and the \gloskey{sort} key is set to the long form
instead of the short form.  On \gls{firstuse}, the footnote text is
in the form \meta{long}: \meta{description} (instead of just the
long form). This requires defining a \idx{newacronym}
style that inherits from the \acrstyle{footnote-sc-desc} style.

\glsxtrnote
The conversion to \sty{glossaries-extra} starts in much the same way
as the previous examples:
\begin{codebox}
\cmd{usepackage}[\opt{acronym},\opt{nomain},\strong{\opt{postdot},\opt{stylemods},}\optval{style}{\glostyle{altlist}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
The \idxpl{abbrvstyle} have associated helper commands that may be
redefined to make minor modifications. These redefinitions should be
done before the \idxpl{abbreviation} are defined.

The \abbrstyle{short-sc-footnote-desc} \idx{abbrvstyle} is the closest match
to the requirement, so replace the \gls{setacronymstyle} command
with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{short-sc-footnote-desc}}
\end{codebox}
Again, you may prefer \abbrstyle{short-sc-postfootnote-desc}. Both
styles use the same helper commands.

Next some adjustments need to be made to fit the new requirements.
The name needs to be \meta{long} (\meta{short}):
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescname}}\marg{\comment{}
  \cmd{protect}\strong{\gls{glslongfont}\marg{\cmd{the}\gls{glslongtok}}}\comment{}
  \cmd{protect}\gls{glsxtrfullsep}\marg{\cmd{the}\gls{glslabeltok}}\comment{}
  \cmd{protect}\gls{glsxtrparen}\marg{\cmd{protect}\strong{\gls{glsabbrvfont}\marg{\cmd{the}\gls{glsshorttok}}}}\comment{}
}
\end{codebox}
This command expands when the \idxpl{abbreviation} are defined so take care
to \csfmt{protect} commands that shouldn't be expanded at that point,
and make sure that the token registers that store the label, long
and short values are able to expand. Similarly the sort value needs
adjusting:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescsort}}\marg{\strong{\cmd{the}\gls{glslongtok}}}
\end{codebox}
The footnote for all the footnote \idxpl{abbrvstyle} is produced
with:
\begin{codebox}
\gls{glsxtrabbrvfootnote}\margm{label}\margm{text}
\end{codebox}
where \meta{text} is the singular or plural long form, depending on
what command was used to reference the \idx{abbreviation} (\gls{gls},
\gls{glspl} etc). This can simply be redefined as:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}\marg{\comment{}
  \#2: \gls{glsentrydesc}\marg{\#1}}}
\end{codebox}
This will mimic the result from the original sample document.
Note that newer versions of \sty{glossaries-extra} may have
additional helper commands associated with certain \idxpl{abbrvstyle}.

You may prefer to replace \code{\#2} with a reference to a
specific field (or fields). For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}\marg{\comment{}
 \gls{Glsfmtlong}\marg{\#1} (\gls{glsfmtshort}\marg{\#1}): \gls{glsentrydesc}\marg{\#1}.}}
\end{codebox}
As with the earlier \samplefile{AcrDesc}, you need to remove or change the redefinition of
\gls{glsseeitemformat} since \gls{acronymfont} is no longer appropriate.

In the original \file{sampleCustomAcr.tex} source code, I started
the description with a capital:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{Statistical pattern recognition 
technique using the ``kernel trick''},
\gloskeyval{see}{[see also]\marg{svm}},
}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine}
\end{codebox}
This leads to a capital letter after the colon in the footnote,
which is undesirable, but I would like to have the description start
with a capital in the \idx{glossary}. The solution to this problem
is easy with \sty{glossaries-extra}. I start the description with a
\idx{lowercase} letter and set the \catattr{glossdesc}
\idx{categoryattribute} to \optfmt{firstuc} to convert the
description to \idx{sentencecase} in the \idx{glossary}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{glossdesc}}\marg{firstuc}
\end{codebox}
The \idx{abbreviation} definitions are modified slightly:
\begin{codebox}
\gls{newacronym}\oarg{\gloskeyval{description}{\strong{s}tatistical pattern recognition 
technique using the ``kernel trick''},
\strong{\gloskeyval{seealso}{svm}},
}\marg{ksvm}\marg{ksvm}\marg{kernel support vector machine}
\end{codebox}
Note the use of the \gloskey{seealso} key, which is only
available with \sty{glossaries-extra}.

If you prefer to use \gls{newabbreviation} instead of
\gls{newacronym}, then the category needs to be
\cat{abbreviation} rather than \cat{acronym}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\strong{\cat{abbreviation}}}\marg{\catattr{glossdesc}}\marg{firstuc}
\end{codebox}
and the style command needs to be adjusted so that it omits the
optional argument. For example:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{short-sc-postfootnote-desc}}
\end{codebox}

\filedef{sample-FnDesc.tex}
This example defines a custom \idx+{entryformat}{display format} that 
puts the description in a footnote on \idx{firstuse}.
\begin{terminal}
pdflatex sample-FnDesc
makeglossaries sample-FnDesc
pdflatex sample-FnDesc
\end{terminal}
In order to prevent nested \idxpl{hyperlink}, this document uses the
\optval{hyperfirst}{false} package option (otherwise the footnote
marker \idx{hyperlink} would be inside the \idx{hyperlink} around the
\idx{linktext} which would result in a nested \idx{hyperlink}).

\glsxtrnote
The \sty{glossaries-extra} package has category \idxpl{postlinkhook}
that make it easier to adjust the \idxc{entryformat}{formatting}.
The \idx{postlinkhook} is placed after the \idx{hyperlink} around
the \idx{linktext}, so a \idx{hyperlink} created by \gls{footnote}
in the \idx{postlinkhook} won't cause a nested link. This means that the
\optval{hyperfirst}{false} option isn't required:
\begin{codebox}
\cmd{usepackage}[\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}

\begin{important}
Never use commands like \gls{gls} or \gls{glsdesc} in the 
\idx{postlinkhook} as you can end up with infinite recursion. Use commands that
don't themselves have a \idx{postlinkhook}, such as \gls{glsentrydesc} or
\gls{glossentrydesc}, instead.
\end{important}

In the original \file{sample-FnDesc.tex} file, the \idx{entryformat} was
adjusted with:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}%
}
\end{codebox}
This can be changed to:
\begin{codebox}
\gls{glsdefpostlink}
\marg{\cat{general}}\comment{category label}
\marg{\gls{glsxtrifwasfirstuse}\marg{\gls{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}\marg{}}
\end{codebox}
This sets the \idx{postlinkhook} for the \cat{general} category
(which is the default category for \idxpl{entry} defined with \gls{newglossaryentry}). If I
added some \idxpl{abbreviation} (which have a different category) then this
change wouldn't apply to them.

The first paragraph in the document is:
\begin{codebox}
First use: \gls{gls}\marg{sample}.
\end{codebox}
So the \idx{PDF} will have the word \qt{sample} (the \idx{linktext}
created by \code{\gls{gls}\marg{sample}}) as a \idx{hyperlink} to the entry in the
\idx{glossary} followed by the footnote marker, which is a
\idx{hyperlink} to
the footnote. This is then followed by the sentence terminator. 
\qt{First use: sample\textsuperscript{1}.}

It would look tidier if the footnote marker could be shifted after
the full stop. \qt{First use: sample.\textsuperscript{1}} 
This can easily be achieved with a minor modification:
\begin{codebox}
\gls{glsdefpostlink}
\marg{\cat{general}}\comment{category label}
\marg{\gls{glsxtrifwasfirstuse}
 \marg{\gls{glsxtrdopostpunc}\marg{\gls{footnote}\marg{\gls{glsentrydesc}\marg{\gls{glslabel}}}}}\comment{}
 \marg{}\comment{}
}
\end{codebox}
You may prefer to use \gls{glossentrydesc} instead of
\gls{glsentrydesc}. This will obey the \catattr{glossdesc} 
\idx{categoryattribute}.
If you append \gls{glspostdescription}, you can also pick up the
\opt{postdot} package option. For example:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossdesc}}\marg{firstuc}
\codepar
\gls{glsdefpostlink}
\marg{\cat{general}}\comment{category label}
\marg{\gls{glsxtrifwasfirstuse}
 \marg{\gls{glsxtrdopostpunc}\marg{\gls{footnote}\marg{\comment{}
   \strong{\gls{glossentrydesc}}\marg{\gls{glslabel}}\strong{\gls{glspostdescription}}}}}\comment{}
 \marg{}\comment{}
}
\end{codebox}
Alternatively, you could just use \gls{Glsentrydesc} and explicitly
append the full stop.

\filedef{sample-custom-acronym.tex}
This document illustrates how to define your own \idx{acronymstyle} if
the predefined styles don't suit your requirements.
\begin{terminal}
pdflatex sample-custom-acronym
makeglossaries sample-custom-acronym
pdflatex sample-custom-acronym
\end{terminal}
In this case, a style is defined to show the short form in the text
with the long form and description in a footnote on \idx{firstuse}.
The long form is used for the \gloskey{sort} value.
The short form is displayed in \idx+{smallcaps} in the main part of the
document but in \idx{uppercase} in the list of acronyms. (So it's a slight
variation of some of the examples above.) The \gloskey{name} is set
to the long form (starting with an initial capital) followed by the
\idx+{allcaps} short form in parentheses. The final requirement is that
the inline form should show the long form followed by the short form
in parentheses.

\glsxtrnote
As with \samplefile{FnAcrDesc}, the \abbrstyle{short-sc-footnote-desc}
and \abbrstyle{short-sc-postfootnote-desc} \idxpl{abbrvstyle} produce 
almost the required effect so one of those can be used as a starting point. 
However the final requirement doesn't fit. It's now necessary to actually define a custom
\idx{abbrvstyle}, but it can mostly inherit from the
\abbrstyle{short-sc-footnote-desc} or \abbrstyle{short-sc-postfootnote-desc} style:
\begin{codebox}
\gls{newabbreviationstyle}\marg{custom-fn}\comment{}
\marg{\comment{}
  \gls{GlsXtrUseAbbrStyleSetup}\marg{\abbrstyle{short-sc-footnote-desc}}\comment{}
}\comment{}
\marg{\comment{}
  \gls{GlsXtrUseAbbrStyleFmts}\marg{\abbrstyle{short-sc-footnote-desc}}\comment{}
  \cmd{renewcommand}*\marg{\gls{glsxtrinlinefullformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{glsaccesslong}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}\comment{}
     \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshort}\marg{\idx{hashhash}1}}}}\comment{}
  }\comment{}
  \cmd{renewcommand}*\marg{\gls{glsxtrinlinefullplformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{glsaccesslongpl}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}%
    \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshortpl}\marg{\idx{hashhash}1}}}}\comment{}
  }%
  \cmd{renewcommand}*\marg{\gls{Glsxtrinlinefullformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{Glsaccesslong}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}\comment{}
     \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshort}\marg{\idx{hashhash}1}}}}\comment{}
  }\comment{}
  \cmd{renewcommand}*\marg{\gls{Glsxtrinlinefullplformat}}[2]\marg{\comment{}
    \strong{\gls{glsfirstlongfootnotefont}}\marg{\strong{\gls{Glsaccesslongpl}\marg{\idx{hashhash}1}}\comment{}
       \gls{ifglsxtrinsertinside}\idx{hashhash}2\cmd{fi}}\comment{}
    \gls{ifglsxtrinsertinside}\cmd{else}\idx{hashhash}2\cmd{fi}\gls{glsxtrfullsep}\marg{\idx{hashhash}1}\comment{}
    \gls{glsxtrparen}\marg{\strong{\gls{glsfirstabbrvscfont}\marg{\gls{glsaccessshortpl}\marg{\idx{hashhash}1}}}}\comment{}
  }\comment{}
}
\end{codebox}
(See the \sty{glossaries-extra} user manual for further details.)

This new custom style now needs to be set:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{custom-fn}
\end{codebox}
Remember that if you decide to use \gls{newabbreviation} instead 
of \gls{newacronym} then the category will be \cat{abbreviation} not \cat{acronym}:
\begin{codebox}
\gls{setabbreviationstyle}\marg{custom-fn}
\end{codebox}
This custom style simply adjusts the inline full form. There are other
adjustments to be made that apply to the inherited style. (The alternative is to
design a new style from scratch.) The footnote contains the long form followed by the
description. This is the same as the modification to an earlier
example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}\marg{\#2:
\gls{glsentrydesc}\marg{\#1}.}}
\end{codebox}
As with \samplefile{CustomAcr}, if you specifically
want the singular long form then you can ignore the second argument.
For example:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrabbrvfootnote}}[2]\marg{\gls{footnote}
 \marg{\gls{Glsfmtlong}\marg{\#1}: \gls{glsentrydesc}\marg{\#1}.}}
\end{codebox}

The \gloskey{name} now needs to be the long form followed by the
short form in parentheses, but note the new requirement that the
short form should now be in \idx{allcaps} not \idx{smallcaps} and the
long form should start with a capital letter.
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescname}}\marg{\comment{}
  \cmd{protect}\gls{glsfirstlongfootnotefont}
    \marg{\gls{makefirstuc}\marg{\cmd{the}\gls{glslongtok}}}
  (\cmd{protect}\gls{glsuppercase}\marg{\cmd{the}\gls{glsshorttok}})\comment{}
}
\end{codebox}
The inherited \idx{abbrvstyle} uses the short form as the 
\gloskey{sort} value by default. This needs to be changed to the long form:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsxtrfootnotedescsort}}\marg{\cmd{the}\strong{\gls{glslongtok}}}
\end{codebox}

\begin{bib2gls}
If you want to switch to using \app{bib2gls}, remember to set the
\idx{abbrvstyle} before the resource command and change the
default sort fallback field to \gloskey{long}, as with
\samplefile{AcrDesc}.
\end{bib2gls}

\filedef{sample-dot-abbr.tex}
This document illustrates how to use the base
\idx{postlinkhook} to adjust the space factor after \idxpl{acronym}.
\begin{terminal}
pdflatex sample-dot-abbr
makeglossaries sampledot-abbrf
pdflatex sample-dot-abbr
\end{terminal}
This example creates a custom storage key that provides a similar
function to \sty{glossaries-extra}['s] \gloskey{category} key.

\glsxtrnote
This example is much simpler with \sty{glossaries-extra}. The custom
storage key, which is defined using:
\begin{codebox}
\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}}
\end{codebox}
can now be removed.

The \gloskey{category} key is set to \qt{initials} for
the initialisms (which are defined with the custom \csfmt{newacr}
command). The \idxpl{abbrvstyle} can be set with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{setabbreviationstyle}\oarg{initials}\marg{\abbrstyle{long-short}}
\end{codebox}
The \catattr{discardperiod} \idx{categoryattribute} will discard any \idx{fullstop}
(period) following commands like \gls{gls}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{discardperiod}}\marg{true}
\end{codebox}
(If you want to use the \catattr{noshortplural} attribute then you will
also need to set the \catattr{pluraldiscardperiod} attribute.)

The \idx{firstuse} is governed by the \catattr{retainfirstuseperiod}
\idx{categoryattribute}. If set, the period won't be discarded if it follows the
\idx{firstuse} of commands like \gls{gls}. This is useful for styles
where the \idx{firstuse} doesn't end with the short form. In this
case, the \idx{firstuse} of the \abbrstyle{long-short} style ends
with a closing parenthesis, so the end of sentence might be clearer
if the period is retained:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{retainfirstuseperiod}}\marg{true}
\end{codebox}

The \catattr{insertdots} \idx{categoryattribute} can automatically insert dots into
the short form with a final space factor adjustment:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{initials}\marg{\catattr{insertdots}}\marg{true}
\end{codebox}

The custom helper command defined in the example needs to be
slightly modified:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newabbr}}[1][]\marg{\comment{}
 \strong{\gls{newabbreviation}}\oarg{\strong{\gloskey{category}}=initials,\#1}}
\end{codebox}
The definitions need to be slightly modified to work with the
\catattr{insertdots} \idxc{categoryattribute}{attribute}:
\begin{codebox}
\cmd{newabbr}\marg{eg}\marg{\strong{eg}}\marg{eg}
\cmd{newabbr}\marg{ie}\marg{\strong{ie}}\marg{ie}
\cmd{newabbr}\marg{bsc}\marg{\strong{B\marg{Sc}}}\marg{Bachelor of Science}
\cmd{newabbr}\marg{ba}\marg{\strong{BA}}\marg{BA}
\cmd{newabbr}\marg{agm}\marg{\strong{AGM}}\marg{AGM}
\end{codebox}
(This makes it much easier to change your mind if you decide at a
later date to omit the dots, especially if you are storing all your
definitions in a file that's shared across multiple documents, but
note the need to group \qt{Sc}.)

The \qt{laser} definition remains unchanged:
\begin{codebox}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\end{codebox}
The remaining code in the \idxf{preamble/document} must now be removed. (It will
interfere with \sty{glossaries-extra}['s] category post-link hooks.)
No change is required in the document body.

See the \sty{glossaries-extra} user manual for further details about
\idxpl{categoryattribute} and post-link hooks.

\filedef{sample-font-abbr.tex}
This document illustrates how to have different fonts
for \idxpl{acronym} within the style. The document build is:
\begin{terminal}
pdflatex sample-font-abbr
makeglossaries sample-font-abbr
pdflatex sample-font-abbr
\end{terminal}
The \idx{acronym} mechanism provided by the base \sty{glossaries}
package isn't well suited to having a mixture of styles. This
example provides a workaround that involves defining a new storage
key with \gls{glsaddstoragekey} that's used to hold the font
declaration (such as \csfmt{em}).
\begin{codebox}
\gls{glsaddstoragekey}\marg{font}\marg{}\marg{\cmd{entryfont}}
\end{codebox}
A new custom \idx+{acronymstyle} is defined that fetches the font
information from this new key so that it can be applied to the
\idx{acronym}. Some helper commands are also provided to define the
different types of \idxpl{acronym}:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newitabbr}}[1][]\marg{\gls{newacronym}\oarg{font=\cmd{em},\#1}}
\cmd{newcommand}*\marg{\cmd{newupabbr}}\marg{\gls{newacronym}}
\codepar
\cmd{newitabbr}\marg{eg}\marg{e.g.}\marg{exempli gratia}
\cmd{newupabbr}\marg{bsc}\marg{BSc}\marg{Bachelor of Science}
\end{codebox}
This makes the \idx{firstuse} of \code{\gls{gls}\marg{eg}} appear as \qt{exempli
gratia (\emph{e.g.})} whereas the \idx{firstuse} of \code{\gls{gls}\marg{bsc}}
is \qt{Bachelor of Science (BSc)}.

\glsxtrnote
This example document is much simpler with \sty{glossaries-extra}.
First the \csfmt{usepackage} command needs adjusting:
\begin{codebox}
\cmd{usepackage}[\opt{postdot},\opt{stylemods}]\marg{\strong{glossaries-extra}}
\end{codebox}
The custom storage key can now be removed and also the custom
\idx{acronymstyle}. Now replace the \gls{setacronymstyle} line with:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short-em}}
\end{codebox*}
and change the definition of the helper commands:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newitabbr}}\marg{\gls{newacronym}}
\cmd{newcommand}*\marg{\cmd{newupabbr}}\marg{\strong{\gls{newabbreviation}}}
\end{codebox}
Note that the \code{font=\cmd{em},} part has been removed from the
definition of the first command and the second command uses
\gls{newabbreviation} instead of \gls{newacronym}. This means that
\csfmt{newitabbr} will default to
\gloskeyval{category}{\cat{acronym}} and \csfmt{newupabbr} will
default to \gloskeyval{category}{\cat{abbreviation}}. The
default style for the \cat{abbreviation} category is
\abbrstyle{long-short}, which is the required style for this
example. This just means that only the \cat{acronym} category needs
to have the style set (with the above \gls{setabbreviationstyle}
command).

Finally, the \gls{acrshort}, \gls{acrlong} and \gls{acrfull} commands
need to be replaced with \gls{glsxtrshort}, \gls{glsxtrlong} and
\gls{glsxtrfull}.

You may notice that the spacing after \qt{e.g\@.} and \qt{i.e\@.}
isn't correct. This is similar to the \samplefile{-dot-abbr} example
where the space factor needs adjusting. In this case I've inserted
the dots manually (rather than relying on the \catattr{insertdots}
\idxc{categoryattribute}{attribute}). You can either remove the dots 
and use \catattr{insertdots} with \catattr{discardperiod}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{insertdots}}\marg{true}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{discardperiod}}\marg{true}
\codepar
\cmd{newitabbr}\marg{eg}\marg{\strong{eg}}\marg{exempli gratia}
\cmd{newitabbr}\marg{ie}\marg{\strong{ie}}\marg{id est}
\end{codebox}
Or you can manually insert the space factor adjustment with \gls{cs.at} and only use
the \catattr{discardperiod} \idxc{categoryattribute}{attribute}:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{acronym}}\marg{\catattr{discardperiod}}\marg{true}
\codepar
\cmd{newitabbr}\marg{eg}\marg{e.g.\strong{\gls{cs.at}}}\marg{exempli gratia}
\cmd{newitabbr}\marg{ie}\marg{i.e.\strong{\gls{cs.at}}}\marg{id est}
\end{codebox}

You don't have to use the \cat{acronym} category. You may prefer a
different label that fits better semantically. For example:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\strong{latinabbr}}\marg{\abbrstyle{long-short-em}}
\cmd{newcommand}*\marg{\cmd{new\strong{latin}abbr}}[1][]\marg{\gls{newabbreviation}\oarg{\gloskeyval{category}{\strong{latinabbr}},\#1}}
\gls{glssetcategoryattribute}\marg{\strong{latinabbr}}\marg{\catattr{insertdots}}\marg{true}
\gls{glssetcategoryattribute}\marg{\strong{latinabbr}}\marg{\catattr{discardperiod}}\marg{true}
\codepar
\cmd{new\strong{latin}abbr}\marg{eg}\marg{e.g.\strong{\gls{cs.at}}}\marg{exempli gratia}
\cmd{new\strong{latin}abbr}\marg{ie}\marg{i.e.\strong{\gls{cs.at}}}\marg{id est}
\end{codebox}

\section{Non-Page Locations}
\label{sec:samplecounter}

\filedef{sampleEq.tex}
This document illustrates how to change the \idx{entrylocation} to something
other than the page number. In this case, the \ctr{equation} counter
is used since all \idxpl{glossaryentry} appear inside an \env{equation}
environment. To create the document do:
\begin{terminal}
pdflatex sampleEq
makeglossaries sampleEq
pdflatex sampleEq
\end{terminal}
The \sty{glossaries} package provides some \idxpl{locationformat}, such
as \encap{hyperrm} and \encap{hyperbf}, that allow the \locations\ in the
\idx{numberlist} to \idx{hyperlink} to the appropriate place in the document (if
\sty{hyperref} has been used). Since it's not possible to include
the \idx{hyperlink} name in the \idx{indexing} information with \app{makeindex}
and \app{xindy}, the \sty{glossaries} package has to reform the
name from a prefix and the \location\ value.

Unfortunately it's not always possible to split the link name into a
prefix and location.  That happens with the \ctr{equation}
counter in certain classes, such as the \cls{report} class (which
is used in this example). This means that it's necessary to redefine
\theHcounter{equation} so that it has a format that fits the requirement:
\begin{codebox}
\cmd{renewcommand}*\theHcounter{equation}\marg{\theHcounter{chapter}.\gls{arabic}\marg{equation}}
\end{codebox}
If you don't do this, the equation \locations\ in the \idx{glossary} won't
form valid \idxpl{hyperlink}.

Each \idx{glossaryentry} represents a mathematical symbol. This means
that with \options{noidx,mkidx,xdy} it's necessary to use the \gloskey{sort} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\gloskeyval{description}{Gamma function},\strong{\gloskeyval{sort}{Gamma}}}
\end{codebox}

\bibglsnote
If you want to switch to using \app{bib2gls}, the first change you
need to make is to switch from explicitly loading
\sty{glossaries} to loading \sty{glossaries-extra} with the
\opt{record} package option. If \optval{record}{only} (or
\opt{record} without a value) is used, then the above
redefinition of \theHcounter{equation} is still required. If
\optval{record}{nameref} is used instead then the redefinition of
\theHcounter{equation} isn't required. You may also want to use the
\opt{stylemods} and \opt{postdot} options:
\begin{codebox}
\cmd{usepackage}[\strong{\optval{record}{nameref}},\opt{stylemods},\opt{postdot},
 \opt{ucmark},\optval{style}{\glostyle{long3colheader}},\optval{counter}{\ctr{equation}}]\marg{\strong{glossaries-extra}}
\end{codebox}
The entries now need to be converted into the \ext{bib} format required 
by \app{bib2gls}, which can be done with \app{convertgls2bib}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampleEq.tex entries.bib
\end{terminal}
This will create a file called \filefmt{entries.bib} that starts:
\begin{codebox}
\comment{Encoding: UTF-8}
\atentry{entry}\marg{Gamma,
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
  \gloskeyval{description}{Gamma function}
}
\end{codebox}
You may prefer to change \atentry{entry} to \atentry{symbol}. (This
should be easy to do with your text editor's search and replace
function.)

Note that the \gloskey{sort} key has been omitted. This is because
it typically shouldn't be used. The difference between using
\atentry{entry} and \atentry{symbol} is that with \atentry{entry}
the sort value will be obtained from the \gloskey{name} but with
\atentry{symbol} the sort value will be obtained from the label.
If you explicitly use the \gloskey{sort} key then you will break
this behaviour. (If you try this example out, notice the difference
in the ordering if you switch between \atentry{entry} and
\atentry{symbol}. See also \bibglsgallery{sorting}.)

Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
If you have used \optval{record}{nameref} then you can remove the
redefinition of \theHcounter{equation}. Next remove all the lines
defining the glossary entries (since they're now defined in the
\ext{bib} file). 

Finally, replace \gls{printglossary} with \gls{printunsrtglossary}:
\begin{codebox}
\strong{\gls{printunsrtglossary}}\oarg{\printglossoptvalm{title}{Index of Special Functions and Notations}}
\end{codebox}
The rest of the document remains unchanged (unless you want to use
\gls{glsxtrfmt} as described in the following example).

\filedef{sampleEqPg.tex}
This is similar to the previous example, but the \idxpl{numberlist} are a
mixture of page numbers and equation numbers. This example adds the
\idx{glossary} to the \idx{tableofcontents}, so an extra \LaTeX\ run is
required:
\begin{terminal}
pdflatex sampleEqPg
makeglossaries sampleEqPg
pdflatex sampleEqPg
pdflatex sampleEqPg
\end{terminal}
As with the previous example, entries are defined like this:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\gloskeyval{description}{Gamma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
The \optval{counter}{\ctr{equation}} package option is used to set the
default indexing counter to \ctr{equation}. This means that it
has to be changed for \idx{indexing} outside of any numbered equation. For
example:
\begin{codebox}
\gls{glslink}\oarg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}\marg{Gamma}\marg{gamma function}
\end{codebox}
I've set the \glsopt{format} to \encap{hyperbf} to indicate that
this is a primary reference. (Note that I'm using \encap{hyperbf} not
\encap{textbf} in order to include a \idx{hyperlink} in the location.)

The \idx{linktext} here is almost identical to the
description. The only difference is that the description starts with
a capital (\idx{sentencecase}). If it started with a \idx{lowercase} character instead, I could
simply use \gls{glsdesc} instead of \gls{glslink}. If I change the
entry descriptions so that they all start with a \idx{lowercase} letter
then I would need to create a custom \idx{glossarystyle} that used
\gls{Glossentrydesc} instead of \gls{glossentrydesc}.

\glsxtrnote
If I switch to using \sty{glossaries-extra} I wouldn't need a new
\idx{glossarystyle}. Instead I could just use the \catattr{glossdesc}
\idx{categoryattribute} to perform the \idx{casechange}. Remember that the first change
to make is to replace \sty{glossaries} with
\sty{glossaries-extra}:
\begin{codebox}
\cmd{usepackage}\oarg{\optval{style}{\glostyle{long3colheader}},\strong{\opt{postdot},\opt{stylemods}},
            \optval{counter}{\ctr{equation}}}\marg{\strong{glossaries-extra}}
\end{codebox}
The entries are now all defined so that the description starts with
a lowercase letter (except for the descriptions that start with a
proper noun). For example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\gloskeyval{description}{\strong{g}amma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
The \catattr{glossdesc} \idx{categoryattribute} needs setting:
\begin{codebox}
\gls{glssetcategoryattribute}\marg{\cat{general}}\marg{\catattr{glossdesc}}\marg{firstuc}
\end{codebox}
This means that I can now use \gls{glsdesc} instead of \gls{glslink}.

It's a bit cumbersome typing \code{\oarg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}}
for each primary reference, but \sty{glossaries-extra} provides a
convenient way of having a third modifier for commands like \gls{gls}
and \gls{glstext}. This needs to be a single punctuation character
(but not \code{*} or \code{+} which are already in use). For
example:
\begin{codebox}
\gls{GlsXtrSetAltModifier}\marg{\strong{!}}\marg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}
\end{codebox}
Now \code{\gls{glsdesc}\strong{!}\marg{Gamma}} is equivalent to:
\begin{codebox}
\gls{glsdesc}\oarg{\glsoptval{format}{\encap{hyperbf}},\glsoptval{counter}{\ctr{page}}}\marg{Gamma}
\end{codebox}
So the text at the start of the \qt{Gamma Functions} chapter is now
just:
\begin{codebox}
The \gls{glsdesc}!\marg{Gamma} is defined as
\end{codebox}
which is much more compact. Similar changes can be made for the
other instance of \gls{glslink} where the \idx{linktext} is just
the description:
\begin{codebox}
The \gls{glsdesc}!\marg{erf} is defined as
\end{codebox}

There are three other instances of \gls{glslink}, such as:
\begin{codebox}
\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(x+1)}
\end{codebox}
If I just use \code{\gls{gls}\marg{Gamma}} then I would get $\Gamma(z)$ as the
\idx{linktext}. For entries like this that represent functions with
variable parameters it would be more convenient (and help with
consistency) if a command was available to easily replace the
parameters.

With the base \sty{glossaries} package, one simple solution that
works for this example is to save just the function symbol in the 
\gloskey{symbol} field, for example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\strong{\gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{Gamma}}},}
\gloskeyval{description}{gamma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
and then use:
\begin{codebox}
\strong{\gls{glssymbol}}\marg{Gamma}\strong[(\cmd{Gamma}(x+1))\strong]
\end{codebox}
(which includes the function parameter inside the \idx{linktext}) or just:
\begin{codebox}
\gls{glssymbol}\marg{Gamma}(\cmd{Gamma}(x+1))
\end{codebox}
(which has the function parameter after the \idx{linktext}).
This is a convenient approach where the extra material can simply
follow the symbol, and it can also be used with \sty{glossaries-extra}.

The \sty{glossaries-extra} package provides another possibility. It
requires a command that takes a single argument, for example:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{Gammafunction}}[1]\marg{\cmd{Gamma}(\#1)}
\end{codebox}
The control sequence name (the command name without the leading
backslash) is stored in the field identified by the command \gls{GlsXtrFmtField}
(this should be the internal field name not the key name, see \tableref{tab:fieldmap}). The
default is \glosfield{useri} which corresponds to the \gloskey{user1}
key. This means that the \qt{Gamma} entry would need to be
defined with \gloskeyval{user1}{Gammafunction}. With this approach, each
function entry would need a separate associated command.

Another approach is to store the parameterless function in the
\gloskey{symbol} key (as earlier) and have a more generic command that uses this
symbol. This requires the entry label, which can be obtained with
\gls{glslabel} within the \idx{linktext}:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{entryfunc}}[1]\marg{\gls{glsentrysymbol}\marg{\gls{glslabel}}(\#1)}
\end{codebox}
(Obviously, this command can't be used outside of the \idx{linktext}
or post-link hooks since it uses \gls{glslabel}.)

So the entry now needs the parameterless function in 
\gloskey{symbol} and the control sequence name of this generic
command in \gloskey{user1}. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{Gamma}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Gamma}(z)}},
\strong{\gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{Gamma}}},\gloskeyval{user1}{entryfunc},}
\gloskeyval{description}{gamma function},\gloskeyval{sort}{Gamma}}
\end{codebox}
(This doesn't need to be done for the \qt{C} and \qt{G}
entries since they're constants not functions.)

You may want to consider providing helper commands to make the
functions easier to define. For example:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{func}}[2]\marg{\#1(\#2)}
\cmd{newcommand}\marg{\cmd{entryfunc}}[1]\marg{\cmd{func}\marg{\gls{glsentrysymbol}\marg{\gls{glslabel}}}\marg{\#1}}
\cmd{newcommand}\marg{\cmd{newfunc}}[5][]\marg{\comment{}
 \gls{newglossaryentry}\marg{\#2}\marg{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{func}\marg{\#3}\marg{\#4}}},
   \gloskeyval{symbol}{\#3},
   \gloskeyval{user1}{entryfunc},
   \gloskeyval{description}{\#5},
   \gloskeyval{sort}{\#2},\#1
 }\comment{}
}
\end{codebox}
The entries can now be defined using this custom \csfmt{newfunc}
command. For example:
\begin{codebox}
\cmd{newfunc}\marg{Gamma}\marg{\cmd{Gamma}}\marg{z}\marg{gamma function}
\cmd{newfunc}[\gloskeyval{sort}{gamma1}]\marg{gamma}\marg{\cmd{gamma}}\marg{\cmd{alpha},x}\marg{lower 
  incomplete gamma function}
\cmd{newfunc}[\gloskeyval{sort}{Gamma2}]\marg{iGamma}\marg{\cmd{Gamma}}\marg{\cmd{alpha},x}\marg{upper 
  incomplete gamma function}
\end{codebox}

Note that in \csfmt{newfunc} the \gloskey{symbol} key doesn't have its value
encapsulated with \gls{ensuremath} so \gls{glssymbol} will need to explicitly be
placed in \idx{mathmode}. If you switch to a \idx{glossarystyle} that displays
the symbol, you will either need to adjust the definition of
\csfmt{newfunc} to use \gls{ensuremath} in the \gloskey{symbol} field
or you can add the encapsulation with the \catattr{glosssymbolfont}
\idx{categoryattribute}.

Now \code{\gls{glslink}\marg{Znu}\marg{Z\_\cmd{nu}}} can simply be replaced with
\code{\gls{glssymbol}\marg{Znu}} (no parameter is required in
this case). For the other cases, where the parameter is different
from that given in the \gloskey{text} field (which is obtained from
the \gloskey{name}), you can use \gls{glsxtrfmt}. For example, 
\code{\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(x+1)}} can now be replaced with:
\begin{codebox}
\gls{glsxtrfmt}\marg{Gamma}\marg{x+1}
\end{codebox}
This effectively works like \gls{glslink} but omits the post-link hook.
(See the \sty{glossaries-extra} user manual for further details.)

\begin{important}
Don't use \gls{glsxtrfmt} within the argument of another \gls{glsxtrfmt} command
(or inside any other \idx{linktext}).
\end{important}

Similarly \code{\gls{glslink}\marg{Gamma}\marg{\cmd{Gamma}(\cmd{alpha})}}
can now be replaced with:
\begin{codebox}
\gls{glsxtrfmt}\marg{Gamma}\marg{\cmd{alpha}}
\end{codebox}
Note that it's still possible to use:
\begin{codebox}
\gls{glssymbol}\marg{Gamma}[(\cmd{alpha})]
\end{codebox}
You may prefer to define a helper command that makes it easier to
switch between your preferred method. For example:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{Fn}}[3][]\marg{\gls{glssymbol}\oarg{\#1}\marg{\#2}[(\#3)]}
\end{codebox}
or:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{Fn}}[3][]\marg{\gls{glsxtrfmt}\oarg{\#1}\marg{\#2}\marg{\#3}}
\end{codebox}

\bibglsnote
If you want to convert this example so that it works with \app{bib2gls}, first
convert it to use \sty{glossaries-extra} (as described above), and
then follow the instructions from \samplefile{Eq}. The
\app{convertgls2bib} application recognises \csfmt{newcommand} so it
will be able to parse the custom \csfmt{newfunc} commands.

Note that \app{bib2gls} allows you to separate the \locations\ in
the \idx{numberlist} into different groups according to the
\idxc{locationcounter}{counter} used for the location. This can be
done with the \resourceopt{loc-counters} resource option. It's also
possible to identify primary \idxc{locationencap}{formats} (such as
\encap{hyperbf} used in this example) using the
\resourceopt{primary-location-formats} option. The primary
\locations\ can then be given a more prominent position in the
\idx{numberlist}.  See the \app{bib2gls} user manual for further
details.

\filedef{sampleSec.tex}
This document also illustrates how to change the \location\ to something other than the
page number. In this case, the \ctr{section} counter is used.
This example adds the \idx{glossary} to the \idx{tableofcontents}, so an extra
\LaTeX\ run is required:
\begin{terminal}
pdflatex sampleSec
makeglossaries sampleSec
pdflatex sampleSec
pdflatex sampleSec
\end{terminal}
Note that there are conflicting \idxpl{locationformat}, 
which trigger a warning from \app{makeindex}:
\begin{terminal}
\#\# Warning (input = sampleSec.glo, line = 6; output = sampleSec.gls, line = 9):
   -- Conflicting entries: \idxpl{multipleencap} for the same page under same key.
\codepar
\#\# Warning (input = sampleSec.glo, line = 2; output = sampleSec.gls, line = 10):
   -- Conflicting entries: \idxpl{multipleencap} for the same page under same key.
\end{terminal}
This is the result of \idx{indexing} an entry multiple times for the same
\location\ with different values of the \glsopt{format} key (\idxpl{encap}). 
(\app{makeindex} assumes that the \location\ is a page number)

In this case, it's caused by three references to the \qt{ident} entry in section~2.1:
\begin{codebox}
\gls{gls}\oarg{\glsoptval{format}{\encap{hyperit}}}\marg{ident}
\gls{glspl}\marg{ident} \comment{default \glsoptval{format}{\encap{glsnumberformat}}}
\gls{gls}*\oarg{\glsoptval{format}{\encap{hyperbf}}}\marg{ident}
\end{codebox}

If you use the \app{makeglossaries} Perl script it will detect the warnings in the
\app{makeindex} transcript file and attempt to fix the conflict by
removing entries from the \ext{glo} file:
\begin{transcript}
\Idxpl{multipleencap} detected. Attempting to remedy.
Reading sampleSec.glo...
Writing sampleSec.glo...
Retrying
\end{transcript}
(Range formats have highest precedence. The default \encap{glsnumberformat}
has the lowest precedence.)

If you use \app{makeglossaries-lite} or call
\app{makeindex} directly then the problem won't be fixed and the
\idx{glossary} will end up with the rather odd \idx{numberlist} for the
identity matrix entry consisting of three references to section 2.1:
the first in the default font, followed by bold (\encap{hyperbf})
and then italic (\encap{hyperit}), which results in 2.1,
\textbf{2.1}, \textit{2.1}.  If you use \app{makeglossaries} then
only the bold entry (\textbf{2.1}) will be present.  However, 
if you don't want the problem corrected, call
\app{makeglossaries} with the \mkglsopt{e} switch.

If you switch to \app{xindy}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{xindy}},\optval{style}{\glostyle{altlist}},\opt{toc},\optval{counter}{\ctr{section}}]\marg{glossaries}
\end{codebox}
then the conflict will be resolved using the number format \idxc{xindyattr}{attribute}
list order of priority. In this case, \encap{glsnumberformat} has
the highest priority. This means that only the upright medium weight entry
(2.1) will be present. The simplest way of altering this is to
provide your own custom format. For example:
\begin{codebox}
\cmd{newcommand}*\marg{\strong{\cmd{primary}}}[1]\marg{\gls{hyperit}\marg{\#1}}
\gls{GlsAddXdyAttribute}\marg{\strong{primary}}
\end{codebox}
and change \code{\gls{gls}\oarg{\glsoptval{format}{hyperit}}} to
\code{\gls{gls}\oarg{\glsoptval{format}{\strong{primary}}}} etc.
This will give \glsoptval{format}{primary} the highest priority.
(It's also better practice to provide this kind of semantic command.)

With \app{bib2gls}, you can supply rules to deal with 
\idx{locationformat} conflicts, as illustrated below.

\bibglsnote
In order to switch to \app{bib2gls}, first replace
\sty{glossaries} with \sty{glossaries-extra}, and add the \opt{record} 
package option. Remember that \sty{glossaries-extra} has a different
set of defaults and you may also want to patch the predefined base styles.
For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{altlist}},\strong{\opt{postdot},\opt{stylemods}},\optval{counter}{\ctr{section}}]
\marg{\strong{glossaries-extra}}
\end{codebox}

The entry definitions now need to be converted into \app{bib2gls}
format and saved in a \ext{bib} file (say, \filefmt{entries.bib}). You can use 
\app{convertgls2bib}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampleSec.tex entries.bib
\end{terminal} 

Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
and remove all the \gls{newglossaryentry} commands.

Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.
The document build is now:
\begin{terminal}
pdflatex sampleSec
bib2gls sampleSec
pdflatex sampleSec
\end{terminal}
As with the original example, there's still a location format
conflict, which \app{bib2gls} warns about:
\begin{transcript}
Warning: Entry location conflict for formats: \encap{hyperbf} and \encap{hyperit}
Discarding: \marg{ident}\marg{}\marg{\ctr{section}}\marg{\encap{hyperbf}}\marg{2.1}
Conflicts with: \marg{ident}\marg{}\marg{\ctr{section}}\marg{\encap{hyperit}}\marg{2.1}
\end{transcript}
This means that it has discarded the bold location and kept the
italic one. (As with \app{makeglossaries}, range formats have the
highest priority and \encap{glsnumberformat} has the lowest.)

It would be better if the conflict could be merged into
a single location that was both bold and italic. To achieve this,
it's first necessary to define a command that produces this effect:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{hyperbfit}}[1]\marg{\cmd{textbf}\marg{\gls{hyperit}\marg{\#1}}}
\end{codebox}
Now \app{bib2gls} needs to be invoked with the appropriate mapping
with the \switch{map-format} or \bibglsopt{m} switch:
\begin{terminal}
bib2gls \bibglsopt{m} \glsquote{hyperbf:hyperbfit,hyperit:hyperbfit} sampleSec
\end{terminal}
If you are using \app{arara} the directive should be:
\begin{codebox}
\araraline{bib2gls: \marg{ mapformats: [ [hyperbf, hyperbfit],
\araracont [hyperit, hyperbfit] ] }}
\end{codebox}

If you try out this example, notice the difference between
\optval{record}{only} and \optval{record}{nameref}. If you use the
latter, the \locations\ will now be the section titles rather than the
section numbers. If you use the \optval{record}{nameref} setting you can customize the
\location\ by defining the command:
\begin{codebox}
\gls{glsxtrcounterlocfmt}\margm{location}\margm{title}
\end{codebox}

In this case the counter is \ctr{section}, so the command should be 
\glsxtrcounterlocfmt{section}. It takes two arguments: the first is the
location and the second is the title. For example:
\begin{codebox*}
\cmd{newcommand}*\marg{\glsxtrcounterlocfmt{section}}[2]\marg{\gls{S}\#1 \#2}
\end{codebox*}
(The only command of this type that is defined by default is the one
for the \ctr{equation} counter, \glsxtrcounterlocfmt{equation}.) Make sure 
that you have at least version 1.42 of \sty{glossaries-extra}.

\section{Multiple Glossaries}
\label{sec:samplestype}

See also \samplefile{Sort} in \sectionref{sec:samplessort}, which
has three glossaries.

\filedef{sampleNtn.tex}
This document illustrates how to create an additional \idx{glossary}
type. This example adds the \idx{glossary} to the
\idx{tableofcontents}, so an extra \LaTeX\ run is required:
\begin{terminal}
pdflatex sampleNtn
makeglossaries sampleNtn
pdflatex sampleNtn
pdflatex sampleNtn
\end{terminal}
Note that if you want to call \app{makeindex} explicitly instead of
using the \app{makeglossaries} or \app{makeglossaries-lite}
scripts then you need to call \app{makeindex} twice:
\begin{enumerate}
\item Create the \glostype{main} glossary (all on one line):
\begin{terminal}
makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
\end{terminal}
\item Create the secondary glossary (all on one line):
\begin{terminal}
makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.not sampleNtn.ntn
\end{terminal}
\end{enumerate}
This document creates a new glossary using:
\begin{codebox}
\gls{newglossary}\oarg{nlg}\marg{notation}\marg{not}\marg{ntn}\marg{Notation}
\end{codebox}
This defines a \idx{glossary} that can be identified with the label
\qt{notation} with the default title \qt{Notation}. The other
arguments are the file extensions required with \options{mkidx,xdy}. For those
two options, the \sty{glossaries} package needs to know the input
and output files required by \app{makeindex} or \app{xindy}. 

(The optional argument is the file extension of the \idx{indexing}
transcript file, which \sty{glossaries} doesn't need to know about
(unless \opt{automake} is used), but it writes the information to
the \ext{aux} file for the benefit of \app{makeglossaries} and
\app{makeglossaries-lite}.)

If you switch to a different \idx{indexing} option then these file extensions
aren't required, in which case it's simpler to use the starred form:
\begin{codebox}
\gls{newglossary*}\marg{notation}\marg{Notation}
\end{codebox}

This example uses a label prefixing system to differentiate
between the different types of entries.  (If you use
\sty{babel} with a language that makes 
\idx{colon} active you will need to change the prefix.)
For example, the term
\qt{set} is defined as:
\begin{codebox}
\gls{newglossaryentry}\marg{gls:set}\marg{\gloskeyval{name}{set},
\gloskeyval{description}{A collection of distinct objects}}
\end{codebox}
and the set notation is defined as:
\begin{codebox}
\gls{newglossaryentry}\marg{not:set}\marg{\gloskeyval{type}{notation},
\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
\gloskeyval{description}{A \gls{gls}\marg{gls:set}},\gloskeyval{sort}{S}}
\end{codebox}
Notice that the latter description contains \gls{gls}. This means
you shouldn't use \gls{glsdesc} with this entry otherwise you will
end up with nested links.

\glsxtrnote
The \sty{glossaries-extra} package provides a command for use in
within field values to prevent nested \idx{linktext}:
\begin{codebox}
\gls{glsxtrp}\margm{field}\margm{label}
\end{codebox}
There are convenient shortcuts for common fields:
\code{\gls{glsps}\margm{label}} (for the \gloskey{short} field) and 
\code{\gls{glspt}\margm{label}} (for the \gloskey{text}
field). So the set notation definition can be modified:
\begin{codebox}
\gls{newglossaryentry}\marg{not:set}\marg{\gloskeyval{type}{notation},
\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
\gloskeyval{description}{A \strong{\gls{glspt}\marg{gls:set}}},\gloskeyval{sort}{S}}
\end{codebox}
This will stop the inner reference from causing interference if you use \gls{glsdesc}.
It will also suppress \idx{indexing} within the \idx{glossary} but will have a
\idx{hyperlink} (if \sty{hyperref} is used).

The \sty{glossaries-extra} package provides a way of defining
commands like \gls{gls} that automatically insert a prefix. For
example:
\begin{codebox}
\gls{glsxtrnewgls}\marg{not:}\marg{\cmd{sym}}
\gls{glsxtrnewglslike}\marg{gls:}\marg{\cmd{term}}\marg{\cmd{termpl}}\marg{\cmd{Term}}\marg{\cmd{Termpl}}
\end{codebox}
(there's no point providing commands for plural or \casechanging\
with symbols).  Now \code{\gls{gls}\marg{not:set}} can be replaced
with \code{\cmd{sym}\marg{set}} and \code{\gls{gls}\marg{gls:set}}
can be replaced with \code{\cmd{term}\marg{set}}.

\bibglsnote
These two commands are primarily provided for the benefit of \app{bib2gls} as
the information is written to the \ext{aux} file. This allows
\app{bib2gls} to recognise the custom commands if they have been
used in the \ext{bib} files. When combined with
\resourceopt{label-prefix} and \resourceopt{ext-prefixes} (see
below) this makes it much simpler to change the prefixes if
necessary.

If you want to convert this document to use \app{bib2gls}, remember
that you need the \opt{record} or \optval{record}{nameref}
option. For example:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},}\opt{postdot},\opt{stylemods}]\marg{glossaries-extra}
\end{codebox}
As with earlier examples, \app{convertgls2bib} can be used to
convert the entry definitions into the required \ext{bib} format.
You may prefer to split the entries into separate files according to
type. (Requires at least \app{bib2gls} v2.0.) This is useful 
if you want to reuse a large database of
entries across multiple documents as it doesn't lock you into using
a specific glossary.  For example:
\begin{terminal}
convertgls2bib \switch{split-on-type} \switch{preamble-only} sampleNtn.tex entries.bib
\end{terminal}
This will create a file called \filefmt{entries.bib} that contains
the entries that didn't have a \gloskey{type} assigned in the original
file, such as:
\begin{codebox}
\atentry{entry}\marg{gls:set,
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of distinct objects}
}
\end{codebox}
It will also create a file called \filefmt{notation.bib} that
contains the entries that had the \gloskey{type} set to
\qt{notation} in the original file, such as:
\begin{codebox}
\atentry{entry}\marg{not:set,
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
  \gloskeyval{description}{A \gls{glspt}\marg{gls:set}}
}
\end{codebox}
Note that the \gloskey{type} field has been removed. The above entry
in the \filefmt{notation.bib} file references a term in the
\filefmt{entries.bib} file. It's possible to strip all the
prefixes from the \ext{bib} files and get \app{bib2gls} to
automatically insert them. In which case, this cross-reference needs
adjusting to indicate that it's referring to an entry in another
file. This can be done with one of the special
\xtroptfmt{ext\meta{n}.}\ prefixes:
\begin{codebox}
\atentry{entry}\marg{\strong{set},
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
  \gloskeyval{description}{A \gls{glspt}\marg{\strong{\xtrfmt{ext1.}}set}}
}
\end{codebox}
The corresponding term in the \filefmt{entries.bib} file is now:
\begin{codebox}
\atentry{entry}\marg{\strong{set},
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of distinct objects}
}
\end{codebox}

Now you can replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\strong{\resourceoptvalm{label-prefix}{gls:}}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{notation},\resourceoptval{type}{notation},
 \strong{\resourceoptvalm{label-prefix}{not:},\resourceoptvalm{ext-prefixes}{gls:}}}
\end{codebox}
Remove all the \gls{newglossaryentry} definitions and replace 
\gls{printglossaries} with \gls{printunsrtglossaries}.

Regardless of how many resource sets the document contains, only one
\app{bib2gls} call is required:
\begin{terminal}
pdflatex sampleNtn
bib2gls sampleNtn
pdflatex sampleNtn
\end{terminal}

You may notice that the ordering in the notations list has changed
from the original. This is because the \gloskey{sort} field was
automatically removed by \app{convertgls2bib}, so the entries are
now sorted according to the \gloskey{name} field (since they are
defined with \atentry{entry}). You can use your text editor's search
and replace function to replace all instances of \atentry{entry}
with \atentry{symbol} in the \filefmt{notations.bib} file so that,
for example, the \qt{set} definition becomes:
\begin{codebox}
\strong{\atentry{symbol}}\marg{set,
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{mathcal}\marg{S}}},
  \gloskeyval{description}{A \gls{glspt}\marg{\xtrfmt{ext1.}set}}
}
\end{codebox}
Now these \atentry{symbol} entries will be sorted according to their
label. (The original label in the \ext{bib} file, not the
prefixed label.) This will put them in the same order as the original
document. (See the \qt{Examples} chapter of
the \app{bib2gls} user manual for examples of varying the sorting
and also \bibglsgallery{sorting}.)

\filedef{sample-dual.tex}
This document illustrates how to define an entry that both appears in the list of
acronyms and in the \glostype{main} glossary. To create the document do:
\begin{terminal}
pdflatex sample-dual
makeglossaries sample-dual
pdflatex sample-dual
\end{terminal}
This defines a custom command \gls{newdualentry} that defines two \idxpl{entry} 
at once (a normal \idx{entry} and an \idx{acronym}). It uses \gls{glsadd} to ensure
that if one is used then the other is automatically \indexed:
\begin{codebox}
\cmd{newcommand}*\marg{\gls{newdualentry}}[5][]\marg{\comment{}
  \comment{main entry:}
  \gls{newglossaryentry}\marg{main-\#2}\marg{\gloskeyval{name}{\#4},\comment{}
  \gloskeyval{text}{\#3\gls{glsadd}\marg{\#2}},\comment{}
  \gloskeyval{description}{\#5},\comment{}
  \#1\comment{additional options for main entry}
  }\comment{}
  \comment{\idx{acronym}:}
  \gls{newacronym}\marg{\#2}\marg{\#3\gls{glsadd}\marg{main-\#2}}\marg{\#4}\comment{}
}
\end{codebox}
A sample dual entry is defined with this command:
\begin{codebox}
\gls{newdualentry}\marg{svm}\comment{label}
  \marg{SVM}\comment{short form}
  \marg{support vector machine}\comment{long form}
  \marg{Statistical pattern recognition technique}\comment{description}
\end{codebox}
This defines an \idx{acronym} with the label \qt{svm} that can be
referenced with \code{\gls{gls}\marg{svm}} but it also defines an
\idx{entry} with the label \qt{main-svm}. This isn't used in the document with
\gls{gls} but it's automatically added from the
\code{\gls{glsadd}\marg{main-svm}} code in the short form of
\qt{svm}.

For this trivial document, this kind of dual entry is redundant and
unnecessarily leads the reader down a trail, first to the list of
acronyms and from there the reader then has to go to the \glostype{main}
glossary to look up the description. It's better to simply include
the description in the list of acronyms.

There are, however, uses for repeating \idxpl{entry} across multiple lists.
For example, this user manual defines all described commands (such
as \gls{gls}) as \idxpl{glossaryentry}. They appear in the 
\hyperref[cmdsummary]{command summary} (where the syntax is given
with a brief description and the principle \location\ in the document
where the command is described) and they also appear in the
\hyperref[index]{index} (where just the name and \idx{locationlist}
is shown).

\bibglsnote
If you want to switch over to \app{bib2gls}, first change to
\sty{glossaries-extra}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next, the definition needs to be converted to the \ext{bib}
format required by \app{bib2gls}. If you do:
\begin{terminal}
convertgls2bib \switch{preamble-only} sample-dual.tex entries.bib
\end{terminal}
then \app{convertgls2bib} will report the following:
\begin{transcript}
Overriding default definition of \gls{newdualentry} with custom 
definition. (Change \csfmt{newcommand} to \gls{providecommand} if you want 
\gls{newdualentry}\oarg{options}\marg{label}\marg{short}\marg{long}\marg{description}
converted to \atentry{dualabbreviationentry}.)
\end{transcript}
This is because \app{convertgls2bib} has its own internal definition
of \gls{newdualentry}, but if it encounters a new definition that
will override its default. If you want to retain
\app{convertgls2bib}['s] definition (recommended) then just replace
\csfmt{newcommand} with \csfmt{providecommand} in the document source and
rerun \app{convertgls2bib}.

With \csfmt{providecommand}, the new \filefmt{entries.bib} file
created by \app{convertgls2bib} contains:
\begin{codebox}
\atentry{dualabbreviationentry}\marg{svm,
  \gloskeyval{short}{SVM},
  \gloskeyval{description}{Statistical pattern recognition technique},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
If \csfmt{newcommand} is retained, it will instead contain:
\begin{codebox}
\atentry{entry}\marg{main-svm,
  \gloskeyval{name}{support vector machine},
  \gloskeyval{description}{Statistical pattern recognition technique},
  \gloskeyval{text}{SVM\gls{glsadd}\marg{svm}}
}
\codepar
\atentry{acronym}\marg{svm,
  \gloskeyval{short}{SVM\gls{glsadd}\marg{main-svm}},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
In the first case, \app{bib2gls} creates two linked entries using
its primary-dual mechanism. In the second case, \app{bib2gls}
creates two entries that simply reference each other.

Assuming that your \filefmt{entries.bib} file just contains
\atentry{dualabbreviationentry}, 
now replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{entries.bib}
  \resourceoptval{type}{\glostype{acronym}},\resourceoptval{dual-type}{\glostype{main}},\resourceoptvalm{dual-prefix}{main-}}
\end{codebox}

Then remove the definition of \gls{newdualentry} and the entry
definition. Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}.
The document build is:
\begin{terminal}
pdflatex sample-dual
bib2gls sample-dual
pdflatex sample-dual
\end{terminal}

If, instead, your \filefmt{entries.bib} file contains separate
\atentry{entry} and \atentry{acronym}, then you need:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries}}
\end{codebox}
If you need \idxpl{numberlist}, the document build is now
\begin{terminal}
pdflatex sample-dual
bib2gls sample-dual
pdflatex sample-dual
bib2gls sample-dual
pdflatex sample-dual
\end{terminal}
and this time \app{bib2gls} complains about the use of \gls{glsadd}
within the \gloskey{short} and \gloskey{text} fields as this can be
problematic. (The extra \app{bib2gls} and \LaTeX\ calls are
to ensure the \idx{numberlist} is up to date for the
\qt{main-svm} entry, which can only be \indexed\ with \gls{glsadd}
after \qt{svm} has been defined.)

Dual entries make much more sense when one \idx{entry} is for a \idx{glossary}
with the description displayed but no \idx{numberlist} (or just a
primary \location), and the other is for the index without the
description but with a \idx{numberlist}. This can be created by
replacing \atentry{dualabbreviationentry} with
\atentry{dualindexabbreviation}:
\begin{codebox}
\atentry{dualindexabbreviation}\marg{svm,
  \gloskeyval{description}{Statistical pattern recognition technique},
  \gloskeyval{short}{SVM},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
This can be mixed with \atentry{index} terms for example:
\begin{codebox}
\atentry{index}\marg{machlearn,
   \gloskeyval{name}{machine learning}
}
\end{codebox}
The document needs modifying:
\begin{codebox*}
\cmd{documentclass}\marg{article}
\codepar
\cmd{usepackage}[\opt{record},\opt{postdot},
 \opt{nostyles},\optval{stylemods}{\xtroptfmt{bookindex},list},\comment{only want \glostyle{bookindex} and \glostyle{list} styles}
 acronym]\marg{glossaries-extra}
\codepar
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short-desc}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{entries.bib}
 \resourceoptval{dual-type}{\glostype{acronym}},
 \resourceoptvalm{label-prefix}{\strong{idx.}},\resourceoptvalm{dual-prefix}{},
 \resourceoptvalm{combine-dual-locations}{primary}}
\codepar
\gls{glsxtrnewglslike}\marg{\strong{idx.}}\marg{\strong{\cmd{idx}}}\marg{\cmd{idxpl}}\marg{\cmd{Idx}}\marg{\cmd{Idxpl}}
\codepar
\cbeg{document}
\gls{gls}\marg{svm} and \strong{\cmd{idx}}\marg{machlearn}.
\codepar
\gls{printunsrtglossary}\oarg{\printglossoptval{type}{\gls{acronymtype}},\printglossoptval{style}{\glostyle{altlist}}}
\gls{printunsrtglossary}\oarg{\printglossoptval{style}{\glostyle{bookindex}},\printglossoptvalm{title}{Index}}
\cend{document}
\end{codebox*}
See the \app{bib2gls} manual for further details.

\filedef{sample-langdict.tex}
This document illustrates how to use the \sty{glossaries} package to create English
to French and French to English dictionaries. To create the document
do:
\begin{terminal}
pdflatex sample-langdict
makeglossaries sample-langdict
pdflatex sample-langdict
\end{terminal}
This example uses the \opt{nomain} package option to prevent the
creation of the \glostype{main} glossary. This means that the document
must provide its own \idxpl{glossary}:
\begin{codebox}
\gls{newglossary}\oarg{glg}\marg{english}\marg{gls}\marg{glo}\marg{English to French}
\gls{newglossary}\oarg{flg}\marg{french}\marg{flx}\marg{flo}\marg{French to English}
\end{codebox}
This means that if you want to call \app{makeindex} explicitly
you need to take these new extensions into account:
\begin{terminal}
makeindex -s sample-langdict.ist -t sample-langdict.glg -o sample-langdict.gls sample-langdict.glo
makeindex -s sample-langdict.ist -t sample-langdict.flg -o sample-langdict.flx sample-langdict.flo
\end{terminal}
As with the previous example, this document provides a custom
command that defines two related entries:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{newword}}[4]\marg{\comment{}
  \gls{newglossaryentry}\marg{en-\#1}\marg{\gloskeyval{type}{english},\gloskeyval{name}{\#2},\gloskeyval{description}{\#3 \#4}}\comment{}
  \gls{newglossaryentry}\marg{fr-\#1}\marg{\gloskeyval{type}{french},\gloskeyval{name}{\#3 \#4},\gloskeyval{text}{\#4},\gloskeyval{sort}{\#4},
    \gloskeyval{description}{\#2}}\comment{}
}
\end{codebox}
This has the syntax:
\begin{codebox}
\cmd{newword}\margm{label}\margm{english}\margm{determiner}\margm{french}
\end{codebox}
(Note that this trivial example doesn't take plurals into account.)
This custom command will define two terms with labels \code{en-\meta{label}} (for
the English term) and \code{fr-\meta{label}} (for the French term).
So
\begin{codebox}
\cmd{newword}\marg{cat}\marg{cat}\marg{le}\marg{chat}
\end{codebox}
is equivalent to:
\begin{codebox}
\gls{newglossaryentry}\marg{en-cat}\marg{\gloskeyval{type}{english},\gloskeyval{name}{cat},\gloskeyval{description}{le chat}}
\gls{newglossaryentry}\marg{fr-cat}\marg{\gloskeyval{type}{french},\gloskeyval{name}{le
chat},\gloskeyval{sort}{chat},
  \gloskeyval{description}{cat}}
\end{codebox}

Unlike the previous example (\samplefile{-dual}), there's no link
between these two entries. If the document only uses
\code{\gls{gls}\marg{en-cat}}, then the \qt{en-cat} entry will appear in the
\optfmt{english} glossary but the \qt{fr-cat} entry won't
appear in the \optfmt{french} one.

\bibglsnote
If you want to switch to \app{bib2gls} then you first need to
convert the document so that it uses \sty{glossaries-extra}, but
include the \opt{prefix} option to ensure that
\sty{glossaries-prefix} is also loaded:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},\opt{prefix}},\opt{postdot},\opt{stylemods},\opt{nomain}]\marg{\strong{glossaries-extra}}
\end{codebox}
You don't need to worry about file extensions now, so it's simpler
to use the starred \gls{newglossary*}:
\begin{codebox}
\glslink{newglossary*}{\csfmt{newglossary}\strong{*}}\marg{english}\marg{English to French}
\glslink{newglossary*}{\csfmt{newglossary}\strong{*}}\marg{french}\marg{French to English}
\end{codebox}
Next the entries need to be converted to the \ext{bib} format
required by \app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} \switch{ignore-type} sample-langdict.tex entries.bib
\end{terminal}
This creates the file \filefmt{entries.bib} that contains entries
defined like:
\begin{codebox}
\atentry{entry}\marg{en-cat,
  \gloskeyval{name}{cat},
  \gloskeyval{description}{le chat}
}
\codepar
\atentry{entry}\marg{fr-cat,
  \gloskeyval{name}{le chat},
  \gloskeyval{description}{cat},
  \gloskeyval{text}{chat}
}
\end{codebox}
(Note that the \gloskey{sort} and \gloskey{type} fields have been omitted.)

This would be more flexible, and much briefer, if these entries were
defined using \app{bib2gls}['s] dual entry system combined with the
\sty{glossaries-prefix} package:
\begin{codebox}
\atentry{dualentry}\marg{cat,
  \gloskeyval{name}{chat},
  \gloskeyval{description}{cat},
  \gloskeyval{prefix}{le},
  \gloskeyval{prefixplural}{les}
}
\end{codebox}
Similarly for the \qt{chair} entry:
\begin{codebox}
\atentry{dualentry}\marg{chair,
  \gloskeyval{name}{chaise},
  \gloskeyval{description}{chair},
  \gloskeyval{prefix}{la},
  \gloskeyval{prefixplural}{les}
}
\end{codebox}

With \atentry{dualentry}, the English and French terms are now
automatically linked from \app{bib2gls}['s] point of view. If only one
is referenced in the document, the other will also be added by default.

Now that the determiner has been moved out of the description, it
won't show in the \idx{glossary}. However, it's possible to include it by
providing a command to encapsulate the description (which can also
apply the language change as well).

\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\comment{entries.bib}
 \resourceoptvalm{append-prefix-field}{space},
 \resourceoptvalm{category}{same as type},\resourceoptvalm{dual-category}{same as type},
 \resourceoptvalm{label-prefix}{en-},\resourceoptvalm{dual-prefix}{fr-},
 \resourceoptval{type}{english},\resourceoptval{dual-type}{french},
 \resourceoptval{sort}{en},\resourceoptval{dual-sort}{fr}}
\codepar
\cmd{newcommand}\marg{\cmd{FrEncap}}[1]\marg{\comment{}
 \gls{foreignlanguage}\marg{french}\marg{\gls{glsentryprefix}\marg{\gls{glscurrententrylabel}}\#1}}
\cmd{newcommand}\marg{\cmd{EnEncap}}[1]\marg{\gls{foreignlanguage}\marg{english}\marg{\#1}}
\codepar
\gls{glssetcategoryattribute}\marg{english}\marg{\catattr{glossnamefont}}\marg{EnEncap}
\gls{glssetcategoryattribute}\marg{english}\marg{\catattr{glossdescfont}}\marg{FrEncap}
\gls{glssetcategoryattribute}\marg{french}\marg{\catattr{glossnamefont}}\marg{FrEncap}
\gls{glssetcategoryattribute}\marg{french}\marg{\catattr{glossdescfont}}\marg{EnEncap}
\end{codebox*}

Remember to remove \gls{makeglossaries}, the definition of \csfmt{newword} and
the entry definitions from the \idxf{preamble/document}, and 
replace \gls{printglossary} with:
\begin{codebox}
\gls{printunsrtglossary}
\end{codebox}

Other refinements that you might like to make include using
\gls{glsxtrnewglslike} so you don't have to worry about the label
prefix (\qt{en-} and \qt{fr-}). See the \sty{glossaries-extra}
manual for further details.

\filedef{sample-index.tex}
This document uses the \sty{glossaries} package to create both a
glossary and an index. This requires two \app{makeglossaries} (or
\app{makeglossaries-lite}) calls to ensure the document is up to
date:
\begin{terminal}
pdflatex sample-index
makeglossaries sample-index
pdflatex sample-index
makeglossaries sample-index
pdflatex sample-index
\end{terminal}

\section{Sorting}
\label{sec:samplessort}

\filedef{samplePeople.tex}
This document illustrates how you can hook into the
standard sort mechanism to adjust the way the sort key is set. This
requires an additional run to ensure the \idx{tableofcontents} is
up-to-date:
\begin{terminal}
pdflatex samplePeople
makeglossaries samplePeople
pdflatex samplePeople
pdflatex samplePeople
\end{terminal}
This provides two commands for typesetting a name:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{sortname}}[2]\marg{\#2, \#1}
\cmd{newcommand}\marg{\cmd{textname}}[2]\marg{\#1 \#2}
\end{codebox}
where the first argument contains the forenames and the second is the
surname. The first command is the one required for sorting the name
and the second is the one required for displaying the name in the
document. A synonym is then defined:
\begin{codebox}
\cmd{let}\cmd{name}\cmd{textname}
\end{codebox}
This command defaults to the display name command (\csfmt{textname})
but is temporarily redefined to the sort name command (\csfmt{sortname})
within the \gloskey{sort} field assignment hook:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]\marg{\comment{}
 \strong{\cmd{let}\cmd{name}\cmd{sortname}}
 \cmd{edef}\#1\marg{\cmd{expandafter}\cmd{expandonce}\cmd{expandafter}\marg{\#1}}\comment{}
 \strong{\cmd{let}\cmd{name}\cmd{textname}}
 \gls{glsdosanitizesort}
}
\end{codebox}
The people are defined using the custom \csfmt{name} command:
\begin{codebox}
\gls{newglossaryentry}\marg{joebloggs}\marg{\gloskeyval{name}{\strong{\cmd{name}}\marg{Joe}\marg{Bloggs}},
 \gloskeyval{description}{\gls{nopostdesc}}}
\end{codebox}
Since \csfmt{name} is temporarily changed while the \gloskey{sort} key
is being assigned, the sort value for this entry ends up as
\qt{Bloggs, Joe}, but the name appears in the document as \qt{Joe Bloggs}.

\bibglsnote
If you want to use \app{bib2gls}, you first need to convert the
document to use \sty{glossaries-extra} but make sure you include the
\opt{record} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{stylemods},\optval{style}{\glostyle{listgroup}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next it's necessary to convert the entry definitions to the
\ext{bib} format required by \app{bib2gls}. You can simply do:
\begin{terminal}
convertgls2bib \switch{preamble-only} samplePeople people.bib
\end{terminal}
which will create a file called \filefmt{people.bib} that contains
definitions like:
\begin{codebox}
\atentry{entry}\marg{joebloggs,
  \gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}},
  \gloskeyval{description}{\gls{nopostdesc}}
}
\end{codebox}
However, you may prefer to use the \switch{index-conversion}
(\switch{i}) switch:
\begin{terminal}
convertgls2bib \switch{i} \switch{preamble-only} samplePeople people.bib
\end{terminal}
This will discard the \gloskey{description} field and use
\atentry{index} instead of \atentry{entry} if the
\gloskey{description} is either empty or simply set to \gls{nopostdesc} or
\gls{glsxtrnopostpunc}. The \filefmt{people.bib} file now
contains definitions like:
\begin{codebox}
\atentry{index}\marg{joebloggs,
  \gloskeyval{name}{\cmd{name}\marg{Joe}\marg{Bloggs}}
}
\end{codebox}
Regardless of which approach you used to create the \ext{bib}
file, you now need to edit it to provide a definition of the custom
\csfmt{name} command for \app{bib2gls}['s] use:
\begin{codebox*}
\atentry{preamble}\marg{"\strong{\gls{providecommand}}\marg{\cmd{name}}[2]\marg{\#2, \#1}"}
\end{codebox*}
Note the use of \gls{providecommand} instead of \csfmt{newcommand}.

In the document (\file{samplePeople.tex}) you now need to
delete \gls{makeglossaries}, the definitions of \csfmt{sortname},
\csfmt{textname}, \csfmt{name}, \gls{glsprestandardsort}, and all the entry
definitions. Then add the following to the \idxf{preamble/document}:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{name}}[2]\marg{\#1 \#2}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{people}}
\end{codebox}
Next, use your text editor's search and replace function to
substitute all instances of \gls{glsentrytext} in the chapter
headings with \gls{glsfmttext}. For example:
\begin{codebox*}
\gls{chapter}\marg{\strong{\gls{glsfmttext}}\marg{joebloggs}}
\end{codebox*}
Finally, replace \gls{printglossaries} with:
\begin{codebox}
\gls{printunsrtglossaries}
\end{codebox}
The document build is now:
\begin{terminal}
pdflatex samplePeople
bib2gls samplePeople
pdflatex samplePeople
pdflatex samplePeople
\end{terminal}
The third \LaTeX\ call is required to ensure that the \idxpl{PDFbookmark}
are up to date, as the entries aren't defined until after the
\app{bib2gls} run (which is why you have to use \gls{glsfmttext}
instead of \gls{glsentrytext}).

This again leads to a list sorted by surname. The reason this works
is because \app{bib2gls} only sees the definition of \csfmt{name}
provided in \atentry{preamble}, but the document uses the definition
of \csfmt{name} provided before \gls{GlsXtrLoadResources}. The use of
\gls{providecommand} in \atentry{preamble} prevents \csfmt{name} from 
being redefined within the document.

See also the \qt{Examples} chapter of the \app{bib2gls} user manual,
which provides another \qt{people} example and
\gallerypage{aliases}{Aliases}.

\filedef{sampleSort.tex}
This is another document that illustrates how to hook
into the standard sort mechanism. An additional run is required to
ensure the \idx{tableofcontents} is up-to-date:
\begin{terminal}
pdflatex sampleSort
makeglossaries sampleSort
pdflatex sampleSort
pdflatex sampleSort
\end{terminal}
This document has three glossaries (\glostype{main}, \glostype{acronym}
and a custom \glostypefmt{notation}), so if you want to use
\app{makeindex} explicitly you will need to have three
\app{makeindex} calls with the appropriate file extensions:
\begin{terminal}
pdflatex sampleSort
makeindex -s sampleSort.ist -t sampleSort.alg -o sampleSort.acr sampleSort.acn
makeindex -s sampleSort.ist -t sampleSort.glg -o sampleSort.gls sampleSort.glo
makeindex -s sampleSort.ist -t sampleSort.nlg -o sampleSort.not sampleSort.ntn
pdflatex sampleSort
pdflatex sampleSort
\end{terminal}
It's much simpler to just use \app{makeglossaries} or \app{makeglossaries-lite}.

In this example, the sort hook is adjusted to ensure the list of
notation is sorted according to the order of definition. A new
counter is defined to keep track of the entry number:
\begin{codebox}
\cmd{newcounter}\marg{sortcount}
\end{codebox}
The sort hook is then redefined to increment this counter and assign
the sort key to that numerical value, but only for the
\glostypefmt{notation} glossary. The other two \idxpl{glossary} have their sort
keys assigned as normal:
\begin{codebox*}
\cmd{renewcommand}\marg{\gls{glsprestandardsort}}[3]{\comment{}
  \cmd{ifdefstring}\marg{\#2}\marg{notation}\comment{}
  \marg{\comment{}
     \cmd{stepcounter}\marg{sortcount}\comment{}
     \cmd{edef}\#1\marg{\gls{glssortnumberfmt}\marg{\gls{arabic}\marg{sortcount}}}\comment{}
  }\comment{}
  \marg{\comment{}
     \gls{glsdosanitizesort}
  }\comment{}
}
\end{codebox*}
This means that \app{makeindex} will sort the notation in numerical order.

\glsxtrnote
If you want to convert this document to use \sty{glossaries-extra},
a much simpler approach is available with its hybrid method. First
change the package loading line to:
\begin{codebox}
\cmd{usepackage}[\opt{postdot},\opt{stylemods},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
Either remove \gls{setacronymstyle} and replace all instances of
\gls{newacronym} with \gls{newabbreviation} or replace:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
with:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\end{codebox}

The custom counter and redefinition of \gls{glsprestandardsort} can now
be removed. The file extensions for the custom \glostylefmt{notation}
glossary are no longer relevant so the \idx{glossary} definition can be
changed to:
\begin{codebox}
\glslink{newglossary*}{\csfmt{newglossary\strong{*}}}\marg{notation}\marg{Notation}
\end{codebox}
The \gls{makeglossaries} command now needs to be adjusted to
indicate which \idxpl{glossary} need to be processed by \app{makeindex}:
\begin{codebox}
\gls{makeglossaries}\strong{[\glostype{main},\glostype{acronym}]}
\end{codebox}
Finally, \gls{printglossaries} needs to be replaced with:
\begin{codebox}
\gls{printglossary}
\gls{printacronyms}
\glslink{printnoidxglossary}{\csfmt{print\strong{noidx}glossary}}\oarg{\printglossoptval{type}{notation}\strong{,\printglossoptval{sort}{def}}}
\end{codebox}
Note that the \glostylefmt{notation} glossary, which hasn't been listed in the optional
argument of \gls{makeglossaries}, must be displayed with \gls{printnoidxglossary}.

This means that \app{makeindex} only needs to process the
\glostype{main} and \glostype{acronym} glossaries. No actual sorting is
performed for the \glostypefmt{notation} glossary because, when used with
\printglossoptval{sort}{def}, \gls{printnoidxglossary} simply
iterates over the list of entries that have been indexed.

The document build doesn't need the third \LaTeX\ call now (since
none of the \idxpl{glossary} extend beyond a page break):
\begin{terminal}
pdflatex sampleSort
makeglossaries sampleSort
pdflatex sampleSort
\end{terminal}
This time \app{makeglossaries} will include the message:
\begin{transcript}
only processing subset '\glostype{main},\glostype{acronym}'
\end{transcript}
This means that although \app{makeglossaries} has noticed the
\glostypefmt{notation} glossary, it will be skipped.

If you are explicitly calling \app{makeindex} then you need to drop the call
for the \glostypefmt{notation} glossary:
\begin{terminal}
pdflatex sampleSort
makeindex -s sampleSort.ist -t sampleSort.alg -o sampleSort.acr sampleSort.acn
makeindex -s sampleSort.ist -t sampleSort.glg -o sampleSort.gls sampleSort.glo
pdflatex sampleSort
\end{terminal}

\bibglsnote
If you prefer to use \app{bib2gls}, the package loading line needs
to be changed to:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next the entry definitions need to be convert to the \ext{bib}
format required by \app{bib2gls}.

For this example, it's simpler to split the entries into different files according
to the glossary type. This can be done with the
\switch{split-on-type} or \switch{t} switch:
\begin{terminal}
convertgls2bib \switch{t} \switch{preamble-only} sampleSort.tex entries.bib
\end{terminal}
This will create three files:
\begin{deflist}
\itemtitle{\filefmt{entries.bib}}
\begin{itemdesc}
This contains the entries that were
defined with \gls{newglossaryentry}. For example:
\begin{codebox}
\atentry{entry}\marg{gls:set,
  \gloskeyval{name}{set},
  \gloskeyval{description}{A collection of distinct objects}
}
\end{codebox}
\end{itemdesc}

\itemtitle{\filefmt{abbreviations.bib}}
\begin{itemdesc}
This contains the entries that
were defined with \gls{newacronym}. For example:
\begin{codebox}
\atentry{acronym}\marg{zfc,
  \gloskeyval{short}{ZFC},
  \gloskeyval{long}{Zermelo-Fraenkel set theory}
}
\end{codebox}
If you changed \gls{newacronym} to \gls{newabbreviation} then
\atentry{abbreviation} will be used instead:
\begin{codebox}
\atentry{abbreviation}\marg{zfc,
  \gloskeyval{short}{ZFC},
  \gloskeyval{long}{Zermelo-Fraenkel set theory}
}
\end{codebox}
\end{itemdesc}

\itemtitle{\filefmt{notation.bib}}
\begin{itemdesc}
This contains the entries that were
defined with \gloskeyval{type}{notation}. For example:
\begin{codebox}
\atentry{entry}\marg{not:set,
  \gloskeyval{name}{\$\cmd{mathcal}\marg{S}\$},
  \gloskeyval{description}{A set},
  \gloskeyval{text}{\cmd{mathcal}\marg{S}}
}
\end{codebox}
You may prefer to replace \atentry{entry} with \atentry{symbol}
in this file.
\end{itemdesc}
\end{deflist}
\emph{After} the definition of the \glostypefmt{notation} glossary
(\gls{newglossary}), add:
\begin{codebox}
\comment{\idx{abbrvstyle} must be set first:}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries,abbreviations}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{notation},\comment{notation.bib}
 \strong{\resourceoptval{type}{notation}},\resourceoptval{sort}{\strong{unsrt}}}
\end{codebox}
Delete the remainder of the \idxf{preamble/document} (\gls{makeglossaries} and entry
definitions).

Finally, replace the lines that display the \idxpl{glossary} with:
\begin{codebox}
\gls{printunsrtglossaries}
\end{codebox}
The build process is now:
\begin{terminal}
pdflatex sampleSort
bib2gls sampleSort
pdflatex sampleSort
\end{terminal}

In this case, I have one resource command that processes two
glossaries (\glostype{main} and \glostype{acronym}) at the same time.
The entries in these glossaries are ordered alphabetically.
The second resource command processes the \glostypefmt{notation} glossary but
the entries in this glossary aren't sorted (and so will appear in
the order of definition within the \ext{bib} file).

See also \samplefile{Ntn}, \bibglsgallery{sorting} and the \app{bib2gls} user manual
for more examples.

\section{Child Entries}
\label{sec:samplesparent}

\filedef{sample.tex}
This document illustrates some of
the basics, including how to create child entries that use the same
name as the parent entry. This example adds the glossary to the
\idx{tableofcontents} and it also uses \gls{glsrefentry}, so an extra \LaTeX\ 
run is required:
\begin{terminal}
pdflatex sample
makeglossaries sample
pdflatex sample
pdflatex sample
\end{terminal}
You can see the difference between word and letter ordering if you
add the package option \optval{order}{letter}. (Note
that this will only have an effect if you use
\app{makeglossaries} or \app{makeglossaries-lite}.
If you use \app{makeindex} explicitly, you will need to use the
\mkidxopt{l} switch to indicate letter ordering.)

One of the entries has its name encapsulated with a semantic command:
\begin{codebox}
\cmd{newcommand}\marg{\strong{\cmd{scriptlang}}}[1]\marg{\cmd{textsf}\marg{\#1}}
\codepar
\gls{newglossaryentry}\marg{Perl}\marg{\gloskeyval{name}{\strong{\cmd{scriptlang}}\marg{Perl}},\strong{\gloskeyval{sort}{Perl},}
\gloskeyval{description}{A scripting language}}
\end{codebox}
This means that this entry needs to have the \gloskey{sort} key set
otherwise \app{makeindex} will assign it to the \qt{symbol} 
\idx{group}, since it starts with a backslash (which \app{makeindex}
simply treats as punctuation).

The homograph entries \qt{glossary} and \qt{bravo} are defined as
sub-entries that inherit the name from the parent entry. The parent
entry doesn't have a description, but with the default
\optval{nopostdot}{false} setting this will lead to a spurious dot.
This can be removed by adding \gls{nopostdesc} to the description,
which suppresses the post-description hook for that entry.

Since the child entries have the same name as the parent, this means
that the child entries will have duplicate sort values unless the
default is changed with the \gloskey{sort} key:
\begin{codebox}
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
 \gloskeyval{description}{\strong{\gls{nopostdesc}}},\gloskeyval{plural}{glossaries}}
\codepar
\gls{newglossaryentry}\marg{glossarycol}\marg{
 \gloskeyval{description}{collection of glosses},
 \strong{\gloskeyval{sort}{2},}
 \gloskeyval{parent}{glossary}\comment{parent \emph{label}}
}
\codepar
\gls{newglossaryentry}\marg{glossarylist}\marg{
 \gloskeyval{description}{list of technical words},
 \strong{\gloskeyval{sort}{1},}
 \gloskeyval{parent}{glossary}\comment{parent \emph{label}}
}
\end{codebox} 
(Remember that the entries are sorted hierarchically.) This will
place \qt{glossarylist} before \qt{glossarycol}, but both
will come immediately after their parent \qt{glossary} entry.

\glsxtrnote
If you switch to using \sty{glossaries-extra}, remember that the
default package options are different:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{postdot},\opt{stylemods}},\optval{style}{\glostyle{treenonamegroup}},\optval{order}{word},
  \opt{subentrycounter}]\marg{\strong{glossaries-extra}}
\end{codebox}

You may now want to consider replacing \gls{nopostdesc} in the
descriptions with \gls{glsxtrnopostpunc} (using your
text editor's search and replace function). This suppresses the
post-description punctuation but not the category post-description
hook.

You may have noticed that some of the descriptions include the
plural form, but it's not done very consistently. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},
  \gloskeyval{plural}{cows},\comment{not required as this is the default}
  \gloskeyval{user1}{kine},
  \gloskeyval{description}{(\cmd{emph}\marg{pl.}\gls{cs.sp}cows, \cmd{emph}\marg{archaic} kine) an adult
female of any bovine animal} 
}
\end{codebox}
which has the parenthetical material at the start of the
description with emphasis,
\begin{codebox}
\gls{newglossaryentry}\marg{bravocry}\marg{
  \gloskeyval{description}{cry of approval (pl.\gls{cs.sp}bravos)},
  \gloskeyval{sort}{1},
  \gloskeyval{parent}{bravo}
}
\end{codebox}
which has the parenthetical material at the end of the
description without emphasis even though it's a regular plural,
\begin{codebox}
\gls{newglossaryentry}\marg{bravoruffian}\marg{
  \gloskeyval{description}{hired ruffian or killer (pl.\gls{cs.sp}bravoes)},
  \gloskeyval{sort}{2},
  \gloskeyval{plural}{bravoes},
  \gloskeyval{parent}{bravo}}
\end{codebox}
which has the parenthetical material at the end of the
description without emphasis, and
\begin{codebox}
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
  \gloskeyval{description}{\gls{nopostdesc}},
  \gloskeyval{plural}{glossaries}}
\end{codebox}
which doesn't show the plural in the description.

With \sty{glossaries-extra}, you can remove this parenthetical
material and implement it using the category post-description hook instead. 
For example, the above definitions become:
\begin{codebox}
\gls{newglossaryentry}\marg{cow}\marg{\gloskeyval{name}{cow},
  \gloskeyval{user1}{kine},
  \gloskeyval{description}{an adult female of any bovine animal} 
}
\codepar
\gls{newglossaryentry}\marg{bravocry}\marg{
  \gloskeyval{description}{cry of approval},
  \gloskeyval{sort}{1},
  \gloskeyval{parent}{bravo}
}
\codepar
\gls{newglossaryentry}\marg{bravoruffian}\marg{
  \gloskeyval{description}{hired ruffian or killer},
  \gloskeyval{sort}{2},
  \gloskeyval{plural}{bravoes},
  \gloskeyval{parent}{bravo}}
\codepar
\gls{newglossaryentry}\marg{glossary}\marg{\gloskeyval{name}{glossary},
  \gloskeyval{description}{\strong{\gls{glsxtrnopostpunc}}},
  \gloskeyval{plural}{glossaries}}
\end{codebox}
The post-description hook for the \cat{general} category can now be
set:
\begin{codebox*}
\gls{glsdefpostdesc}\marg{general}\marg{\comment{}
\comment{Has the \gloskey{user1} key been set?}
  \gls{glsxtrifhasfield}\marg{\glosfield{useri}}\marg{\gls{glscurrententrylabel}}\comment{}
  \marg{\gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}},
    \cmd{emph}\marg{archaic} \gls{glscurrentfieldvalue})\comment{}
  }\comment{}
  \marg{\comment{}
\comment{The \gloskey{user1} key hasn't been set. Is the plural the same as the}
\comment{singular form with the plural suffix appended?}
    \gls{GlsXtrIfXpFieldEqXpStr}\marg{\gloskey{plural}}\marg{\gls{glscurrententrylabel}}\comment{}
    \marg{\gls{glsentrytext}\marg{\gls{glscurrententrylabel}}\gls{glspluralsuffix}}\comment{}
    \marg{\comment{}
\comment{Sibling check with \app{bib2gls} (see below)}
    }\comment{}
    \marg{\comment{}
\comment{The plural isn't the default. Does this entry have a parent?}
      \gls{ifglshasparent}\marg{\gls{glscurrententrylabel}}%
      \marg{\comment{}
\comment{This entry has a parent.}
\comment{Are the plurals for the child and parent the same?}
        \gls{GlsXtrIfXpFieldEqXpStr}\marg{\gloskey{plural}}\marg{\gls{glscurrententrylabel}}\comment{}
        \marg{\gls{glsentryplural}\marg{\gls{glsentryparent}\marg{\gls{glscurrententrylabel}}}}\comment{}
        \marg{}\comment{child and parent plurals the same}
        \marg{\comment{}
          \gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})\comment{}
        }\comment{}
      }%
      \marg{\gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})}\comment{}
    }\comment{}
  }\comment{}
}
\end{codebox*}
(If you try this example out, notice the difference for the
\qt{glossary} entry if you use \gls{nopostdesc} and then
replace it with \gls{glsxtrnopostpunc}.)
See the \sty{glossaries-extra} user manual for further details and
also \bibglsbegin.

The \qt{bravo} homographs are an oddity where the singular form is
identical but the plural is different (\qt{bravos} and
\qt{bravoes}). In the original, both descriptions included the
plural term. The above modifications drop the display of the regular
\qt{bravos} plural (for the \qt{bravocry} term) and only show 
the \qt{bravoes} plural (for the \qt{bravoruffian} term). In this
particular case it might be useful to show the regular plural in
order to highlight the difference.

While it's straightforward to access an entry's parent label (with
\gls{glsentryparent}) it's much harder to access entry's children or
siblings. The \gls{ifglshaschildren} command has to iterate over all
entries to determine if any have a parent that matches the given
label. This is obviously very time-consuming if you have a large
database of entries. It also doesn't provide a way of determining
whether or not the child entries have been indexed.

With \app{bib2gls}, it's possible to save this information with the
\resourceopt{save-child-count} and \resourceopt{save-sibling-count},
which not only save the total but also save the child or sibling
labels in an \sty{etoolbox} internal list. This makes the
information much faster to access and also only includes the labels of
those entries that have actually been indexed.

In the above, the comment line:
\begin{codebox}
\comment{Sibling check with \app{bib2gls} (see below)}
\end{codebox}
indicates where to put the extra code. If you switch to
\app{bib2gls} and make sure to use \resourceopt{save-sibling-count}
then you can insert the following code in the block above where that
comment is:
\begin{codebox*}
\gls{GlsXtrIfFieldNonZero}\marg{\glosfield{siblingcount}}\marg{\gls{glscurrententrylabel}}\%
\marg{\comment{\glosfield{siblingcount} field value non-zero}
 \gls{glsxtrfieldforlistloop} \comment{iterate over internal list}
 \marg{\gls{glscurrententrylabel}} \comment{entry label}
 \marg{\glosfield{siblinglist}} \comment{label of field containing list}
 \marg{\cmd{siblinghandler}} \comment{loop handler}
}\comment{}
\marg{}\comment{\glosfield{siblingcount} field value 0 or empty or missing}
\end{codebox*}
This uses a custom handler that's defined as follows:
\begin{codebox*}
\cmd{newcommand}\marg{\cmd{siblinghandler}}[1]\marg{\comment{}
  \gls{GlsXtrIfXpFieldEqXpStr}*\marg{\gloskey{plural}}\marg{\gls{glscurrententrylabel}}\comment{}
  \marg{\gls{glsentryplural}\marg{\#1}}\comment{}
  \marg{}\comment{current entry's plural same as sibling's plural}
  \marg{\comment{}
    \gls{space}(\cmd{emph}\marg{pl.}\gls{cs.sp}\gls{glsentryplural}\marg{\gls{glscurrententrylabel}})\comment{}
    \gls{listbreak}
  }\comment{}
}
\end{codebox*}
The \gls{listbreak} command is provided by \sty{etoolbox} and is used
for prematurely exiting a loop. The handler tests if the sibling's
\gloskey{plural} field is identical to the current entry's \gloskey{plural}
field. If they are the same, it does nothing. If they are different,
it displays the current entry's plural and breaks the loop.

Note that this assumes that the parent entry hasn't had the plural
form explicitly set to \qt{bravoes} instead of the default
\qt{bravos}. In that case, the parent entry would show the plural
but the \qt{bravoruffian} child entry wouldn't show the plural (since
this case would led to the empty code block identified with the
comment \qt{child and parent plurals the same}). The \qt{bravoes}
plural form would instead be shown for the parent, which wouldn't
look right.

If you don't use \app{bib2gls} or if you use it without the
\resourceopt{save-sibling-count} resource option then the sibling
information won't be available.

\bibglsnote
In order to switch to using \app{bib2gls}, it's first necessary to
switch to using \sty{glossaries-extra} (as above). Remember that the
\opt{record} option is required:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},}\opt{postdot},\opt{stylemods},\optval{style}{\glostyle{treenonamegroup}},
\opt{subentrycounter}]\marg{glossaries-extra}
\end{codebox}
Next the entry definitions need to be converted to the
\ext{bib} format required by \app{bib2gls}. This can be done
with \app{convertgls2bib}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sample.tex entries.
\end{terminal}
The semantic command may be moved to the \ext{bib} file's \idx{preamble/bib} to
ensure it's defined:
\begin{codebox}
\atentry{preamble}\marg{"\gls{providecommand}\marg{\cmd{scriptlang}}[1]\marg{\cmd{textsf}\marg{\#1}}"}
\end{codebox}

The \gloskey{sort} field typically shouldn't be set when using
\app{bib2gls}, so \app{convertgls2bib} strips it. 
If the \gloskey{sort} field is missing, \app{bib2gls} will obtain it
from the sort fallback for that entry type. In this case,
\atentry{entry} has the \gloskey{name} field as the sort fallback.
If this is also missing then its value is obtained from the parent's
\gloskey{name} field (see \bibglsgallery{sorting} for other examples).

Therefore the \qt{Perl} entry is simply defined as:
\begin{codebox}
\atentry{entry}\marg{Perl,
  \gloskeyval{name}{\cmd{scriptlang}\marg{Perl}},
  \gloskeyval{description}{A scripting language}
}
\end{codebox}
This isn't a problem for \app{bib2gls}. In this case, the command
has been provided in the \atentry{preamble}, but \app{bib2gls}
strips font information so the sort value becomes \qt{Perl}. 
If the definition isn't placed in \atentry{preamble} then
\app{bib2gls} will simply ignore the command (as \app{xindy} does)
so the sort value will still end up as \qt{Perl}.

The homograph entries have also had their \gloskey{sort} fields omitted:
\begin{codebox}
\atentry{entry}\marg{glossarycol,
  \gloskeyval{parent}{glossary},
  \gloskeyval{description}{collection of glosses}
}
\codepar
\atentry{entry}\marg{glossarylist,
  \gloskeyval{parent}{glossary},
  \gloskeyval{description}{list of technical words}
}
\end{codebox}

This means that the sort value for both these child entries is
\qt{glossary}. When \app{bib2gls} encounters identical sort values
it acts according to its \resourceopt{identical-sort-action} setting.
The default action is to sort by the label using a simple string
comparison. In this case, it would put \qt{glossarycol} before
\qt{glossarylist}. In the original document, the \gloskey{sort}
value was manually chosen to ensure that the entries are ordered
according to \idx{firstuse}.  This ordering can easily be obtained
by changing \app{bib2gls}['s] identical sort action (requires at
least \app{bib2gls} v2.0):
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\strong{\resourceoptval{identical-sort-action}{use}}}
\end{codebox}
This command should replace \gls{makeglossaries}. If you want the
sibling information (see earlier), then you need to remember to add
\resourceopt{save-sibling-count} to the list of options.

Note that this is a better solution than in the original example. If
I edit the document so that \qt{glossarycol} is used first, then
the ordering will be updated accordingly, but with the original
example, the \gloskey{sort} keys would need to be manually changed.

The remainder of the \idxf{preamble/document} (that is, the definition of
\csfmt{scriptlang} and all the entry definitions) should now be
removed.

Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.
The document build is now:
\begin{terminal}
pdflatex sample
bib2gls \switch{group} sample
pdflatex sample
pdflatex sample
\end{terminal}
Note use of the \switch{group} (or \bibglsopt{g}) switch, which is needed
to support the \glostyle{treenonamegroup} style. The third \LaTeX\
call is needed because the document contains \gls{glsrefentry}.

Note that you can't use the \optval{order}{letter} package option
with \app{bib2gls}. Instead use the \resourceoptval{break-at}{none}
resource option:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptvalm{src}{entries},\resourceoptval{identical-sort-action}{use},
  \strong{\resourceoptval{break-at}{none}}
}
\end{codebox}

\filedef{sample-inline.tex}
This document is like \file{sample.tex}, above, but uses the \glostyle{inline}
glossary style to put the \idx{glossary} in a footnote. The document build
is:
\begin{terminal}
pdflatex sample-inline
makeglossaries sample-inline
pdflatex sample-inline
pdflatex sample-inline
\end{terminal}
If you want to convert this document to \sty{glossaries-extra},
follow the same procedure as above. If you want to use \app{bib2gls}
then you don't need the \switch{group} switch since no letter
groups are required.

\filedef{sampletree.tex}
This document illustrates a \hierarchical\ glossary structure where 
child entries have different names to their corresponding parent entry. 
To create the document do:
\begin{terminal}
pdflatex sampletree
makeglossaries sampletree
pdflatex sampletree
\end{terminal}
The document uses the \glostyle{alttreehypergroup} glossary style,
which needs to know the widest name for each \idx{hierarchicallevel}.
This has been assigned manually in the \idxf{preamble/document} with
\gls{glssetwidest}:
\begin{codebox}
\gls{glssetwidest}\marg{Roman letters} \comment{level 0 widest name}
\gls{glssetwidest}\oarg{1}\marg{Sigma}      \comment{level 1 widest name}
\end{codebox}
(Level~0 is the top-most level. That is, entries that don't have a
parent.) It's possible to get \sty{glossaries} to compute the
widest top-level entry with \gls{glsfindwidesttoplevelname} but this
will iterate over all top-level entries, regardless of whether or
not they appear in the \idx{glossary}. If you have a large database of
entries, this will firstly take time and secondly the width may be
too large due to an unindexed entry with a big name.

This sample document doesn't require any of the tabular styles so I've
prevented those packages from being loaded with \opt{nolong} and
\opt{nosuper}. The reduces the overall package loading and reduces 
the potential of package conflict.
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{alttreehypergroup}},\strong{\opt{nolong},\opt{nosuper}}]
\marg{glossaries}
\end{codebox}
(This example glossary is actually better suited for one of the
topic styles provided with \sty{glossary-topic}, see below.)

This is obviously a contrived example since it's strange to have the
symbol names (such as \qt{Sigma}) in the glossary. The purpose is to
demonstrate the \glostyle{alttreehypergroup} with an entry that's
noticeably wider than the others in the same \idx{hierarchicallevel}. A
more sensible document would have the symbol in the \gloskey{name}
key.

\glsxtrnote
If you want to switch to \sty{glossaries-extra}, then you can
instead use a combination of \opt{nostyles} and
\opt{stylemods}:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{alttreehypergroup}},\opt{postdot},\strong{\opt{nostyles},
\optval{stylemods}{tree}}]\marg{\strong{glossaries-extra}}
\end{codebox}
The \opt{stylemods} package not only patches the original styles
provided by the base \sty{glossaries} package (such as
\sty{glossary-tree} used in this example) but also provides extra
helper commands. In this case, it provides additional commands to
calculate the widest name. For example, instead of manually setting
the widest entry with \gls{glssetwidest}, you could add the
following before the glossary:
\begin{codebox*}
\gls{glsFindWidestUsedTopLevelName}
\gls{glsFindWidestUsedLevelTwo}
\end{codebox*}
This will only take into account the entries that have actually been
used in the document, but it can still be time-consuming if you have
a large number of entries.

\begin{important}
Note that the glossary must be at the end of the document (after all
required entries have been used) with this method. The alternative
is to perform the calculation at the end of the document and save
the results in the \ext{aux} file for the next run.
\end{important}

This example document is using top-level entries for topics without
descriptions. This means that the descriptions simply contain
\gls{nopostdesc} to prevent the post-description punctuation from
being automatically inserted. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{greekletter}\marg{\gloskeyval{name}{Greek letters},
\gloskeyval{text}{Greek letter},
\gloskeyval{description}{\gls{nopostdesc}}}
\end{codebox}
With \sty{glossaries-extra}, you can convert this to
\gls{glsxtrnopostpunc} which will prevent the post-description
punctuation without interfering with the category post-description
hook.

In order to distinguish between the child entries, which are
symbols, and the parent entries, which are topics, it's useful to
give these two different types of entries different categories. The
topics can use the default \cat{general} category, but the symbol
entries can be assigned to a different category. The value of the
\gloskey{category} key must be a label. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{C}\marg{\gloskeyval{name}{C},
\gloskeyval{description}{Euler's constant},
\strong{\gloskeyval{category}{\cat{symbol}},}
\gloskeyval{parent}{romanletter}}
\end{codebox}

There is some redundancy caused by a parenthetical note after 
the \idx{firstuse} in some of the symbol entries. For example:
\begin{codebox}
\gls{newglossaryentry}\marg{pi}\marg{\gloskeyval{name}{pi},
\gloskeyval{text}{\gls{ensuremath}\marg{\cmd{pi}}},
\gloskeyval{first}{\gls{ensuremath}\marg{\cmd{pi}} (lowercase pi)},
\gloskeyval{description}{Transcendental number},
\gloskeyval{parent}{greekletter}}
\end{codebox}
With \sty{glossaries-extra} this can be dealt with through the category post-link hook:
\begin{codebox}
\gls{glsdefpostlink}\marg{symbol}\marg{\comment{}
  \gls{glsxtrifwasfirstuse}
  \marg{\comment{first use}
    \gls{glsxtrifhasfield}\marg{\glosfield{useri}}\marg{\gls{glslabel}}\comment{}
    \marg{ (\gls{glscurrentfieldvalue})}\marg{}\comment{}
  }\comment{} 
  \marg{}\comment{not first use}
}
\end{codebox}
The parenthetical material is now stored in the \gloskey{user1} key.
For example:
\begin{codebox}
\gls{newglossaryentry}\marg{sigma}\marg{\gloskeyval{name}{Sigma},
\gloskeyval{text}{\gls{ensuremath}{\cmd{Sigma}}},
\strong{\gloskeyval{user1}{uppercase sigma},}
\gloskeyval{description}{Used to indicate summation},
\gloskeyval{parent}{greekletter}}
\end{codebox}
The category post-description link is also set to ensure that the symbol is
displayed after the description in the glossary:
\begin{codebox}
\gls{glsdefpostdesc}\marg{symbol}\marg{\gls{space}
  (\$\gls{glsentrytext}\marg{\gls{glscurrententrylabel}}\$)}
\end{codebox}
These modifications only affect entries with the
\gloskey{category} set to \cat{symbol}.

With \sty{glossaries-extra}, it's now possible to use the topic
styles provided with the \sty{glossary-topic} package:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\strong{\glostyle{topic}}},\opt{postdot},\strong{\opt{nostyles}},\optvalm{stylemods}{tree\strong{,topic}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
The \glostyle{topic} style is designed for this kind of hierarchy
where all the top-level entries don't have descriptions. This means
that the \gls{nopostdesc} and \gls{glsxtrnopostpunc} commands aren't
required. The top-level entries can simply be defined as:
\begin{codebox}
\gls{newglossaryentry}\marg{greekletter}\marg{\gloskeyval{name}{Greek letters},
\gloskeyval{text}{Greek letter}, \gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{romanletter}\marg{\gloskeyval{name}{Roman letters},
\gloskeyval{text}{Roman letter}, \gloskeyval{description}{}}
\end{codebox}
I've now loaded both the \sty{glossary-tree} and
\sty{glossary-topic} packages
(via \optvalm{stylemods}{tree\dcomma topic}). The
\sty{glossary-topic} package can be used without
\sty{glossary-tree}, in which case it will behave more like the
normal \glostyle{tree} rather than \glostyle{alttree} styles (but
with different indentation and no description in the top-level).
However, if you use \gls{glssetwidest} (provided by
\sty{glossary-tree}) then the \glostyle{topic} style will behave
more like \glostyle{alttree}.

Since there's no description for the top-level entries, the
\glostyle{topic} style ignores the widest name setting for the
top-level, so I can just have the level~1 setting:
\begin{codebox}
\gls{glssetwidest}\oarg{1}{Sigma}
\end{codebox}

\bibglsnote
If you want to convert this document so that it uses \app{bib2gls},
you first need to convert it to using \sty{glossaries-extra}, as
described above, but remember that you now need the \opt{record}
option.
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record},}\optval{style}{\glostyle{topic}},\opt{postdot},\opt{nostyles},\optvalm{stylemods}{tree,topic}]
\marg{\strong{glossaries-extra}}
\end{codebox}
Next convert the entries to the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sampletree.tex entries.bib
\end{terminal}
Now replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\strong{\resourceopt{set-widest}}}
\end{codebox}
I've used the \resourceopt{set-widest} option here to get
\app{bib2gls} to compute the widest name. (Obviously, it can only do
this if it can correctly interpret any commands contained in the
\gloskey{name} field.)

This means that the \gls{glssetwidest} commands can now be removed
completely. All the \gls{newglossaryentry} commands also need to be removed from
the \idxf{preamble/document}. Finally, \gls{printglossaries} needs to be
replaced with \gls{printunsrtglossaries}. The document build is now:
\begin{terminal}
pdflatex sampletree
bib2gls sampletree
pdflatex sampletree
\end{terminal}

This produces the same result as with just \sty{glossaries-extra}
and \app{makeglossaries}. However, there are some modifications that
can be made to the \ext{bib} file to make it neater. 

The top-level entries are defined as:
\begin{codebox}
\atentry{entry}\marg{greekletter,
  \gloskeyval{name}{Greek letters},
  \gloskeyval{description}{},
  \gloskeyval{text}{Greek letter}
}
\codepar
\atentry{entry}\marg{romanletter,
  \gloskeyval{name}{Roman letters},
  \gloskeyval{description}{},
  \gloskeyval{text}{Roman letter}
}
\end{codebox}
This is a direct translation from the \gls{newglossaryentry} commands
(after switching to the \glostyle{topic} style). There's a more
appropriate entry type:
\begin{codebox}
\atentry{indexplural}\marg{greekletter,
  \gloskeyval{text}{Greek letter}
}
\codepar
\atentry{indexplural}\marg{romanletter,
  \gloskeyval{text}{Roman letter}
}
\end{codebox}
The \atentry{indexplural} entry type doesn't require the
\gloskey{description} and will set the \gloskey{name} field to the
same as the \gloskey{plural} field. Since the \gloskey{plural} field
hasn't been set it's obtained by appending \qt{s} to the
\gloskey{text} field.

Now let's assume that the symbol entries are defined in a more
rational manner, with the actual symbol in the \gloskey{name} field.
For example:
\begin{codebox}
\atentry{entry}\marg{sigma,
  \gloskeyval{user1}{uppercase sigma},
  \gloskeyval{parent}{greekletter},
  \gloskeyval{description}{Used to indicate summation},
  \strong{\gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Sigma}}}},
  \gloskeyval{category}{\cat{symbol}}
}
\codepar
\atentry{entry}\marg{C,
  \gloskeyval{parent}{romanletter},
  \gloskeyval{name}{\gls{ensuremath}\marg{C}},
  \gloskeyval{description}{Euler's constant},
  \gloskeyval{category}{\cat{symbol}}
}
\end{codebox}
The category post-description hook (provided with
\gls{glsdefpostdesc}) should now be removed from the document.

If you make these changes and rebuild the document, you'll find that
the order has changed. Now the \qt{sigma} entry is before the
\qt{pi} entry. This is because \app{bib2gls} is obtaining the
sort values from the \gloskey{name} field, which is the sort
fallback for \atentry{entry}. This means that the sort values end up
as $\Sigma$ and $\pi$ (\app{bib2gls} recognises the commands
\csfmt{Sigma} and \csfmt{pi} and converts them to the Unicode characters
0x1D6F4 and 0x1D70B).

If you change \atentry{entry} to \atentry{symbol} then you will once
again get the order from the original example (\qt{pi} before
\qt{Sigma}). This is because the sort fallback for
\atentry{symbol} is the label not the \gloskey{name}. (Remember that
the sort fallback is only used if the \gloskey{sort} field isn't
set. If you explicitly set the \gloskey{sort} field then no fallback
is required. See \bibglsgallery{sorting}.)

You can further tidy the \ext{bib} file by removing the
\gloskey{category} fields. For example:
\begin{codebox}
\atentry{symbol}\marg{sigma,
  \gloskeyval{user1}{uppercase sigma},
  \gloskeyval{parent}{greekletter},
  \gloskeyval{description}{Used to indicate summation},
  \gloskeyval{name}{\gls{ensuremath}\marg{\cmd{Sigma}}}
}
\end{codebox}
You can then assign the \gloskey{category} in the resource set:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceopt{set-widest},\strong{\resourceoptvalm{category}{same as entry}}}
\end{codebox}
This means that all the entries defined with \atentry{symbol} will
have the \gloskey{category} set to \cat{symbol} and all the
entries defined with \atentry{indexplural} will have the
\gloskey{category} set to \catfmt{indexplural}. (Only the
\cat{symbol} category is significant in this example.)

You can make the \ext{bib} files even more flexible by
introducing field and entry aliases with \resourceopt{field-aliases}
and \resourceopt{entry-type-aliases}. See the \app{bib2gls} manual
for further details.

\section{Cross-Referencing}
\label{sec:samplescrossref}

\filedef{sample-crossref.tex}
This document illustrates how to cross-reference entries in the
glossary.
\begin{terminal}
pdflatex sample-crossref
makeglossaries sample-crossref
pdflatex sample-crossref
\end{terminal}
The document provides a command \gls{alsoname} to produce some fixed text, which can be
changed as appropriate (usually within a language hook):
\begin{codebox}
\gls{providecommand}\marg{\gls{alsoname}}\marg{see also}
\end{codebox}
I've used \gls{providecommand} as some packages define this command.
This is used to create a \qt{see also} cross-reference with the
\gloskey{see} key:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{firm, round fruit},
\gloskeyval{see}{[\gls{alsoname}]\marg{pear}}}
\codepar
\gls{newglossaryentry}\marg{marrow}\marg{\gloskeyval{name}{marrow},
 \gloskeyval{description}{long vegetable with thin green skin and white flesh},
 \gloskeyval{see}{[\gls{alsoname}]courgette}}
\end{codebox}

Note that \qt{marrow} is included in the glossary even though it
hasn't been referenced in the text. This is because the
\gloskey{see} key automatically triggers \gls{glssee} which indexes
the term. This behaviour is intended for documents where only the
terms that are actually required in the document are defined. It's
not suitable for a large database of terms shared across multiple
documents that may or may not be used in a particular document. In
that case, you may want to consider using \sty{glossaries-extra}
(see below).

\glsxtrnote
This example is quite simple to convert to \sty{glossaries-extra}.
If you want the dot after the description, you need the
\optval{nopostdot}{false} or \opt{postdot} package option. You
may also want to consider using the \opt{stylemods} option.

In order to prevent the \qt{marrow} entry from being automatically
being added to the glossary as a result of the cross-reference, you
can use \optval{autoseeindex}{false} to prevent the automatic
indexing triggered by the \gloskey{see} key (or the
\gloskey{seealso} key provided by \sty{glossaries-extra}).

\begin{codebox}
\cmd{usepackage}[\strong{\optval{autoseeindex}{false}},\opt{postdot},\opt{stylemods}]\marg{glossaries-extra}
\end{codebox}
The document build is the same, but now the \qt{marrow} and
\qt{zucchini} entries aren't present in the document.

Note that the \qt{fruit} entry is still included even though it
hasn't been used in the document. This is because it was explicitly
indexed with \gls{glssee} not via the \gloskey{see} key.

The entries that contains \gloskey{see}{[\gls{alsoname}\meta{xr-label}]}
can be converted to use the \gloskey{seealso} key:
\begin{codebox}
\gls{newglossaryentry}\marg{apple}\marg{\gloskeyval{name}{apple},\gloskeyval{description}{firm, round fruit},
\strong{\gloskeyval{seealso}{pear}}}
\codepar
\gls{newglossaryentry}\marg{marrow}\marg{\gloskeyval{name}{marrow},
 \gloskeyval{description}{long vegetable with thin green skin and white flesh},
 \strong{\gloskeyval{seealso}{courgette}}}
\end{codebox}
(The provided \gls{alsoname} definition may be removed.)

The original example redefines the cross-referencing format to use
\idx{smallcaps}:
\begin{codebox}
\cmd{renewcommand}\marg{\gls{glsseeitemformat}}[1]\marg{\gls{textsc}\marg{\gls{glsentryname}\marg{\#1}}}
\end{codebox}
This will still produce the desired effect with \sty{glossaries-extra} for 
this simple example but, as with \samplefile{AcrDesc},
this redefinition isn't necessary if you have at least
\sty{glossaries-extra} v1.42.

\bibglsnote
If you want to switch to \app{bib2gls} then you first need to switch
to \sty{glossaries-extra}, as described above, but you now need the
\opt{record} option but no longer need the
\optval{autoseeindex}{false} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods}]\marg{glossaries-extra}
\end{codebox}
Next the entry definitions need to be converted to the
\ext{bib} format required by \app{bib2gls}.
\begin{terminal}
convertgls2bib sample-crossref.tex entries.bib
\end{terminal}
If you have at least v2.0 then \app{convertgls2bib} will absorb the
cross-referencing information supplied by:
\begin{codebox}
\gls{glssee}\marg{fruit}\marg{pear,apple,banana}
\end{codebox}
into the \qt{fruit} definition:
\begin{codebox}
\atentry{entry}\marg{fruit,
  \gloskeyval{see}{pear,apple,banana},
  \gloskeyval{name}{fruit},
  \gloskeyval{description}{sweet, fleshy product of plant containing seed}
}
\end{codebox}
Now remove \gls{makeglossaries} and all the entry definition commands
(including \gls{glssee} from the \idxf{preamble/document}) and add:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}. The document build is now:
\begin{terminal}
pdflatex sample-crossref
bib2gls sample-crossref
pdflatex sample-crossref
\end{terminal}
The glossary now contains: apple, banana, courgette and pear. Note
that it doesn't contain fruit, zucchini or marrow.

Now change the selection criteria:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
 \strong{\resourceoptvalm{selection}{recorded and deps and see}}}
\end{codebox}
The glossary now includes fruit, zucchini and marrow.

The fruit and zucchini use the \gloskey{see} key which is a simple
redirection for the reader. There's no \idx{numberlist} for either
of these entries. Whereas marrow uses the \gloskey{seealso} key,
which is typically intended as a supplement to a \idx{numberlist}
but in this case there are no \locations\ as marrow hasn't been used
in the text.

With at least v2.0, there's an alternative:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
 \resourceoptvalm{selection}{recorded and deps and see\strong{ not also}}}
\end{codebox}
In this case, the glossary includes fruit and zucchini but not marrow.

\section{Custom Keys}
\label{sec:samplescustomkeys}

\filedef{sample-newkeys.tex}
This document illustrates how add custom keys
(using \gls{glsaddkey}). There are two custom keys \csoptfmt{ed}, where
the default value is the \gloskey{text} field with \qt{ed} appended,
and \csoptfmt{ing}, where the default value is the \gloskey{text}
field with \qt{ing} appended. Since the default value in both cases
references the \gloskey{text} field, the starred version
\starredcs{glsaddkey} is required to ensure that the 
default value is expanded on definition if no alternative has been provided.

The entries are then defined as follows:
\begin{codebox}
\gls{newglossaryentry}\marg{jump}\marg{\gloskeyval{name}{jump},\gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{run}\marg{\gloskeyval{name}{run},
 ed=\marg{ran},
 ing=\marg{running},
 \gloskeyval{description}{}}
\codepar
\gls{newglossaryentry}\marg{waddle}\marg{name={waddle},
 ed=\marg{waddled},
 ing=\marg{waddling},
 \gloskeyval{description}{}}
\end{codebox}

Each custom key is provided a set of commands analogous to
\gls{glsentrytext}, that allows the key value to be accessed, and
\gls{glstext} that allows the key value to be access with indexing
and hyperlinking (where applicable).

If you find yourself wanting to create a lot of custom keys that
produce minor variations of existing keys (such as different tenses)
you may find it simpler to just use \gls{glsdisp}. When editing the
document source, it's usually simpler to read:
\begin{codebox}
The dog \gls{glsdisp}\marg{jump}\marg{jumped} over the duck.
\end{codebox}
than
\begin{codebox}
The dog \cmd{glsed}\marg{jump} over the duck.
\end{codebox}

\bibglsnote
If you want to convert this document to use \app{bib2gls}, you first
need to switch to \sty{glossaries-extra}, but remember that you need
the \opt{record} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next convert the entry definitions to the \ext{bib} format
required by \app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{index-conversion} \switch{preamble-only} sample-newkeys.tex entries.bib
\end{terminal}
The \switch{index-conversion} switch requires at least v2.0 and
will convert entries without a description (or where the description
is simply \gls{nopostdesc} or \gls{glsxtrnopostpunc}) to
\atentry{index} instead of \atentry{entry}. This means that the
new \filefmt{entries.bib} file will contain:
\begin{codebox}
\atentry{index}\marg{jump,
  \gloskeyval{name}{jump}
}
\codepar
\atentry{index}\marg{run,
  ing = \marg{running},
  \gloskeyval{name}{run},
  ed = \marg{ran}
}
\codepar
\atentry{index}\marg{waddle,
  ing = \marg{waddling},
  \gloskeyval{name}{waddle},
  ed = \marg{waddled}
}
\end{codebox}
Now replace \gls{makeglossaries} with
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and delete the \gls{newglossaryentry} commands. Finally replace
\gls{printglossaries} with \gls{printunsrtglossaries}.

The document build is now:
\begin{terminal}
pdflatex sample-newkeys
bib2gls sample-newkeys
pdflatex sample-newkeys
\end{terminal}
Note that there's no need for the \opt{nonumberlist} package
option when you don't use \app{bib2gls}['s] \switch{group}
switch.
 
\filedef{sample-storage-abbr.tex}
This document illustrates how add custom
storage keys (using \gls{glsaddstoragekey}). The document build is:
\begin{terminal}
pdflatex sample-storage-abbr
makeglossaries sample-storage-abbr
pdflatex sample-storage-abbr
\end{terminal}

The custom storage key is called \csoptfmt{abbrtype} which defaults
to \qt{word} if not explicitly set. Its value can be accessed
with the provided custom command \csfmt{abbrtype}.
\begin{codebox}
\gls{glsaddstoragekey}\marg{abbrtype}\marg{word}\marg{\cmd{abbrtype}}
\end{codebox}
A custom \idx{acronymstyle} is then defined that checks the value of
this key and makes certain adjustments depending on whether or not
its value is the default \qt{word}.

This essentially forms a very similar function to the
\sty{glossaries-extra} package's \gloskey{category} key, which is
also defined as a storage key:
\begin{codebox*}
\gls{glsaddstoragekey}\marg{\gloskey{category}}\marg{\cat{general}}\marg{\gls{glscategory}}
\end{codebox*}

\glsxtrnote
This document is much simpler with the \sty{glossaries-extra}
package:
\begin{codebox}
\cmd{documentclass}\marg{article}
\cmd{usepackage}[\opt{postdot}]\marg{\strong{glossaries-extra}}
\gls{makeglossaries}
\gls{setabbreviationstyle}\oarg{\strong{\cat{acronym}}}\marg{\abbrstyle{short-long}}
\gls{newacronym}\marg{radar}\marg{radar}\marg{radio detecting and ranging}
\gls{newacronym}\marg{laser}\marg{laser}\marg{light amplification by stimulated
emission of radiation}
\gls{newacronym}\marg{scuba}\marg{scuba}\marg{self-contained underwater breathing
apparatus}
\codepar
\gls{newabbreviation}\marg{dsp}\marg{DSP}\marg{digital signal processing}
\gls{newabbreviation}\marg{atm}\marg{ATM}\marg{automated teller machine}
\codepar
\cbeg{document}
First use: \gls{gls}\marg{radar}, \gls{gls}\marg{laser}, \gls{gls}\marg{scuba}, \gls{gls}\marg{dsp},
\gls{gls}\marg{atm}.
\codepar
Next use: \gls{gls}\marg{radar}, \gls{gls}\marg{laser}, \gls{gls}\marg{scuba}, \gls{gls}\marg{dsp},
\gls{gls}\marg{atm}.
\codepar
\gls{printglossaries}
\cend{document}
\end{codebox}

\filedef{sample-storage-abbr-desc.tex}
An extension of the previous example
where the user needs to provide a~description.

\filedef{sample-chap-hyperfirst.tex}
This document illustrates how to add
a~custom key using \gls{glsaddstoragekey} and hook into the \gls{glslike}
and \gls{glstextlike} mechanism used to determine whether or not to
\idx+{hyperlink} an \idx{entry}.
The document build is:
\begin{terminal}
pdflatex sample-chap-hyperfirst
makeglossaries sample-chap-hyperfirst
pdflatex sample-chap-hyperfirst
\end{terminal}
This example creates a storage key called \qt{chapter} used to store the chapter 
number.
\begin{codebox}
\gls{glsaddstoragekey}\marg{\strong{chapter}}\marg{0}\marg{\strong{\cmd{glschapnum}}}
\end{codebox}
It's initialised to 0 and the \gls{glslinkpostsetkeys} hook is used
to check this value against the current chapter number. If the
values are the same then the \idx{hyperlink} is switched off, otherwise
the key value is updated unless the \idx{hyperlink} has been switched off
(through the optional argument of commands like \gls{gls} and \gls{glstext}).
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkpostsetkeys}}\marg{\comment{}
 \cmd{edef}\cmd{currentchap}\marg{\gls{arabic}\marg{chapter}}\comment{}
 \cmd{ifnum}\cmd{currentchap}=\strong{\cmd{glschapnum}}\marg{\gls{glslabel}}\cmd{relax}
  \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\comment{}
 \cmd{else}
  \gls{glsifhyperon}\marg{\gls{glsfieldxdef}\marg{\gls{glslabel}}\marg{\strong{chapter}}\marg{\cmd{currentchap}}}\marg{}\comment{}
 \cmd{fi}
}
\end{codebox}
Since this key isn't intended for use when the \idx{entry} is being
defined, it would be more appropriate to simply use an internal
field that doesn't have an associated key or helper command, but
\gls{glsfieldxdef} requires the existence of the field. The
\sty{glossaries-extra} package provides utility commands designed to
work on internal fields that don't have an associated key and may
not have had a value assigned.

\glsxtrnote
If you want to switch to \sty{glossaries-extra} you need to change
the package loading line:
\begin{codebox}
\cmd{usepackage}[\opt{postdot}]\marg{\strong{glossaries-extra}}
\end{codebox}
The custom storage key (provided with \gls{glsaddstoragekey}) can be
removed, and the \gls{glslinkpostsetkeys} hook can be changed to:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glslinkpostsetkeys}}\marg{\comment{}
 \cmd{edef}\cmd{currentchap}\marg{\gls{arabic}\marg{chapter}}\comment{}
 \strong{\gls{GlsXtrIfFieldEqNum}*}\marg{\strong{chapter}}\marg{\gls{glslabel}}\marg{\cmd{currentchap}}
 \marg{\comment{}
   \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\comment{}
 }\comment{}
 \marg{\comment{}
   \gls{glsifhyperon}\marg{\strong{\gls{xGlsXtrSetField}}\marg{\gls{glslabel}}\marg{\strong{chapter}}\marg{\cmd{currentchap}}}\marg{}\comment{}
 }\comment{}
}
\end{codebox}
The field name is still called \qt{chapter} but there's no
longer an associated key or command.

\section{Xindy (Option \glsfmttext{idx.opt.xdy})}
\label{sec:samplesxindy}

Most of the earlier \app{makeindex} sample files can be adapted to
use \app{xindy} instead by adding the \opt{xindy} package option.
Situations that you need to be careful about are when the sort value
(obtained from the \gloskey{name} if the \gloskey{sort} key is
omitted) contains commands (such as \gloskeyval{name}{\csfmt{pi}}) or is identical 
to another value (or is identical after \app{xindy} has stripped all
commands and braces). This section describes sample documents that
use features which are unavailable with \app{makeindex}.

\filedef{samplexdy.tex}
The document uses \idx{utf8} \idx{encoding} (with the
\sty{inputenc} package). This is information that needs to be passed
to \app{xindy}, so the \idx{encoding} is picked up by \app{makeglossaries}
from the \ext{aux} file.

This document has an exotic numbering system which requires the
package option \optval{esclocations}{true}. Before \sty{glossaries}
v4.50, this was the default setting, but the default is now
\optval{esclocations}{false}, so this package option now needs to be
set explicitly.

By default, this document will create a \app{xindy} style file called 
\filefmt{samplexdy.xdy}, but if you uncomment the lines
\begin{codebox*}
\gls{setStyleFile}\marg{samplexdy-mc}
\gls{noist}
\gls{GlsSetXdyLanguage}\marg{}
\end{codebox*}
it will set the style file to \filefmt{samplexdy-mc.xdy} instead.
This provides an additional \idx{lettergroup} for entries starting with
\qt{Mc} or \qt{Mac}. If you use \app{makeglossaries} or
\app{makeglossaries-lite}, you don't
need to supply any additional information. If you don't use
\app{makeglossaries}, you will need to specify the required
information. Note that if you set the style file to
\filefmt{samplexdy-mc.xdy} you must also specify \gls{noist},
otherwise the \sty{glossaries} package will overwrite
\filefmt{samplexdy-mc.xdy} and you will lose the \qt{Mc} 
\idx{lettergroup}.

To create the document do:
\begin{terminal}
pdflatex samplexdy
makeglossaries samplexdy
pdflatex samplexdy
\end{terminal}
If you don't have Perl installed then you can't use 
\app{makeglossaries}, but you also can't use \app{xindy}!
However, if for some reason you want to call 
\app{xindy} explicitly instead of using \app{makeglossaries} (or
\app{makeglossaries-lite}):
\begin{itemize}
\item if you are using the default style file \filefmt{samplexdy.xdy}, then
do (no line breaks):
\begin{terminal}
xindy \xdyopt{L} english \xdyopt{C} utf8 \xdyopt{I} xindy \xdyopt{M} samplexdy \xdyopt{t} samplexdy.glg \xdyopt{o} samplexdy.gls samplexdy.glo
\end{terminal}
\item if you are using \filefmt{samplexdy-mc.xdy}, then do
(no line breaks):
\begin{terminal}
xindy \xdyopt{I} xindy \xdyopt{M} samplexdy-mc \xdyopt{t} samplexdy.glg \xdyopt{o} samplexdy.gls samplexdy.glo
\end{terminal}
\end{itemize}

This document creates a new command to use with the
\glsopt{format} key in the optional argument of commands
like \gls{gls} to format the \location\ in the \idx{numberlist}.
The usual type of definition when a hyperlinked location is required
should use one of the \csmetafmt{hyper}{xx}{} commands listed in
\tableref{tab:hyperxx}:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{hyperbfit}}[1]\marg{\cmd{textit}\marg{\gls{hyperbf}\marg{\#1}}}
\end{codebox}
Unfortunately, this definition doesn't work for this particular
document and some adjustments are needed (see below). As a result of
the adjustments, this command doesn't actually get used by \TeX,
even though \code{hyperbfit} is used in the
\glsopt{format} key. It does, however, need to be
identified as an \idxc{xindyattr}{attribute} so that \app{xindy} can recognise it:
\begin{codebox*}
\gls{GlsAddXdyAttribute}\marg{hyperbfit}
\end{codebox*}
This will add information to the \ext{xdy} file when it's
created by \gls{makeglossaries}. If you prevent the creation of this
file with \gls{noist} then you will need to add the \idxc{xindyattr}{attribute} to
your custom \ext{xdy} file (see the provided
\filefmt{samplexdy-mc.xdy} file).

In order to illustrate unusual location formats, this sample
document provides a command called \csfmt{tallynum}\margm{n} that represents its
numerical argument with a die or dice where the dots add up to \meta{n}:
\begin{codebox}
\cmd{newrobustcmd}*\marg{\cmd{tallynum}}[1]\marg{\comment{}
 \cmd{ifnum}\cmd{number}\#1<7
  \$\cmd{csname} dice\cmd{romannumeral}\#1\cmd{endcsname}\$\comment{}
 \cmd{else}
  \$\cmd{dicevi}\$\comment{}
  \cmd{expandafter}\cmd{tallynum}\cmd{expandafter}\marg{\cmd{numexpr}\#1-6}\comment{}
 \cmd{fi}
}
\end{codebox}
This command needs to be robust to prevent it from being expanded
when it's written to any of the auxiliary files. The \gls{dicei},
\ldots, \csfmt{dicevi} commands are provided by the \sty{stix}
package, so that needs to be loaded.

An associated command \csfmt{tally}\margm{counter} is defined that
formats the value of the named \meta{counter} according to
\csfmt{tallynum}:
\begin{codebox}
\cmd{newcommand}*\marg{\cmd{tally}}[1]\marg{\cmd{tallynum}\marg{\gls{arabic}\marg{\#1}}}
\end{codebox}
(This shouldn't be robust as it needs the counter value to expand.)
The page numbers are altered to use this format (by redefining \gls{thepage}).

This custom location format also needs to be identified in the
\ext{xdy} file so that \app{xindy} can recognise it and
determine how to form ranges if required.
\begin{codebox*}
\gls{GlsAddXdyLocation}\marg{tally}\marg{\comment{tally location format}
 :sep "\cmd{string}\cmd{tallynum}\gls{space}\gls{glsopenbrace}"
 "arabic-numbers" 
 :sep "\gls{glsclosebrace}"
}
\end{codebox*}
Again this information is written to the \ext{xdy} file by
\gls{makeglossaries} so if you use \gls{noist} then you need to
manually add it to your custom \ext{xdy} file.

When \app{xindy} creates the associated \idxpl{indexingfile}, the
\locations\ will be written using: 
\begin{codebox*}
\gls{glsXcounterXformat}\margm{hyper-prefix}\margm{location}
\end{codebox*}
In this case:
\begin{codebox}
\glsXcounterXformat{page}{glsnumberformat}\marg{}\marg{\cmd{tallynum}\margm{number}}
\end{codebox}
or
\begin{codebox}
\glsXcounterXformat{page}{hyperbfit}\marg{}\marg{\cmd{tallynum}\margm{number}}
\end{codebox}
This means that although \gls{hyperbf} is designed to create
hyperlinked locations, the presence of \csfmt{tallynum} interferes with
it.
In order to make the \idxpl{hyperlink} work correctly, the definitions of
\glsXcounterXformat{page}{hyperbfit} need to be redefined in order to grab the
number part in order to work out the location's numeric value. If
the value of \csfmt{tally} is changed so that it expands differently
then these modifications won't work.

Remember that in both cases, the second argument \verb|#2| is in the
form \code{\csfmt{tally}\margm{n}}:
\begin{codebox}
\cmd{renewcommand}\marg{\glsXcounterXformat{page}{glsnumberformat}}[2]\marg{\comment{}
 \cmd{linkpagenumber}\#2\comment{}
}
\cmd{renewcommand}\marg{\glsXcounterXformat{page}{hyperbfit}}[2]\marg{\comment{}
 \cmd{textbf}\marg{\cmd{em}\cmd{linkpagenumber}\#2}\comment{}
}
\end{codebox}
These need a command that can grab the actual number and correctly encapsulate
it:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{linkpagenumber}}[2]\marg{\gls{hyperlink}\marg{page.\#2}\marg{\#1\marg{\#2}}}
\end{codebox}

If you want to try out the \filefmt{samplexdy-mc.xdy} file, the
entries starting with \qt{Mac} or \qt{Mc} will be placed in their
own \qt{Mc} \idx{lettergroup}. Ideally it should be possible to do
this simply with \gls{GlsAddLetterGroup} (and not require a custom
\ext{xdy} file) but unfortunately the \qt{M} \idx{lettergroup} will
have already been defined and take precedence over \qt{Mc}, which is
why a custom file is required and the normal language module must be
suppressed:
\begin{codebox}
\gls{setStyleFile}\marg{samplexdy-mc}
\gls{noist}
\gls{GlsSetXdyLanguage}\marg{}
\end{codebox}

This \qt{Mc} \idx{group} is suitable for names like
\qt{Maclaurin} but not for \qt{Mach}. To prevent this, the
\gloskey{sort} key for that value is set to lower case:
\begin{codebox}
\gls{newglossaryentry}\marg{mach}\marg{\gloskeyval{name}{Mach, Ernst},
\gloskeyval{first}{Ernst Mach},\gloskeyval{text}{Mach},
\gloskeyval{sort}{mach, Ernst},
\gloskeyval{description}{Czech/Austrian physicist and philosopher}}
\end{codebox}

\bibglsnote
If you want to convert this document so that it uses \app{bib2gls},
you first need to switch to \sty{glossaries-extra} and use the
\opt{record} package option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot}]\marg{\strong{glossaries-extra}}
\end{codebox}
The \app{xindy}-only commands can now all be removed
(\idxc{xindyattr}{attribute} \gls{GlsAddXdyAttribute}, location \gls{GlsAddXdyLocation},
language \gls{GlsSetXdyLanguage}, \idxpl{locationencap} 
\gls{glsXcounterXformat} and the custom helper \csfmt{linkpagenumber}).
Also \gls{noist} and \gls{setStyleFile} aren't relevant with
\app{bib2gls} and so should be removed.

The definitions of \csfmt{hyperbfit} should be retained (as well as
\csfmt{tallynum}, \csfmt{tally} and the redefinition of \gls{thepage}).

The entries all need to be converted to the \ext{bib} format
required by \app{bib2gls}.
\begin{terminal}
convertgls2bib \switch{preamble-only} samplexdy.tex entries.bib
\end{terminal}
Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and remove all the entry definitions from the \idxf{preamble/document}. Use the
search and replace function on your text editor to replace all
instances of \gls{glsentryfirst} with \gls{glsfmtfirst}, and all
instances of \gls{glsentryname} with \gls{glsfmtname}.

Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.
The document build is now:
\begin{terminal}
pdflatex samplexdy
bib2gls \switch{group} samplexdy
pdflatex samplexdy
\end{terminal}

This results in a slightly different ordering from the original
document (without the \qt{Mc} \idx{lettergroup}). In the original
example, \qt{Mach number} was listed before \qt{Mach, Ernest}. The
modified document now has \qt{Mach, Ernest} before \qt{Mach number}.
This difference is due to \app{bib2gls}['s] default
\resourceoptval{break-at}{word} setting, which marks word boundaries
with the \idx{pipe} character, so the sort values for
\app{bib2gls} are \code{Mach|Earnest|} and \code{Mach|number|}.
See the \app{bib2gls} manual for further details of this option, and
also see the examples chapter of that manual for alternative
approaches when creating entries that contain people's names.

If you want the \qt{Mc} \idx{lettergroup}, it can be obtained by
providing a custom sort rule:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
   \resourceoptval{sort}{\strong{custom}},
   \strong{\resourceoptvalm{sort-rule}}{\gls{glsxtrGeneralInitRules}
   <\gls{glsxtrGeneralLatinAtoGrules}
   <h,H<i,I<j,J<k,K<l,L\strong{<Mc=Mac}<m,M
   <\gls{glsxtrGeneralLatinNtoZrules}
   }
}
\end{codebox}
Unfortunately, as with \app{xindy}, this puts \qt{Mach} into the
\qt{Mc} \idx{lettergroup}. (See the \sty{glossaries-extra} manual for
details about the sort rule commands.)

One way to get around this problem is to define a custom command to
help identify genuine \qt{Mc}/\qt{Mac} prefixes with names that
happen to start with \qt{Mac}. For example:
\begin{codebox}
\atentry{entry}\marg{mcadam,
  \gloskeyval{name}{\strong{\cmd{Mac}\marg{Mc}}Adam, John Loudon},
  \gloskeyval{description}{Scottish engineer},
  \gloskeyval{text}{McAdam},
  \gloskeyval{first}{John Loudon McAdam}
}
\codepar
\atentry{entry}\marg{maclaurin,
  \gloskeyval{name}{\strong{\cmd{Mac}\marg{Mac}}laurin, Colin},
  \gloskeyval{description}{Scottish mathematician best known for the
\gls{gls}\marg{maclaurinseries}},
  \gloskeyval{text}{Maclaurin},
  \gloskeyval{first}{Colin Maclaurin}
}
\end{codebox}
but not for \qt{Mach}:
\begin{codebox}
\atentry{entry}\marg{mach,
  \gloskeyval{name}{Mach, Ernst},
  \gloskeyval{description}{Czech/Austrian physicist and philosopher},
  \gloskeyval{text}{Mach},
  \gloskeyval{first}{Ernst Mach}
}
\end{codebox}
With \LaTeX, this command should simply do its argument:
\begin{codebox}
\cmd{newcommand}\marg{\cmd{Mac}}[1]\marg{\#1}
\end{codebox}
However, when \app{bib2gls} works out the \gloskey{sort} value, it
needs to be defined with something unique that won't happen to occur
at the start of another term. For example:
\begin{codebox}
\cmd{providecommand}\marg{\cmd{Mac}}[1]\marg{MC}
\end{codebox}
(Remember that \resourceoptval{break-at}{word} will strip spaces
and punctuation so don't include them unless you switch to
\resourceoptval{break-at}{none}.)

So add the first definition of \csfmt{Mac} to the \ext{tex} file and modify
\filefmt{entries.bib} so that it includes the second definition:
\begin{codebox}
\atentry{preamble}\marg{"\gls{providecommand}\marg{\cmd{Mac}}[1]\marg{MC}"}
\end{codebox}
Then modify the \qt{Mc}/\qt{Mac} entries as appropriate (see the
above \qt{McAdam} and \qt{Maclaurin} examples).

The custom sort rule needs to be modified:
\begin{codebox*}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},
   \strong{\resourceoptval{write-preamble}{false},}
   \resourceoptval{sort}{custom},
   \resourceoptval{sort-rule}{\gls{glsxtrGeneralInitRules}
   <\gls{glsxtrGeneralLatinAtoGrules}
   <h,H<i,I<j,J<k,K<l,L\strong{<MC}<m,M
   <\gls{glsxtrGeneralLatinNtoZrules}
   }
}
\end{codebox*}
This will create a \qt{Mc} \idx{lettergroup} that only includes the names
that start with the custom \csfmt{Mac} command.

Other alternatives include moving \atentry{preamble} into a separate
\ext{bib} file, so that you can choose whether or not to
include it. See the \qt{Examples} chapter of the \app{bib2gls} user
manual for further examples.

\filedef{samplexdy2.tex}
This document illustrates how to use the \sty{glossaries} package where the 
\location\ numbers don't follow a standard syntax. This example won't work
with \app{makeindex}, which only accepts a limited set of location syntax. 
To create the document do:
\begin{terminal}
pdflatex samplexdy2
makeglossaries samplexdy2
pdflatex samplexdy2
\end{terminal}
The explicit \app{xindy} call is:
\begin{terminal}
xindy -L english -C utf8 -I xindy -M samplexdy2 -t samplexdy2.glg -o samplexdy2.gls samplexdy2.glo
\end{terminal}
This example uses the \ctr{section} counter with \app{xindy}:
\begin{codebox}
\cmd{usepackage}[\opt{xindy},\optval{counter}{section}]\marg{glossaries}
\end{codebox}
The document employs an eccentric section numbering system for
illustrative purposes. The section numbers are prefixed by the
chapter number in square brackets:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{section}}\marg{[\thecounter{chapter}]\gls{arabic}\marg{section}}
\end{codebox}
Parts use Roman numerals:
\begin{codebox}
\cmd{renewcommand}*\marg{\thecounter{part}}\marg{\gls{Roman}\marg{part}}
\end{codebox}
The section \idx{hyperlink} name includes the part:
\begin{codebox}
\cmd{renewcommand}*\marg{\theHcounter{section}}\marg{\thecounter{part}.\thecounter{section}}
\end{codebox}
This custom numbering scheme needs to be identified in the
\ext{xdy} file:
\begin{codebox}
\gls{GlsAddXdyLocation}\oarg{"roman-numbers-uppercase"}\marg{section}\marg{:sep "["
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
If the part is 0 then \thecounter{part} will be \idxc{emptylocation}{empty} 
(there isn't a zero Roman numeral). An extra case is needed to catch this:
\begin{codebox}
\gls{GlsAddXdyLocation}\marg{zero.section}\marg{:sep "["
  "arabic-numbers" :sep "]" "arabic-numbers"
}
\end{codebox}
Note that this will stop \app{xindy} giving a warning, but the \location\
hyperlinks will be invalid if no \gls{part} is used.

\bibglsnote
If you want to switch to \app{bib2gls}, you first need to switch to
\sty{glossaries-extra} but remember to use \opt{record} instead
of \opt{xindy}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\optval{counter}{section}]\marg{\strong{glossaries-extra}}
\end{codebox}
Next remove the \gls{GlsAddXdyLocation} commands and convert the
entry definitions to the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} samplexdy2.tex entries.bib
\end{terminal}
Now replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and remove the \gls{newglossaryentry} commands.
Finally, replace \gls{printglossaries} with \gls{printunsrtglossaries}.

The document build is:
\begin{terminal}
pdflatex samplexdy2
bib2gls samplexdy2
pdflatex samplexdy2
\end{terminal}

With unusual numbering systems, it's sometimes better to use \optval{record}{nameref}:
\begin{codebox}
\cmd{usepackage}[\strong{\optval{record}{nameref}},\optval{counter}{section}]\marg{\strong{glossaries-extra}}
\end{codebox}
In this case, the locations will be the actual section headings,
rather than the section number. In order to make the number appear
instead you need to define:
\begin{codebox*}
\cmd{newcommand}*\marg{\glsxtrcounterlocfmt{section}}[2]\marg{\#1}
\end{codebox*}
(Make sure you have at least v1.42 of \sty{glossaries-extra}.) See
also the earlier \samplefile{Sec}. 

\filedef{samplexdy3.tex}
This document is very similar to 
\samplefile{xdy} but uses the command \gls{Numberstring} from the
\sty{fmtcount} package to format the page numbers instead of the
\csfmt{tally} command from the earlier example.

\filedef{sampleutf8.tex}
This is another example that uses \app{xindy}. Unlike \app{makeindex},
\app{xindy} recognises \idxpl{nonlatinchar} (provided the correct 
\idx{encoding} is passed to \app{xindy} via the \xdyopt{C} switch). This
document uses \idx{utf8} \idx{encoding}. To create the document do:
\begin{terminal}
pdflatex sampleutf8
makeglossaries sampleutf8
pdflatex sampleutf8
\end{terminal}
The explicit \app{xindy} call is
(no line breaks):
\begin{terminal}
xindy -L english -C utf8 -I xindy -M sampleutf8 -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
\end{terminal}

If you remove the \opt{xindy} option from \file{sampleutf8.tex} 
and do:
\begin{terminal}
pdflatex sampleutf8
makeglossaries sampleutf8
pdflatex sampleutf8
\end{terminal}
or
\begin{terminal}
pdflatex sampleutf8
makeglossaries-lite sampleutf8
pdflatex sampleutf8
\end{terminal}
you will see that the entries that start with an \idx{exlatinchar}
now appear in the symbols \idx{group}, and the word \qt{man\oe uvre} is now 
after \qt{manor} instead of before it. If you want to explicitly
call \app{makeindex} (no line breaks):
\begin{terminal}
makeindex -s sampleutf8.ist -t sampleutf8.glg -o sampleutf8.gls sampleutf8.glo
\end{terminal}

\bibglsnote
If you want to switch to \app{bib2gls}, you first need to switch to
\sty{glossaries-extra} but replace \opt{xindy} with
\opt{record}:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{postdot},\opt{stylemods},\optval{style}{\glostyle{listgroup}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Note that you don't need the \opt{nonumberlist} option with
\app{bib2gls}. You can instruct \app{bib2gls} to simply not save the
\idxpl{numberlist}, but in this case there won't be any locations as
there's no actual \idx{indexing}.

The entries need to be converted to the \ext{bib} format
required by \app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} \switch{texenc} UTF-8 \switch{bibenc} UTF-8 sampleutf8.tex entries.bib
\end{terminal}
Note the first line of the \filefmt{entries.bib} file:
\begin{codebox}
\comment{Encoding: UTF-8}
\end{codebox}
This is the \idx{encoding} of the \ext{bib} file. It doesn't have to
match the \idx{encoding} of the \ext{tex} file, but it's generally
better to be consistent. When \app{bib2gls} parses this file, it
will look for this \idx{encoding} line.
(If the \switch{texenc} and \switch{bibenc} switches aren't
used, \app{convertgls2bib} will assume your Java default
\idx{encoding}. See the \app{bib2gls} manual for further details.)

Next replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{\strong{all}}}
\end{codebox}
and remove all the \gls{newglossaryentry} commands.

Iterative commands like \gls{glsaddall} don't work with
\app{bib2gls}.  Instead, you can select all entries using the
\resourceoptval{selection}{all} option.
This is actually better than \gls{glsaddall}, which enforces
the selection of all entries by \idx{indexing} each entry. As a result,
with \app{makeindex} and \app{xindy} (and \option{noidx}), every entry will
have the same location (which is the location of the \gls{glsaddall}
command, in this case page~1). With \resourceoptval{selection}{all},
\app{bib2gls} will automatically selection all entries even if they
don't have any records (\idx{indexing} information) so in this case there
are no \idxpl{numberlist}.

Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}. The build process is now:
\begin{terminal}
pdflatex sampleutf8
bib2gls \switch{group} sampleutf8
pdflatex sampleutf8
\end{terminal}
\app{bib2gls} picks up the \idx{encoding} of the \ext{tex} file from
the \ext{aux} file:
\begin{codebox}
\gls{glsxtr@texencoding}\marg{utf8}
\end{codebox}
If you experience any \idx{encoding} issues, check the \ext{aux} file for
this command and check the \ext{bib} file for the \idx{encoding}
comment line. Also check \app{bib2gls}['s] \ext{glg} transcript file
for \idx{encoding} messages, which should look like:
\begin{transcript}
TeX character encoding: UTF-8
\end{transcript}

The document language, if it has been set, is also added to the \ext{aux} file when
the \opt{record} option is used. In this case, no language
package has been used, so \app{bib2gls} will fallback on the system's default
locale. If no sort method is set, the entries will be sorted
according to the document language, if set, or the default locale.
You can specify a specific locale using the \resourceopt{sort} key
with a locale tag identifier. For example:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{\strong{all}},\strong{\resourceoptval{sort}{de-CH-1996}}}
\end{codebox}
(Swiss German new orthography) or:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\resourceoptval{selection}{\strong{all}},\strong{\resourceoptval{sort}{is}}}
\end{codebox}
(Icelandic).

\section{No Indexing Application (Option \glsfmttext{idx.opt.noidx})}
\label{sec:samplesnoidx}

\filedef{sample-noidxapp.tex}
This document illustrates how to use the
\sty{glossaries} package without an external \idx{indexingapp} (\option{noidx}).
To create the complete document, you need to do:
\begin{terminal}
pdflatex sample-noidxapp
pdflatex sample-noidxapp
\end{terminal}
With old \LaTeX\ kernels and old versions of \sty{mfirstuc}, it was necessary to
group the accent command that occurs at the start
of the \gloskey{name}:
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{\comment{}
  name=\marg{\strong{\marg{\gls{cs.apos}e}}lite},\comment{\sty{mfirstuc} v2.07}
  description=\marg{select group of people}
}
\end{codebox}
This used to be necessary to allow the term to work with \gls{Gls}. With a new
kernel and latest versions of \sty{glossaries} and \sty{mfirstuc}, this should
no longer be necessary.
\begin{codebox}
\gls{newglossaryentry}\marg{elite}\marg{\comment{}
  name=\marg{\strong{\gls{cs.apos}e}lite},\comment{\sty{mfirstuc} v2.08}
  description=\marg{select group of people}
}
\end{codebox}

Notice also how the \idxpl{numberlist} can't be compacted into
ranges. For example, the list \qt{1, 2, 3} would be converted to
\qt{1--3} with a proper indexing application (\optionsor{mkidx,xdy} or, with
\sty{glossaries-extra}, \option{b2g}).

The larger the list of entries, the longer the document build time.
This method is very inefficient for large glossaries. See
\galleryref{glossaries-performance.shtml}{Gallery: glossaries performance} for a comparison.

\filedef{sample-noidxapp-utf8.tex}
As the previous example, except that it uses the \sty{inputenc} package.
In this case, the \gloskey{sort} key is used for the entries with 
\idx{utf8} characters in the names.
To create the complete document, you need to do:
\begin{terminal}
pdflatex sample-noidxapp-utf8
pdflatex sample-noidxapp-utf8
\end{terminal}
This method is unsuitable for sorting languages with
\idxpl{exlatinalph} or \idxpl{nonlatinalph}. Use \optionsor{xdy,b2g} instead.

\section{Other}
\label{sec:samplesother}

\filedef{sample4col.tex}
This document illustrates a four column \idx{glossary} where the 
entries have a symbol in addition to the name and description. 
To create the complete document, you need to do:
\begin{terminal}
pdflatex sample4col
makeglossaries sample4col
pdflatex sample4col
\end{terminal}
or
\begin{terminal}
pdflatex sample4col
makeglossaries-lite sample4col
pdflatex sample4col
\end{terminal}
The vertical gap between entries is the gap created at the start of
each \idx{lettergroup}.  This can be suppressed using the
\opt{nogroupskip} package option. (If you switch to \app{bib2gls},
simply omit the \switch{group} command line option.)

This example uses the \glostyle{long4colheaderborder}. This style
doesn't allow multi-line descriptions. You may prefer to use
\glostyle{altlong4colheaderborder} with long descriptions. However,
in either case a style that uses \sty{booktabs} is preferable. For
example, \glostyle{long4col-booktabs} or
\glostyle{altlongragged4col-booktabs}. Note that this requires
\sty{glossary-longbooktabs}, which needs to be explicitly loaded.
The style can only be set once this package has been loaded:
\begin{codebox}
\cmd{usepackage}\marg{glossaries}
\cmd{usepackage}\marg{glossary-longbooktabs}
\gls{setglossarystyle}\marg{\glostyle{altlongragged4col-booktabs}}
\end{codebox}

\glsxtrnote
The \sty{glossaries-extra} package provides a more compact way of
doing this with the \opt{stylemods} option:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{altlongragged4col-booktabs}},\optval{stylemods}{\strong{longbooktabs}}]
\marg{\strong{glossaries-extra}}
\end{codebox}
The \sty{glossaries-extra} package provides additional styles,
including more \qt{long} styles with the \sty{glossary-longextra}
package. For example, the \glostyle{long-name-desc-sym-loc}
style:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\strong{\glostyle{long-name-desc-sym-loc}}},\optval{stylemods}{\strong{longextra}}]
\marg{glossaries-extra}
\end{codebox}
If you use the \opt{stylemods} option with an argument, you may
prefer to use it with \opt{nostyles} to prevent unwanted styles
from being automatically loaded. For example:
\begin{codebox}
\cmd{usepackage}[\optval{style}{\glostyle{long-name-desc-sym-loc}},\strong{\opt{nostyles},}\optval{stylemods}{longextra}]
\marg{glossaries-extra}
\end{codebox}
See also the
\galleryref{glossaries-styles/}{gallery of predefined styles}.

\filedef{sample-numberlist.tex}
This document illustrates how to reference the
\idx{numberlist} in the document text. This requires an additional
\LaTeX\ run:
\begin{terminal}
pdflatex sample-numberlist
makeglossaries sample-numberlist
pdflatex sample-numberlist
pdflatex sample-numberlist
\end{terminal}
This uses the \opt{savenumberlist} package option, which enables 
\gls{glsentrynumberlist} and \gls{glsdisplaynumberlist}
(with limitations).  The location counter is set to
\ctr{chapter}, so the \idx{numberlist} refers to the chapter
numbers.
\begin{codebox}
\cmd{usepackage}[\opt{savenumberlist},\optval{counter}{\ctr{chapter}}]\marg{glossaries}
\end{codebox}
The \idx{numberlist} can't be obtained until \app{makeindex} (or
\app{xindy}) has created the \idx{indexingfile}. The \idx{numberlist} is
picked up when this file is input by \gls{printglossary} and is then
saved in the \ext{aux} file so that it's available on the next
\LaTeX\ run.

This document contains both commands:
\begin{codebox*}
This is a \gls{gls}\marg{sample} document. \gls{Glspl}\marg{sample}
are discussed in chapters~\strong{\gls{glsdisplaynumberlist}}\marg{sample}
(or \strong{\gls{glsentrynumberlist}}\marg{sample}).
\end{codebox*}
Without \sty{hyperref}, the first list shows as \qt{1--3, 5 \& 6}
and the second list shows as \qt{1--3, 5, 6}.

Note that you can't use \gls{glsdisplaynumberlist} with
\sty{hyperref} and \optionsor{mkidx,xdy}. If you do, you will get the warning:
\begin{transcript}
Package glossaries Warning: \gls{glsdisplaynumberlist} doesn't work with hyperref.
Using \gls{glsentrynumberlist} instead
\end{transcript}
Now both lists show as \qt{1--3, 5, 6}.

If you switch to \option{noidx} (replace \gls{makeglossaries} with
\gls{makenoidxglossaries} and replace \gls{printglossaries} with
\gls{printnoidxglossaries}), then the document build is simply:
\begin{terminal}
pdflatex sample-numberlist
pdflatex sample-numberlist
\end{terminal}
Now \gls{glsdisplaynumberlist} works with \sty{hyperref},
however there are no ranges, so the first list shows as \qt{1,
2, 3, 5, \& 6} and the second list shows as \qt{1, 2, 3, 4, 5, 6}.

\bibglsnote
If you want to switch to \app{bib2gls}, you first need to switch to
\sty{glossaries-extra} (at least v1.42) but remember to include the \opt{record}
option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\optval{counter}{\ctr{chapter}}]\marg{\strong{glossaries-extra}}
\end{codebox}
Note that the \opt{savenumberlist} option is no longer required.
Next convert the entry to the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib sample-numberlist.tex entries.bib
\end{terminal}
Replace \gls{makeglossaries} with:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
and remove the \gls{newglossaryentry} command from the 
\idxf{preamble/document}. Finally, replace \gls{printglossaries} with
\gls{printunsrtglossaries}. The build process is now:
\begin{terminal}
pdflatex sample-numberlist
bib2gls sample-numberlist
pdflatex sample-numberlist
\end{terminal}
Now both ranges and \idxpl{hyperlink} work. The first list shows \qt{1--3,
5, \& 6} and the second list shows \qt{1--3, 5, 6}. You can also
use:
\begin{codebox}
\gls{glsxtrfieldformatlist}\marg{sample}\marg{loclist}
\end{codebox}
which will show the complete list without ranges \qt{1, 2, 3, 5 \&
6}.

This method works much better than using the \opt{savenumberlist}
option because \app{bib2gls} saves the formatted \idx{numberlist} in the
\gloskey{location} field (which is provided by
\sty{glossaries-extra} for the benefit of \app{bib2gls}) and the
unformatted \idx{numberlist} in the \glosfield{loclist} internal field (which is
also used by \option{noidx}).

With \options{mkidx,xdy}, both \app{makeindex} and \app{xindy} simply create a
file containing the commands to typeset the glossary, which is input
by \gls{printglossary}. This means that it's quite hard to gather
information obtained by the \idx{indexingapp}.

\app{bib2gls}, on the other hand, doesn't write a file containing
the \idx{glossary}. It writes a file containing the entry definitions and
uses internal fields to save the \idx{indexing} information. The \idx{glossary} is
then displayed with \gls{printunsrtglossary}, which simply iterates
over all defined entries and fetches the required information from
those internal fields.

The \gls{glsdisplaynumberlist} and \gls{glsentrynumberlist} commands
are redefined by \sty{glossaries-extra-bib2gls} to simply access the
\gloskey{location} field.
However, if you want a complete list without ranges you can use:
\begin{codebox}
\gls{glsxtrfieldformatlist}\marg{sample}\marg{loclist}
\end{codebox}
In this example, this produces \qt{1, 2, 3, 5 \& 6}. 

Note the difference if you use the \optval{record}{nameref} package
option instead of just \opt{record}.

\filedef{sample-nomathhyper.tex}
This document illustrates how to selectively
enable and disable entry \idxpl{hyperlink} in \gls{glsentryfmt}. The
document build is:
\begin{terminal}
pdflatex sample-nomathhyper
makeglossaries sample-nomathhyper
pdflatex sample-nomathhyper
\end{terminal}
This disables the \idxpl{hyperlink} for the \glostype{main} glossary with:
\begin{codebox}
\gls{GlsDeclareNoHyperList}\marg{\glostype{main}}
\end{codebox}
and then redefines \gls{glsentryfmt} so that it adds a \idx{hyperlink} if
not in maths mode and the \idxpl{hyperlink} haven't been forced off (with
the \glsoptval{hyper}{false} key).

\glsxtrnote
If you want to switch to \sty{glossaries-extra}, then you can
instead use the hook that comes before the keys are set. The
\idx{preamble/document} is much simpler:
\begin{codebox}
\cmd{usepackage}\marg{\strong{glossaries-extra}}
\codepar
\gls{makeglossaries}
\codepar
\cmd{renewcommand}\marg{\strong{\gls{glslinkpresetkeys}}}\marg{\comment{}
 \cmd{ifmmode} \cmd{setkeys}\marg{glslink}\marg{\glsoptval{hyper}{false}}\cmd{fi}
}
\codepar
\comment{entry definition}
\end{codebox}

\filedef{sample-entryfmt.tex}
This document illustrates how to change the
way an entry is displayed in the text. (This is just a test
document. For a real document, I recommend you use the \sty{siunitx}
package to typeset units.) The document build is:
\begin{terminal}
pdflatex sample-entryfmt
makeglossaries sample-entryfmt
pdflatex sample-entryfmt
\end{terminal}
This redefines \gls{glsentryfmt} to add the symbol on
\idx{firstuse}:
\begin{codebox}
\cmd{renewcommand}*\marg{\gls{glsentryfmt}}\marg{\comment{}
  \gls{glsgenentryfmt}
  \gls{ifglsused}\marg{\gls{glslabel}}\marg{}\marg{\gls{space} (\strong{\gls{glsentrysymbol}}\marg{\gls{glslabel}})}\comment{}
}
\end{codebox}
Note the use of \gls{glsentrysymbol} \emph{not} \gls{glssymbol} (which
would result in nested \idx{linktext}).

\glsxtrnote
If you want to switch to the \sty{glossaries-extra} package, you can
make use of the category post-link hook instead:
\begin{codebox}
\cmd{usepackage}[\opt{stylemods},\optval{style}{tree}]\marg{\strong{glossaries-extra}}
\codepar
\gls{makeglossaries}
\codepar
\gls{glsdefpostlink}\marg{\strong{unit}}\marg{\gls{glsxtrpostlinkAddSymbolOnFirstUse}}
\codepar
\gls{newglossaryentry}\marg{distance}\marg{
\gloskeyval{category}{\strong{unit}},
\gloskeyval{name}{distance},
\gloskeyval{description}{The length between two points},
\gloskeyval{symbol}{km}}
\end{codebox}
Note that in this case the symbol is now outside of the \idx{hyperlink}.

\filedef{sample-prefix.tex}
This document illustrates the use of the
\sty{glossaries-prefix} package. An additional run is required to
ensure the \idx{tableofcontents} is up-to-date:
\begin{terminal}
pdflatex sample-prefix
makeglossaries sample-prefix
pdflatex sample-prefix
pdflatex sample-prefix
\end{terminal}
Remember that the default separator between the prefix and \gls{gls}
(or one of its variants) is empty, so if a space is required it must
be inserted at the end of the prefix. However, the \sty{xkeyval}
package (which is used to parse the \keyval\ lists) trims leading 
and trailing space from the values, so an
ordinary space character will be lost.
\begin{codebox*}
\gls{newglossaryentry}\marg{sample}\marg{\gloskeyval{name}{sample},
  \gloskeyval{description}{an example},
  \gloskeyval{prefix}{a\strong{\sym{nbsp}}},
  \gloskeyval{prefixplural}{the\strong{\gls{space}}}%
}
\codepar
\gls{newglossaryentry}\marg{oeil}\marg{\gloskeyval{name}{oeil},
  \gloskeyval{plural}{yeux},
  \gloskeyval{description}{eye},
  \gloskeyval{prefix}{l'},
  \gloskeyval{prefixplural}{les\strong{\gls{space}}}}
\end{codebox*}

\glsxtrnote
If you want to convert this example to use \sty{glossaries-extra},
then (as from v1.42) you can use the \opt{prefix} option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{prefix}},\opt{postdot},\opt{acronym}]\marg{\strong{glossaries-extra}}
\end{codebox}
(Alternatively load \sty{glossaries-prefix} after
\sty{glossaries-extra}.) The rest of the document is the same as for
the base \sty{glossaries} package, unless you want to switch to
using \app{bib2gls}.

\bibglsnote
If you want to switch to \app{bib2gls}, first switch to
\sty{glossaries-extra} (as above) but make sure you include the
\opt{record} package option:
\begin{codebox}
\cmd{usepackage}[\strong{\opt{record}},\opt{prefix},\opt{postdot},\opt{acronym}]\marg{glossaries-extra}
\end{codebox}
Next convert the entries into the \ext{bib} format required by
\app{bib2gls}:
\begin{terminal}
convertgls2bib \switch{preamble-only} sample-prefix.tex entries.bib
\end{terminal}
Replace \gls{makeglossaries} with
\begin{codebox}
\gls{setabbreviationstyle}\oarg{\cat{acronym}}\marg{\abbrstyle{long-short}}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries}}
\end{codebox}
remove the entry definitions from the \idxf{preamble/document}, and replace
\begin{codebox}
\gls{printglossary}\oarg{\printglossoptval{style}{plist}}
\gls{printacronyms}
\end{codebox}
with
\begin{codebox}
\gls{printunsrtglossary}\oarg{\printglossoptval{style}{plist}}
\gls{printunsrtacronyms}
\end{codebox}
The document build is now:
\begin{terminal}
pdflatex sample-prefix
bib2gls sample-prefix
pdflatex sample-prefix
\end{terminal}

With \app{bib2gls} v2.0+, you don't need to manually insert the spaces at
the end of the prefixes. Instead you can instruct \app{bib2gls} to
insert them. To try this out, remove the trailing \gls{space} and 
\idx{nbsp} from the \filefmt{entries.bib} file:
\begin{codebox}
\atentry{entry}\marg{sample,
  \gloskeyval{prefix}{a},
  \gloskeyval{name}{sample},
  \gloskeyval{description}{an example},
  \gloskeyval{prefixplural}{the}
}
\codepar
\atentry{entry}\marg{oeil,
  \gloskeyval{plural}{yeux},
  \gloskeyval{prefix}{l'},
  \gloskeyval{name}{oeil},
  \gloskeyval{description}{eye},
  \gloskeyval{prefixplural}{les}
}
\codepar
\atentry{acronym}\marg{svm,
  \gloskeyval{prefixfirst}{a},
  \gloskeyval{prefix}{an},
  \gloskeyval{short}{SVM},
  \gloskeyval{long}{support vector machine}
}
\end{codebox}
Now add the \resourceoptvalm{append-prefix-field}{space or nbsp}
resource option:
\begin{codebox}
\gls{GlsXtrLoadResources}\oarg{\resourceoptval{src}{entries},\strong{\resourceoptvalm{append-prefix-field}{space or nbsp}}}
\end{codebox}
See the \app{bib2gls} manual for further details.

\filedef{sampleaccsupp.tex}
This document uses the \sty{glossaries-accsupp} package 
(see \sectionref{sec:accsupp}). That package automatically loads
\sty{glossaries} and passes all options to the base package. So
you can load both packages at once with just:
\begin{codebox}
\cmd{usepackage}[\opt{acronym}]\marg{glossaries-accsupp}
\end{codebox}
This provides additional keys that aren't available with just the
base package, which may be used to provide replacement text. The
replacement text is inserted using \sty{accsupp}['s]
\gls{BeginAccSupp} and \gls{EndAccSupp} commands. See the
\sty{accsupp} package for further details of those commands.

Note that this example document is provided to demonstrate
\sty{glossaries-accsupp} as succinctly as possible. The resulting
document isn't fully accessible as it's not tagged. See the
\sty{accessibility} and \sty{tagpdf} packages for further
information about tagging documents.

It's not essential to use \sty{glossaries-accsupp}. 
You can simply insert the replacement
text directly into the field values. For example:
\begin{codebox*}
\gls{newglossaryentry}\marg{Drive}\marg{
 \gloskeyval{name}{\gls{BeginAccSupp}\marg{Actual=Drive}Dr.\gls{EndAccSupp}\marg{}},
 \gloskeyval{description}{Drive}
}
\gls{newglossaryentry}\marg{image}\marg{\gloskeyval{name}{sample image},
 \gloskeyval{description}{an example image},
 \gloskeyval{user1}{\cmd{protect}\gls{BeginAccSupp}\marg{Alt=\marg{a boilerplate image used in
  examples}}\cmd{protect}\gls{includegraphics}
  \oarg{height=20pt}\marg{example-image}\cmd{protect}\gls{EndAccSupp}\marg{}}
}
\end{codebox*}
However, this can cause interference (especially with
\casechanging). With \sty{glossaries-accsupp} it's possible to
obtain the field values without the accessibility information if
required. (If in the future \gls{includegraphics} is given extra
options to provide replacement text then the image example here
won't be necessary. However, the example can be adapted for images
created with \TeX\ code.)

The \idx{acronymstyle} is set using:
\begin{codebox}
\gls{setacronymstyle}\marg{\acrstyle{long-short}}
\end{codebox}
The first \idx{acronym} is straightforward:
\begin{codebox}
\gls{newacronym}\marg{eg}\marg{e.g.}\marg{for example}
\end{codebox}
The \gloskey{shortaccess} replacement text is automatically set to
the long form. The next \idx{acronym} is awkward as the long form contains
formatting commands which can't be included in the replacement text.
This means that the \gloskey{shortaccess} key must be supplied:
\begin{codebox}
\gls{newacronym}\oarg{\strong{\gloskey{shortaccess}}=\marg{TiKZ ist kein Zeichenprogramm}}
\marg{tikz}\marg{Ti\cmd{emph}\marg{k}Z}\marg{Ti\cmd{emph}\marg{k}Z ist \cmd{emph}\marg{kein} Zeichenprogramm}
\end{codebox}
In the above two cases, the short form obtained in \gls{gls} will use
the \qt{E} \idx{PDFelement}.

By way of comparison, there are some entries that are technically 
abbreviations but are defined using \gls{newglossaryentry} instead
of \gls{newacronym}. The replacement text is provided in the
\gloskey{access} key:
\begin{codebox}
\gls{newglossaryentry}\marg{Doctor}\marg{\gloskeyval{name}{Dr},\gloskeyval{description}{Doctor},\strong{\gloskey{access}}=\marg{Doctor}}
\gls{newglossaryentry}\marg{Drive}\marg{\gloskeyval{name}{Dr.},\gloskeyval{plural}{Drvs},\gloskeyval{description}{Drive},
  \strong{\gloskey{access}}=\marg{Drive}}
\end{codebox}
These will use the \qt{ActualText} \idx{PDFelement} (not \qt{E}).

The next \idx{entry} is a symbol (the integration symbol $\int$). This
could be defined simply as:
\begin{codebox}
\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral},
 \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}}}
\end{codebox}
and then referenced in the text like this:
\begin{codebox}
Symbol: \gls{gls}\marg{int} (\gls{glssymbol}\marg{int}).
\end{codebox}
This results in the text \qt{Symbol: integral ($\int$).} However if you
copy and paste this from the \idx{PDF} you will find the resulting text is
\qt{Symbol: int (R).} This is what's actually read out by the
text-to-speech system.

It would be better if the actual text was the Unicode character
0x222B. This would not only assist the text-to-speech system but
also make it easier to copy and paste the text. The simplest method
is to identify the character by its hexadecimal code, but in order
to do this the \gls{BeginAccSupp} command needs to have the options adjusted.

In order to determine whether to use \qt{E}, \qt{ActualText} or \qt{Alt} for a
particular field, \sty{glossaries-accsupp} will check if the command
\gls{glsfield-labelaccsupp} exists (where \meta{field-label} is the
\idx{internalfieldlabel}, see \tableref{tab:fieldmap}). Only two of these
commands are predefined: \gls{glsshortaccsupp} and \gls{glsshortplaccsupp},
which is why the \gloskey{shortaccess} field uses \qt{E}. If the given command
doesn't exist then the generic \gls{glsaccsupp} command is used instead.

This means that in order to simply set \gloskey{symbolaccess} to the
hexadecimal character code, I need to provide a command called
\glsfieldlabelaccsupp{symbol}:
\begin{codebox}
\cmd{newcommand}\marg{\glsfieldlabelaccsupp{\strong{symbol}}}[2]\marg{\comment{}
 \gls{glsaccessibility}\oarg{\strong{method=hex,unicode}}\marg{\strong{ActualText}}\marg{\#1}\marg{\#2}\comment{}
}
\end{codebox} 
Now I can adjust the definition of the \qt{int} \idx{entry}:
\begin{codebox}
\gls{newglossaryentry}\marg{int}\marg{\gloskeyval{name}{int},\gloskeyval{description}{integral},
  \gloskeyval{symbol}{\gls{ensuremath}\marg{\cmd{int}}},\strong{\gloskeyval{symbolaccess}{222B}}
}
\end{codebox}

The final \idx{entry} has an image stored in the \gloskey{user1} key. (The
image file is provided with the \sty{mwe} package.) This should use
\qt{Alt} instead of \qt{ActualText} so I need to define
\glsfieldlabelaccsupp{useri}:
\begin{codebox}
\cmd{newcommand}\marg{\glsfieldlabelaccsupp{\strong{useri}}}[2]\marg{\comment{}
  \gls{glsaccessibility}\marg{\strong{Alt}}\marg{\#1}\marg{\#2}\comment{}
}
\end{codebox}
The image description is provided in the \gloskey{user1access} key:
\begin{codebox}
\cmd{newglossaryentry}\marg{sampleimage}\marg{\gloskeyval{name}{sample image},
 \gloskeyval{description}{an example image},
 \gloskeyval{user1}{\cmd{protect}\gls{includegraphics}\oarg{height=20pt}\marg{example-image}},
 \strong{\gloskey{user1access}}=\marg{a boilerplate image used in examples}
}
\end{codebox}
(Note the need to protect the fragile \gls{includegraphics}. The alternative is
to use \gls{glsnoexpandfields} before defining the command. See
\sectionref{sec:expansion}.)

The \idx{PDF} can be inspected either by
uncompressing the file and viewing it in a text editor or you can use
a tool such as the PDFDebugger provided with 
\href{https://pdfbox.apache.org/}{PDFBox}. If you do this you will find
content like:
\begin{verbatim}
/Span << /ActualText (Doctor) >> BDC
  BT
    /F8 9.9626 Tf
    73.102 697.123 Td
    [ (Dr) ] TJ
  ET
EMC
\end{verbatim}
This shows that \qt{ActualText} was used for \code{\gls{gls}\marg{Doctor}}.
The integral symbol ($\int$) created with \code{\gls{glssymbol}\marg{int}} is:
\begin{verbatim}
/Span << /ActualText (\376\377"+) >> BDC
  BT
    /F1 9.9626 Tf
    97.732 650.382 Td
    [ (R) ] TJ
  ET
EMC
\end{verbatim} 
Again, \qt{ActualText} has been used, but the character code has
been supplied. The image created with \code{\gls{glsuseri}\marg{sampleimage}} is:
\begin{verbatim}
/Span << /Alt (a boilerplate image used in examples) >> BDC
  1 0 0 1 106.588 618.391 cm
  q
    0.08301 0 0 0.08301 0 0 cm
    q
      1 0 0 1 0 0 cm
      /Im1 Do
    Q
  Q
EMC
\end{verbatim}
This shows that \qt{Alt} has been used.

The first use of \code{\gls{gls}\marg{eg}} produces the long form (not
reproduced here) followed by the short form:
\begin{verbatim}
/Span << /E (for example) >> BDC
  BT
    /F8 9.9626 Tf
    161.687 563.624 Td
    [ (e.g.) ] TJ
  ET
EMC
\end{verbatim}
The subsequent use also has the \qt{E} element:
\begin{verbatim}
/Span << /E (for example) >> BDC
  BT
    /F8 9.9626 Tf
    118.543 551.669 Td
    [ (e.g.) ] TJ
  ET
EMC
\end{verbatim}
Similarly for \code{\gls{acrshort}\marg{eg}}. You can also use the
\opteqvalref{debug}{showaccsupp} package option. This will show the
replacement text in the document, but note that this is the content before
it's processed by \gls{BeginAccSupp}.

If the \gls{setacronymstyle} command is removed (or commented out)
then the result would be different. The \idx{firstuse} of \gls{gls} uses \qt{E} for
the short form but the subsequent use has \qt{ActualText} instead.
This is because without \gls{setacronymstyle} the original acronym
mechanism is used, which is less sophisticated than the newer
acronym mechanism that's triggered with \gls{setacronymstyle}.

\begin{important}
If you want to convert this example so that it uses
\sty{glossaries-extra}, make sure you have at least version 1.42 of
the extension package.
\end{important}

\glsxtrnote
If you want to convert this example so that it uses
\sty{glossaries-extra}, you need to replace the explicit loading of
\sty{glossaries-accsupp} with an implicit load through the
\opt{accsupp} package option:
\begin{codebox}
\cmd{usepackage}[\opt{abbreviations},\strong{\opt{accsupp}}]\marg{\strong{glossaries-extra}}
\end{codebox}
I'm switching from \gls{newacronym} to \gls{newabbreviation}, which
means that the default category is \cat{abbreviation} and also the
file extensions are different. If you are using \app{makeglossaries}
or \app{makeglossaries-lite} you don't need to worry about it.
However, if you're not using those helper scripts then you will need
to adjust the file extensions in your document build process.

The style command \code{\gls{setacronymstyle}\marg{\acrstyle{long-short}}} needs
to be replaced with:
\begin{codebox}
\gls{setabbreviationstyle}\marg{\abbrstyle{long-short}}
\end{codebox}
This is actually the default so you can simply delete the
\gls{setacronymstyle} line. Substitute the two instances of
\gls{newacronym} with \gls{newabbreviation}. For example:
\begin{codebox}
\strong{\gls{newabbreviation}}\marg{eg}\marg{e.g.}\marg{for example}
\end{codebox}
Note that for the \qt{tikz} entry you can now remove the explicit assignment of
\gloskey{shortaccess} with \sty{glossaries-extra} v1.42 as it will
strip formatting commands like \csfmt{emph}: 
\begin{codebox}
\gls{newabbreviation}
 \marg{tikz}\marg{Ti\cmd{emph}\marg{k}Z}\marg{Ti\cmd{emph}\marg{k}Z ist \cmd{emph}\marg{kein} Zeichenprogramm}
\end{codebox}
It's also necessary to replace \gls{acrshort}, \gls{acrlong} and \gls{acrfull} with
\gls{glsxtrshort}, \gls{glsxtrlong} and \gls{glsxtrfull}.

You may notice a slight difference from the original example if you use a
version of \sty{glossaries-extra} between 1.42 and 1.48. The
\gloskey{shortaccess} field shows \meta{long} (\meta{short}) instead of just
\meta{long}. This is because \sty{glossaries-extra} v1.42 redefined
\gls{glsdefaultshortaccess} to include the short form.  The original definition
was restored in \sty{glossaries} v1.49.

Now that the extension package is being used, there are some other
modifications that would tidy up the code and fix a few issues.

The \qt{Doctor} and \qt{Drive} entries should really be defined as
\idxpl{abbreviation} but they shouldn't be expanded on \idx{firstuse}. The
\abbrstyle{short-nolong} style can achieve this and it happens to be
the default style for the \cat{acronym} category. This means that
you can simply replace the \qt{Doctor} definition with:
\begin{codebox}
\gls{newacronym}\marg{Doctor}\marg{Dr}\marg{Doctor}
\end{codebox}
The \idx{firstuse} of \code{\gls{gls}\marg{Doctor}} is just \qt{Dr}.  This
means that the \qt{E} \idx{PDFelement} will be used instead of \qt{ActualText}.
Now I don't need to supply the accessibility text as its obtained
from the long form.

The \qt{Drive} \idx{entry} can be similarly defined but it has the awkward
terminating full stop. This means that I had to omit the end of
sentence terminator in:
\begin{codebox}
\gls{gls}\marg{Doctor} Smith lives at 2, Blueberry \gls{gls}\marg{Drive}
\end{codebox}
This looks odd when reading the document source and it's easy to
forgot. This is very similar to the situation in the
\samplefile{-dot-abbr} example. I can again use the
\catattr{discardperiod} \idx{categoryattribute}, but I need to assign a different
category so that it doesn't interfere with the \qt{Doctor}
\idx{entry}.

The category is simply a label that's used in the construction of
some internal command names. This means that it must be fully
expandable, but I can choose whatever label I like (\cat{general},
\cat{abbreviation}, \cat{acronym}, \cat{index}, \cat{symbol} and
\cat{number} are used by various commands provided by
\sty{glossaries-extra}).

In this case, I've decided to have a category called \catfmt{shortdotted} 
to indicate an \idx{abbreviation} that ends with a
dot but only the short form is shown on \idx{firstuse}:
\begin{codebox*}
\gls{setabbreviationstyle}\oarg{shortdotted}\marg{\abbrstyle{short-nolong-noreg}}
\gls{glssetcategoryattribute}\marg{shortdotted}\marg{\catattr{discardperiod}}\marg{true}
\gls{newabbreviation}\oarg{\gloskeyval{category}{shortdotted}}\marg{Drive}\marg{Dr.\gls{cs.at}}\marg{Drive}
\end{codebox*}
In the \samplefile{-dot-abbr} example, I also used the
\catattr{insertdots} \idxc{categoryattribute}{attribute} to automatically insert the dots and add
the space factor (which is adjusted if \catattr{discardperiod} discards
a period). In this case I'm inserting the dot manually so I've also
added the space factor with \gls{cs.at} in case the \idx{abbreviation} is used
mid-sentence. For example:
\begin{codebox}
\gls{gls}\marg{Doctor} Smith lives at 2, Blueberry \gls{gls}\marg{Drive}. Next sentence.
\codepar
\gls{gls}\marg{Doctor} Smith lives at 2, Blueberry \gls{gls}\marg{Drive} end of sentence.
\end{codebox}
(The spacing is more noticeable if you first switch to a monospaced
font with \cmd{ttfamily}.)

The \qt{e.g.}\ \idx{abbreviation} similarly ends with a dot. It's not
usual to write \qt{for example (e.g.)}\ in a document, so it really
ought to have the same \catfmt{shortdotted} category, but it has a
long-short form for illustrative purposes in this test document. In
this case I need to choose another category so that I can apply a
different style. For example:
\begin{codebox}
\gls{setabbreviationstyle}\oarg{longshortdotted}\marg{\abbrstyle{long-short}}
\gls{glssetcategoryattribute}\marg{longshortdotted}\marg{\catattr{discardperiod}}\marg{true}
\gls{newabbreviation}\oarg{\gloskeyval{category}{longshortdotted}}\marg{e.g.}\marg{e.g.\gls{cs.at}}\marg{for example}
\end{codebox}

To further illustrate categories, let's suppose the symbol and image should be
in the \gloskey{name} field instead of the \gloskey{symbol} and \gloskey{user1}
fields. Now the \glsfieldlabelaccsupp{symbol} and \glsfieldlabelaccsupp{useri}
commands won't be used. I can't deal with both cases if I just provide
\glsfieldlabelaccsupp{name}. 

I could provide category+field versions, such as
\glsxtrcategoryfieldaccsupp{symbolname}, but remember that this only covers
accessing the \gloskey{name} field, which is typically only done in
the glossary. I would also need similar commands for the
\gloskey{first}, \gloskey{firstplural}, \gloskey{text} and
\gloskey{plural} keys. This is quite complicated, but since I don't
need to worry about any of the other fields it's simpler to just
provide the \gls{glsxtrcategoryaccsupp} version:
\begin{codebox}
\cmd{newcommand}\marg{\glsxtrcategoryaccsupp{\strong{symbol}}}[2]\marg{\comment{}
 \gls{glsaccessibility}\oarg{method=hex,unicode}\marg{ActualText}\marg{\#1}\marg{\#2}\comment{}
}
\cmd{newcommand}\marg{\glsxtrcategoryaccsupp{\strong{image}}}[2]\marg{\comment{}
  \gls{glsaccessibility}\marg{Alt}\marg{\#1}\marg{\#2}\comment{}
}
\codepar
\gls{newglossaryentry}\marg{int}\marg{\strong{\gloskeyval{category}{\cat{symbol}}},
  \strong{\gloskey{name}}=\marg{\gls{ensuremath}\marg{\cmd{int}}},\strong{\gloskey{access}}=\marg{222B},
  \gloskeyval{description}{integral}
}
\codepar
\gls{newglossaryentry}\marg{sampleimage}\marg{\strong{\gloskeyval{category}{image}},
 \gloskeyval{description}{an example image},
 \strong{\gloskey{name}}=\marg{\cmd{protect}\gls{includegraphics}\oarg{height=20pt}\marg{example-image}},
 \strong{\gloskey{access}}=\marg{a boilerplate image used in examples}
}
\end{codebox}
If it's necessary to provide support for additional fields, then the
category+field command \gls{glsxtrcategoryfieldaccsupp} could be used to
override the more general category command \gls{glsxtrcategoryaccsupp}.

\filedef{sample-ignored.tex}
This document defines an \idx{ignoredglossary} for
common terms that don't need a definition. The document build is:
\begin{terminal}
pdflatex sample-ignored
makeglossaries sample-ignored
pdflatex sample-ignored
\end{terminal}
A new \idx{ignoredglossary} is defined with:
\begin{codebox}
\gls{newignoredglossary}\marg{common}
\end{codebox}
There are no associated files with an \idx{ignoredglossary}. An entry is defined with 
this as its \idx{glossary} type:
\begin{codebox}
\gls{newglossaryentry}\marg{commonex}\marg{\gloskeyval{type}{common},\gloskeyval{name}{common term}}
\end{codebox}
Note that the \gloskey{description} key isn't required. This term
may be referenced with \gls{gls} (which is useful for consistent
formatting) but it won't be indexed.

\filedef{sample-entrycount.tex}
This document uses \gls{glsenableentrycount}
and \gls{cgls} (described in \sectionref{sec:enableentrycount})
so that acronyms only used once don't appear in the list of
acronyms. The document build is:
\begin{terminal}
pdflatex sample-entrycount
pdflatex sample-entrycount
makeglossaries sample-entrycount
pdflatex sample-entrycount
\end{terminal}
Note the need to call \LaTeX\ twice before \app{makeglossaries}, and
then a final \LaTeX\ call is required at the end.

\begin{xtr}
The \sty{glossaries-extra} package has additions that extend this
mechanism and comes with some other sample files related to entry counting.
\end{xtr}

\begin{bib2gls}
If you switch to \app{bib2gls} you can use record counting instead.
See the \app{bib2gls} manual for further details.
\end{bib2gls}

\chapter{Troubleshooting}
\label{sec:trouble}

In addition to the sample files listed in \sectionref{sec:samples}, 
the \sty{glossaries} package comes with some minimal example
files, \file{minimalgls.tex}, \file{mwe-gls.tex},
\file{mwe-acr.tex} and \file{mwe-acr-desc.tex}, which can be
used for testing. These should be located in the \filefmt{samples}
subdirectory (folder) of the \sty{glossaries} documentation
directory. The location varies according to your operating system
and \TeX\ installation.  For example, on Linux it may
be in \filefmt{/usr/local/texlive/2022/texmf-dist/doc/latex/glossaries/}.
The \app{makeglossariesgui} application can also be used to test for
various problems.
Further information on debugging \LaTeX\ code is available at
\url{http://www.dickimaw-books.com/latex/minexample/}.

If you have any problems, please first consult the 
\faqspkg{glossaries}. If that
doesn't help, try posting your query to somewhere like the
\texttt{comp.text.tex} newsgroup, the 
\urlfootref{https://latex.org/forum/}{\LaTeX\ Community Forum} or 
\urlfootref{https://tex.stackexchange.com/}{\TeX\ on StackExchange}. 
Bug reports can be submitted via 
\urlfootref{https://www.dickimaw-books.com/bug-report.html}{my package bug report form}. 


\part{Summaries and Index}
\label{summaries}
\backmatter
\printterms[title={Terms}]
\printcommonoptions[label=sec:gloskeys]{idx.gloskey}
\printcommonoptions{idx.glsopt}
\printcommonoptions{idx.printglossopt}
\printcommonoptions{idx.acronymstyle}
\printcommonoptions{idx.glossarystyle}
\printsummary
    
\printuserguideindex

\end{document}
